Last active
May 6, 2016 19:12
-
-
Save voyeg3r/c18391ddaf33a01a32ce650659bc3fb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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