aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorTeddy Wing2014-06-06 00:41:47 -0400
committerTeddy Wing2014-06-06 00:41:47 -0400
commit320e54ce8d0109bce251acbbe457402aa1c2a059 (patch)
treec9546116cc693652511a4653164eaa0bbe746163 /vimrc
parente05f4fd92940b839c6aaf0ca279a1353825783a7 (diff)
downloaddotvim-320e54ce8d0109bce251acbbe457402aa1c2a059.tar.bz2
vimrc: mapping to copy text to OS X clipboard
Since I'm using OS X's stock vim which isn't compiled with clipboard support, add a command to copy text to the clipboard. Useful when split windows are open or when I want to copy an entire file that takes up more than a single terminal page.
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 9a3b626..b436055 100644
--- a/vimrc
+++ b/vimrc
@@ -198,6 +198,10 @@
" * Map 0 -> g0 and $ -> g$ plus the reverse. Makes it easier to get to
" the beginning & end of a soft wrapped line.
"
+" 2014.06.06:
+" * Add Visual mode mapping to copy selected text to the OS X clipboard
+" since I'm using stock vim not compiled with clipboard support.
+"
" Pathogen
@@ -506,6 +510,10 @@ nnoremap [q :cprevious<cr>
" Set scrollbind on a window
nnoremap <leader>sb :setlocal scrollbind!<cr>
+" Copy to OS X clipboard from visual mode
+" http://stackoverflow.com/a/17126375
+vnoremap <leader>c !tee >(pbcopy)<cr>
+
" Commands