From e52b0061ea0269c565f4c09573663b5b2a3ebb67 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 31 Jul 2026 12:24:47 -0400 Subject: [PATCH] Replace toggleterm with Snacks.terminal Snacks.terminal has been driving the terminal keymaps since 6341c73. Carry and over so the muscle memory survives. The old binding was never a valid keycode and could not have fired. Co-Authored-By: Claude Opus 5 --- lua/config/keymaps.lua | 7 ++++++ lua/plugins/toggleterm.lua | 44 -------------------------------------- 2 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 lua/plugins/toggleterm.lua diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 0ce0b2a..bc8bef0 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -14,6 +14,13 @@ vim.keymap.set("n", "B", function() Snacks.terminal({ "btop" }, { esc_esc = false, ctrl_hjkl = false }) end, { desc = "Toggle btop (improved console top monitor) floating terminal" }) +local function toggle_split_terminal() + Snacks.terminal.toggle(nil, { win = { position = "bottom" } }) +end + +vim.keymap.set({ "n", "t" }, [[]], toggle_split_terminal, { desc = "Toggle terminal split" }) +vim.keymap.set({ "n", "t" }, "", toggle_split_terminal, { desc = "Toggle terminal split" }) + -- Toggle zoom/maximize current window ( is the vim window prefix, m for maximize) vim.keymap.set({ "n", "t" }, "m", function() Snacks.toggle.zoom():toggle() diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua deleted file mode 100644 index c4f704f..0000000 --- a/lua/plugins/toggleterm.lua +++ /dev/null @@ -1,44 +0,0 @@ -return { - "akinsho/toggleterm.nvim", - version = "*", - opts = { - direction = "horizontal", - open_mapping = [[]], - hide_numbers = true, - }, - cmd = { - "ToggleTerm", - "TermExec", - "ToggleTermSendCurrentLine", - "ToggleTermSendVisualLines", - "ToggleTermSendVisualSelection", - "ToggleTermOpenAll", - "ToggleTermCloseAll", - "ToggleTermToggleAll", - }, - keys = { - [[]], - { "", [[ToggleTerm direction=float]], desc = "Toggle terminal in floating window" }, - { - "", - [[ToggleTerm direction=horizontal]], - desc = "Toggle terminal in horizontal bottom window", - }, - -- tmux muscle-memory for fullscreening nvim window - -- replaced with true-zen.nvim - -- vim.keymap.set('n', [[z]], [[ToggleTermToggleAll]]) - -- vim.keymap.set('t', [[z]], [[tab split]]) - { "", [[]], mode = "t", desc = "Escape terminal mode" }, - { "", [[]], mode = "t", desc = "Escape inside terminal" }, - -- These were replaced by smart-splits - -- { "", [[wincmd h]], mode = "t", desc = "Move focus down one window" }, - -- { "", [[wincmd h]], mode = "t", desc = "Move focus left one window" }, - -- { "", [[wincmd k]], mode = "t", desc = "Move focus up one window" }, - -- { "", [[wincmd l]], mode = "t", desc = "Move focus right one window" }, - { [[]], [[ToggleTerm]] }, - { "", [[ToggleTerm]] }, - { "", [[ToggleTerm]], mode = "t" }, - -- { "H", "lua _clx_toggle()", { desc = "Toggle clx (console HackerNews) floating terminal" } }, - -- { "G", "lua _gitui_toggle()", { desc = "Toggle gitui floating terminal" } }, - }, -}