Vimrc – how to block comment

block-commentvimrc

I don't want to comment lines of text in a text file or code. I am looking for inserting block comments in a .vimrc file. To insert a single line comment " is used, for example:

" remove spaces and tabs as well  at the end of line automatically while saving
autocmd BufWritePre * :%s/\s\+$//e

Now I've got a relatively large amount of settings/configs/plugins collected over the years after browsing through the internet to add cool features. I'm looking to add some large comment blocks to my .vimrc file. Adding " to each line is a option but I am looking for a block comment syntax. Similar to /**/ in C.

// is identical to "
/* */ is identical to _____ ?

Searching Unix.SE, SO and googling didn't help much.

Best Answer

I do not think this is possible. The best you'll be able to do is block select some text, and do a search/replace on the first character s/^/"/ in vim to insert a " to the beginning of each line.

The vim plugin NERD Commenter might help make this easier as well.

Related Question