On 2009-03-26, Raúl Núñez de Arenas Coronado wrote:
> Saluton Abhishek :)
>
> On Thu 26 Mar 2009 17:59 +0100, Abhishek Gupta <[email protected]> dixit:
> > I have some settings for comments in my vimrc (see attached vimrc.txt).
> [...]
> > However when I edit text files using vim (vim test.txt), the comments get
> > overridden with the following:
> [...]
> > And for C/C++ files, the comments get overridden with the following:
> [...]
> > How can I prevent this?
> > I.e. I would like to keep my comments setting for all file types.
> > Is this possible?
>
> You can always do "filetype off" in your .vimrc, but if you want to have
> all the advantages that "filetype on" offers and at the same time use
> your own "comment" settings, I would do the following in my .vimrc:
>
> autocmd BufRead,BufNewFile,FileReadPost * set comments=<put here your
> settings>
If you decide to use the above autocommand in your .vimrc, be sure
to put it _after_ your "filetype plugin on" command so that your
autocommand is executed last.
Also, I think it would be better to use the FileType event rather
than BufRead and BufNewFile, and I don't see the reason for using
the FileReadPost event at all. The result would be
autocmd FileType * set comments=<put here your settings>
Regards,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---