add mapping for telescope to toggle preview

This commit is contained in:
2022-04-20 22:28:09 +03:00
parent 3fce20fa06
commit 28b79eea73

View File

@@ -1,5 +1,6 @@
local telescope = require("telescope") local telescope = require("telescope")
local actions = require("telescope.actions") local actions = require("telescope.actions")
local layout_actions = require("telescope.actions.layout")
telescope.setup({ telescope.setup({
defaults = { defaults = {
@@ -12,11 +13,13 @@ telescope.setup({
["<C-d>"] = function(prompt_bufnr) ["<C-d>"] = function(prompt_bufnr)
actions.delete_buffer(prompt_bufnr) actions.delete_buffer(prompt_bufnr)
end, end,
["<C-p>"] = layout_actions.toggle_preview,
}, },
n = { n = {
["<C-d>"] = function(prompt_bufnr) ["<C-d>"] = function(prompt_bufnr)
actions.delete_buffer(prompt_bufnr) actions.delete_buffer(prompt_bufnr)
end, end,
["<C-p>"] = layout_actions.toggle_preview,
}, },
}, },
}, },