Question: How can I debug/log/view/?? what nvim is doing when it interprets keymappings?
I have a keymapping, <leader>hb
that mostly gets interpreted as h
followed by b
, but will sometimes render the intended results (in my case, gitsigns’ git-blame pop-up reveal) and so it is an intermittent success…
Verbose:
experiencing some difficulty integrating a plugin (gitsigns) that relies on a keymap, <leader>hb
poked around, and generically, same problem was happening whether it was this combination or any other that, without <leader>
could be interpreted as normal mode commands on their own.
tried to create an mre (nvim --clean -u mre.lua
) and everything works fine (of course).
so I’m left chasing it into the rest of the config and wondering how to know what nvim’s thinking when its decoding a normal mode keymapping.
(here is the mre, anyway)
local opts = { noremap = true, silent = false }
-- Shorten function name
local keymap = vim.api.nvim_set_keymap
--Remap space as leader key
keymap("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
keymap("n","<leader><leader>","<cmd>set statusline='ll'<cr>", opts)
keymap("n","<leader>h","<cmd>set statusline='l-h'<cr>", opts)
keymap("n","<leader>hh","<cmd>set statusline='l-hh'<cr>", opts)
keymap("n","<leader>hb","<cmd>set statusline='l-hb'<cr>", opts)