Development Workflow
This page is for working on the Khanelivim repo itself, not for consuming the built package.
Development Shell
Enter the dev shell before doing repo work:
nix develop
That gives you the formatting, linting, and helper tools used by the repo.
Core Commands
# Update flake inputs
nix flake update
# Validate the flake
nix flake check
# Format and lint Nix code
nix fmt
deadnix -e
statix fix .
# Build the default package
nix build
# Run the default package
nix run
Adding A Plugin
Use the plugin generator from the dev shell:
new-plugin <plugin-name> <template-type>
Template choices:
nixvimfor standard plugins that map cleanly to upstream Nixvim optionscustomfor plugins that need custom Lua or more complex setupcustom-lazyfor plugins that should be lazy-loaded and need custom setup
After generating the module:
- configure the plugin in its module
- prefer
khanelivim.*option wiring when exposing user-facing behavior - test the result with
nix buildornix run
Editing Existing Behavior
When changing the repo itself:
- keep edits modular
- prefer semantic
khanelivim.*options over one-off plugin hacks - use the generated init as the runtime source of truth when debugging behavior
If you are debugging Neovim runtime behavior, inspect nixvim-print-init output
rather than assuming a local ad-hoc config matches the built package.
Docs
The docs are generated from the evaluated flake outputs:
nix build .#docs-html
nix run .#docs
Use the generated docs for:
khanelivim.*options- evaluated profile differences
- usage workflows and customization guidance
Performance
When adding or changing plugins, measure startup impact:
nix run .#profile -- -i --iterations 1
nix run .#profile -- -i --baseline --event deferred
nix run .#profile -- -i --compare --event deferred
The current target is to keep deferred startup under roughly 800ms, and new
plugins that add meaningful startup cost should usually be lazy-loaded.
Contribution Notes
For repository conventions, read:
CONTRIBUTING.mdfor style, workflow, and commit guidanceAGENTS.mdfor repo-specific development rules used during automated edits