Skip to content

Instantly share code, notes, and snippets.

@sjl
Created January 17, 2014 17:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjl/8477971 to your computer and use it in GitHub Desktop.
Save sjl/8477971 to your computer and use it in GitHub Desktop.
Zip Right Vim mapping
" Zip Right
"
" Moves the character under the cursor to the end of the line. Handy when you
" have something like:
"
" foo
"
" And you want to wrap it in a method call, so you type:
"
" println()foo
"
" Once you hit escape your cursor is on the closing paren, so you can 'zip' it
" over to the right with this mapping.
"
" This should preserve your last yank/delete as well.
nnoremap zl :let @z=@"<cr>x$p:let @"=@z<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment