Change text inside any character (like ci')

Viewed 46

Is it possible to change inside any character?

For example I can change inside ' by using ci'.

I want to change inside the - character, like this:

--I want to change inside this --

I am unable to do this with ci-.

1 Answers

It is not possible by default but you can create your own text-objects. Check this plugin: targets.vim Also have a look at :help operator and :help mapmode-o

Long story short, this seems to do the trick: :omap i- :<C-u>normal!T-vt-<CR>

Related