Created
September 26, 2013 10:53
-
-
Save jpommerening/6712617 to your computer and use it in GitHub Desktop.
xclip from vim – I often find myself wanting to copy my vim selection to an X application. Vim has an optional feature for this (xterm_clipboard), but most installs come without the feature baked in. I could use the Shift-key when selecting, but that would copy my line numbers as well (and probably do other nasty things), so instead I wrote a li…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun! Xclip() range | |
let l:_a = @a | |
exec a:firstline . ',' . a:lastline . 'yank a' | |
exec system('xclip', @a) | |
let @a = l:_a | |
endfun | |
" If you want to map this to Ctrl+c: | |
" vnoremap <C-c> :call Xclip()<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment