A personal Neovim setup built on Lazy.nvim, focused on C/C++, Python, Rust, and Bazel. It has full LSP, formatting, linting, and a handful of UI/motion plugins I use.
This configuration requires Neovim 0.12 or newer. Mason installs the configured LSP servers, formatters, and linters, but it relies on system runtimes to install some packages.
Install Node.js and npm with nvm
npm is included with Node.js. Do not install npm separately. Install the current Node.js LTS release and the latest npm version compatible with it:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.6/install.sh | bashRestart the shell, then run:
nvm install --lts --latest-npm
node --version
npm --versionMason uses Node and npm for tools such as pyright, prettier, eslint_d, and
markdownlint-cli2.
Install the remaining dependencies
Python 3.10 or newer is required for Mason packages such as black, isort,
mypy, and yamllint. The nvim-treesitter main branch requires
tree-sitter-cli 0.26.1 or newer.
Arch:
sudo pacman -S --needed git ripgrep python python-pip tree-sitter-cli luarocks clang unzip curl xclipUbuntu/Debian:
sudo apt install git ripgrep python3 python3-pip python3-venv luarocks clang unzip curl xclipInstall tree-sitter-cli 0.26.1 or newer with the system package manager and
confirm the installed version with tree-sitter --version.
macOS:
brew install git ripgrep python tree-sitter-cli luarocks llvm unzip curlHomebrew must appear before /usr/bin so Mason finds Homebrew Python instead of
Apple's older system Python. Add this to ~/.zprofile:
eval "$(/opt/homebrew/bin/brew shellenv)"Restart the shell and verify the runtimes:
python3 --version
tree-sitter --versionRust toolchain (optional, only if you edit Rust):
Mason installs rust-analyzer, but does not ship rustfmt (it's not in Mason's registry — rustfmt is part of the Rust toolchain). Install via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup component add rustfmtThis also gives you rustc and cargo, which rust-analyzer needs to find the sysroot when opening .rs files. Distro-packaged rustfmt works too (sudo apt install rustfmt), but rustup is recommended.
git clone <repo-url> ~/.config/nvimThen just open Neovim — Lazy.nvim bootstraps itself and installs everything on first launch.
To install any missing Mason tools manually and wait for completion:
:MasonToolsInstallSyncMarkdown rendering depends on the markdown and markdown_inline Tree-sitter
parsers. Check it with:
:checkhealth render-markdownLanguage servers are auto-installed via Mason:
- Python —
pyright - C/C++ —
clangd, configured for Bazel projects (compile_commands.json, Bazel root markers) - Rust —
rust_analyzer(proc macros and build scripts disabled to avoid indexing stalls) - Bazel/Starlark —
starpls
Completion comes from nvim-cmp with LuaSnip for snippets.
Formatting (via Conform, auto-runs on save with 500ms timeout): black, isort, rustfmt, clang-format, buildifier, stylua, prettier, shfmt
Linting (via nvim-lint, runs on BufEnter/BufWrite/InsertLeave): flake8, mypy, luacheck, eslint_d, shellcheck, markdownlint-cli2, yamllint, buildifier
- Telescope — fuzzy file/grep/buffer search
- Neo-tree — file explorer with git status
- Flash — fast jump motions (
sto jump,Sfor treesitter selection) - Trouble — diagnostics panel
- Noice — cleaner LSP hover and message display
- Snacks — notifications, dashboard, git bits
- Lualine — status line
- Bufferline — tabbed buffers
- Render-markdown — renders markdown right in the buffer
- Indent-blankline — indentation guides
- Gitsigns — git change indicators in the gutter
- Vim-fugitive — git commands from within Neovim
- Lazygit (via Snacks) — full git TUI
- DAP — debugging support
- Comment.nvim —
gc/gbto toggle comments - Vim-tmux-navigator — seamless pane navigation between tmux and Neovim
- Mini-pairs — auto-closes brackets and quotes
- Persistence — session management
- Todo-comments — highlights TODO, FIXME, NOTE, etc.
- Claude-code — Claude Code integration
- 99 — LLM completion
Note:
gd(go to definition),grr(references),grn(rename), andK(hover) are built-in Neovim 0.11+ LSP mappings — they're not defined here but work out of the box.
| Key | Action |
|---|---|
gD |
Go to declaration |
gi |
Go to implementation |
grt |
Go to type definition |
gO |
Document symbols |
gq |
Format code |
<C-s> |
Signature help (insert mode) |
| Key | Action |
|---|---|
[d / ]d |
Previous / next diagnostic |
<leader>d |
Show error details |
<leader>xx |
Toggle all diagnostics (Trouble) |
<leader>xX |
Toggle buffer diagnostics |
<leader>cs |
Show symbols |
<leader>cl |
LSP definitions / references |
<leader>xL |
Location list |
<leader>xQ |
Quickfix list |
[q / ]q |
Previous / next quickfix item |
| Key | Action |
|---|---|
<leader>ff |
Find files |
<leader>fg |
Live grep |
<leader>fb |
Find buffers |
<leader>fh |
Find help tags |
<leader>e |
Toggle Neo-tree |
<leader>o |
Focus Neo-tree |
| Key | Action |
|---|---|
<cr> |
Open file / folder |
l / h |
Open file / close folder |
a |
Add file or folder |
d |
Delete |
r |
Rename |
y / x / p |
Copy / cut / paste |
c / m |
Copy / move |
R |
Refresh |
H |
Toggle hidden files |
[g / ]g |
Previous / next git change |
P |
Toggle preview |
zc / ze |
Close / expand all |
? |
Help |
| Key | Action |
|---|---|
s |
Jump |
S |
Treesitter selection |
r |
Remote flash (operator) |
R |
Treesitter search |
<c-s> |
Toggle flash search |
| Key | Action |
|---|---|
gc |
Toggle line comment |
gb |
Toggle block comment |
| Key | Action |
|---|---|
<leader>cf |
Format buffer |
<leader>cL |
Trigger linting |
<leader>mt |
Toggle markdown render |
<c-/> |
Toggle terminal |
<leader>gg |
Lazygit |
<leader>gb |
Git blame line |
<leader>gl |
Lazygit log |
<leader>bd |
Delete buffer |
<leader>cR |
Rename file |
- Telescope doesn't find ROS2 nodes or action servers