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.
We will not go through the basics of Vim regular expression. From the Vim documentation, we would suggest reading the followings.
- Search commands and patterns (
- The definition of a pattern (
- Patterns and search commands (
- Substitute (
incsearch and hlsearch
incsearch are global parameters that highlight all matches as we type. They are on by default in Neovim.
For substitution, the
:h icm) option shows the effects of
: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.
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