This repository is a personal Neovim configuration built around lazy.nvim, mason.nvim, nvim-lspconfig, telescope.nvim, nvim-treesitter, and a small set of writing-focused tools for LaTeX, Markdown, Obsidian, and Neorg.
The goal of this README is practical:
- explain what this config does
- list what must be installed before it works well
- separate required dependencies from optional ones
- call out repo-specific assumptions and current caveats
This setup is organized like this:
- init.lua: entrypoint
- lua/mathieu/core/options.lua: basic editor options
- lua/mathieu/core/keymaps.lua: global keymaps
- lua/mathieu/lazy.lua:
lazy.nvimbootstrap - lua/mathieu/plugins: one plugin spec per file
- lua/mathieu/word-count.lua: custom statusline helper for TeX word diffs and git staleness
Main feature areas:
- file navigation:
nvim-tree,bufferline,telescope - LSP and diagnostics:
nvim-lspconfig,mason,nvim-lint,trouble - completion and snippets:
nvim-cmp,LuaSnip, LaTeX snippets - formatting:
conform.nvim - Git:
gitsigns,lazygit.nvim, custom git-based word count - writing:
vimtex,markdown-preview.nvim,obsidian.nvim,neorg - sessions and UI:
alpha,auto-session,which-key,lualine,huez,auto-dark-mode
Use Neovim 0.11+.
This repo currently uses vim.lsp.config(...) in lua/mathieu/plugins/lspconfig.lua, which is part of the newer LSP API. The machine inspected for this README is running NVIM v0.11.3.
These are the baseline packages this config expects for normal use:
neovim>= 0.11gitcurlorwgetunziptargzipmakegccorclangnodeandnpmpython3andpip
Recommended in practice:
ripgrepfdxclipon X11 Linux orwl-clipboardon Wayland- a Nerd Font
Why these matter:
lazy.nvimbootstraps itself by cloning from GitHub, sogitis mandatory.mason.nvimshells out to archive and download tools such ascurl/wget,unzip,tar, andgzip.telescope-fzf-native.nvimbuilds withmakeand a C compiler.markdown-preview.nvimuses a Node-based preview app.LuaSnipis configured to buildjsregexpwithmake install_jsregexp.- clipboard integration is enabled with
opt.clipboard:append("unnamedplus"), so Linux users generally needxcliporwl-copy.
Pick the block for your system. These cover the base packages plus the
recommended extras (ripgrep, fd, clipboard, tmux, lazygit) and the
manual tools this config uses but does not auto-install (latexmk, zathura).
sudo apt update
sudo apt install -y \
neovim git curl wget unzip tar gzip make gcc \
nodejs npm python3 python3-pip python3-venv \
ripgrep fd-find xclip wl-clipboard tmux lazygit \
latexmk zathura texlive-fullOn Debian/Ubuntu the
fdbinary is calledfdfind; symlink it if you want thefdname:mkdir -p ~/.local/bin && ln -s "$(which fdfind)" ~/.local/bin/fd. If the distro'sneovimis older than 0.11, use the unstable PPA (sudo add-apt-repository ppa:neovim-ppa/unstable) or the AppImage from https://github.com/neovim/neovim/releases.
sudo pacman -S --needed \
neovim git curl wget unzip tar gzip make gcc \
nodejs npm python python-pip \
ripgrep fd xclip wl-clipboard tmux lazygit \
texlive-most zathura zathura-pdf-mupdfsudo dnf install -y \
neovim git curl wget unzip tar gzip make gcc \
nodejs npm python3 python3-pip \
ripgrep fd-find xclip wl-clipboard tmux lazygit \
latexmk zathura texlive-scheme-fullbrew install \
neovim git curl wget gnu-tar make gcc \
node python ripgrep fd tmux lazygit
brew install --cask mactex zathuramacOS ships
unzip,gzip, andtar, and uses the system clipboard, soxclip/wl-clipboardare not needed. A TeX distribution viamactexis large;basictexpluslatexmkis a lighter alternative.
Also install a Nerd Font for the UI icons (any patched font works): https://www.nerdfonts.com/font-downloads.
Back up any existing config and state, then clone this repo to ~/.config/nvim:
# Back up an existing config (only runs if one is present)
[ -e ~/.config/nvim ] && mv ~/.config/nvim ~/.config/nvim.bak.$(date +%s)
[ -e ~/.local/share/nvim ] && mv ~/.local/share/nvim ~/.local/share/nvim.bak.$(date +%s)
# Clone this config into place
git clone <this-repo-url> ~/.config/nvimOn first launch:
lazy.nvimwill bootstrap itself- plugins pinned in lazy-lock.json will be installed
- plugin build steps will run where configured
Then run:
:Lazy syncThis repo configures Mason in lua/mathieu/plugins/mason.lua.
The config asks Mason to install these LSP servers:
lua_lspyrightclangdastro
It also asks Mason to install these formatter/linter tools:
prettierstyluaisortblackpylint
Open Neovim and run:
:MasonIf anything above is missing, install it from Mason manually.
This is the part most likely to be missed.
-
eslint_dUsed by lua/mathieu/plugins/linting.lua for JavaScript, TypeScript, React, and Svelte linting. -
tex-fmtUsed by lua/mathieu/plugins/formatting.lua fortexandplaintex. -
ltex-ls-plusor another working LTEX server setup lua/mathieu/plugins/lspconfig.lua configuresltex, but Mason is not set to install it.
-
latexmkRequired byvimtexfor LaTeX compilation. -
zathuraRequired by this repo specifically because lua/mathieu/plugins/vimtex.lua sets:vim.g.vimtex_view_method = "zathura"
-
lazygitNeeded for:LazyGit. -
tmuxNeeded forvim-tmux-navigator. -
sshandscpNeeded forremote-nvim. -
devpodNeeded only forremote-nvimdevcontainer workflows. -
uvNeeded foruv.nvim. -
detex,texcount, orpandocUsed by lua/mathieu/word-count.lua to count TeX words in git diffs. The fallback is plainwc -w, but the LaTeX-aware tools are better.
eslint_d and tex-fmt are easiest to install from Mason (:MasonInstall eslint_d tex-fmt). The rest come from their own ecosystems:
# Node-based: eslint_d (JS/TS/Svelte linting)
npm install -g eslint_d
# Rust-based: tex-fmt (LaTeX formatter) and uv (Python env manager)
cargo install tex-fmt # or: download a release binary from GitHub
curl -LsSf https://astral.sh/uv/install.sh | sh
# ruff (Python LSP/linter) — install via uv or pipx
uv tool install ruff # or: pipx install ruff
# ltex-ls-plus (prose LSP) — grab a release archive and put it on $PATH
# https://github.com/ltex-plus/ltex-ls-plus/releases
# texcount / detex usually ship with your TeX distribution; pandoc is separate:
# Debian/Ubuntu: sudo apt install -y pandoc
# Arch: sudo pacman -S pandoc
# Fedora: sudo dnf install -y pandoc
# macOS: brew install pandoc
remote-nvimneedsssh/scp(usually preinstalled) and, only for devcontainer workflows,devpod >= 0.5from https://github.com/loft-sh/devpod/releases.
After installation:
:checkhealth
:checkhealth mason
:checkhealth vimtex
:checkhealth remote-nvimFor plugin state and build failures:
:Lazy
:Mason-
lazy.nvimRequiresgit. Upstream also recommends a Nerd Font. Some plugins pull in Lua rock dependencies, whichlazy.nviminstalls throughluarocks/hererocks— see Luarocks / hererocks below if that step fails. -
plenary.nvimLua helper library. No external binary dependency by itself.
-
telescope.nvimWorks without extra binaries, but this config mapslive_grep, soripgrepis effectively required for full functionality. -
telescope-fzf-native.nvimRequiresmakeplusgccorclangbecause this repo builds it withmake. -
nvim-treeNo mandatory external binaries. -
bufferline,window-picker,smart-splits,scrollfix,mini.bufremoveNo external binaries.
-
nvim-lspconfigDepends on actual language servers being installed. -
mason.nvimRequires download/archive utilities. It may also rely on ecosystem package managers depending on the tool being installed. -
mason-lspconfig.nvimBridges Mason package install names and LSP server names. -
mason-tool-installer.nvimAuto-installs Mason packages listed in this repo. -
nvim-cmpNo external binary by itself. -
LuaSnipThis repo builds optionaljsregexp, somakeand a C compiler are required. -
conform.nvimOnly formats through external formatters that must exist on$PATH. -
nvim-lintOnly lints through external linters that must exist on$PATH.
Configured language servers and tooling in this repo:
| Area | Tool | How it is expected to be installed |
|---|---|---|
| Lua LSP | lua_ls |
Mason |
| Python LSP | pyright |
Mason |
| C/C++ LSP | clangd |
Mason |
| Astro LSP | astro |
Mason |
| Python LSP | ruff |
not auto-installed here; install manually if you want it |
| Markdown/LaTeX prose LSP | ltex |
not auto-installed here; install manually |
| JS/TS/CSS/HTML/Markdown formatter | prettier |
Mason |
| Lua formatter | stylua |
Mason |
| Python formatters | black, isort |
Mason |
| Python linter | pylint |
Mason |
| JS/TS/Svelte linter | eslint_d |
manual |
| TeX formatter | tex-fmt |
manual or Mason |
Notes:
pyright,prettier, andastro-language-serverare Node ecosystem tools under Mason.black,pylint, andisortare Python ecosystem tools under Mason.clangd,lua-language-server, andtex-fmtare distributed as standalone binaries/releases in Mason.
LaTeX support comes from:
vimtexcmp-vimtexluasnip-latex-snippetsconform.nvimwithtex-fmt- custom git word-count in the statusline
To use the LaTeX workflow properly, install:
- a TeX distribution
latexmkzathuratex-fmt
Helpful extras for the word-count statusline:
detextexcountpandoc
The custom statusline helper:
- only computes added/removed words for TeX buffers
- expects the file to be inside a git repo
- also shows days since last commit
Markdown support comes from:
- Treesitter
markdown-preview.nvimobsidian.nvimltexconfiguration for prose checking
To use Markdown preview comfortably:
- install
node - ensure you have a browser available
If you use Obsidian image paste on Linux:
- install
xclipfor X11 orwl-clipboardfor Wayland
If you want Obsidian quick search and switching:
- install
ripgrep
This repo defaults to this vault path:
~/thesis/Obsidian-folder/To use a different vault, set the OBSIDIAN_VAULT environment variable, or edit lua/mathieu/plugins/obsidian-nvim.lua.
Daily notes are expected under:
3 Resources/Periodic notes/Daily notesinside the vault.
Neorg is configured with this workspace:
~/neorg/notesOverride it with the NEORG_NOTES environment variable if you keep notes elsewhere.
Neorg also depends on Treesitter and uses nvim-cmp integration in this config.
-
gitsigns.nvimNo extra dependency beyondgit. -
lazygit.nvimRequires thelazygitbinary. -
custom word count module Requires
git; optionaldetex/texcount/pandoc. -
vim-tmux-navigatorRequirestmuxif you want pane navigation between Neovim and tmux.
alpha-nvimwhich-key.nvimlualine.nvimindent-blankline.nvimdressing.nvimauto-sessionnvim-surroundsubstitute.nvimComment.nvimnvim-autopairstodo-comments.nvimtrouble.nvimvim-maximizer
These do not need extra system packages beyond standard Neovim prerequisites.
This repo uses huez.nvim as the colorscheme selector.
Important caveat:
- lua/mathieu/plugins/huez-nvim.lua configures
huez - several old colorscheme plugin specs have been removed from the repo
- lazy-lock.json still contains stale lock entries for some themes
So theme switching is configured, but the actual set of installed theme plugins may not match the lockfile history.
auto-dark-mode.nvim needs OS support for system appearance detection:
- Linux desktop implementing
org.freedesktop.appearance.color-scheme - macOS Mojave+
- Windows 10+
remote-nvim.nvim is installed and configured with defaults.
For plain SSH remote editing you need:
sshscpcurl- remote host with
bash
For devcontainer workflows you also need:
devpod >= 0.5
This plugin also needs network access to download remote Neovim builds unless you use its offline mode.
This config enables:
opt.clipboard:append("unnamedplus")On Linux that usually means:
xclipon X11wl-copy/wl-pastefromwl-clipboardon Wayland
Without one of those providers, system clipboard support will be incomplete.
Some plugins declare Lua rock dependencies (rockspecs). When lazy.nvim sees
one, it installs the rock into an isolated Lua env that it builds with
hererocks — a Python script that
compiles a private Lua + luarocks under ~/.local/share/nvim/lazy-rocks/.
This is the step that commonly breaks on a fresh machine, so it gets its own
section here.
hererocks needs, on $PATH:
python3(it is a Python script)git,curlorwget(to fetch Lua and luarocks)- a C toolchain:
makeplusgcc/clang, and the Lua headers unzip(luarocks unpacks rock archives)
Install the build prerequisites:
# Debian / Ubuntu
sudo apt install -y build-essential libreadline-dev unzip python3 curl git
# Arch
sudo pacman -S --needed base-devel readline unzip python curl git
# Fedora
sudo dnf install -y @development-tools readline-devel unzip python3 curl git
# macOS (Xcode command line tools provide the compiler)
xcode-select --install-
:checkhealth lazyreports whetherluarocks/hererocksare usable and prints the exact error when they are not. -
If the private env got into a bad state, delete it and let
lazy.nvimrebuild it on the next launch:rm -rf ~/.local/share/nvim/lazy-rocksthen reopen Neovim and run
:Lazy sync.
Rocks are built against Lua 5.1 (Neovim's runtime is LuaJIT, which is 5.1
compatible), so luarocks needs a Lua 5.1 interpreter.
Try this first — it is usually all that is needed:
# Debian / Ubuntu
sudo apt install -y luarocksInstalling the system luarocks package pulls in a working Lua 5.1 toolchain,
which resolved this error in practice. Then reopen Neovim and run :Lazy sync.
The equivalent on other distros is sudo pacman -S luarocks (Arch),
sudo dnf install luarocks (Fedora), or brew install luarocks (macOS).
If that alone does not fix it, this error means one of two things:
-
lazy.nvimis usinghererocksbut cannot build its private Lua 5.1. hererocks downloads the Lua 5.1 source and compiles it, which fails without a C compiler and the readline headers. Install the build prerequisites from the Luarocks / hererocks section above, wipe the env (rm -rf ~/.local/share/nvim/lazy-rocks), and run:Lazy syncagain. -
lazy.nvimpicked up a systemluarocksthat has no Lua 5.1 behind it. A distroluarocksis often wired to Lua 5.4, so it reports 5.1 as missing. The most reliable fix is to install a matching Lua 5.1 + luarocks pair and tell lazy.nvim to skip hererocks:# Debian / Ubuntu sudo apt install -y lua5.1 liblua5.1-0-dev luarocks # Arch sudo pacman -S --needed lua51 luarocks # Fedora sudo dnf install -y compat-lua compat-lua-devel luarocks # macOS brew install lua@5.1 luarocks
Then point lazy.nvim at the system luarocks instead of hererocks in the options table of lua/mathieu/lazy.lua:
rocks = { hererocks = false, -- use system luarocks/lua5.1 instead of a private build },
If neither route is worth the trouble, just disable rocks entirely — see below.
Rock support is optional for this config. You can either disable it globally by
adding rocks = { enabled = false } to the options table in
lua/mathieu/lazy.lua:
require("lazy").setup({ { import = "mathieu.plugins" } }, {
rocks = { enabled = false },
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
})or, if a specific plugin only wants a rock in order to pull a Lua library that
is also available as a normal plugin, add pkg = false to that plugin's spec so
lazy.nvim skips its rockspec. The Neorg spec in
lua/mathieu/plugins/neorg.lua
already does this (pkg = false) and lists its Lua dependencies
(lua-utils.nvim, pathlib.nvim, nui.nvim, nvim-nio) as plain plugins, so
Neorg here does not require a working luarocks/hererocks toolchain.
Core bindings defined in this repo:
<leader>ee: toggle file tree<leader>ff: find files<leader>fs: live grep<leader>ft: search TODOs<leader>g: open LazyGit<leader>wr: restore session<leader>ws: save session<leader>mp: format current buffer/range<leader>l: trigger lintinggd,gD,gR,gi,gt,K: LSP navigation and hover<Tab>/<S-Tab>: cycle buffers<C-h>,<C-j>,<C-k>,<C-l>: split navigation
See:
These are real caveats from the checked-in config.
The personal paths in this config now default sensibly and can be overridden without editing Lua:
| Variable | Default | Used by |
|---|---|---|
OBSIDIAN_VAULT |
~/thesis/Obsidian-folder |
obsidian.nvim |
NEORG_NOTES |
~/neorg/notes |
Neorg workspace |
LTEX_NGRAMS_DIR |
~/.local/models/ngrams/ |
LTEX n-gram language model (optional) |
The LTEX languageModel setting is only sent to the server when the directory
exists, so a fresh machine without the models will not error.
The repo defines a ruff LSP config, but lua/mathieu/plugins/mason.lua does not ensure-install ruff.
Formatting/linting for some filetypes will silently be incomplete until you install them.
If you want the shortest path to a working setup on Linux, install at least:
neovimgitcurlunziptargzipmakegccnodenpmpython3pipripgrepfdxcliporwl-clipboardtmuxlazygitlatexmkzathura
Then inside Neovim install or verify:
- Mason-managed:
lua_ls,pyright,clangd,astro,prettier,stylua,isort,black,pylint - extra manual tools:
eslint_d,tex-fmt,ruff,ltex-ls-plus,uv
These upstream docs were the important ones for the dependency audit:
lazy.nvim: https://github.com/folke/lazy.nvimmason.nvim: https://github.com/mason-org/mason.nvimtelescope-fzf-native.nvim: https://github.com/nvim-telescope/telescope-fzf-native.nvimLuaSnip: https://github.com/L3MON4D3/LuaSnipmarkdown-preview.nvim: https://github.com/iamcco/markdown-preview.nvimvimtex: https://github.com/lervag/vimtexobsidian.nvim: https://github.com/epwalsh/obsidian.nvimremote-nvim.nvim: https://github.com/amitds1997/remote-nvim.nvimuv.nvim: https://github.com/benomahony/uv.nvimauto-dark-mode.nvim: https://github.com/f-person/auto-dark-mode.nvim