Saturday, April 19, 2014

Vim clipboard copy paste workaround

I love Vim. But the somewhat difficult to handle system clipboard integration just doesn't seem to fit in with me. I made a recompile to get +xterm-clipbard option, but the whole Ctrl-C Ctrl-V thing was missig. And I didn't want to recompile everytime. Got a nice workaround using xclip :) here [ http://vim.wikia.com/wiki/In_line_copy_and_paste_to_system_clipboard ]
Just to make a note / backup, here's what you have to do. Just put that into your .vimrc
" Copy paste from clipboard
vmap  y: call system("xclip -i -selection clipboard", getreg("\""))
nmap  :call setreg("\"",system("xclip -o -selection clipboard"))p
You're good to go.

No comments:

Post a Comment

Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...