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.

3
  • Welcome to Vi and Vim!
    – filbranden
    Commented Jun 29, 2020 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
    Commented Jun 30, 2020 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
    Commented Jun 30, 2020 at 9:02

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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