On 22/07/10 04:35, Christian J. Robinson wrote:
I just noticed that my 'foldmethod' is getting set to "syntax" when editing Vim script files, but the syntax/vim.vim file doesn't set that option even if you've enabled syntax folding for Vim code. Since I have "let perl_fold=1" in my vimrc, I get this when I do ":verbose set fdm?" while in a Vim script buffer: foldmethod=syntax Last set from [...]/vim/vim73b/syntax/perl.vim It's not really a problem for me, considering it has taken what has probably been years to notice I hadn't set this in my ~/.vim/ftplugin/vim.vim file. I probably would have done so if it hadn't been done for me, but I'd definitely call this an unintended consequence of having the vim.vim syntax file include the perl.vim syntax file. - Christian
I'm not sure it's unintended: if your vim script includes a Perl here-document, I suppose that _that_ will be syntax-folded thanks to this statement. OTOH maybe (I'm not sure) setting 'foldmethod' belongs in an ftplugin, not a syntax script, in which case (since neither syntax/vim.vim nor ftplugin/vim.vim sources ftplugin/perl.vim) you wouldn't see it anymore.
Note that syntax/perl.vim is well-behaved: what it does at line 57 is ":setlocal foldmethod=syntax" (not plain :set) so it will only apply to Perl sources and to filetypes which (like Vim scripts) may contain embedded Perl source code.
Best rgards, Tony. -- In Tennessee, it is illegal to shoot any game other than whales from a moving automobile. -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
