From f313554c25a6b6cf6044bd6fb3038f484d1507d3 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 11 Nov 2015 20:11:34 -0500 Subject: Create 'copy' plugin A custom plugin that invokes a system copy to OS X's pasteboard using `pbcopy` via a Vim command. This allows us to specify a range of lines to copy in command mode, similar to the way that Chris Toomey's System Copy plugin provides an easy way to invoke a system copy using motions. With this plugin we can write: :5,21Copy to copy those lines. :12,'aCopy will also work. If your Vim is compiled with `+clipboard` support, you would instead write: :15,24y * Since I use a Vim that doesn't have clipboard support, I decided to use a plugin to get the same functionality rather than compile a new Vim. --- bundle/copy/plugin/copy.vim | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 bundle/copy/plugin/copy.vim (limited to 'bundle/copy/plugin') diff --git a/bundle/copy/plugin/copy.vim b/bundle/copy/plugin/copy.vim new file mode 100644 index 0000000..1383eca --- /dev/null +++ b/bundle/copy/plugin/copy.vim @@ -0,0 +1,5 @@ +" Copy +" +" Takes a range and copies the lines specified to the system clipboard. + +command! -range Copy call copy#Copy(, ) -- cgit v1.2.3