Troubleshooting
Each case below happened for real in this guide's lab, and the transcripts are the exhibits. The order is the order you are likely to meet them.
Neovim starts, but with an error and none of my settings
The lab broke its own config on
purpose (transcript
neovim-lab/transcripts/t10-broken-config.txt)
— an init.lua whose second line is
not Lua at all:
Error in /home/hatch/workspace/build-check/neovim-scratch/lab/config-broken/nvim/init.lua:
E5112: Lua chunk: ...ild-check/neovim-scratch/lab/config-broken/nvim/init.lua:2: '=' expected near 'is'
Three facts in that shape to rely on.
The editor still starts, in a
default state — a broken config costs
you your settings, not your editor.
The message names the file and the
line, and Lua errors are usually
exact: '=' expected near 'is' is the
parser telling you line 2 is not a
statement it can read. And the fix
order is mechanical: read the first
error only (later ones are often its
children), fix that line, restart.
:messages replays the startup errors
in a running session, and bisecting a
long file — comment out the second
half, see if the error survives — is
the standard hunt.
My settings are silently not there at all
Worse than an error is silence: no
message, and the editor behaves as if
init.lua does not exist. Chapter 2
warned about the cause — Neovim reads
the config folder the operating
system's variables point to, and if
those differ from where you have been
editing, your file is simply never
opened. The lab proved it with two
identical editors (transcript
neovim-lab/transcripts/t12-stdpath.txt):
the one pointed at the lab's config
reported tabstop = 4, the value the
file sets; the one pointed at an empty
folder reported tabstop = 8, the
default, and said nothing at all.
The diagnosis is the asking of chapter
4: :echo stdpath('config') prints
the folder this process is using,
:echo $MYVIMRC the exact file it
loaded (empty if none), and :scriptnames
everything it has read. Between them,
the ghost config takes thirty seconds
to exorcise, once you know it is a
ghost.
:TSInstallSync is not an editor command
You followed a guide — possibly an
older edition of hard-won internet
wisdom — and Neovim answers E492: Not
an editor command. In this ecosystem
that usually means the command
existed and was removed or renamed
by a rewrite, not that you installed
wrongly. The lab's instance is in
transcript neovim-lab/transcripts/t07-tsinstall.txt:
the rewritten nvim-treesitter dropped
the Sync variants. The remedy habit
generalises: ask the installed thing,
not the internet — :help for the
plugin, or :checkhealth for its own
account of itself — and prefer sources
that name a version you can compare
with nvim --version.
A parser install fails with ENOENT: 'tree-sitter'
Same transcript, second exhibit: the
rewritten nvim-treesitter compiles
parsers by calling the standalone
tree-sitter command line tool,
which is not part of Neovim and not
part of the plugin. Absent, the
install downloads happily and fails at
the build step with a bare
ENOENT: no such file or directory (cmd): 'tree-sitter'.
Install the tool (its project's
releases carry a binary per platform),
confirm tree-sitter --version
answers on the PATH your editor
inherits, and run the install again.
The wider lesson belongs to the whole
tool: Neovim shells out constantly —
to git, to search tools, to servers —
and an ENOENT naming a command is
nearly always the environment's, not
the editor's, confession.
checkhealth complains about locale, clipboard or providers
From the lab's own report (transcript
neovim-lab/transcripts/t05-checkhealth.txt):
- ❌ ERROR Locale does not support UTF-8. Unicode characters may not display correctly.
- ⚠️ WARNING No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.
These are the machine talking, and
:checkhealth is designed to relay
it — each finding arrives with ADVICE
attached, and the advice is the fix:
set a UTF-8 locale (LANG and
friends) for the locale error; install
the platform's clipboard tool
(xclip or xsel on X11,
wl-clipboard on Wayland, pbcopy
built in on macOS) for the registers.
The WARNINGs about missing Python,
Ruby, Perl and Node providers are
calmer than they look: providers are
bridges that let some plugins be
written in those languages. If no
plugin you use needs one, the warning
is furniture. Learn to read the report
by section — what you installed and
use is worth keeping green; the rest
is the editor honestly listing doors
you have not opened.
A language server never attaches
Chapter 8's machinery fails in three
mundane ways, in this order of
likelihood. The cmd path is wrong —
run the exact path in a shell and
watch the server start (it will sit
waiting for a client; that silence is
health). No root marker was found
above your file, so the client never
started the server at all — open the
file from inside the project, or add
the marker your project actually has.
Or the server started and died, in
which case its own words are in the
LSP log (:lua vim.cmd('edit ' ..
vim.lsp.get_log_path())). And the
question that settles most cases in
one line: vim.lsp.get_clients()
returns who is actually attached —
asked by the lab's script before it
believed anything else.