diff --git a/nvim/README.md b/nvim/README.md index 466b4a9..9eeb15e 100644 --- a/nvim/README.md +++ b/nvim/README.md @@ -1,18 +1,41 @@ # Personal Neovim Config -My personal Neovim configuration built on [LazyVim](https://github.com/LazyVim/LazyVim). +Built on [LazyVim](https://www.lazyvim.org). Everything LazyVim documents still applies — +this file only covers what's different. Press `` and wait for which-key, or +`?` to fuzzy-search every keymap. -## Current Setup +## Setup -- **Base**: LazyVim with Gruvbox colorscheme -- **AI**: Claude Code integration (`claudecode.nvim`) -- **UI**: Snacks dashboard (custom STP banner), Which-Key (helix preset) -- **Languages**: TypeScript, Vue, Python, Go, SQL, Tailwind, Docker -- **Extras**: mini-surround, Prettier formatting, git extras +- Colorscheme: oxocarbon +- Language extras: C/C++ (clangd), Python, Go, TypeScript/Vue/Tailwind, SQL, Docker, Clojure +- Requires `tree-sitter-cli` (parsers can't be built without it) — see `../packages.txt` -## Suggested Plugins to Add +## Custom keymaps -- **vim-fugitive** or **neogit** - deeper git workflow beyond LazyVim's built-in gitsigns -- **nvim-lint** - async linting beyond what LSP provides -- **oil.nvim** - file explorer that works like a buffer (edit filesystem like text) -- **zen-mode.nvim** - distraction-free writing/coding +| Key | Action | +|-----|--------| +| `?` | Search all keymaps | +| `` | Toggle terminal (project root, bottom of current window) | +| **AI** — `a` | | +| `ac` / `af` | Toggle / focus Claude Code | +| `ar` / `aC` | Resume / continue last Claude session | +| `ab` | Add current buffer to Claude context | +| `as` | Send selection (visual) or file (explorer) to Claude | +| `aa` / `ad` | Accept / deny Claude's proposed diff | +| **Git** (Neogit) — `g` | | +| `gg` | Neogit status | +| `gc` / `gl` / `gp` | Commit / log / push | +| **Harpoon** | | +| `h` | Add file to harpoon | +| `` | Harpoon menu | +| ``…`` | Jump to harpoon file 1–4 | +| **Other** | | +| `cu` | Undotree | +| `` | Window "hydra" mode (repeat window commands) | + +## Behaviour changes from LazyVim + +- 4-space indent by default; C/C++ uses 2 spaces and has format-on-save **off** + (format manually with `cf`) +- `nvim a b c` opens the files side by side +- Inactive windows are dimmed (vimade); markdown renders inline (markview) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 3c4adcc..f7b0343 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -2,14 +2,13 @@ -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here --- Terminal: open relative to current window (don't squash explorer) and smaller -local terminal_opts = { - cwd = LazyVim.root(), - win = { position = "bottom", height = 0.3, relative = "win" }, -} -vim.keymap.set({ "n", "t" }, "", function() - Snacks.terminal(nil, terminal_opts) -end, { desc = "Terminal (Root Dir)" }) -vim.keymap.set({ "n", "t" }, "", function() - Snacks.terminal(nil, terminal_opts) -end, { desc = "which_key_ignore" }) +-- Terminal: open relative to current window (don't squash explorer) and smaller. +-- Root is resolved on each press so it follows the current buffer's project. +local function terminal() + Snacks.terminal(nil, { + cwd = LazyVim.root(), + win = { position = "bottom", height = 0.3, relative = "win" }, + }) +end +vim.keymap.set({ "n", "t" }, "", terminal, { desc = "Terminal (Root Dir)" }) +vim.keymap.set({ "n", "t" }, "", terminal, { desc = "which_key_ignore" }) diff --git a/nvim/lua/plugins/claudecode.lua b/nvim/lua/plugins/claudecode.lua index b755887..6896c0a 100644 --- a/nvim/lua/plugins/claudecode.lua +++ b/nvim/lua/plugins/claudecode.lua @@ -9,7 +9,6 @@ return { relative = "win", position = "bottom", height = 0.3, - split_width_percentage = 0.99, }, }, diff_opts = { @@ -19,7 +18,6 @@ return { }, }, keys = { - { "a", "", desc = "+ai", mode = { "n", "v" } }, { "ac", "ClaudeCode", desc = "Toggle Claude" }, { "af", "ClaudeCodeFocus", desc = "Focus Claude" }, { "ar", "ClaudeCode --resume", desc = "Resume Claude" }, diff --git a/nvim/lua/plugins/whichkey.lua b/nvim/lua/plugins/whichkey.lua index f8c4187..6d53cad 100644 --- a/nvim/lua/plugins/whichkey.lua +++ b/nvim/lua/plugins/whichkey.lua @@ -1,60 +1,16 @@ +-- LazyVim already defines all the default groups; only override what differs. return { { "folke/which-key.nvim", - event = "VeryLazy", - opts_extend = { "spec" }, opts = { preset = "helix", spec = { - { - mode = { "n", "x" }, - { "", group = "tabs" }, - { "c", group = "code" }, - { "d", group = "debug" }, - { "dp", group = "profiler" }, - { "f", group = "file/find" }, - { "g", group = "git" }, - { "gh", group = "hunks" }, - { "q", group = "quit/session" }, - { "s", group = "search" }, - { "u", group = "ui" }, - { "x", group = "diagnostics/quickfix" }, - { "[", group = "prev" }, - { "]", group = "next" }, - { "g", group = "goto" }, - { "gs", group = "surround" }, - { "z", group = "fold" }, - { - "b", - group = "buffer", - expand = function() - return require("which-key.extras").expand.buf() - end, - }, - { - "w", - group = "windows", - proxy = "", - expand = function() - return require("which-key.extras").expand.win() - end, - }, - -- better descriptions - { "gx", desc = "Open with system app" }, - { "gc", group = "comment", desc = "Toggle comment" }, - }, + { "a", group = "ai", mode = { "n", "v" } }, }, }, keys = { -- disable LazyVim's default ? so the snacks keymaps picker owns it { "?", false }, - { - "", - function() - require("which-key").show({ keys = "", loop = true }) - end, - desc = "Window Hydra Mode (which-key)", - }, }, }, } diff --git a/packages.txt b/packages.txt index 39f5c04..eef1bd7 100644 --- a/packages.txt +++ b/packages.txt @@ -96,3 +96,4 @@ wine mono avahi +tree-sitter-cli