For example, I have text like this:
I talked to a friend, I hiked a mountain, I am working with blah blah,
And I want to delete or substitute
There are a bunch of plugins that help you create custom text-objects like textobjectify.
I've had the following snippet in my vimrc
for quite a while and it never failed me:
for char in [ '_', '.', ':', ',', ';', '', '/', '', '*', '+', '%' ]
execute 'xnoremap i' . char . ' :normal! T' . char . 'vt' . char . ''
execute 'onoremap i' . char . ' :normal vi' . char . ''
execute 'xnoremap a' . char . ' :normal! F' . char . 'vf' . char . ''
execute 'onoremap a' . char . ' :normal va' . char . ''
endfor
It creates all the custom operator-pending mappings required for di,
, vi%
, ci:
, ya|
and so on.
And it's easy to add new delimiters.
And I have cute smileys in my vimrc
.