How to comment in Vim's config files: ".vimrc"?

VimCommentsConfiguration Files

Vim Problem Overview


How do I add a comment in Vim's configuration files, like .vimrc?

Vim Solutions


Solution 1 - Vim

A double quote to the left of the text you want to comment.

Example: " this is how a comment looks like in ~/.vimrc

To be clear: Do not include a closing double quote. (See comment from Arslan Ali below.)

Solution 2 - Vim

"This is a comment in vimrc. It does not have a closing quote 

Source: http://vim.wikia.com/wiki/Backing_up_and_commenting_vimrc

Solution 3 - Vim

Same as above. Use double quote to start the comment and without the closing quote.

Example: > set cul "Highlight current line

Solution 4 - Vim

You can add comments in Vim's configuration file by either:

" brief description of the command    

or:

"" commented command

Taken from here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionalexchencoView Question on Stackoverflow
Solution 1 - VimMylesView Answer on Stackoverflow
Solution 2 - Vimuser3670292View Answer on Stackoverflow
Solution 3 - VimRandy LamView Answer on Stackoverflow
Solution 4 - VimSaurabhView Answer on Stackoverflow