Tuesday, December 1, 2009

How to switch two strings?

I frequently need to switch two strings. For example, if I want to
switch 'a' and 'b', I shall use the following three commands. I'm
wondering if there is a more convenient way to do so.

:%s/b/c/g
:%s/a/b/g
:%s/c/a/g

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: