feat: show keymaps for builtin actions (#1084)
* Add default mappings `<C-/>`and `?` for insert and normal mode, respectively, to show registered keymappings (`actions.which_key`) attached to prompt buffer
This commit is contained in:
@@ -30,6 +30,7 @@ mappings.default_mappings = config.values.default_mappings
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
|
||||
n = {
|
||||
@@ -56,6 +57,7 @@ mappings.default_mappings = config.values.default_mappings
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -222,6 +224,7 @@ mappings.execute_keymap = function(prompt_bufnr, keymap_identifier)
|
||||
assert(key_func, string.format("Unsure of how we got this failure: %s %s", prompt_bufnr, keymap_identifier))
|
||||
|
||||
key_func(prompt_bufnr)
|
||||
vim.cmd [[ doautocmd User TelescopeKeymap ]]
|
||||
end
|
||||
|
||||
mappings.clear = function(prompt_bufnr)
|
||||
|
||||
Reference in New Issue
Block a user