You are not logged in.

#1 2009-01-24 10:20:33

msh
Member
From: Latvia
Registered: 2009-01-16
Posts: 17

[SOLVED] Setting "comments" option in vim.

Greetings.

I've run into issues with setting the "comments" option in vim 7.2. I'm trying to set it to "s:/*,m:**,ex:*/".

/*
** Comments should be formated like this!
*/

I've added the line "set comments=s:/*,m:**,ex:*/" to ~/.vimrc but it does not work and comments formatting reverts back to the default for the specific file extension. I suspect that this option gets overwritten from somewhere whitin vim's syntax files since setting the option for the active file works fine.

Any suggestions on how I can get it to work like I want to?

Last edited by msh (2009-01-24 20:14:50)

Offline

#2 2009-01-24 20:14:29

msh
Member
From: Latvia
Registered: 2009-01-16
Posts: 17

Re: [SOLVED] Setting "comments" option in vim.

Solved by adding the below code to ~/.vimrc.

if !exists ("autocommands_loaded")
    let autocommands_loaded = 1
    autocmd FileType c set comments=s:/*,mb:**,ex:*/
endif

Offline

Board footer

Powered by FluxBB