Skip to main content
1 of 3
Albert
  • 143
  • 6

Append inside brackets, quotes, double quotes

Been using Vim for a few weeks now and I find myself constantly using ci" or ci( to change whats enclosed in "" or (). I do also find myself wanting to append inside of the brackets e.g.:

If I have:

if (name == "Frank") {

I want to be anywhere on that line and append && lastName == "Castle" to my condition inside the (). To end up with:

if (name == "Frank" & lastName == "Castle") {

OR I want to append Castle to what's inside the "". To end up with:

if (name == "Frank Castle") {

Obviously ai" and ai( doesn't work, since it puts you in append/insert mode and you then just type i"...

Anyone know how to do that, or if it's possible?

Cheers,

Albert
  • 143
  • 6