2.0 KiB
2.0 KiB
Agent instructions
This is a small Neovim config: Nix provides the binaries, Lua provides the behaviour.
The spec is the source of truth: Neovim Spec.md in the Obsidian vault (10 Projekte/Privat/Neovim Spec.md).
Read it before changing anything. If code and spec disagree, ask which one is right.
Rules
- Spec first. A new plugin, keymap or setting gets a row or line in the spec with a reason, in the same change.
Every plugin in
lazy-lock.jsonmust appear in the spec's plugin table. - Native first. Add a plugin only when the built-in feature is clearly worse. Do not add a distribution, Mason, Copilot or any cloud AI completion.
- Nix installs tools. Language servers, formatters, linters and debug adapters go into
nix/module.nix, never into the Lua config. - Two profiles.
full(default) andslim(servers). Heavy plugins usecond = vim.g.profile == "full". In slim, maps for disabled plugins must not exist. - Layout. One file per plugin or tight group in
lua/plugins/. Plugin-independent settings live inlua/core/. Per-server LSP overrides live inlsp/<server>.lua, per-filetype options inafter/ftplugin/. - Lazy loading. Load on event, command, key or filetype. Only the colourscheme, mini.statusline, mini.tabline and snacks core load at startup. Budget: under 50 ms.
- Treesitter is native. nvim-treesitter only installs parsers. Highlighting starts through
vim.treesitter.start(). - Keymaps. The owner uses a German QWERTZ keyboard, so never add a map that needs
[or]. Every map has adesc. No map overrides a built-in motion, except the ones listed in the spec. - Style.
styluawithstylua.toml(120 columns, 2 spaces, double quotes).
Checks
- Load a changed file headless:
nvim --headless -u NONE "+lua dofile('<file>')" +qa. - Run
:checkhealthin both profiles (NVIM_PROFILE=slim nvim) after larger changes. - After adding or removing a plugin, run
:Lazy syncand commitlazy-lock.json.