Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The quickest way to delete a function argument in Vim

Tags:

vim

If I have the following code:

foo->call(bar, baz->widget);

With cursor on "b" in "baz" or on "w" in "widget", how would I quickly delete the argument at the cursor?

foo->call(bar);

It can be any argument (first, last, or in the middle).

like image 602
Alex B Avatar asked Jan 17 '11 03:01

Alex B


1 Answers

With my omap-param plugin, just type di, or da,.

It won't be bothered by other brackets. For instance, in f(a+g(42, "string")), foobar), from "a" to "g", da, will just leave foobar in f call.

like image 78
Luc Hermitte Avatar answered Sep 30 '22 16:09

Luc Hermitte