Files
nvim/AGENTS.md
T
2026-11-12 23:55:14 +01:00

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

  1. 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.json must appear in the spec's plugin table.
  2. 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.
  3. Nix installs tools. Language servers, formatters, linters and debug adapters go into nix/module.nix, never into the Lua config.
  4. Two profiles. full (default) and slim (servers). Heavy plugins use cond = vim.g.profile == "full". In slim, maps for disabled plugins must not exist.
  5. Layout. One file per plugin or tight group in lua/plugins/. Plugin-independent settings live in lua/core/. Per-server LSP overrides live in lsp/<server>.lua, per-filetype options in after/ftplugin/.
  6. 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.
  7. Treesitter is native. nvim-treesitter only installs parsers. Highlighting starts through vim.treesitter.start().
  8. Keymaps. The owner uses a German QWERTZ keyboard, so never add a map that needs [ or ]. Every map has a desc. No map overrides a built-in motion, except the ones listed in the spec.
  9. Style. stylua with stylua.toml (120 columns, 2 spaces, double quotes).

Checks

  • Load a changed file headless: nvim --headless -u NONE "+lua dofile('<file>')" +qa.
  • Run :checkhealth in both profiles (NVIM_PROFILE=slim nvim) after larger changes.
  • After adding or removing a plugin, run :Lazy sync and commit lazy-lock.json.