return { { "nvim-telescope/telescope.nvim", tag = "0.1.8", dependencies = { "nvim-lua/plenary.nvim", { "nvim-telescope/telescope-fzf-native.nvim", build = "make", config = function() require("telescope").load_extension("fzf") end, }, }, config = function() local actions = require("telescope.actions") local action_layout = require("telescope.actions.layout") local grep_appearance = { layout_strategies = "vertical", theme = "dropdown", layout_config = { prompt_position = "bottom", width = 0.7, height = 0.5, }, } local telescope = require("telescope") telescope.setup({ defaults = { mappings = { i = { [""] = "which_key", [""] = false, [""] = actions.to_fuzzy_refine, [""] = actions.close, [""] = action_layout.toggle_preview, }, }, }, pickers = { buffers = { theme = "dropdown", layout_config = { prompt_position = "bottom", }, previewer = false, sort_lastused = true, sort_mru = true, ignore_current_buffer = true, }, live_grep = grep_appearance, grep_string = grep_appearance, help_tags = { theme = "dropdown", layout_strategies = "vertical", layout_config = { width = 0.7, }, }, }, extensions = { fzf = {}, }, }) local builtin = require("telescope.builtin") vim.keymap.set("n", "b", builtin.buffers, { desc = "List buffers" }) vim.keymap.set("n", "B", function() builtin.live_grep({ grep_open_files = true }) end, { desc = "Searches open buffers contents" }) vim.keymap.set("n", "f", builtin.live_grep, { desc = "Search file contents" }) vim.keymap.set("n", "F", builtin.grep_string, { desc = "Search for the string under the cursor" }) vim.keymap.set("n", "m", function() builtin.treesitter({ symbols = "function", previewer = true, prompt_title = "Functions", prompt_prefix = "𝑓" }) end, { desc = "Lists function names from treesitter queries", }) vim.keymap.set("n", "o", function() local ok, _ = pcall(builtin.git_files, { previewer = false }) if not ok then builtin.find_files() end end, { desc = "Open a file" }) vim.keymap.set("n", "O", builtin.find_files, { desc = "Open a file" }) vim.keymap.set("n", "gf", function() local ok, _ = pcall(builtin.git_status, { previewer = false }) if not ok then builtin.find_files() end end, { desc = "Show files marked as modified by git." }) vim.keymap.set("n", "gF", function() local ok, _ = pcall(builtin.git_files, { previewer = false, git_command = { "git", "diff-tree", "--no-commit-id", "--name-only", "HEAD", "-r" } }) if not ok then builtin.find_files() end end, { desc = "Show files in the present git commit." }) vim.keymap.set("n", "gc", "Telescope git_commits", { desc = "Show commits" }) vim.keymap.set("n", "gC", "Telescope git_bcommits", { desc = "Show commits for the current buffer" }) telescope.load_extension("zk") end, }, }