Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the auto comment in shell script vi editing?

Tags:

comments

shell

vi

I'm using vi(m) to edit a shell script and when I insert a comment and type , the new line came with a comment already.
How can I disable it ?

Ex :
# When I type enter, the comment simbol # below is inserted automaticaly.
#

like image 365
Celso Suzuki Avatar asked Oct 04 '11 19:10

Celso Suzuki


People also ask

How do I block comments in vi?

Go to the line from which you want to start commenting. Then, press ctrl + v , this will enable the visual block mode.

How do you uncomment multiple lines in vi?

Another method is to use Visual mode. Navigate to the line you wish to comment out and press CTRL + V to enter Visual mode. Use the up and down arrow keys to highlight the lines you wish to uncomment. Once selected, press x to remove the comments.


1 Answers

I was finding the same answer, try

:set paste 

this may help

like image 186
auxten Avatar answered Nov 09 '22 18:11

auxten