(Haven't seen Tim's reply yet, so answering here)

On Do, 10 Dez 2009, Ben Kim wrote:

> >> Likewise, if I undo the replace, and would like then to search for
> >> "otherword", is there a shortcut too?
> >
> > I'm not sure there's an easy way to search for the *replacement* side of a 
> > substitute.  Though I'd love to be proven wrong...I've occasionally reached 
> > for this and been disappointed not to know a solution.

If you want to repeat the last substitute, try :& You can add add flags 
to it, e.g. :& g (repeat last substitute and replace all matches on the 
line) If you want to redo the last substitute command on the range 1,$, 
try g&

If you'd like to search for something different, but replace with the 
last used substitution, you can use :s/foobar/~/ (e.g. use the ~ as 
shortcut).

See :h :substitute and scroll down a little bit.

regards,
Christian

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

Reply via email to