diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index 11b6a7ea3..6e784eac2 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -78,10 +78,14 @@ local opts = { nowait = true, -- use `nowait` when creating keymaps } +local buffer_theme = "dropdown{previewer = false}" +local find_file_theme = "dropdown{previewer = false}" +local find_text_theme = "ivy{}" + local mappings = { ["a"] = { "Alpha", "Alpha" }, ["b"] = { - "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})", + "lua require('telescope.builtin').buffers(require('telescope.themes').get_" .. buffer_theme .. ")", "Buffers", }, ["e"] = { "NvimTreeToggle", "Explorer" }, @@ -90,10 +94,13 @@ local mappings = { ["c"] = { "Bdelete!", "Close Buffer" }, ["h"] = { "nohlsearch", "No Highlight" }, ["f"] = { - "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})", + "lua require('telescope.builtin').find_files(require('telescope.themes').get_" .. find_file_theme .. ")", "Find files", }, - ["F"] = { "Telescope live_grep theme=ivy", "Find Text" }, + ["F"] = { + "lua require('telescope.builtin').live_grep(require('telescope.themes').get_" .. find_text_theme .. ")", + "Find text", + }, ["P"] = { "lua require('telescope').extensions.projects.projects()", "Projects" }, p = {