Closed fjchen7 closed 1 year ago
The final purpose is to make help panel cleaner if users want.
For me the specific requirement is:
require("diffview").setup {
keymaps = {
file_panel = {
-- I don't want to show some conventional keymaps
{ "n", "j", actions.next_entry, { desc = false } },
{ "n", "<down>", actions.next_entry, { desc = false } },
{ "n", "k", actions.prev_entry, { desc = false } },
{ "n", "<up>", actions.prev_entry, { desc = false } },
-- I want to disable some keymaps without showing them in the help panel.
{ "n", "<C-o>", "", { desc = false } }, -- Avoid accidentally messing up buffer
{ "n", "<C-i>", "", { desc = false } },
}
}
}
Of we directly choose the special string like __DIFFVIEW_IGNORED__
or something to hide keymap? (Just like which_key_ignore
in which-key)
For example,
{ "n", "<2-LeftMouse>", actions.select_entry, { desc = "__DIFFVIEW_IGNORED__" } },
In my opinion, this could avoid conflict with the extension about desc = false
in nvim_set_keymap()
and may be better.
@fjchen7 good call. Let's just go with "diffview_ignore"
as the special value then.
@fjchen7 Thanks for the PR!
I'm missing some explanation for this change. What's the point of hiding entries from the help panel?