feat(nvim): add Telescope default mappings

Add an insert mode mapping for `which_key` and also one for insert and
normal mode for toggling the previewer.
This commit is contained in:
Oliver Davies 2022-05-03 09:08:49 +01:00
parent 5b162e7241
commit 6b8bb7daf2

View file

@ -28,9 +28,21 @@ local new_maker = function(filepath, bufnr, opts)
:sync()
end
local action_layout = require 'telescope.actions.layout'
local actions = require 'telescope.actions'
telescope.setup {
defaults = {
buffer_previewer_maker = new_maker,
mappings = {
i = {
["<C-h>"] = actions.which_key,
["<C-p>"] = action_layout.toggle_preview,
},
n = {
["<C-p>"] = action_layout.toggle_preview,
},
},
no_ignore = true,
prompt_prefix = "$ ",
},