On Mon, 2008-11-10 at 02:13 -0800, Srikanth wrote: > Lot of times I search for strings using the * command and I would > replace the searched string with some other string but how to avoid > typing the last searched string again in the ":%s/ > <last_searched_string>/<replace>" command?
The last search pattern is stored in the / buffer. You can insert it into the substitution with Ctrl+r followed by a / Type this: :%s/^R// and then the replacement. You can use Ctrl+r in any : command and when in insert mode. It will work with any buffer / * + " a to z -- Just my 0.00000002 million dollars worth, Shawn The map is not the territory, the dossier is not the person, the model is not reality, and the universe is indifferent to your beliefs. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
