Skip to content

Commit

Permalink
fix(nvim): which-key v3 prevents lazygit from pressing esc
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed Jul 15, 2024
1 parent c9da0ed commit f57e7cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .config/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ vim.keymap.set("n", "<leader>gl", function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-k>", true, false, true), "n", true)
end, { buffer = term.bufnr })

-- which-key v3 pops up when I press esc by default, causing esc to not work. Work around it.
vim.keymap.set({ "t" }, "<esc>", function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<esc>", true, false, true), "n", true)
end, { buffer = term.bufnr })

vim.keymap.set({ "t" }, "<C-j>", function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-j>", true, false, true), "n", true)
end, { buffer = term.bufnr })
Expand Down Expand Up @@ -79,6 +84,11 @@ local function openLazyGit()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-k>", true, false, true), "n", true)
end, { buffer = term.bufnr })

-- which-key v3 pops up when I press esc by default, causing esc to not work. Work around it.
vim.keymap.set({ "t" }, "<esc>", function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<esc>", true, false, true), "n", true)
end, { buffer = term.bufnr })

vim.keymap.set({ "t" }, "<C-j>", function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-j>", true, false, true), "n", true)
end, { buffer = term.bufnr })
Expand Down

0 comments on commit f57e7cb

Please sign in to comment.