From 5388da2989bb5d192e38788767b43f8ee6d68ee9 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Tue, 21 Oct 2025 10:52:08 +0200 Subject: [PATCH] fix(mappings): go back to using to exit terminal mode --- lua/core/mappings.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 1457a9f..24385db 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -16,8 +16,17 @@ vim.keymap.set({ "n", "x" }, "p", '"+p') vim.keymap.set({ "n", "x" }, "P", '"+P') vim.keymap.set({ "n", "x" }, "+", ":call setreg('+', @\")") --- Exit insert mode in terminal using -vim.keymap.set("t", "", "") +-- Exit insert mode in terminal using +vim.keymap.set("t", "", "") + +-- Feed ESC in terminal mode using +vim.keymap.set("t", "", function() + vim.api.nvim_feedkeys( + vim.api.nvim_replace_termcodes("", true, false, true), + "n", + false + ) +end) -- Use :diffput/get instead of normal one to allow staging visual selection vim.keymap.set({ "n", "x" }, "dp", ":diffput")