Sunday, May 2, 2010

Re: set fo ignored in .vimrc

On 02/05/10 21:15, Aryeh M. Friedman wrote:
> I am able to on a per file basis turn off the &*(^&*^( leading comment
> and such autoinsert feature (i.e. when editting do ":set fo=") but when
> I do the same in my .vimrc it is completely ignored...

I think this is normal. 'formatoptions' is one of those options which is
expected to be set differently for files of different 'filetype's.
Therefore, most filetype-plugins include a ":setlocal
formatoptions=<something>".

To change the 'formatoptions' for files of a given 'filetype' (let's say
filetype foobar), you would insert a :setlocal (not plain :set) command
for that option in a file named (on Unix)
~/.vim/after/ftplugin/foobar.vim or (on Windows)
~/vimfiles/after/ftplugin/foobar.vim -- create any files and/or
directories which don't yet exist.

See
:help 'runtimepath'
:help after-directory
:help write-filetype-plugin
:help add-filetype-plugin
:help ftplugin-overrule
:help filetype-plugins


Best regards,
Tony.
--
GUARD #2: Wait a minute -- supposing two swallows carried it together?
GUARD #1: No, they'd have to have it on a line.
GUARD #2: Well, simple! They'd just use a standard creeper!
GUARD #1: What, held under the dorsal guiding feathers?
GUARD #2: Well, why not?
The Quest for the Holy Grail (Monty
Python)

--
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

No comments:

Post a Comment