From 963c35e67f17adb7cd5cabc3e19e46528f6eafcd Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Thu, 16 Oct 2025 13:48:36 -0400 Subject: [PATCH] refactor(nvim): streamline Neovim configuration and plugin management --- lua/config/terminals.lua | 28 +++++++++++++--------------- lua/plugins/astrocore.lua | 10 ++-------- lua/plugins/tsx.lua | 8 -------- 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/lua/config/terminals.lua b/lua/config/terminals.lua index 9c9724f..b7cf3b0 100644 --- a/lua/config/terminals.lua +++ b/lua/config/terminals.lua @@ -33,23 +33,11 @@ function M.setup() end, } - -- Yazi file manager terminal - local opencode = Terminal:new { - cmd = "opencode", - hidden = true, - direction = "vertical", - close_on_exit = true, - on_open = function(term) - vim.cmd "startinsert!" - vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", { noremap = true, silent = true }) - end, - } - -- Scooter find and replace terminal local scooter = Terminal:new { cmd = "scooter", hidden = true, - direction = "vertical", + direction = "tab", on_open = function(term) vim.cmd "startinsert!" vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", { noremap = true, silent = true }) @@ -59,7 +47,17 @@ function M.setup() local mk = Terminal:new { cmd = "task", hidden = true, - direction = "tab", + direction = "horizontal", + on_open = function(term) + vim.cmd "startinsert!" + vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", { noremap = true, silent = true }) + end, + } + -- Mk (make) terminal + local lazygit = Terminal:new { + cmd = "lazygit", + hidden = true, + direction = "float", on_open = function(term) vim.cmd "startinsert!" vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", { noremap = true, silent = true }) @@ -68,9 +66,9 @@ function M.setup() -- Export toggle functions to module instead of global namespace M.claude_toggle = function() claude:toggle() end - M.opencode_toggle = function() opencode:toggle() end M.scooter_toggle = function() scooter:toggle() end M.mk_toggle = function() mk:toggle() end + M.lazygit_toggle = function() lazygit:toggle() end end return M diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index 25727a6..d3b1aa5 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -152,14 +152,8 @@ return { desc = "GH Dash", }, [""] = { - function() - require("snacks").terminal("lazygit", { - hidden = true, - auto_close = true, - interactive = true, - }) - end, - desc = "Lazygit", + terminals.lazygit_toggle, + desc = "Lazygit Toggle", }, [""] = { "Octo issue list", desc = "List Issues" }, [""] = { "Octo label", desc = "Manage Labels" }, diff --git a/lua/plugins/tsx.lua b/lua/plugins/tsx.lua index 5bfc987..526f3f4 100644 --- a/lua/plugins/tsx.lua +++ b/lua/plugins/tsx.lua @@ -201,14 +201,6 @@ return { }) end, }, - - -- React/JSX snippets and helpers - { - "dsznajder/vscode-es7-react-js-snippets", - build = "yarn install --frozen-lockfile && yarn compile", - ft = { "javascript", "typescript", "javascriptreact", "typescriptreact" }, - }, - -- Auto-close and auto-rename JSX tags { "windwp/nvim-ts-autotag",