Skip to content
Cover image for Preview replace results in Neovim

Preview replace results in Neovim

konstantin profile image Konstantin twitter logo github logo ・1 min read

There is an interesting option in Neovim called inccommand. It allows you see the live preview of your buffer after some command (i.e. replace).

To configure it add following to your ~/.config/nvim/init.vim:

set inccommand=nosplit

Or if you're using ~/.vimrc to configure both vim and neovim:

if has("nvim") 
  set inccommand=nosplit

Now, as you type %s/text/replace/before you hit Enter you'll see the live result of your command so you can cancel it by hitting Esc.

You can also set inccommand to split. In that case the result will be shown in a separate split pane.

twitter logo DISCUSS (2)
markdown guide
Classic DEV Post from Aug 6 '19

What to put in your portfolio as a beginner web dev

Konstantin profile image
My name is Konstantin and I'm a developer based in Paris.