Monday, June 21, 2010

Re: questions about formatoptions on Ubuntu 10.04 vim

On 21/06/10 05:27, allstars wrote:
> hi
> i found in ubuntu 10.04 vim
> the comment leader wont be inserted automatically
> when i type<Enter>
>
> it seems i have to add an extra line
> set formatoptions=ro
> in my vim.rc
>
> am i correct about this?
> does anyone know why i need to add this line additionally?
> before 10.04 i didnt have to add this options
>
> thanks
>

1) The 'formatoptions' is an option whioch is often modified by
filetype-plugins; it may depend of the 'filetype' of the file you're
currently editing. If it bothers you you may add an after-ftplugin in
~/.vim/after/ftplugin/whatever.vim, replacing "whatever" by the
filetype. DO NOT modify-in-place anything in or under $VIMRUNTIME at any
depth because any runtime files update may (and sooner or later an
update is bound to) remove your changes with no warning.

2) Some Linux distributions (misguidedly IMO) add a "system vimrc" which
is sourced before your .vimrc and can modify Vim defaults (for instance,
the SuSE system vimrc disables modelines "for security reasons" (sic)).
The location of that system vimrc can be modified at compile-time; it is
listed near the middle of the output of the ":version" command. If this
is the case, I think the correct way to counteract it is in your vimrc
(after all, if they did it once, they can do it again, e.g. at the next
system upgrade).

Another possibility against (2) is to compile your own Vim, which will
install (by default) under /usr/local (with $VIMRUNTIME at
/usr/local/share/vim/vim72/ or /usr/local/share/vim/vim73a/ for the
current "stable" and "development" versions respectively), and will look
for its system vimrc at $VIM/vimrc while most distributions place it as
/etc/vimrc.


Best regards,
Tony.
--
Be free and open and breezy! Enjoy! Things won't get any better so
get used to it.

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