Timeline for How can I do a 'change word' in Vim using the current paste buffer?
Current License: CC BY-SA 3.0
16 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 6, 2022 at 6:49 | comment | added | Raphael Pinel | I tried Option 1, works. But if I do a typo and correct it with backspace, the text to paste moves to the - register. Maybe I should have exited the insert mode and undone the changes, or keep track of the backspace and use Ctrl R - | |
| Jan 15, 2021 at 0:19 | comment | added | azureai | The problem with option 1 here is that when you're coming from another vim window, having stored what you want to paste in the * buffer, it gets overwritten (at least for me), by the 'ciw'. | |
| Jun 13, 2019 at 8:12 | comment | added | eddd | I find the vi{range}p the best approach. | |
| May 24, 2019 at 2:02 | comment | added | Michael Draper | Option 1 works amazingly for me, thank you so much for this answer! | |
| Mar 3, 2019 at 0:50 | comment | added | Paul Parker | Anyone wanting to know why CTRL-R does it's magic: :help insert then search CTRL-R /CTRL-R. For how ve"0p works, look at :help registers | |
| Mar 3, 2019 at 0:47 | comment | added | Paul Parker | If you're going to map it to something, it's probably better to use: map <C-j> ciw<C-r>0<ESC> so that it doesn't matter from where in the word you press ^j. | |
| Feb 6, 2019 at 19:03 | comment | added | JKillian | ve"0p would work to let you repeat your change | |
| Sep 20, 2018 at 17:36 | comment | added | daparic | I like Option 3 when there is only 1 word to change. If there is more than one same word to change, Option 1 allows me to use the . operator to repeat it.. | |
| Sep 10, 2014 at 1:28 | history | edited | jmathew | CC BY-SA 3.0 | Fixed egregious mistake of vaw instead of viw and mented @tlos comment |
| Sep 9, 2014 at 22:10 | comment | added | tlo | Option 3 (even simpler): With your word yanked, cursor over the first character of the word you want to replace and do vep. | |
| Aug 29, 2013 at 15:48 | vote | accept | Michael Durrant | ||
| S Aug 29, 2013 at 15:39 | history | suggested | Michael Durrant | CC BY-SA 3.0 | Improve answer with additional detail. |
| Aug 29, 2013 at 15:34 | review | Suggested edits | |||
| S Aug 29, 2013 at 15:39 | |||||
| Aug 29, 2013 at 15:25 | history | edited | jmathew | CC BY-SA 3.0 | added 180 characters in body |
| Aug 29, 2013 at 15:11 | history | edited | jmathew | CC BY-SA 3.0 | added 84 characters in body |
| Aug 29, 2013 at 15:04 | history | answered | jmathew | CC BY-SA 3.0 |