return { "telescope.nvim", after = function() require("telescope").setup({ extensions = { ["ui-select"] = { require("telescope.themes").get_dropdown({}), }, }, }) require("telescope").load_extension("ui-select") end, keys = { { " ", function() local builtin = require("telescope.builtin") local is_git = vim.fn.finddir(".git", vim.fn.getcwd() .. ";") if is_git then builtin.git_files() else builtin.find_files() end end, desc = "Grep through all files tracked by git, or fall back to just cwd", mode = "n", }, { "ff", function() require("telescope.builtin").find_files() end, desc = "Grep through all files in cwd", mode = "n", }, { "ca", vim.lsp.buf.code_action, desc = "LSP Code Action", mode = "n" }, { "/", function() require("telescope.builtin").live_grep() end, desc = "Live grep", mode = "n", }, { "k", function() require("telescope.builtin").buffers() end, desc = "List buffers", mode = "n", }, { "gd", function() require("telescope.builtin").lsp_definitions() end, desc = "Go to LSP definition", mode = "n", }, { "gi", function() require("telescope.builtin").lsp_implementations() end, desc = "Go to implementations", mode = "n", }, { "j", function() require("telescope.builtin").lsp_document_symbols() end, desc = "Search through document symbols", mode = "n", }, { "fs", function() require("telescope.builtin").lsp_workspace_symbols() end, desc = "Search through entire workspace symbols", mode = "n", }, { "fd", function() require("telescope.builtin").diagnostics() end, desc = "Search through LSP diagnostics", mode = "n", }, }, }