-- Fuzzy Finder (files, lsp, etc) return { "nvim-telescope/telescope.nvim", version = "*", event = "VeryLazy", dependencies = { { "nvim-lua/plenary.nvim" }, { -- Blazingly Fast Fuzzy Finder Algorithm for Telescope "nvim-telescope/telescope-fzf-native.nvim", build = "make", cond = function() return vim.fn.executable("make") == 1 end, }, { "nvim-telescope/telescope-file-browser.nvim", }, }, config = function() local actions = require("telescope.actions") local telescope = require("telescope") local builtin = require("telescope.builtin") local opts = { defaults = { prompt_prefix = " ", selection_caret = " ", layout_strategy = "vertical", layout_config = { vertical = { height = 0.99, mirror = true, prompt_position = "top" } }, mappings = { i = { [""] = actions.preview_scrolling_up, [""] = actions.preview_scrolling_down, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, [""] = actions.file_vsplit, [""] = actions.file_split, [""] = actions.close, [""] = actions.send_to_qflist + actions.open_qflist, [""] = actions.send_selected_to_qflist + actions.open_qflist, [""] = function(...) return require("trouble.providers.telescope").open_with_trouble(...) end, [""] = function(...) return require("trouble.providers.telescope").open_selected_with_trouble(...) end, }, }, }, } telescope.setup(opts) -- Enable telescope fzf native, if installed pcall(telescope.load_extension, "fzf") pcall(telescope.load_extension, "file_browser") -- Find files vim.keymap.set( "n", "fe", ":Telescope file_browser path=%:p:h select_buffer=true", { desc = "File Explorer" } ) vim.keymap.set("n", "fb", builtin.buffers, { desc = "Find buffers" }) vim.keymap.set("n", "ff", builtin.find_files, { desc = "Find files" }) vim.keymap.set("n", "fF", function() builtin.find_files({ hidden = true, no_ignore = true }) end, { desc = "Find all files" }) -- Search inside files vim.keymap.set("n", "fw", builtin.grep_string, { desc = "Find word under cursor" }) vim.keymap.set("n", "fW", builtin.live_grep, { desc = "Find word (live grep)" }) -- Help vim.keymap.set("n", "fc", builtin.command_history, { desc = "Find in commands history" }) vim.keymap.set("n", "fC", builtin.commands, { desc = "Find a command" }) vim.keymap.set("n", "fh", builtin.help_tags, { desc = "Find Help" }) vim.keymap.set("n", "fk", builtin.keymaps, { desc = "Find Keymaps" }) -- Git vim.keymap.set("n", "gb", builtin.git_branches, { desc = "Change branch" }) vim.keymap.set("n", "gL", builtin.git_bcommits, { desc = "Commits of buffer" }) -- Diagnosticos -- Disabled, handle by trouble -- vim.keymap.set("n", "fD", function() -- builtin.diagnostics({ bufnr = 0 }) -- end, { desc = "Find diagnostics (Telescope)" }) -- vim.keymap.set("n", "fD", function() -- builtin.diagnostics({ bufnr = nil }) -- end, { desc = "Find diagnostics in workspace (Telescope)" }) -- vim.keymap.set("n", "fz", builtin.spell_suggest, { desc = "Find spell suggestion" }) end, }