From c386492859d480b7d36528f1ecb3c842ce82859d Mon Sep 17 00:00:00 2001 From: Naoto Ikuno Date: Wed, 25 Sep 2024 12:58:12 +0900 Subject: [PATCH] open terminal in insert mode --- nvim/lua/plugins/ui.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua index e3716f8..8ef6387 100644 --- a/nvim/lua/plugins/ui.lua +++ b/nvim/lua/plugins/ui.lua @@ -222,9 +222,12 @@ return { hidden = true } - vim.keymap.set('n', 'g', function() lazygit:toggle() end, { silent = true, desc = 'open lazygit' }) + vim.keymap.set('n', 'gg', function() lazygit:toggle() end, { silent = true, desc = 'open lazygit' }) - local terminal = Terminal:new { direction = 'float' } + local terminal = Terminal:new { + direction = 'float', + on_open = function(term) term:set_mode('i') end, + } vim.keymap.set('n', "'", function() terminal:toggle() end, { silent = true, desc = 'open terminal' }) end },