We use the
which-key.nvim plugin to create key bindings and display a popup with possible key bindings as we type. In this article, let’s explore other alternative solutions.
This article is part of the Neovim for Beginners series.
The Neovim configuration files can be found in this repository.
The introduction of the Lua keymap APIs (
:h lua-keymap) makes it very easy to define key bindings. Several of these plugins use the Lua keymap APIs.
For those new to the Lua keymap APIs, check out this article.
Neovim for Beginners —Lua Autocmd and Keymap Functions
Neovim Lua autocmd and keymap functions.
legendary.nvim helps us define keymaps, commands, and autocommands as simple Lua tables, building a legend at the same time. It can integrate with the
which-key.nvim plugin, allowing us to use existing
which-key.nvim tables with it.
lua/plugins.lua file, we install it using
legendary.nvim uses the Lua keymap (
:h lua-keymap) , autocmd (
:h api-autocmd), and UI (
:h lua-ui) APIs. For a better user interface, we use the
Check out this article for the Lua UI APIs.
lua/config/legendary.lua file, we set up the plugin.