From 924a4c58889c28e385389105ba6675e52dd1a0d8 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Tue, 11 Nov 2025 13:20:24 -0500 Subject: [PATCH] refactor(lua): adjust claudecode config and keymaps --- lua/community.lua | 1 - lua/plugins/astrocore.lua | 27 ++++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lua/community.lua b/lua/community.lua index 868ebd2..a61dace 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -6,7 +6,6 @@ return { "AstroNvim/astrocommunity", version = false, -- Use latest astrocommunity - { import = "astrocommunity.pack.astro" }, { import = "astrocommunity.pack.bash" }, { import = "astrocommunity.pack.chezmoi" }, { import = "astrocommunity.pack.lua" }, diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index 86246ef..22a4963 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -19,6 +19,27 @@ return { "coder/claudecode.nvim", dependencies = { "folke/snacks.nvim" }, config = true, + opts = { + auto_start = true, + focus_after_send = true, + track_selection = true, + terminal = { + split_side = "right", -- "left" or "right" + split_width_percentage = 0.30, + provider = "auto", -- "auto", "snacks", "native", "external", "none", or custom provider table + auto_close = true, + snacks_win_opts = {}, -- Opts to pass to `Snacks.terminal.open()` - see Floating Window section below + + -- Provider-specific options + provider_opts = { + -- Command for external terminal provider. Can be: + -- 1. String with %s placeholder: "alacritty -e %s" (backward compatible) + -- 2. String with two %s placeholders: "alacritty --working-directory %s -e %s" (cwd, command) + -- 3. Function returning command: function(cmd, env) return "alacritty -e " .. cmd end + external_terminal_cmd = nil, + }, + }, + }, }, { "pittcat/claude-fzf.nvim", @@ -135,7 +156,7 @@ return { -- automatically update working directory (update manually with `:AstroRoot`) autochdir = true, -- scope of working directory to change ("global"|"tab"|"win") - scope = "win", -- Changed from "win" to "global" to make directory changes apply globally + scope = "global", -- Changed from "win" to "global" to make directory changes apply globally -- show notification on every working directory change notify = false, }, @@ -554,8 +575,8 @@ return { ["c"] = { "ClaudeCode --continue", desc = "Continue Claude" }, ["m"] = { "ClaudeCodeSelectModel", desc = "Select Claude model" }, ["b"] = { "ClaudeCodeAdd %", desc = "Add current buffer" }, - ["y"] = { "ClaudeCodeDiffAccept", desc = "Accept diff" }, - ["n"] = { "ClaudeCodeDiffDeny", desc = "Deny diff" }, + [""] = { "ClaudeCodeDiffAccept", desc = "Accept diff" }, + [""] = { "ClaudeCodeDiffDeny", desc = "Deny diff" }, -- UI Toggles with Snacks ["u"] = { desc = "UI Toggles" }, ["ud"] = {