zfqmiw
Last Updated: February 25, 2016
·
1.506K
· endel
Profile 2015 2

VIM: Add "/" and "|" to text objects

This allow you to quick do things "inside" and "around" the "|" and "/" text objects. Like change/delete/yank and enter visual.

Add to your ~/.vimrc:

" Fake '|' as text object
nnoremap di\| T\|d,
nnoremap da\| F\|d,
nnoremap ci\| T\|c,
nnoremap ca\| F\|c,
nnoremap yi\| T\|y,
nnoremap ya\| F\|y,
nnoremap vi\| T\|v,
nnoremap va\| F\|v,

" Fake '/' as text object
nnoremap di/ T/d,
nnoremap da/ F/d,
nnoremap ci/ T/c,
nnoremap ca/ F/c,
nnoremap yi/ T/y,
nnoremap ya/ F/y,
nnoremap vi/ T/v,
nnoremap va/ F/v,
Say Thanks
Respond

1 Response
Add your response

1362

Add ".", ":", "|", "/", "\", "*" to text objects: http://codepad.org/TNVK7vO4

over 1 year ago ·