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")