[EMAIL PROTECTED] wrote:

     How to swap the three columns in file without using substitute
command?
Let us say file with the following contents,

A1 B1 C1
A2 B2 C2

Then after swapping the file content should be,

C1 A1 B1

C2 A2 B2
There's visswap, which you can get from

  http://mysite.verizon.net/astronaut/vim/index.html#VISSWAP

(and as mentioned in http://vim.sourceforge.net/tips/tip.php?tip_id=329)

With it, you can

 a) visually select a column using visual blocks (ctrl-v and move cursor)
 b) press ctrl-y    (sort of a yank)
 c) visually select another column using visual blocks
 c) press ctrl-x    (exchange)

Works with V and v (visually selected lines, visually selected characters), too.

So:

 1) swap columns A & C
 2) swap columns B & A

Regards,
Chip Campbell

Reply via email to