4
votes
3answers
180 views

vim - how can i do a 'change word' using the current paste buffer

I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer. I now go to the word 'bar' and I want to replace it with my paste buffer. To replace the text ...
6
votes
4answers
121 views

Replace a line with the line that I have in the buffer in vi

I cc or dd to copy a line into my paste buffer. Then I go to a new location. I want to replace a line that I see. So I type p Down dd. Is there an easier way (fewer keystrokes)?
2
votes
1answer
2k views

Replace using VIM, reuse part of the search pattern

I am working with VIm and trying to set up a search and replace command to do some replacements where I can re-use the regular expression that is part of my search string. A simple example would be a ...