fix(mappings): go back to using <ESC> to exit terminal mode

This commit is contained in:
2025-10-21 10:52:08 +02:00
parent bcc327cb34
commit 5388da2989
+11 -2
View File
@@ -16,8 +16,17 @@ vim.keymap.set({ "n", "x" }, "<leader>p", '"+p')
vim.keymap.set({ "n", "x" }, "<leader>P", '"+P') vim.keymap.set({ "n", "x" }, "<leader>P", '"+P')
vim.keymap.set({ "n", "x" }, "<leader>+", ":call setreg('+', @\")<CR>") vim.keymap.set({ "n", "x" }, "<leader>+", ":call setreg('+', @\")<CR>")
-- Exit insert mode in terminal using <C-\> -- Exit insert mode in terminal using <ESC>
vim.keymap.set("t", "<C-\\>", "<C-\\><C-n>") vim.keymap.set("t", "<Esc>", "<C-\\><C-n>")
-- Feed ESC in terminal mode using <C-\>
vim.keymap.set("t", "<C-\\>", function()
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes("<Esc>", true, false, true),
"n",
false
)
end)
-- Use :diffput/get instead of normal one to allow staging visual selection -- Use :diffput/get instead of normal one to allow staging visual selection
vim.keymap.set({ "n", "x" }, "<leader>dp", ":diffput<CR>") vim.keymap.set({ "n", "x" }, "<leader>dp", ":diffput<CR>")