Vim: ci (like ci "?

In vim, how can I do c i ( change everything that is in brackets in the current line, for example c i " change everything that is in quotation marks?

I tried

:nnoremap ci( f(lct) 

but my mapping is ignored. Can I not extend the built-in commands?

Is there also a way to combine movements? Can I do something like c { f ) h h } to change all up to two characters before the closing bracket?

Thanks in advance.

+7
source share
1 answer

The behavior of ci( and ci" is different in that vim does not think that quotation marks (and single quotes) are necessarily in pairs, but ({[< do. At first this is a bit strange.

There are a number of β€œfixes” to this β€œproblem”. This is the first thing that comes to mind.

+5
source

All Articles