Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In vscode if my cursor is in a word, i Ctrl+D to select that, then Ctrl+D to select further matches, then begin typing over them. There's other modes too where you can just add more cursors to a line below/above but i find less use for that.

But in vim it's not much slower to do:

    /<search term>
    cgn  " change this this i just matched
    .    " find next occurance AND execute the change here too, i don't have to say "n ." because i used cgn above instead of something like cw
But i still end up relying on

    qq  " stick a macro in q register
    <complex edit sequence>
    @q / @@
For more gnarly stuff


presuming you did a `/<search>` for the results you want, you can follow it up with:

  :%s//<replacement>/gc




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: