extended-text-objects.vim

" 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

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.