Saturday, July 07, 2012

comment multiple lines in vim

Short answer: shift+v and up/down arrow to select lines to comment, then press :s/^/# / and Enter

NB: When you press : vim will add '<,'> to the command line so the final command is:
:'<,'>s/^/# /

Reference: http://www.linuxquestions.org/questions/slackware-14/comment-multiple-lines-in-vim-605491/

No comments:

Post a Comment