Skip to content

Neovim Configuration ​

A declaratively managed Neovim configuration built with NVF (Neovim Flake). Everything — plugins, LSP servers, keybindings, and options — is defined in pure Nix. No Mason, no lazy.nvim, fully reproducible.

Repository: github.com/ItzEmoji/nvim

Quick Start ​

bash
# Run directly
nix run github:ItzEmoji/nvim --accept-flake-config

# Or use in your NixOS config
inputs.nvim.url = "github:ItzEmoji/nvim";

Integration ​

The nvim flake exposes three module types for easy integration:

NixOS module ​

Adds Neovim to system packages:

nix
# In your host configuration.nix modules list:
inputs.nvim.nixosModules.nvim

Home Manager module ​

Adds Neovim to user packages:

nix
# In your home-manager.users.<name>.imports list:
inputs.nvim.homeManagerModules.nvim

Flake module ​

For composing into other flake-parts flakes:

nix
imports = [ inputs.nvim.flakeModules.nvim ];

Architecture ​

The configuration uses the same flake-parts + import-tree pattern as the dotfiles. There are two layers of auto-import:

flake.nix
└── flake-parts + import-tree ./modules
    ├── modules/packages.nix      → builds the nvf package
    ├── modules/modules.nix       → exports nixos/HM/flake modules
    └── modules/format.nix        → treefmt (nixfmt)

    packages.nix calls:
    └── nvf.lib.neovimConfiguration
        └── import-tree ../conf
            ├── conf/vim-options.nix
            ├── conf/config/keybinds.nix
            ├── conf/config/ui.nix
            └── conf/plugins/*.nix

modules/ contains flake-parts modules (package builds, flake outputs, formatting). conf/ contains NVF configuration modules (vim options, plugins, keybindings) that are passed to nvf.lib.neovimConfiguration.

Repository Structure ​

nvim/
├── flake.nix
├── modules/
│   ├── packages.nix            # Builds nvf package, exposes packages + apps
│   ├── modules.nix             # nixosModules, homeManagerModules, flakeModules
│   └── format.nix              # treefmt-nix (nixfmt)
└── conf/
    ├── vim-options.nix          # Core options: indentation, theme, statusline
    ├── config/
    │   ├── keybinds.nix         # All keybindings (~100 mappings)
    │   └── ui.nix               # Noice, devicons
    └── plugins/
        ├── bufferline.nix       # Tab line
        ├── languages.nix        # LSP, treesitter, language enables
        ├── lualine.nix          # Status line
        ├── mini.nix             # mini.nvim modules
        ├── nvim-cmp.nix         # Autocompletion
        └── snacks.nix           # Dashboard, picker, explorer, and more

Theme ​

Catppuccin Mocha is used throughout — the editor theme, lualine status bar, and bufferline tabs all use it.

nix
# conf/vim-options.nix
vim.theme = {
  enable = true;
  name = "catppuccin";
  style = "mocha";
};

Plugins ​

Snacks.nvim ​

The primary UI framework. Provides the dashboard, file explorer, fuzzy picker, notifications, and more:

FeatureDescription
dashboardStart screen with header and key shortcuts
explorerFile explorer
pickerFuzzy finder (files, grep, buffers, git, LSP symbols)
notifierNotification popups
indentIndent guides
scrollSmooth scrolling
imageImage rendering in terminal
bigfilePerformance optimization for large files
statuscolumnCustom status column
scopeScope detection
wordsWord highlighting and jumping

Mini.nvim ​

A collection of small, focused modules:

ModulePurpose
pairsAuto-close brackets and quotes
commentToggle comments (gcc, gc{motion})
surroundAdd/change/delete surrounding characters
splitjoinToggle single-line / multi-line code
moveMove lines and selections with Alt+hjkl
sessionsSession management

Language Support ​

LSP and Treesitter are enabled globally. Language-specific support is configured for:

LanguageLSPTreesitterFormatting
Nixnixdyesnixfmt
Pythonyesyes—
Rustrust-analyzeryes—
Gogoplsyes—
CSScss-lspyes—

Diagnostics are viewable through Trouble.nvim (<leader>xx).

Autocompletion ​

nvim-cmp with three sources:

SourceDescription
pathFilesystem path completion
luasnipSnippet completion
bufferWords from open buffers

UI ​

PluginPurpose
Noice.nvimReplaces cmdline, messages, and popupmenu with a modern UI
nvim-web-deviconsFile type icons
nvim-bufferlineTab bar (tabs mode, no numbers)
LualineStatus line with powerline separators

Keybindings ​

Leader key is space. All keybindings are defined in conf/config/keybinds.nix.

File Navigation ​

KeyAction
<leader>ffFind files
<leader>frRecent files
<leader>fgGit files
<leader>fbBuffers
<leader>eeFile explorer
<leader><space>Smart picker
<leader>,Buffer picker

Search and Grep ​

KeyAction
<leader>/Grep
<leader>sgGrep
<leader>swGrep word under cursor
<leader>sbSearch lines in current buffer
<leader>shHelp
<leader>skKeymaps
<leader>sdDiagnostics
<leader>smMarks

LSP ​

KeyAction
gdGo to definition
gDGo to declaration
grReferences
gIImplementations
gyType definitions
<leader>ssDocument symbols
<leader>sSWorkspace symbols
<leader>fmFormat buffer

Git ​

KeyAction
<leader>ggLazygit
<leader>gsGit status
<leader>gbGit branches
<leader>glGit log
<leader>gdGit diff
<leader>gBOpen in browser

Diagnostics (Trouble) ​

KeyAction
<leader>xxToggle diagnostics
<leader>xXBuffer diagnostics
<leader>csSymbols
<leader>clLSP panel
<leader>xLLocation list
<leader>xQQuickfix list

Toggles ​

KeyAction
<leader>usToggle spelling
<leader>uwToggle wrap
<leader>ulToggle line numbers
<leader>uLToggle relative numbers
<leader>udToggle diagnostics
<leader>ucToggle conceal
<leader>ubToggle dark/light background
<leader>uhToggle inlay hints
<leader>ugToggle indent guides
<leader>uDToggle dim mode

Other ​

KeyAction
<leader>zZen mode
<leader>bdDelete buffer
<leader>trTerminal
<leader>thColorscheme picker
<leader>.Scratch buffer
<leader>:Command history
<leader>nNotifications
<leader>cRRename file