How do I add a comment in Vim's configuration files, like .vimrc?
4 Answers
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.)
-
62
-
1And it shouldn't be an inline comment, for inline (better: at-the-end-of-line comments) you can use
command foo |" my comment
(pipe for command separaion needed) Sep 23, 2019 at 20:03
"This is a comment in vimrc. It does not have a closing quote
Source: http://vim.wikia.com/wiki/Backing_up_and_commenting_vimrc
-
1add a pipe before the double qoute if there is a command on the left of the comment Sep 23, 2019 at 20:04
Same as above. Use double quote to start the comment and without the closing quote.
Example:
set cul "Highlight current line
-
1
You can add comments in Vim's configuration file by either:
" brief description of the command
or:
"" commented command
Taken from here