Skip to content

Instantly share code, notes, and snippets.

@christoomey
Created September 12, 2013 13:24
Show Gist options
  • Save christoomey/6537220 to your computer and use it in GitHub Desktop.
Save christoomey/6537220 to your computer and use it in GitHub Desktop.
Vim command that accepts range
function! PrintGivenRange() range
echo "firstline ".a:firstline." lastline ".a:lastline
echo "firstline contents" . getline(a:firstline)
echo "lastline contents" . getline(a:lastline)
endfunction
command! -range PassRange <line1>,<line2>call PrintGivenRange()
vmap ,pr :PassRange<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment