Everytime I paste in vim, every line is commented out.
Is there a way around this?
In Vim, the primary commands for yanking (copying) and putting (pasting) are y and p . Those commands are prefered to "Right-click/Paste or Middle Click or CTRL+SHFT+V" because the text is "put" into the buffer without any special treatment.
vimrc so pressing F2 toggles paste on and off.
You can use a movement command or up, down, right, and left arrow keys. Press y to copy, or d to cut the selection. Move the cursor to the location where you want to paste the contents. Press P to paste the contents before the cursor, or p to paste it after the cursor.
To copy selected text to system clipboard type "+y in Normal Mode. Now you can paste it anywhere else using Ctrl-v . To copy text from outside applications into Vim editor, first copy the text using the usual Ctrl-C command then go to Vim editor and type "+p in Normal Mode.
Before you paste, type this in normal mode:
:set paste
Then enter insert mode. You will see the status bar say insert (paste)
. Paste your code. Hit ESC to return to normal mode, and:
:set nopaste
You are no longer in paste mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With