Sunday, December 27, 2009

Re: vimrc ignores formatoptions

* Bob <jeep@rahul.net> [2009-12-27 16:27 -0800]:
> Sorry I didnt see the prior 2 msgs until now
> after I replied my last reply.
>
> I tried ':verbose set fo' and I get:
> formatoptions=croql
> Last set from /usr/share/vim/vim72/ftplugin/c.vim
>
> So Im wondering what this plugin is and/or where it
> came from? Ive never messed around with vim other
> than my ~/.vimrc file so I dont know why this file
> exists.

It's loaded for files of C filetype. You can disable the use of
filetype plugins by adding the following to your vimrc:

filetype plugin off

> After editing the fo line in the above file (getting
> rid of 'cr' options, it still shows up as:
>
> formatoptions=coql
>
> At least the 'r' is gone now. The file now reads:
> " Set 'formatoptions' to break comment lines but not other lines,
> " and insert the comment leader when hitting <CR> or using "o".
> setlocal fo-=t fo+=oql
>
> I couldnt find another instance in that file of 'fo' either.
>
> Half way there at least and learned something new.
> What should I try next to find where the 'c' is coming
> from?

If you wish to use filetype plugins but override some of their settings,
use the after-directory. For example with the C filetype, create
'~/.vim/after/ftplugin/c.vim' which contains the following:

setlocal fo-=cr

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: