Reputation: 10865
hi I have macOS High Sierra, and vim with the version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jul 26 2017 19:10:24)
I used to be able to copy a text like :%s/abc//g
into system clipboard, and go to a terminal where vim is current editing a file, and paste by doing cmd+v
, and then it will just run in normal mode to do the full-text replacement.
However, I find now that this process will just paste the text :%s/abc//g
in the file currently being edited, seemingly in the insert mode.
How can I get back the behavior of normal mode? Tried :set nopaste
without any luck.
Upvotes: 3
Views: 18598
Reputation: 307
Try the Plug vim-system-copy. I found it very helpful for me.
Upvotes: 0
Reputation: 27271
:
.<C-r>+
to paste from clipboard.q:
to enter command history mode."+p
.You might even consider creating a mapping.
" Paste to command mode while in insert mode.
inoremap <C-v> <C-o>:<C-r>+
" Not recommended. You can't go into Visual Block mode anymore.
nnoremap <C-v> <C-o>:<C-r>+
Upvotes: 5