Skip to content

Instantly share code, notes, and snippets.

@kogakure
Created October 4, 2012 13:25
Show Gist options
  • Save kogakure/3833510 to your computer and use it in GitHub Desktop.
Save kogakure/3833510 to your computer and use it in GitHub Desktop.
Vim: Extended Text Motions
" Extended Text Motions
" http://connermcd.com/blog/2012/10/01/extending-vim%27s-text-objects/
let pairs = { ":" : ":",
\ "." : ".",
\ "<bar>" : "<bar>",
\ "*" : "*" }
for [key, value] in items(pairs)
exe "nnoremap ci".key." T".key."ct".value
exe "nnoremap ca".key." F".key."cf".value
exe "nnoremap vi".key." T".key."vt".value
exe "nnoremap va".key." F".key."vf".value
exe "nnoremap di".key." T".key."dt".value
exe "nnoremap da".key." F".key."df".value
exe "nnoremap yi".key." T".key."yt".value
exe "nnoremap ya".key." F".key."yf".value
endfor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment