January 7, 2010

vim tip #3: "inside" change, yank, delete

ci(
ci{
yi[
di)


Suppose your cursor is on the 'O' in the following code:

     void myfunc(ArgType* a, OtherArgType b) {
        ...
     }

Type in "ci)" to change the contents between the ()  "ci" could stand for "change inside" the follow delimeter... and )]} are understood to match their counterparts ([{.  You could also delete a space seperated word with "di ".

No comments: