How to read this config. Files are listed in the order Neovim actually loads them — read them in this order and the whole thing will make sense.
NvChad is not a fork of Neovim and this repo is not a fork of NvChad. NvChad is installed as a plugin (see init.lua), and this repo only contains the deltas: our options, our keymaps, our plugin list. Everything NvChad-flavored you see on screen (statusline, tabufline, dashboard, themes) lives in the plugin at ~/.local/share/nvim/lazy/NvChad/ and ~/.local/share/nvim/lazy/ui/ — we just configure it.
init.lua
├─ 1. sets <space> as leader, base46 cache path
├─ 2. bootstraps lazy.nvim (clones it on first run)
├─ 3. require("lazy").setup({ NvChad/NvChad, import "plugins" }, configs/lazy.lua)
│ └─ every file in lua/plugins/*.lua is merged into one plugin list
├─ 4. dofile(base46 cache) — pre-compiled theme highlights, this is why startup is fast
├─ 5. require "options" (lua/options.lua)
├─ 6. require "autocmds" (lua/autocmds.lua)
└─ 7. vim.schedule → require "mappings" (lua/mappings.lua — runs LAST, on purpose)
Step 7 matters: because mappings.lua runs after all plugins are set up, anything we map there wins over both NvChad's defaults and plugin keys= specs. That's the mechanism behind every "conflict fix" in this config.
Unchanged from the NvChad starter. Bootstrap + load order, nothing else. Don't edit it.
NvChad's own config schema (mirrors nvconfig.lua). Owns:
- the theme (
M.base46.theme) - highlight overrides (
hl_override— e.g. the Lazy UI readability fix) - extra base46 integrations (theme colors for flash/trouble/dap/…)
M.mason.pkgs— the list:MasonInstallAllinstalls. Add new LSP servers/formatters/debuggers here first.
Vim options. Loads NvChad's defaults, then our LazyVim ports (relativenumber, scrolloff, sessionoptions for persistence.nvim), plus two load-bearing lines: vim.g.autoformat (the format-on-save switch) and the mason PATH prepend (lets LSP binaries resolve before mason.nvim itself loads).
Event hooks: highlight-on-yank, restore last cursor position, attach the SQL completion source in database buffers.
All keybindings. Structured top-to-bottom:
require "nvchad.mappings"— NvChad defaults come in- deletions/overwrites of the five NvChad keys that fight LazyVim muscle memory
- grouped sections: buffers, pickers, diagnostics, editing, windows, toggles, terminal, git, harpoon, dap, db
Rule: if a key's plugin is lazy-loaded AND NvChad maps the same key (harpoon's <leader>h, dap's <leader>ds, dbui's <leader>D), the mapping must live here as a require() closure — a keys= spec in the plugin file would get clobbered by step 1. Non-colliding keys live next to their plugin in lua/plugins/*.lua.
lazy.lua— lazy.nvim's own settings (everything defaults to lazy-loaded; change-detection notification off)lspconfig.lua— replaces NvChad'son_attach(our LazyVim-style LSP keymaps), per-server settings, and thevim.lsp.enablelist. Add per-server tweaks here.conform.lua— which formatter runs per filetype + the format-on-save logicdap.lua— debug adapter definitions (codelldb, debugpy, js-debug) and dap-ui auto open/close
Every file returns a list of lazy.nvim specs; all of them get imported automatically. Organized by theme:
| File | Owns |
|---|---|
init.lua |
overrides of NvChad's bundled plugins: conform, lspconfig wiring, treesitter parser list, which-key group labels |
editor.lua |
movement/editing: flash, trouble, todo-comments, grug-far, harpoon, persistence, mini.surround |
git.lua |
gitsigns keymaps (via on_attach), diffview |
dap.lua |
the nvim-dap stack (ui, virtual-text, python/go helpers) |
lang.lua |
language-specific: rustaceanvim, crates.nvim, schemastore |
tools.lua |
kulala (REST client), dadbod (databases) |
| I want to… | Touch |
|---|---|
| add a plugin | new spec in the matching lua/plugins/*.lua file (or a new file — auto-imported) |
| add a keymap | lua/mappings.lua if it collides with an NvChad default or belongs to a lazy plugin NvChad also maps; otherwise keys= in the plugin spec |
| add a language | server in configs/lspconfig.lua (vim.lsp.config + vim.lsp.enable), formatter in configs/conform.lua, parser in plugins/init.lua treesitter list, packages in chadrc.lua mason list → :MasonInstallAll |
| change the theme | <leader>th (picker, recompiles automatically) or edit chadrc.lua then :Lazy build base46 |
| change LSP keymaps | the on_attach function in configs/lspconfig.lua |
| add a debugger | adapter + configurations in configs/dap.lua, adapter package in chadrc.lua |
New to LSP/DAP/Mason/treesitter as concepts? Read CONCEPTS.md first.