A common task I run into is having to change the order of arguments. So, for example, I might have something like this:
stringInsert( "text to insert", buffer );
and need to change it into this:
stringInsert( buffer, "text to insert" );
Typically the way I do this is:
da"
(or whatever is required to delete the first arg)f)h
(or f, if I am inserting in the middle of the arg list)p
- Enter insert, insert any necessary spaces in insert mode, leave insert mode
- Go back to beginning and delete unnecessary commas and spaces from beginning of arglist with
x
Obviously, this is kind of tedious. What is a better way?
UPDATE
I have been trying out a macro that looks like this and so far it seems to be working pretty well:
da"2f_i,<ESC>p2F_x