VIM Copy/Paste
Easily copy to the system clipboard in vim?
Yes! (Ubuntu/Mint)
Install xclip:
sudo apt-get install xclip
Add bindings to .vimrc
vmap <c-c> y:call system("xclip -i -selection clipboard", getreg("\""))<cr>:call system("xclip -i", getreg("\""))<cr>
nmap <c-v> :call setreg("\"",system("xclip -o -selection clipboard"))<cr>p")")")"))
Written by Andrew [8xx8] Kulakov
Related protips
3 Responses
What about Shift+Ctrl+c???
over 1 year ago
·
@santiagogil It's not worked in my case
over 1 year ago
·
Vim actually has a special register for the system clipboard, '+'. So you can copy to and from the system clipboard like so:
"+p -> paste from clipboard
"+y -> yank to clipboard
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#