Wednesday, December 4, 2013

How to insert/remove comments in Vim

Insert comments (for example, the "#" symbol):

Go to the line you want to comment.
Press CTRL-V (might be CTRL-Q in Windows because of shortcut conflict)
Cursor to the last line
Press I, #, [Esc]
("I", then "#", then "Escape")
(Case matters.  Uppercase "I", not lowercase "i")




Remove comments:

Go to the line you want to comment.
Press CTRL-V (might be CTRL-Q in Windows because of shortcut conflict)
Cursor to the last line
Press x


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.