4.2 KiB
4.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this repo is
A personal Neovim config forked from kickstart.nvim. Loaded by Neovim from ~/.config/nvim. There is no build/test step — changes take effect by restarting nvim (or :source % / :Lazy reload <plugin> for some edits).
Architecture
init.lua— entrypoint. Sets options, global keymaps, autocmds, bootstrapslazy.nvim, then loads every file underlua/custom/plugins/via{ import = 'custom.plugins' }. The kickstart single-file model has been broken out: only base options/keymaps live here; plugin specs live in their own files.lua/custom/plugins/*.lua— one file per plugin (or tightly related group). Each returns a lazy.nvim spec table (or list of specs). Adding a new plugin = create a new file here; it is picked up automatically. No central manifest to update.lua/custom/zed-keymaps.lua— mirrors Zed bindings (alt-j/k line move, F2 rename,<leader>.code action,gbblame,<leader>xclose buffer, task spawners). Required directly frominit.luabefore lazy setup. Task spawner prefers a floating zellij pane ($ZELLIJset) and falls back to annvimsplit terminal.lua/custom/health.lua— backs:checkhealth kickstart.lazy-lock.json— committed; pin plugin versions. Update via:Lazy updatethen commit.lua/kickstart/does not exist in this fork (upstream kickstart had it). Don't add files there; everything custom lives underlua/custom/.
Key conventions baked into the config
- Leader = Space (both
mapleaderandmaplocalleader). - Window navigation (
<C-h/j/k/l>) is owned bysmart-splits.nvim(lua/custom/plugins/tmux.lua) withmultiplexer_integration = 'zellij'— at a split edge it forwards focus to the zellij pane. Don't re-bind these ininit.lua. - LSP is wired in
lua/custom/plugins/lsp.lua. Servers configured:clangd,gopls,pyright(organize-imports disabled, lint suppressed —ruffhandles both),ruff(hover disabled —pyrighthandles),lua_ls. Mason auto-installs them plusstylua,jdtls,google-java-format. Buffer-local LSP keymaps (gd,gr,gI,<leader>rn,<leader>ca, …) are set in theLspAttachautocmd — add new LSP keybindings there, not globally. Inlay hints are forced on for Go buffers. - Go imports are organized on
BufWritePrefor*.govia asource.organizeImportscode action (lsp.lua). - Formatting is
conform.nvim(conform.lua);format_on_saveruns withtimeout_ms = 500and LSP fallback (disabled forc/cpp). Per-ft formatters:stylua(lua),ruff_organize_imports+ruff_format(python),google-java-format(java),terraform_fmt, prettier (js/xml). - Per-filetype
colorcolumnis set by aFileTypeautocmd ininit.lua(python 80, lua 100, go 120, rust 100, java 120). Other filetypes have no ruler. - Buffer switching:
<A-1>..<A-9>jump tovim.t.bufs[i](populated bymini.bufremove/mini.tablinefrommini.lua). ;is remapped to:in normal mode.<Esc>clears search highlight.
Formatting / lint for files in this repo
Lua files are formatted with stylua using .stylua.toml (2-space indent, single quotes preferred, 160-col width, no call parens). Run via <leader>f or :Format, or from a shell: stylua .. There is no test suite.
Adding / modifying plugins
- New plugin → new file in
lua/custom/plugins/, return a lazy spec. No need to editinit.lua. - After edits:
:Lazy sync(install/update/clean) or restart Neovim. Commitlazy-lock.jsonalong with spec changes so the lock stays reproducible. - Use
:checkhealthand:Masonto verify tool installation.
Repo-specific style notes
.stylua.tomlenforces single quotes and no call parens — keeprequire 'foo'style (notrequire('foo')) in plain calls; conform/lazy spec tables of course still use parens where required.- Existing files have heavy kickstart-original tutorial comments. When editing those files, leave the surrounding teaching comments intact unless the user asks for cleanup; for new files, follow the global comment policy (terse, only when WHY is non-obvious).