From 03ef0ecf15b91d299a988fd5f227871f0ca4f11b Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Sun, 21 Jun 2026 13:25:29 -0400 Subject: [PATCH] refactor(plugins): Update AstroCore, Kitty, and NeoTree configs --- lua/plugins/astrocore.lua | 4 +- lua/plugins/claudecode.lua | 60 ---------------- lua/plugins/kitty.lua | 56 ++++++++++----- lua/plugins/neotree.lua | 4 +- lua/plugins/user.lua | 142 ++++++++++++++++++++++--------------- 5 files changed, 127 insertions(+), 139 deletions(-) delete mode 100644 lua/plugins/claudecode.lua diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index 9cd958e..5ee1640 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -54,7 +54,7 @@ return { dirs = {}, }, autochdir = true, - scope = "win", + scope = "global", notify = false, }, @@ -294,7 +294,7 @@ return { desc = "Paste from system clipboard", }, [""] = { function() terminals.scratch_toggle() end, desc = "Open Scratch Terminal" }, - [""] = { "ClaudeCodeFocus", desc = "Toggle Claude Code" }, + ["f"] = { "ClaudeCodeFocus", desc = "Toggle Claude Code" }, [""] = { "OverseerRun", desc = "Run Overseer task" }, ["d"] = { function() with_trouble("diagnostics") end, diff --git a/lua/plugins/claudecode.lua b/lua/plugins/claudecode.lua deleted file mode 100644 index db4edf3..0000000 --- a/lua/plugins/claudecode.lua +++ /dev/null @@ -1,60 +0,0 @@ --- Claude Code IDE integration via WebSocket MCP. --- opens/focuses a near-fullscreen snacks float; the same key inside --- the terminal hides it (toggle). Visual-mode sends the selection. --- Neo-tree's is wired separately (see lua/plugins/neotree.lua). - -local toggle_key = "" - ----@type LazySpec -return { - "coder/claudecode.nvim", - dependencies = { "folke/snacks.nvim" }, - cmd = { - "ClaudeCode", - "ClaudeCodeFocus", - "ClaudeCodeSend", - "ClaudeCodeAdd", - "ClaudeCodeTreeAdd", - "ClaudeCodeSelectModel", - "ClaudeCodeDiffAccept", - "ClaudeCodeDiffDeny", - "ClaudeCodeStatus", - }, - keys = { - { toggle_key, "ClaudeCodeFocus", mode = { "n", "x" }, desc = "Toggle Claude Code" }, - { "am", "ClaudeCodeSelectModel", desc = "Select Claude model" }, - { "ar", "ClaudeCode --resume", desc = "Resume Claude" }, - { "aC", "ClaudeCode --continue", desc = "Continue Claude" }, - { "ab", "ClaudeCodeAdd %", desc = "Add current buffer to Claude" }, - { "ay", "ClaudeCodeDiffAccept", desc = "Accept Claude diff" }, - { "an", "ClaudeCodeDiffDeny", desc = "Deny Claude diff" }, - }, - opts = { - git_repo_cwd = true, - terminal = { - provider = "snacks", - ---@module "snacks" - ---@type snacks.win.Config|{} - snacks_win_opts = { - position = "right", - width = 0.3, - height = 1, - border = "rounded", - backdrop = 60, - keys = { - claude_hide = { - toggle_key, - function(self) self:hide() end, - mode = { "t", "n" }, - desc = "Hide Claude Code", - }, - }, - }, - }, - diff_opts = { - layout = "vertical", - open_in_new_tab = false, - }, - }, - config = true, -} diff --git a/lua/plugins/kitty.lua b/lua/plugins/kitty.lua index 11c99cd..443b39d 100644 --- a/lua/plugins/kitty.lua +++ b/lua/plugins/kitty.lua @@ -1,18 +1,42 @@ +local function t_nav(fn) + return function() + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes([[]], true, false, true), "n", false) + vim.schedule(fn) + end +end + return { - "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - "TmuxNavigatorProcessList", - }, - keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, - }, + "MunsMan/kitty-navigator.nvim", + -- Keep the kitty-side kittens in sync with the plugin. ~/.config/kitty is symlinked into the + -- dotfiles repo, so this copies navigate_kitty.py + pass_keys.py straight into the tracked config. + -- navigate_kitty.py is required for the nvim->kitty edge handoff (init.lua calls `kitty @ kitten + -- navigate_kitty.py `); pass_keys.py must match the `neighboring_window` map syntax in kitty.conf. + build = { + "cp navigate_kitty.py ~/.config/kitty", + "cp pass_keys.py ~/.config/kitty", + }, + -- Disable smart-splits navigation keys (AstroNvim injects these when KITTY_LISTEN_ON is set); + -- kitty-navigator owns . Resize bindings () are left intact. + specs = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + local m = opts.mappings.n + m[""] = false + m[""] = false + m[""] = false + m[""] = false + end, + }, + }, + keys = { + {"", function()require("kitty-navigator").navigateLeft()end, desc = "Move left a Split", mode = {"n"}}, + {"", function()require("kitty-navigator").navigateDown()end, desc = "Move down a Split", mode = {"n"}}, + {"", function()require("kitty-navigator").navigateUp()end, desc = "Move up a Split", mode = {"n"}}, + {"", function()require("kitty-navigator").navigateRight()end, desc = "Move right a Split", mode = {"n"}}, + {"", t_nav(function()require("kitty-navigator").navigateLeft()end), desc = "Move left a Split", mode = {"t"}}, + {"", t_nav(function()require("kitty-navigator").navigateDown()end), desc = "Move down a Split", mode = {"t"}}, + {"", t_nav(function()require("kitty-navigator").navigateUp()end), desc = "Move up a Split", mode = {"t"}}, + {"", t_nav(function()require("kitty-navigator").navigateRight()end), desc = "Move right a Split", mode = {"t"}}, + }, } diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index 86c2ee6..655153e 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -32,13 +32,13 @@ return { git_status_async = true, -- Asynchronous git status. Improves performance. hide_root_node = true, -- Hide the root node. retain_hidden_root_indent = true, -- IF the root node is hidden, keep the indentation anyhow. - use_libuv_file_watcher = false, + use_libuv_file_watcher = true, sort = { sorter = "name", }, window = { position = "left", - width = 34, + width = 32, mappings = { ["H"] = "navigate_up", ["L"] = function(state) diff --git a/lua/plugins/user.lua b/lua/plugins/user.lua index fc9aff0..2a1bc0e 100644 --- a/lua/plugins/user.lua +++ b/lua/plugins/user.lua @@ -5,27 +5,96 @@ ---@type LazySpec return { -{ - "ankushbhagats/match.nvim", - config = true, -}, - -- == Examples of Adding Plugins == - "andweeb/presence.nvim", - { - "ray-x/lsp_signature.nvim", - event = "BufRead", - config = function() require("lsp_signature").setup() end, - }, - - -- == Examples of Overriding Plugins == -- customize dashboard options { "folke/snacks.nvim", opts = { dashboard = { - preset = { + sections = { + { section = "header" }, + + { section = "keys", gap = 1, padding = 1 }, + { + pane = 2, + icon = " ", + desc = "Browse Repo", + padding = 1, + key = "b", + action = function() + Snacks.gitbrowse() + end, + }, + { + icon = " ", + desc = "Projects (ghq)", + padding = 1, + key = "p", + action = function() + local repos = vim.fn.systemlist("ghq list -p") + vim.ui.select(repos, { prompt = "Select repository" }, function(dir) + if not dir then return end + vim.cmd.cd(dir) + Snacks.picker.files() + end) + end, + }, + function() + local in_git = Snacks.git.get_root() ~= nil + local cmds = { + { + title = "Notifications", + cmd = "gh notify -s -a -n5", + action = function() + vim.ui.open("https://github.com/notifications") + end, + key = "n", + icon = " ", + height = 5, + enabled = true, + }, + { + title = "Open Issues", + cmd = "gh issue list -L 3", + key = "i", + action = function() + vim.fn.jobstart("gh issue list --web", { detach = true }) + end, + icon = " ", + height = 7, + }, + { + icon = " ", + title = "Open PRs", + cmd = "gh pr list -L 3", + key = "P", + action = function() + vim.fn.jobstart("gh pr list --web", { detach = true }) + end, + height = 7, + }, + { + icon = " ", + title = "Git Status", + cmd = "git --no-pager diff --stat -B -M -C", + height = 10, + }, + } + return vim.tbl_map(function(cmd) + return vim.tbl_extend("force", { + pane = 2, + section = "terminal", + enabled = in_git, + padding = 1, + ttl = 5 * 60, + indent = 3, + }, cmd) + end, cmds) + end, + { section = "startup" }, + }, + preset = { header = table.concat({ " █████ ███████ ████████ ██████ ██████ ", "██ ██ ██ ██ ██ ██ ██ ██", @@ -44,49 +113,4 @@ return { }, }, - -- You can disable default plugins as follows: - { "max397574/better-escape.nvim", enabled = false }, - - -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call - { - "L3MON4D3/LuaSnip", - config = function(plugin, opts) - -- add more custom luasnip configuration such as filetype extend or custom snippets - local luasnip = require "luasnip" - luasnip.filetype_extend("javascript", { "javascriptreact" }) - - -- include the default astronvim config that calls the setup call - require "astronvim.plugins.configs.luasnip"(plugin, opts) - end, - }, - - { - "windwp/nvim-autopairs", - config = function(plugin, opts) - require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call - -- add more custom autopairs configuration such as custom rules - local npairs = require "nvim-autopairs" - local Rule = require "nvim-autopairs.rule" - local cond = require "nvim-autopairs.conds" - npairs.add_rules( - { - Rule("$", "$", { "tex", "latex" }) - -- don't add a pair if the next character is % - :with_pair(cond.not_after_regex "%%") - -- don't add a pair if the previous character is xxx - :with_pair( - cond.not_before_regex("xxx", 3) - ) - -- don't move right when repeat character - :with_move(cond.none()) - -- don't delete if the next character is xx - :with_del(cond.not_after_regex "xx") - -- disable adding a newline when you press - :with_cr(cond.none()), - }, - -- disable for .vim files, but it work for another filetypes - Rule("a", "a", "-vim") - ) - end, - }, }