Re: Swapping two elements around a third
> genericallySounds like tagged regex substitution statements are what you're hunting...
> where a, b and c can possibly be quite long, and not simple words.
:s/\(1st item regex\)\(pivot item regex\)\(2nd item regex\)/\3\2\1
So for your trivial case,
will change "abc" to "cba"
However, you can do more powerful stuff like:
would change "foo && bar" to "bar && foo"
This can be applied over a whole document or over a range, depending on what
you feed to the :s (:%s/... or :'a,'bs/... or whatever)