Tidy nvim config: per-press terminal root, trim which-key, refresh README
- Resolve LazyVim.root() when <C-/> is pressed, not once at startup - Drop which-key spec duplicated from LazyVim defaults - Remove no-op split_width_percentage from claudecode - Rewrite README with keymap cheat sheet - Add tree-sitter-cli to packages (needed to build parsers on nvim 0.12) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+35
-12
@@ -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 `<space>` and wait for which-key, or
|
||||
`<space>?` 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 |
|
||||
|-----|--------|
|
||||
| `<space>?` | Search all keymaps |
|
||||
| `<C-/>` | Toggle terminal (project root, bottom of current window) |
|
||||
| **AI** — `<space>a` | |
|
||||
| `<space>ac` / `af` | Toggle / focus Claude Code |
|
||||
| `<space>ar` / `aC` | Resume / continue last Claude session |
|
||||
| `<space>ab` | Add current buffer to Claude context |
|
||||
| `<space>as` | Send selection (visual) or file (explorer) to Claude |
|
||||
| `<space>aa` / `ad` | Accept / deny Claude's proposed diff |
|
||||
| **Git** (Neogit) — `<space>g` | |
|
||||
| `<space>gg` | Neogit status |
|
||||
| `<space>gc` / `gl` / `gp` | Commit / log / push |
|
||||
| **Harpoon** | |
|
||||
| `<space>h` | Add file to harpoon |
|
||||
| `<C-e>` | Harpoon menu |
|
||||
| `<C-1>`…`<C-4>` | Jump to harpoon file 1–4 |
|
||||
| **Other** | |
|
||||
| `<space>cu` | Undotree |
|
||||
| `<C-w><space>` | 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 `<space>cf`)
|
||||
- `nvim a b c` opens the files side by side
|
||||
- Inactive windows are dimmed (vimade); markdown renders inline (markview)
|
||||
|
||||
+10
-11
@@ -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" }, "<c-/>", function()
|
||||
Snacks.terminal(nil, terminal_opts)
|
||||
end, { desc = "Terminal (Root Dir)" })
|
||||
vim.keymap.set({ "n", "t" }, "<c-_>", 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" }, "<c-/>", terminal, { desc = "Terminal (Root Dir)" })
|
||||
vim.keymap.set({ "n", "t" }, "<c-_>", terminal, { desc = "which_key_ignore" })
|
||||
|
||||
@@ -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 = {
|
||||
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
||||
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
|
||||
{ "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" },
|
||||
{ "<leader>ar", "<cmd>ClaudeCode --resume<cr>", desc = "Resume Claude" },
|
||||
|
||||
@@ -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" },
|
||||
{ "<leader><tab>", group = "tabs" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>d", group = "debug" },
|
||||
{ "<leader>dp", group = "profiler" },
|
||||
{ "<leader>f", group = "file/find" },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>gh", group = "hunks" },
|
||||
{ "<leader>q", group = "quit/session" },
|
||||
{ "<leader>s", group = "search" },
|
||||
{ "<leader>u", group = "ui" },
|
||||
{ "<leader>x", group = "diagnostics/quickfix" },
|
||||
{ "[", group = "prev" },
|
||||
{ "]", group = "next" },
|
||||
{ "g", group = "goto" },
|
||||
{ "gs", group = "surround" },
|
||||
{ "z", group = "fold" },
|
||||
{
|
||||
"<leader>b",
|
||||
group = "buffer",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.buf()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"<leader>w",
|
||||
group = "windows",
|
||||
proxy = "<c-w>",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.win()
|
||||
end,
|
||||
},
|
||||
-- better descriptions
|
||||
{ "gx", desc = "Open with system app" },
|
||||
{ "gc", group = "comment", desc = "Toggle comment" },
|
||||
},
|
||||
{ "<leader>a", group = "ai", mode = { "n", "v" } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
-- disable LazyVim's default <leader>? so the snacks keymaps picker owns it
|
||||
{ "<leader>?", false },
|
||||
{
|
||||
"<c-w><space>",
|
||||
function()
|
||||
require("which-key").show({ keys = "<c-w>", loop = true })
|
||||
end,
|
||||
desc = "Window Hydra Mode (which-key)",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user