From 1e7a713aaa635ffb53af8806afc873da8f105819 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Mon, 20 Oct 2025 13:57:09 -0400 Subject: [PATCH] refactor(nvim): simplify lazy loading configuration --- lua/config/terminals.lua | 23 +++++++++++++++++++---- lua/plugins/astrocore.lua | 4 ++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lua/config/terminals.lua b/lua/config/terminals.lua index 686b17f..2656952 100644 --- a/lua/config/terminals.lua +++ b/lua/config/terminals.lua @@ -32,17 +32,30 @@ function M.setup() 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", + local smartCommit = Terminal:new { + cmd = "smartcommit", hidden = true, - direction = "tab", + 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", + 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, + } + -- Mk (make) terminal local mk = Terminal:new { cmd = "task", @@ -53,6 +66,7 @@ function M.setup() 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", @@ -69,6 +83,7 @@ function M.setup() M.scooter_toggle = function() scooter:toggle() end M.mk_toggle = function() mk:toggle() end M.lazygit_toggle = function() lazygit:toggle() end + M.smartCommit_toggle = function() smartCommit:toggle() end end return M diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index d3b1aa5..cbb193d 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -151,6 +151,10 @@ return { end, desc = "GH Dash", }, + [""] = { + terminals.smartCommit_toggle, + desc = "SmartCommit Toggle", + }, [""] = { terminals.lazygit_toggle, desc = "Lazygit Toggle",