Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 956
alexchenco Avatar asked Jan 09 '10 07:01

alexchenco


People also ask

How do I comment an RC file?

RC supports C-style syntax for both single-line comments and block comments. Single-line comments begin with two forward slashes (//) and run to the end of the line. The following is an example of a resource statement followed by a single-line comment.

How do I add a comment in Vim?

Using the up and down arrow key, highlight the lines you wish to comment out. Once you have the lines selected, press the SHIFT + I keys to enter insert mode. Enter your command symbol, for example, # sign, and press the ESC key. Vim will comment out all the highlighted lines.

How do I edit my vimrc file?

Opening vimrc Using file name completion, you could type :e $M then press Tab until you see the desired variable. If you only want to see the path, type :echo $M then press Tab to see the variable, and press Enter. In gvim, the Edit menu includes "Startup Settings" which will use $MYVIMRC to edit your vimrc file.

How do I access .vimrc files?

The global or system-wide vim configuration file is generally located under the /etc/vim/vimrc . This configuration file is applied to all users and when Vim is started this configuration file is read and Vim is configured according to this file contents.


1 Answers

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

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

like image 140
Myles Avatar answered Sep 18 '22 18:09

Myles