On 19/10/12 20:52, Charles Campbell wrote:
lessthanideal wrote:
A lot of ftplugin files turn comment-wrapping on with a
command like this:

set formatoptions+=c

I want to globally disable it.  Is there an easy way to do
this?  I know I can disable it for particular filetypes by
creating files in vimfiles\after\ftplugin\ specifying "set
formatoptions-=c" but there are a lot of them.

Two methods I've found from searching are

. Maintain a single file and use symbolic links to make vim
access it for each filetype.  A bit clumsy - new filetypes
might appear later, I want to maintain real
filetype-specific files as well, etc.

. Use autocmd events to set this.  This works in many cases
but different edge cases are missed by different events so
I'm not sure which events to use.  Also it seems to be
"fighting vim" - trying to keep checking in case vim has
changed the setting and change it back.  I'd like it to just
work, reliably.

Is there a simpler method?

Have you tried putting formatoptions-=c in a file in .vim/after/plugin ?

Regards,
C Campbell


.vim/after/plugin/*.vim are sourced once, near the end of startup. The problematic setting is set by $VIMRUNTIME/ftplugin/<whatever>.vim which is sourced (again, if necessary) shortly after a file of <whatever> filetype is opened for editing. So I think the chronology would be wrong if just using "set fo-=c" in a global plugin. Unless _all_ filetype-plugins build on the default 'formatoptions' ("tcq" in 'incompatible' mode), only adding to or subtracting from it but not replacing the whole option value.

Best regards,
Tony.
--
If you think the United States has stood still, who built the largest
shopping center in the world?
                -- Richard Nixon

--
You received this message from the "vim_use" 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

Reply via email to