return { { "nvim-telescope/telescope.nvim", dependencies = { { "airtonix/telescope-fzf-native.nvim", branch = 'feature/69-prebuilt-release-binaries', build = function() require('telescope-fzf-native').download_library() end }, "nvim-lua/plenary.nvim", }, cmd = "Telescope", version = false, -- telescope did only one release, so use HEAD for now keys = { { "f", "Telescope find_files", desc = "Find Files" }, { "F", "Telescope live_grep theme=ivy", desc = "Grep" }, { "gl", "Telescope git_commits", desc = "Git log" }, { "gh", "Telescope git_bcommits", desc = "Git history" }, { "gB", "Telescope git_branches", desc = "Git branches" }, { "gs", "Telescope git_status", desc = "Git status" }, { "gc", "Telescope git_show", desc = "Show last commit" }, }, opts = function() local actions = require("telescope.actions") local action_state = require("telescope.actions.state") local function git_show() local entry = action_state.get_selected_entry() vim.cmd("Telescope git_show ref=" .. entry.value) end return { defaults = { prompt_prefix = " ", selection_caret = " ", sorting_strategy = "ascending", layout_strategy = "horizontal", layout_config = { horizontal = { prompt_position = "top", } }, path_display = { "truncate" }, mappings = { i = { [""] = actions.close, [""] = actions.close, [""] = function() vim.api.nvim_input("") end, [""] = function() vim.api.nvim_input("") end, [""] = actions.move_selection_previous, [""] = actions.move_selection_next, [""] = function() local has_trouble, trouble_action = pcall(require, "trouble.providers.telescope") if has_trouble then trouble_action.open_with_trouble() end end }, }, }, extensions = { fzf = { fuzzy = true, -- false will only do exact matching override_generic_sorter = true, -- override the generic sorter override_file_sorter = true, -- override the file sorter } }, pickers = { find_files = { hidden = true, find_command = { "fd", "--type", "f", "--strip-cwd-prefix", "-E", ".git" }, }, git_commits = { mappings = { i = { [""] = git_show, }, }, }, git_bcommits = { mappings = { i = { [""] = git_show, }, }, }, git_status = { mappings = { i = { -- [""] = local_actions.commit, }, }, }, }, } end, config = function(_, opts) local telescope = require("telescope") telescope.setup(opts) telescope.load_extension("fzf") telescope.load_extension("git_show") end, } }