neovim: <esc> should exit telescope immediately

This commit is contained in:
Daniel Lundin 2024-05-23 22:53:22 +02:00
parent b520597a52
commit af200b99ed
No known key found for this signature in database

View file

@ -5,29 +5,40 @@ return {
}, },
{ {
"telescope.nvim", "telescope.nvim",
opts = { config = function()
defaults = { local telescope = require("telescope")
layout_strategy = "horizontal", local actions = require("telescope.actions")
layout_config = {
anchor = "top", telescope.setup({
horizontal = { defaults = {
prompt_position = "top", layout_strategy = "horizontal",
mirror = false, layout_config = {
preview_width = 0.4, anchor = "top",
-- preview_height = 0.5, horizontal = {
prompt_position = "top",
mirror = false,
preview_width = 0.4,
-- preview_height = 0.5,
},
width = 0.9,
height = 0.9,
preview_cutoff = 10,
},
mappings = {
i = {
["<esc>"] = actions.close, -- <Esc> close popup
["<C-u>"] = false, -- <C-u> clear prompt
},
},
sorting_strategy = "ascending",
winblend = 0,
wrap_results = true,
previewer = false,
preview = {
hide_on_startup = true,
}, },
width = 0.9,
height = 0.9,
preview_cutoff = 10,
}, },
sorting_strategy = "ascending", })
winblend = 0, end,
wrap_results = true,
previewer = false,
preview = {
hide_on_startup = true,
},
},
},
}, },
} }