Skip to content

Instantly share code, notes, and snippets.

@voyeg3r
Last active May 6, 2016 19:12
Show Gist options
  • Save voyeg3r/c18391ddaf33a01a32ce650659bc3fb0 to your computer and use it in GitHub Desktop.
Save voyeg3r/c18391ddaf33a01a32ce650659bc3fb0 to your computer and use it in GitHub Desktop.
" this code implements seven new text objects on vim: ":",".","|" . . .
" source: https://www.youtube.com/watch?v=0F4FgiVWvB8
let pairs = { ":" : ":",
\ "." : ".",
\ "/" : "/",
\ '\|' : '\|',
\ "*" : "*",
\ "-" : "-",
\ "_" : "_" }
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