Reply to message «Re: are includes possible in vim files?», 
sent 23:40:17 12 December 2010, Sunday
by Marc Weber:

> exec 'exec '.fnameescape(path)
> However it has some limitations
Will never work, maybe you was talking about
    execute join(readfile(path, 'b'), "\n")
Disadvantages:
1. Line continuation will not work (though it is possible to add it manually).
2. Some commands consume a newline (try ``exec "normal! a\necho 'abc'"'', this 
will add new line containing ``echo 'abc''' instead of echoing abc) (it is also 
possible to add a workaround which will enclose such commands in a `execute' 
statement).
 
> Maybe you prefer this:
> exec 'source '.fnameescape(path)
And this variant (as well as `runtime') does not share script-global variables. 
You may want to put all such variables in a dictionary which is more easily 
shared.

> However I'd recommend you rewrtiing your long file htis way:
> 
> 
>   {{{1
>     section 1
> 
>     many lines
>   {{{1
>     section 2
>     more many lines
> 
>   vim: fdm=marker
    "{{{1 section 1 title
    ...
    "{{{1 section 2 title
    ...
    " vim: fdm=marker

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to