From 320e54ce8d0109bce251acbbe457402aa1c2a059 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 6 Jun 2014 00:41:47 -0400 Subject: 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. --- vimrc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vimrc') 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 " Set scrollbind on a window nnoremap sb :setlocal scrollbind! +" Copy to OS X clipboard from visual mode +" http://stackoverflow.com/a/17126375 +vnoremap c !tee >(pbcopy) + " Commands -- cgit v1.2.3