Neovim 101 - Macros and Registers

Manage Neovim macros and registers using Lua.

alpha2phi
5 min readDec 21, 2022
Neovim 101 — Macros and Registers

In this article, we will learn the basics of macros and registers, Lua APIs to manipulate registers, and plugins to help us manage macros and registers.

This article is part of the Neovim 101 series.

The Neovim configuration files are available in this repository.

Getting Started

Let’s get started with the basics.

Registers

There are 10 types of registers (:h registers).

  • The unnamed register
  • 10 numbered registers 0 to 9
  • The small delete register -
  • 26 named registers a to z or A to Z
  • 3 read-only registers : , , . and %
  • Alternate buffer register #
  • The expression register =
  • The selection registers * and +
  • The black hole register _
  • Last search pattern register /

We can use the :registers command to display the type and contents of all numbered and named registers.

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.