commit 468ff0d40f5f72c7e52d699abe0fabe2d9e9dc97
parent bb63096d4da9e2221590b5fdf77d41ab8fe9ecfb
Author: Chris Bracken <chris@bracken.jp>
Date: Thu, 19 Dec 2024 11:30:47 -0800
vim: create keymap to open a new terminal pane
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua
@@ -11,6 +11,11 @@ vim.keymap.set('n', '<Right>', '<NOP>')
-- Remap C-] to return to normal mode like C-[ does by default.
vim.keymap.set('t', '<C-]>', '<C-\\><C-n>')
+-- Launch a terminal in a new vertical split, focus it and enter insert mode.
+vim.keymap.set('n', '<leader>t',
+ '<cmd>vsplit | wincmd l | terminal<CR><cmd>startinsert<CR>',
+ { noremap = true, silent = true })
+
-- Retain selection on <,>.
vim.keymap.set('v', '<', '<gv')
vim.keymap.set('v', '>', '>gv')