Answers for "how to comment multiple lines in vi"

1

vim comment out mutiple lines

# To comment
Press ESC
hit V
Move the cursor until desired lines to comment
hit :
'<,'>s/^/#/g

# To uncomment
Do the same, but command is:
'<,'>s/^#//g

# '<,'> indicates the range you've selected with VISUAL MODE.
Posted by: Guest on August-03-2021
0

how to comment multiple lines in vi

# To comment
Press ESC
hit V
Move the cursor until desired lines to comment
hit :
'<,'>s!^!//!

# To uncomment
'<,'>s!^//!!
Posted by: Guest on August-20-2021

Code answers related to "how to comment multiple lines in vi"

Browse Popular Code Answers by Language