Friday, October 28, 2011

Re: Pernanent disable comment next line

On Fri, 28 Oct 2011, Michael D. Berger wrote:

> In a previous thread I read that I could disable automatically
> commenting of the next line with:
>
> :set formatoptions-=ro

Should be ('fo' is short for 'formatoptions'):

:set fo-=r fo-=o

See:

:help remove-option-flags


> This works, but I have to do it every time I open a file.
> So on my Fedora 15_64 system, I added that set line to
>
> /etc/vimrc
>
> but it didn't work.

You shouldn't do that. You should add it to ~/.vimrc. System Vim files
are fair game for overwriting/deletion during system updates.


> Any suggestions?

It's probably being reset by some plugin/filetype.

In addition to:

:set fo-=r fo-=o

Also add:

:au FileType,BufRead,BufNewFile * se fo-=r fo-=o

Which will set the option every time a filetype is set, a buffer is read
in, or a new file is created. (Possibly overkill, but it should cover
wherever it's being set.)

--
Best,
Ben

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