Commits

Anonymous committed 38e92aa

Simplify <leader>y pasteboard mapping (thanks, Yaniv Aknin!)

  • Participants
  • Parent commits 03dfbde

Comments (0)

Files changed (1)

 
 set makeprg=python\ -m\ nose.core\ --machine-out
 
-command! -range -nargs=1 SendToCommand <line1>,<line2>call SendToCommand(<q-args>) 
+map <silent> <leader>y :<C-u>silent '<,'>w !pbcopy<CR>
 
-function! SendToCommand(UserCommand) range
-    " Get a list of lines containing the selected range
-    let SelectedLines = getline(a:firstline,a:lastline)
-    " Convert to a single string suitable for passing to the
-    " command
-    let ScriptInput = join(SelectedLines, "\n") . "\n"
-    " Run the command
-    let result = system(a:UserCommand, ScriptInput)
-    " Echo the result (could just do "echo
-    " system(....)")
-    echo result
-endfunction
-map <leader>y :SendToCommand pbcopy<cr>
-