Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: ci( like ci"?

Tags:

vim

In vim, how can I make ci( change whatever is in brackets on the current line like ci" changes everything that is in quotes?

I tried

:nnoremap ci( f(lct)

but my mapping is ignored. Can I not extend the builtin commands like that?

Also is there any way to combine movements? Can I do something like c{f)hh} to change everything up to the two characters before the closing bracket?

Thanks in advance.

like image 250
masterxilo Avatar asked Jan 24 '13 17:01

masterxilo


1 Answers

The behaviors of ci( and ci" are diferent because vim doesn't consider that quotes (and single quotes) come necessarily in pairs while ({[< do. This is a bit weird at first.

There are a number of "fixes" to this "issue". This one is the first that comes to mind.

like image 136
romainl Avatar answered Nov 08 '22 11:11

romainl