Skip to content

Installing Neovim

Neovim is installed the ways mature tools are: from your operating system's packages, from the project's own release files, or inside containers and development environments that fetch it for you. The route matters more than usual for one reason: Neovim moves fast, and old versions lack whole features. The built-in vim.pack of chapter 6 arrived in 0.12; the vim.lsp.config style of chapter 8 in 0.11. A distribution package from a conservative release can be two feature generations behind. This guide's lab therefore used the route that always gets the current version — the official release tarball — and it is the route taught here. Everything in the guide is stated against 0.12.6.

The release tarball (Linux)

From the Neovim releases page on GitHub, the file for an ordinary 64-bit Intel or AMD Linux machine is named nvim-linux-x86_64.tar.gz (ARM machines take nvim-linux-arm64.tar.gz). It unpacks to a single folder containing the program and everything it needs — no installer, no system changes:

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
tar xzf nvim-linux-x86_64.tar.gz
./nvim-linux-x86_64/bin/nvim --version

Check: the lab's version printout (transcript neovim-lab/transcripts/t00-version.txt) begins:

$ nvim --version
NVIM v0.12.6
Build type: Release
LuaJIT 2.1.1774638290

To make nvim a plain command, put the folder somewhere permanent and add its bin to your PATH, or unpack it into /opt and link the program into /usr/local/bin. The tarball is also the honest uninstall: delete the folder and it is gone.

The other routes, honestly

  • Your package manager (apt install neovim, brew install neovim, and friends) — the easiest route, and the one most likely to hand you an old version. Run nvim --version afterwards and compare against the feature chapters before blaming a chapter.
  • The AppImage — a single file that runs anywhere, nvim-linux-x86_64.appimage. It needs a kernel feature called FUSE to mount itself. Servers and containers frequently do not have it — this guide's lab machine is one — in which case the AppImage refuses to start, and the documented workaround is to extract it once (--appimage-extract) and run the program inside. The lab did not run this route; it is described here from the project's documentation, and the tarball above does the same job with no FUSE involved.
  • Windows and macOS — the releases page carries a Windows zip and installer and macOS tarballs (nvim-macos-arm64.tar.gz on Apple silicon). Homebrew on macOS tracks current versions closely. Paths in chapter 2's folder tour differ on Windows (the config lives under %LOCALAPPDATA%); the editor's own :echo stdpath('config') always tells the truth for the machine you are on.

Where Neovim keeps its life

Neovim does not scatter files. It keeps four folders, named by job, under locations the operating system picks — on Linux, the XDG directories, which environment variables can move. Ask the editor, never guess (transcript neovim-lab/transcripts/t12-stdpath.txt, where the lab pointed the XDG variables at its own folders so nothing touched the machine's real configuration):

config /home/hatch/workspace/build-check/neovim-scratch/lab/config/nvim
data   /home/hatch/workspace/build-check/neovim-scratch/lab/data/nvim
state  /home/hatch/workspace/build-check/neovim-scratch/lab/state/nvim
cache  /home/hatch/workspace/build-check/neovim-scratch/lab/cache/nvim

On an ordinary Linux machine with no XDG variables set, the same command reports ~/.config/nvim, ~/.local/share/nvim, ~/.local/state/nvim and ~/.cache/nvim. The four jobs:

Folder What lives there
config Your init.lua — the configuration of chapter 4 — and anything you add beside it
data Plugins installed by managers, Tree-sitter parsers (chapter 7), language tooling
state The shada file (history, marks, registers that persist between runs), swap and undo bookkeeping, logs
cache Throwaway copies that can be rebuilt; safe to delete

Two facts from that table earn their keep later. First, your whole editing life is portable: copy the config folder to a new machine and the editor there is your editor. Second, when the editor behaves as if your settings do not exist, the cause is usually that it looked in a different config folder than the one you edited — the single most common Neovim confusion, proven in the lab and diagnosed in chapter 12.

The health check

Once installed, run the built-in diagnostic once, before you need it:

:checkhealth

It opens a report on the program, its providers (the optional links to Python, Node and other runtimes that some plugins use), its Tree-sitter parsers, and the tools it shells out to, each line marked OK, WARNING or ERROR with advice attached. The lab's full report is transcript neovim-lab/transcripts/t05-checkhealth.txt; its sandbox findings are instructive rather than alarming — an ERROR that the machine's locale does not support UTF-8, and a WARNING that no clipboard tool was found, so the system clipboard registers would not work there. A clean machine shows fewer complaints; the point of the command is that when something is wrong later, this report is where the editor itself explains what it could not find. Chapter 12 returns to it.