diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua index 33e7bae2..75a5d3a5 100644 --- a/.config/nvim/after/plugin/telescope.lua +++ b/.config/nvim/after/plugin/telescope.lua @@ -1,9 +1,8 @@ -local ts = require("telescope") +local telescope = require("telescope") local actions = require("telescope.actions") local themes = require("telescope.themes") local config = require("telescope.config") local builtin = require("telescope.builtin") -local map = vim.keymap.set -- Clone the default Telescope configuration local vimgrep_arguments = { unpack(config.values.vimgrep_arguments) } @@ -12,31 +11,46 @@ table.insert(vimgrep_arguments, "--hidden") -- search hidden table.insert(vimgrep_arguments, "--glob") -- ignore git table.insert(vimgrep_arguments, "!**/.git/*") -ts.setup { - defaults = { +telescope.setup { + -- Workaround + -- https://github.com/nvim-telescope/telescope.nvim/issues/938#issuecomment-877539724 + defaults = themes.get_ivy { vimgrep_arguments = vimgrep_arguments, mappings = { i = { [""] = actions.close, }, }, + layout_config = { height = 0.4 }, + borderchars = { + "", + "", + "", + "│", + "", + "", + "", + "", + }, }, pickers = { find_files = { find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, }, + current_buffer_fuzzy_find = { + previewer = false, + }, }, } -- Enable telescope fzf native, if installed pcall(require("telescope").load_extension, "fzf") -map("n", "/", function() builtin.current_buffer_fuzzy_find(themes.get_dropdown { previewer = false }) end) -map("n", "sf", builtin.find_files) -map("n", "gf", builtin.git_files) -map("n", "?", builtin.help_tags) -map("n", "sw", builtin.grep_string) -map("n", "sg", builtin.live_grep) -map("n", "sd", builtin.diagnostics) -map("n", "b", builtin.buffers) -map("n", "sp", builtin.spell_suggest) +vim.keymap.set("n", "/", builtin["current_buffer_fuzzy_find"]) +vim.keymap.set("n", "/", builtin["find_files"]) +-- vim.keymap.set("n", "g/", builtin["git_files"]) +vim.keymap.set("n", "?", builtin["help_tags"]) +vim.keymap.set("n", "g/", builtin["live_grep"]) +vim.keymap.set("n", "d", builtin["diagnostics"]) +vim.keymap.set("n", "b", builtin["buffers"]) +vim.keymap.set("n", "sp", builtin["spell_suggest"])