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:
+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