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:
parent
5b162e7241
commit
6b8bb7daf2
1 changed files with 12 additions and 0 deletions
|
@ -28,9 +28,21 @@ local new_maker = function(filepath, bufnr, opts)
|
||||||
:sync()
|
:sync()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local action_layout = require 'telescope.actions.layout'
|
||||||
|
local actions = require 'telescope.actions'
|
||||||
|
|
||||||
telescope.setup {
|
telescope.setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
buffer_previewer_maker = new_maker,
|
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,
|
no_ignore = true,
|
||||||
prompt_prefix = "$ ",
|
prompt_prefix = "$ ",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue