5

I'm a long time Vim user but a few months back started dabbling in Emacs. One of the things I really liked about Emacs was when doing a find/replace s/you/me it would highlight the word I was changing in red and then the word I was replacing it with in green:

enter image description here

Is there a plugin that can do this in Vim? I've tried searching but I either don't know how to explain what I'm looking for or I can't find it because in searching I just come across a ton of tutorials on how to search and not how to implement this functionality.

  • Welcome to Vi and Vim! – filbranden Jun 29 at 15:58
  • 1
    incsearch can show the search in the substitute, i think, but idk of any plugin that shows the replacement – D. Ben Knoble Jun 30 at 0:52
  • It's been a while since I've used emacs, and when I did I didn't know what I was doing, but I don't think this is its default behaviour. If you're able to figure out what plugin/setting is enabling this feature in Emacs, then you might have more luck searching for a Vim replacement. – Rich Jun 30 at 9:02
1

You have a few options to replicate this functionality in vim:

  1. vim8 supports this out of the box with incsearch
  2. inccommand in neovim
  3. if you’re not using neovim or are stuck on an older version of vim, you can use the plugin vim-over: https://github.com/osyo-manga/vim-over
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.