From af200b99edf12894994690aaaf734c46cf4f5c40 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Thu, 23 May 2024 22:53:22 +0200 Subject: [PATCH] neovim: should exit telescope immediately --- .config/nvim/lua/plugins/editor.lua | 55 +++++++++++++++++------------ 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index f217eb6..c497c0c 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -5,29 +5,40 @@ return { }, { "telescope.nvim", - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { - anchor = "top", - horizontal = { - prompt_position = "top", - mirror = false, - preview_width = 0.4, - -- preview_height = 0.5, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + + telescope.setup({ + defaults = { + layout_strategy = "horizontal", + layout_config = { + anchor = "top", + 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 = { + [""] = actions.close, -- close popup + [""] = false, -- 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, - wrap_results = true, - previewer = false, - preview = { - hide_on_startup = true, - }, - }, - }, + }) + end, }, }