This is my fully customized Neovim configuration, built with Nix and the powerful Nixvim flake. Enjoy a consistent, reproducible, and easy-to-manage Neovim environment across different machines.
- Nixvim for Declarative Configuration: Leverage Nix expressions for a clean and maintainable Neovim setup with 100+ carefully configured plugins.
- AI-Powered Development: Integrated GitHub Copilot, Claude Code, Avante, and Blink completion for intelligent coding assistance.
- Modern Plugin Architecture: Modular plugin system with lazy loading and comprehensive language support for 20+ programming languages.
- Advanced Navigation: Multiple fuzzy finders (FZF-Lua, Snacks Picker) for quick file and symbol searching.
- Comprehensive Git Integration: Full Git workflow support with Gitsigns, Diffview, Git Conflict resolution, and worktree management.
- Debugging & Testing: Complete debugging setup with DAP and comprehensive testing with Neotest for multiple languages.
- Consistent Environments: Reproduce your Neovim setup effortlessly on any system with Nix installed.
- Nix Package Manager: Ensure Nix is installed on your system. Follow the instructions at https://nixos.org/download.html.
Option 1: Using nix run (Easiest):
nix run --extra-experimental-features 'nix-command flakes' github:khaneliman/khanelivimOption 2: Build and run locally:
git clone https://github.com/khaneliman/khanelivim.git
cd khanelivim
nix runOption 3: Home Manager Integration:
Add to your Home Manager configuration:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
khanelivim.url = "github:khaneliman/khanelivim";
};
outputs = { nixpkgs, home-manager, khanelivim, ... }: {
homeConfigurations.username = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
{
home.packages = [
# Option A: Use default configuration
khanelivim.packages.x86_64-linux.default
# Option B: Extend with customizations
(let
baseConfig = khanelivim.nixvimConfigurations.x86_64-linux.khanelivim;
extendedConfig = baseConfig.extendModules {
modules = [
{
# Disable specific plugins
plugins.yazi.enable = false;
# Override plugin settings
plugins.lualine.settings.options.theme = "gruvbox";
# Add custom Lua configuration
extraConfigLua = ''
vim.opt.relativenumber = false
'';
}
];
};
in extendedConfig.config.build.package)
];
}
];
};
};
}Khanelivim exposes profile presets through the khanelivim.profile module
option.
The important detail is that the flake's default package and nix run use the
profile selected by mkNixvimConfig, which currently defaults to standard.
Changing the option default in modules/khanelivim/options/profiles.nix only
changes the module fallback; it does not change the flake's default package on
its own.
In practice:
nix runandnix builduse the default flake package, which currently evaluates thestandardprofile.- To select another profile, evaluate the package or config through
khanelivim.lib.mkNixvimPackageorkhanelivim.lib.mkNixvimConfigand passprofile = "...". - Available profiles are
minimal,basic,standard,full, anddebug. See the generated profile matrix in the docs for the evaluated differences.
Build and run the debug profile from a local checkout:
nix build --impure --expr '
let
f = builtins.getFlake (toString ./.);
in
f.lib.mkNixvimPackage {
system = builtins.currentSystem;
profile = "debug";
}'
./result/bin/nvimUse a specific profile from Home Manager:
{
home.packages = [
(let
debugConfig = khanelivim.lib.mkNixvimConfig {
system = pkgs.system;
profile = "debug";
};
in
debugConfig.config.build.package)
];
}# Update flake dependencies
nix flake update
# Check flake for issues
nix flake check
# Format/lint code
nix fmt
deadnix -e
statix fix .
# Enter development shell
nix develop
# Run Neovim
nix run-
Add new plugins: Use the
new-pluginscript in dev shell:nix develop new-plugin <plugin-name> <template-type>
-
Format and check: Always run before committing:
nix fmt deadnix -e statix fix . -
Testing changes: Build and test locally:
nix build && ./result/bin/nvim
- avante - AI-powered code assistant with chat interface
- blink - Modern completion engine with multiple sources
- copilot - GitHub Copilot integration with chat
- claude-code - Claude AI assistant integration
- catppuccin - Macchiato colorscheme with comprehensive theming
- bufferline - Enhanced buffer/tab line with custom styling
- lualine - Highly customizable status line
- which-key - Keybinding popup help system
- noice - Enhanced UI for messages, cmdline, and popups
- snacks - Dashboard, picker, and various UI utilities
- flash - Enhanced navigation with jump labels
- hop - EasyMotion-like navigation
- harpoon - Quick file navigation and bookmarking
- fzf-lua - Fuzzy finder with git/LSP integration
- yazi - Terminal file manager integration
- neo-tree - File explorer sidebar (when yazi disabled)
- gitsigns - Git decorations with blame, hunks, and staging
- diffview - Enhanced diff viewing
- git-conflict - Git conflict resolution utilities
- git-worktree - Git worktree management
- gitignore - Gitignore file generation
- lspconfig - LSP client configurations for 20+ languages
- rustaceanvim - Comprehensive Rust development
- typescript-tools - Enhanced TypeScript/JavaScript support
- jdtls - Java language server
- clangd-extensions - C/C++ enhancements
- easy-dotnet - .NET development tools
- nix - Nix language support
- lazydev - Lua development enhancements
- conform - Code formatting (prettier, biome, stylua, etc.)
- lint - Linting (shellcheck, eslint, clippy, etc.)
- ts-comments - TypeScript/JavaScript comment utilities
- dap - Debug Adapter Protocol with multi-language support
- dap-ui - Debug UI interface
- dap-virtual-text - Virtual text during debugging
- neotest - Testing framework with multiple adapters
- treesitter - Syntax highlighting and code parsing
- mini - Collection of mini modules (ai, align, surround, etc.)
- luasnip - Snippet engine with friendly-snippets
- refactoring - Code refactoring utilities
- neogen - Documentation generation
- multicursor - Multiple cursor support
- yanky - Enhanced yank/paste functionality
- persistence - Session management
- wakatime - Time tracking
- overseer - Task runner
- rest - REST client for API testing
- grug-far - Find and replace across files
- markdown-preview / markview - Markdown preview and rendering
- glow - Terminal markdown rendering
- neorg - Note-taking and organization
- devdocs - Documentation browser
- colorizer / ccc - Color code highlighting and picker
- smartcolumn - Smart column guides
- trouble - Diagnostics and quickfix list
- todo-comments - TODO comment highlighting
See modules/nixvim/plugins/ for complete plugin configurations.
This configuration emphasizes LSP support to enhance your coding experience with features like:
- Diagnostics: Visual feedback for errors, warnings, hints, and information using symbols (e.g., ❌ for errors).
- Navigation: Quickly jump to definitions, references, implementations, and type definitions.
- Code Actions: Access context-aware suggestions for code improvements.
- Hover Information: Get detailed information about symbols by hovering over them.
- Rename: Refactor symbols accurately across your codebase.
- Formatting: Automatically format your code (either through a dedicated formatter or LSP capabilities).
- lspconfig - Core LSP client configurations
- glance - Preview definitions/references in floating windows
- lightbulb - Visual indicators for available code actions
- navic - LSP-based breadcrumb navigation
- trouble - Enhanced diagnostics and quickfix lists
- rustaceanvim - Advanced Rust development with rust-analyzer
- typescript-tools - Enhanced TypeScript/JavaScript support
- jdtls - Dedicated Java language server integration
- clangd-extensions - C/C++ specific enhancements
- easy-dotnet - .NET development utilities
The configuration includes a comprehensive list of LSP servers to support various programming languages, including:
- Bash/Shell - bashls
- C/C++ - ccls, clangd with extensions
- C#/.NET - roslyn, csharp-ls
- CSS/SCSS/Less - cssls
- Docker - dockerls
- Go - gopls
- HTML - html
- Java - jdtls (dedicated plugin)
- JavaScript/TypeScript - typescript-tools, eslint
- JSON - jsonls
- Lua - lua-ls with lazydev
- Markdown - marksman, harper-ls
- Nix - nil-ls, nixd
- Python - basedpyright, ruff
- Rust - rust-analyzer (via rustaceanvim)
- SQL - sqls
- TOML - taplo
- YAML - yamlls
- Helm - helm-ls
- Typos - typos-lsp
Each server has specific settings tailored to its language, such as filetype associations, initialization options, and formatting configurations.
Khanelivim splits runtime tooling into two groups:
-
<leader>lfor generic LSP and diagnostics actions -
<leader>zfor language-specific tooling in the current buffer -
Code Navigation:
gd,grr,gri,K, andgxstill use Neovim's built-in LSP motions<leader>ld,<leader>li,<leader>ltexpose definition, implementation, and type definition in the LSP group
-
Code Actions:
<leader>la- Code actions<leader>lr- Rename symbol<leader>lf- Format code<leader>lT- Show current buffer tooling details<leader>lI/<leader>lX- LSP health and restart
-
Diagnostics:
<leader>l[/<leader>l]- Previous/next diagnostic<leader>lH- Show line diagnostics<leader>lq,<leader>le,<leader>lE,<leader>lW- Buffer/workspace diagnostics and error lists<leader>lQ- Request workspace diagnostics when the attached LSP supports them
-
Language-specific tooling:
- TypeScript, Rust, Python, and .NET add buffer-local actions under
<leader>z - Examples include import organization, Rust runnables, Python env/test helpers, and .NET build/debug/test flows
- TypeScript, Rust, Python, and .NET add buffer-local actions under
- Automatic formatting via conform.nvim with workspace-aware formatter ownership for Biome and Prettier
- Linting integration with various linters through nvim-lint
- Code completion powered by Blink with LSP, Copilot, and snippet sources
- Debugging support via DAP with UI and virtual text
- Testing integration through Neotest with multiple language adapters
- Workspace-aware diagnostics ownership so Biome and ESLint do not both stay active in the same JS/TS workspace
- Project-wide search and refactoring tools (Spectre, Grug-far, Refactoring.nvim)
| Key | Action | Description |
|---|---|---|
<Space> |
Leader key | Primary prefix for custom maps |
<Esc> |
Clear search | Clear search highlighting |
<C-c> |
Switch buffer | Toggle between recent buffers |
j/k |
Smart movement | Visual line aware movement |
Y |
Yank to end | Yank to end of line |
| Key | Action | Description |
|---|---|---|
<TAB> |
Next buffer | Navigate buffers |
<S-TAB> |
Previous buffer | Navigate buffers |
| |
Vertical split | Split window |
- |
Horizontal split | Split window |
<leader>[/]/,/. |
Window nav | Move between windows |
<leader>w |
Save file | Write current buffer |
<leader>q |
Quit with confirm | Safe quit |
<C-w> |
Close buffer | Smart buffer close |
| Key | Action | Description |
|---|---|---|
<leader><space> |
Smart find files | Main file finder |
<leader>ff |
Find files | Standard file finder |
<leader>fo |
Recent files | Recently opened files |
<leader>fb |
Find buffers | List open buffers |
<leader>fw |
Live grep | Search in files |
<leader>f/ |
Buffer fuzzy find | Search in current buffer |
<leader>fh |
Find help | Search help tags |
<leader>fk |
Find keymaps | Search keybindings |
<leader>fc |
Find commands | Search commands |
| Key | Action | Description |
|---|---|---|
<leader>e |
File explorer | Open Yazi file manager |
<leader>E |
File explorer | Toggle Neo-tree/Yazi |
<leader>fe |
File explorer | Snacks file explorer |
| Key | Action | Description |
|---|---|---|
<leader>gg |
Lazygit | Open Lazygit interface |
<leader>gs |
Git status | Find git status |
<leader>gC |
Git commits | Browse commits |
<leader>gb |
Git blame | Toggle git blame |
<leader>gd |
Git diff hunks | Show git diff hunks |
<leader>ghn/p |
Hunk nav | Next/previous git hunk |
<leader>ghs/u/r |
Hunk ops | Stage/undo/reset hunk |
| Key | Action | Description |
|---|---|---|
gd |
Go to definition | Jump to definition |
grr |
Find references | Show all references |
gri |
Go to implementation | Jump to implementation |
gy |
Go to type def | Jump to type definition |
K |
Hover docs | Show documentation |
gx |
Open document link | Follow LSP document links |
<leader>la |
Code actions | Show code actions |
<leader>lr |
Rename | Rename symbol |
<leader>lT |
Tooling info | Inspect current buffer tooling |
<leader>lI |
LSP health | Run :checkhealth vim.lsp |
<leader>lX |
Restart LSP | Restart attached LSP clients |
| Key | Action | Description |
|---|---|---|
<leader>xx |
Diagnostics | Toggle diagnostics list |
<leader>fd |
Find diagnostics | Buffer diagnostics |
<leader>fD |
Find diagnostics | Workspace diagnostics |
<leader>l[ |
Diagnostic jump | Previous diagnostic |
<leader>l] |
Diagnostic jump | Next diagnostic |
<leader>lH |
Diagnostic hover | Open float at current position |
<leader>lq |
Buffer diagnostics list | Send buffer diagnostics to loclist |
<leader>le |
Buffer errors list | Send buffer errors to loclist |
<leader>lE |
Workspace diagnostics | Send diagnostics to quickfix |
<leader>lW |
Workspace errors list | Send errors to quickfix |
<leader>lx |
Run code lens | Execute code lens when supported |
<leader>db |
Debug breakpoint | Toggle breakpoint |
<leader>dc |
Debug continue | Start/continue debug |
<leader>di |
Debug step | Step into |
<leader>do |
Debug step | Step over |
<leader>dO |
Debug step | Step out |
Language-specific actions live under <leader>z and are buffer-local.
- TypeScript uses
<leader>zfor actions like add imports, fix all, organize imports, source definition, and tsserver logs. - Rust uses
<leader>zfor runnables, debuggables, crate graph, cargo, rust-analyzer logs, and macro tools. - Python uses
<leader>zv,<leader>zc,<leader>zL,<leader>zt,<leader>zT,<leader>zl, and<leader>zdfor env/test/debug workflows. - .NET uses
<leader>zfor build, run, debug, test, watch, diagnostics, and outdated-package flows.
| Key | Action | Description |
|---|---|---|
s |
Flash jump | Quick jump to location |
S |
Flash treesitter | Treesitter-aware jump |
<leader>Ha |
Harpoon add | Add file to harpoon |
<leader>He |
Harpoon menu | Quick harpoon menu |
| Key | Action | Description |
|---|---|---|
<leader>ud |
Toggle diagnostics | Buffer diagnostics |
<leader>uf |
Toggle formatting | Auto-formatting |
<leader>uw |
Toggle word wrap | Text wrapping |
<leader>uS |
Toggle spell check | Spell checking |
<leader>uT |
Toggle terminal | Terminal interface |
<leader>ueI |
Toggle diagnostics in insert | Show diagnostics while typing |
<leader>uev |
Toggle virtual lines | Diagnostic virtual lines |
<leader>ueC |
Toggle code lens | Code lens display |
<leader>uec |
Toggle document colors | LSP document colors |
<leader>ueS |
Toggle semantic tokens | Semantic token highlighting |
| Key | Action | Description |
|---|---|---|
<leader>fy |
Yank history | Paste from yank history |
<leader>f' |
Find marks | Search marks |
<leader>ft |
Find TODOs | Search TODO comments |
<leader>: |
Command history | Recent command history |
Note: Use <leader> (Space) and wait to see all available options via
which-key. Many plugins provide additional context-specific keybindings. See
docs/language-tooling.md for the current runtime tooling model.
The configuration follows a modular architecture:
modules/nixvim/
├── plugins/ # Individual plugin configurations
│ ├── snacks/ # Snacks.nvim configuration
│ ├── lsp/ # Lspconfig configuration
│ ├── dap/ # Debugging setup
│ └── ...
├── keymappings.nix # Global key mappings
├── options.nix # Neovim options
├── lsp.nix # LSP configurations
└── default.nix # Main module entry point
For local development and contribution:
- Enter the development shell:
nix develop - Use the plugin generator:
new-plugin <name> <template-type>- Templates:
custom,custom-lazy,nixvim
- Templates:
- Configure the plugin in its
default.nix - Import it in the main plugins configuration
Each plugin has its own directory with configuration. Edit the default.nix
file in the respective plugin directory.
Add new language servers in modules/nixvim/lsp/ and formatters/linters in the
respective plugin configurations.
git clone https://github.com/khaneliman/khanelivim.git
cd khanelivim
nix develop