How do you embed vim without commenting the code?

Every time I insert vim, each line is commented out.

Is there any way around this?

+52
vim
Jul 09 2018-10-09T00:
source share
2 answers

Before pasting, enter this as usual:

:set paste 

Then enter insert mode. You will see the status bar insert (paste) . Paste your code. Press ESC to return to normal mode, and:

 :set nopaste 

You are no longer in paste mode.

+98
Jul 09 2018-10-09T00:
source share

Or, to avoid turning paste on and off, just put the text. Instead of switching to insert and paste mode in command line mode, type:

 "+p 

Buffer + corresponds to the system buffer.

If you insist on using paste , I would suggest matching something to switch it. For example :set pastetoggle=<F2> (wow, not realizing that there is a special option for this)

+40
Jul 09 2018-10-09T00:
source share



All Articles