A lazy.nvim-based Neovim configuration. Originally inspired by dope.
Required:
- Neovim 0.12+
- ripgrep — live grep, obsidian search
- fd — recent-notes picker
- tree-sitter CLI ≥ 0.26 — parser installation (
brew install tree-sitter-cli) - A C compiler and
make— parser compilation and telescope-fzf-native
Optional formatters. conform.nvim falls back to LSP formatting for any of these that is missing, so none of them is required:
gofmt— Go (imports are organised by the gopls code action, no tool needed)rustfmt— Rust (ships with the toolchain)stylua— Lua, uses the.stylua.tomlin this repo. Also required by the Checks section below and by CI.prettier— json, jsonc, yaml, markdownshfmt— sh, bash
init.lua leader key, core module loading order
lua/core/
options.lua editor options (clipboard, folds, search, ...)
mappings.lua plugin-independent keymaps
keymap.lua small keymap.set wrapper
lsp.lua capabilities + LspAttach keymaps
diagnostics.lua diagnostic rendering
incremental_selection.lua <C-space>/<BS> treesitter selection
theme.lua follows the terminal light/dark state file
lazy.lua lazy.nvim bootstrap
lua/lsp/ one module of settings per language server
lua/plugins/ one spec per plugin (keymaps live with their plugin)
after/ftplugin/ per-filetype deltas from the global options
plugin/trimwhite.lua :TrimTrailingWhitespace with inccommand preview
scripts/smoke.lua headless config sanity check (also run in CI)
-
Leader is
<Space>; which-key shows group labels, individual descriptions come from each mapping'sdesc. -
LSP servers are installed by mason / mason-lspconfig (
lua/plugins/mason.lua). mason-lspconfig v2 enables them itself, so the config only supplies per-server settings fromlua/lsp/<server>.luaviavim.lsp.config()— which takes precedence over thelsp/<server>.luafiles nvim-lspconfig puts on the runtimepath. -
pylsp expects
python-lsp-black,pylsp-mypy,pyls-isort, andpylintinstalled in its mason venv. -
Formatting is owned by conform.nvim (
lua/plugins/conform.lua):<Leader>fwformats on demand in any buffer, and Go and Rust format on save. -
Notes workflow uses obsidian.nvim (community fork) with a vault at
~/notes. Note keymaps live under<Leader>o(which also holds<Leader>ozZen Mode);<Leader>chtoggles a checkbox. -
Markdown buffers get an in-place rendered view via render-markdown.nvim;
<Leader>tmswaps between rendered and raw source. -
Treesitter (main rewrite) has no auto-install: parsers are pre-listed in
lua/plugins/nvim_treesitter.lua. Startup only installs what is missing;:TSEnsureInstalledre-checks the list on demand. -
gopls runs with
staticcheckon and inlay hints configured. Its settings and analyzer defaults were checked against the binary withgopls api-jsonrather than the docs, which lag:unusedparams,nilness,unusedwriteandunusedvariableare all on by default in v0.23 and need noanalysesentry, andcompleteUnimportedis no longer a setting at all. -
LSP keymaps are Neovim's own, not remapped. Neovim 0.11 began shipping these; this config predated that and duplicated them on other keys, so the custom set was dropped:
was now action grgrrreferences gigriimplementation gDgrttype definition gdgdor<C-]>definition (kept, plus Neovim's key) <Leader>rngrnrename <Leader>cagracode action — grxrun codelens — gOdocument symbols KKhover (Neovim maps this itself on attach) <C-k><C-s>signature help (insert/select mode) lua/core/lsp.luakeeps those bindings but rebindsgd,<C-]>,grr,gri,grtandgOto telescope pickers, since stock Neovim sends them to the quickfix list.gra(code action) goes throughvim.ui.select, which telescope-ui-select routes into a picker as well.grn,grx,Kand<C-s>are left exactly as Neovim sets them.<Leader>fs/<Leader>fSpick document and workspace symbols, and<Leader>ihtoggles inlay hints. -
Every LSP picker clears
file_ignore_patterns. Telescope applies its defaults to all pickers, so the ignore list meant for file browsing would otherwise makegdfail silently whenever a definition lives invendor/or a generated.pb.go. -
Pressing
gralone waitstimeoutlenbefore the builtingr{char}virtual replace runs, because the sixgr*defaults above extend it (:h map-ambiguous). This is stock Neovim behaviour, reproducible withnvim --clean. -
<Leader>fffinds files,<Leader>fhfinds them including hidden and gitignored paths (this repo lives under.config/, which<Leader>ffskips). -
NVIM_COLUMNoverridestextwidth(defaults to 120);colorcolumntracks it. -
Clipboard uses pbcopy/pbpaste on macOS and OSC52 elsewhere (works over SSH).
-
lazy-lock.jsonis committed. Use:Lazy restoreto pin a machine to it and:Lazy updateto move it forward.
stylua --check .
nvim --headless -c 'luafile scripts/smoke.lua' -c 'qa'Both run in CI on every push and pull request to master.