Skip to main content

Thread: Vim Question - Single command to swap words


hi, i'm working through sobell's book linux commands, editors , shell programming, , i'm stumped on 1 of odd-numbered exercises (for not publish answers). it's chapter 6, exercise 15.

i'll quote in entirety:

which command use swap words hither , yon on line number of words between them? (you need not worry special punctuation, uppercase , lowercase letters , spaces.)

seems mean this: single command swap 2 strings on line in file?

have no clue how this, considering hither , yon might exist before or after 1 on given line (although seems he's implying hither comes before yon).

ideas?

i know vim not have dedicated command one, know can write macro it.

command line in general, alt + t transposes 2 words.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Vim Question - Single command to swap words


Ubuntu

Comments