-1

I find myself sometimes having to rearrange arguments to functions in C-like languages. I.e. changing:

hello("world", makeExclamation(1), foo(bar(a, b, c)))
->
hello(foo(bar(a, b, c)), "world", makeExclamation(1))

If one changes the very first with the very last, copying the delimiter (, ) works quite well because it will be needed again where the argument is to be pasted. But in the case above the delimiter has to move to the other side of the yanked/cut string:

|, foo(bar(a, b, c))|
->
|foo(bar(a, b, c)), |

Generally I do this with the F and f command, but in a case like above that's not the most precise to use. Alternatively %B also works to move to the beginning but also not always (e.g. if "foo" is also composite and has whitespace).

Is there a way to have a dedicated command to do this automatically or a nice shortcut I'm not aware of?

Note: I usually visual-cut-paste in case that's any difference (e.g. velldP).

1 Answer 1

1

You could be interested by @PeterRincker argumentative plugin.

With that plugin when on foo you hit 2<, you'll go from:

hello("world", makeExclamation(1), foo(bar(a, b, c)))

to:

hello(foo(bar(a, b, c)), "world", makeExclamation(1))
2
  • 1
    That was precisely what I was looking for. Cheers.
    – bitmask
    Apr 17 at 8:57
  • 1
    Thanks for the feedback :-) Apr 17 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.