return { "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, "nvim-telescope/telescope-ui-select.nvim", "nvim-tree/nvim-web-devicons", "ThePrimeagen/harpoon", }, config = function() -- import telescope plugin safely local telescope = require("telescope") -- import telescope actions safely local actions = require("telescope.actions") -- import telescope-ui-select safely local themes = require("telescope.themes") -- configure telescope telescope.setup({ -- configure custom mappings defaults = { path_display = { "truncate" }, mappings = { i = { [""] = actions.move_selection_previous, -- move to prev result [""] = actions.move_selection_next, -- move to next result [""] = actions.send_selected_to_qflist + actions.open_qflist, -- send selected to quickfixlist }, }, }, extensions = { ["ui-select"] = { themes.get_dropdown({}), }, }, }) telescope.load_extension("fzf") telescope.load_extension("ui-select") telescope.load_extension("harpoon") -- set keymaps local keymap = vim.keymap -- for conciseness keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd" }) -- find files within current working directory, respects .gitignore keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files" }) -- find previously opened files keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd" }) -- find string in current working directory as you type keymap.set("n", "fc", "Telescope grep_string", { desc = "Find string under cursor in cwd" }) -- find string under cursor in current working directory keymap.set("n", "fb", "Telescope buffers", { desc = "Show open buffers" }) -- list open buffers in current neovim instance keymap.set("n", "hf", "Telescope harpoon marks", { desc = "Show harpoon marks" }) -- show harpoon marks keymap.set("n", "gc", "Telescope git_commits", { desc = "Show git commits" }) -- list all git commits (use to checkout) ["gc" for git commits] keymap.set("n", "gfc", "Telescope git_bcommits", { desc = "Show git commits for current buffer" }) -- list git commits for current file/buffer (use to checkout) ["gfc" for git file commits] keymap.set("n", "gb", "Telescope git_branches", { desc = "Show git branches" }) -- list git branches (use to checkout) ["gb" for git branch] keymap.set("n", "gs", "Telescope git_status", { desc = "Show current git changes per file" }) -- list current changes per file with diff preview ["gs" for git status] end, }