Replace toggleterm with Snacks.terminal
Snacks.terminal has been driving the terminal keymaps since 6341c73. Carry
<C-\> and <F12> over so the muscle memory survives. The old <M-> binding was
never a valid keycode and could not have fired.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,13 @@ vim.keymap.set("n", "<leader>B", function()
|
|||||||
Snacks.terminal({ "btop" }, { esc_esc = false, ctrl_hjkl = false })
|
Snacks.terminal({ "btop" }, { esc_esc = false, ctrl_hjkl = false })
|
||||||
end, { desc = "Toggle btop (improved console top monitor) floating terminal" })
|
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" }, [[<C-\>]], toggle_split_terminal, { desc = "Toggle terminal split" })
|
||||||
|
vim.keymap.set({ "n", "t" }, "<F12>", toggle_split_terminal, { desc = "Toggle terminal split" })
|
||||||
|
|
||||||
-- Toggle zoom/maximize current window (<C-w> is the vim window prefix, m for maximize)
|
-- Toggle zoom/maximize current window (<C-w> is the vim window prefix, m for maximize)
|
||||||
vim.keymap.set({ "n", "t" }, "<C-w>m", function()
|
vim.keymap.set({ "n", "t" }, "<C-w>m", function()
|
||||||
Snacks.toggle.zoom():toggle()
|
Snacks.toggle.zoom():toggle()
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
return {
|
|
||||||
"akinsho/toggleterm.nvim",
|
|
||||||
version = "*",
|
|
||||||
opts = {
|
|
||||||
direction = "horizontal",
|
|
||||||
open_mapping = [[<C-\>]],
|
|
||||||
hide_numbers = true,
|
|
||||||
},
|
|
||||||
cmd = {
|
|
||||||
"ToggleTerm",
|
|
||||||
"TermExec",
|
|
||||||
"ToggleTermSendCurrentLine",
|
|
||||||
"ToggleTermSendVisualLines",
|
|
||||||
"ToggleTermSendVisualSelection",
|
|
||||||
"ToggleTermOpenAll",
|
|
||||||
"ToggleTermCloseAll",
|
|
||||||
"ToggleTermToggleAll",
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
[[<C-\>]],
|
|
||||||
{ "<M-=>", [[<Cmd>ToggleTerm direction=float<CR>]], desc = "Toggle terminal in floating window" },
|
|
||||||
{
|
|
||||||
"<M->",
|
|
||||||
[[<Cmd>ToggleTerm direction=horizontal<CR>]],
|
|
||||||
desc = "Toggle terminal in horizontal bottom window",
|
|
||||||
},
|
|
||||||
-- tmux muscle-memory for fullscreening nvim window
|
|
||||||
-- replaced with true-zen.nvim
|
|
||||||
-- vim.keymap.set('n', [[<C-a>z]], [[<Cmd>ToggleTermToggleAll<CR>]])
|
|
||||||
-- vim.keymap.set('t', [[<C-a>z]], [[<Cmd>tab split<CR>]])
|
|
||||||
{ "<Esc>", [[<C-\><C-n>]], mode = "t", desc = "Escape terminal mode" },
|
|
||||||
{ "<Esc><Esc>", [[<Esc>]], mode = "t", desc = "Escape inside terminal" },
|
|
||||||
-- These were replaced by smart-splits
|
|
||||||
-- { "<C-j>", [[<Cmd>wincmd h<CR>]], mode = "t", desc = "Move focus down one window" },
|
|
||||||
-- { "<C-h>", [[<Cmd>wincmd h<CR>]], mode = "t", desc = "Move focus left one window" },
|
|
||||||
-- { "<C-k>", [[<Cmd>wincmd k<CR>]], mode = "t", desc = "Move focus up one window" },
|
|
||||||
-- { "<C-l>", [[<Cmd>wincmd l<CR>]], mode = "t", desc = "Move focus right one window" },
|
|
||||||
{ [[<C-\>]], [[<Cmd>ToggleTerm<CR>]] },
|
|
||||||
{ "<F12>", [[<Cmd>ToggleTerm<CR>]] },
|
|
||||||
{ "<F12>", [[<Cmd>ToggleTerm<CR>]], mode = "t" },
|
|
||||||
-- { "<leader>H", "<cmd>lua _clx_toggle()<CR>", { desc = "Toggle clx (console HackerNews) floating terminal" } },
|
|
||||||
-- { "<leader>G", "<cmd>lua _gitui_toggle()<CR>", { desc = "Toggle gitui floating terminal" } },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user