Neovim 101 — Regular Expression

Tips and tricks for Vim regular expression.

3 min readSep 10, 2022


Neovim 101 — Regular Expression

Vim regular expression is powerful but could be challenging for beginners to learn. In this article, we go through several tricks to help us use Vim regular expression.

This article is part of the Neovim 101 series.

The Neovim configuration files are available in this repository.

Getting Started

We will not go through the basics of Vim regular expression. From the Vim documentation, we would suggest reading the followings.

  • The definition of a pattern (:h regexp)
  • Patterns and search commands (:h pattern-searches)
  • Substitute (:h :substitute)

incsearch and hlsearch

hlsearch and incsearch are global parameters that highlight all matches as we type. They are on by default in Neovim.

Highlight Search


For substitution, the inccommand (:h icm) option shows the effects of :substitute, :smagic, :snomagic and user commands with the :command-preview flag as we type.

The possible values for this option are

  • nosplit — Shows the effects of a command incrementally in the buffer.
  • split — Like nosplit, but also shows partial off-screen results in a preview window.


  • This option is only available for Neovim
  • For Vim users, check out the traces.vim plugin





Software engineer, Data Science and ML practitioner.