---@module 'lazy' ---@type LazySpec return { { 'nvim-telescope/telescope.nvim', -- fuzzy finder (files, lsp, etc) event = 'VeryLazy', branch = '0.1.x', dependencies = { { 'nvim-lua/plenary.nvim' }, -- contains lua functions for neovim, apparently { 'nvim-telescope/telescope-ui-select.nvim' }, -- allows neovim core stuff to enter the telescope picker { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make', -- used for when the plugin is installed/updated cond = function() return vim.fn.executable 'make' == 1 end, -- condition for whether the plugin should be loaded / installed }, }, opts = { pickers = { find_files = { find_command = { 'fd', '-t', 'f', '-HE', '/.git', '--strip-cwd-prefix' }, }, }, extensions = { file_browser = { hijack_netrw = true, }, }, }, config = function(_, opts) local tel = require('telescope') local std = require("telescope.builtin") local ext = tel.extensions require('telescope').setup(opts) -- load telescope extensions, if they are installed pcall(tel.load_extension, 'fzf') pcall(tel.load_extension, 'ui-select') -- set the telescope keymaps Map({ 'n' }, '', std.live_grep, { desc = 'Search by Grep' }) Map({ 'n' }, '', std.resume, { desc = 'Search Resume' }) Map({ 'n', 'i' }, '', std.find_files, { desc = 'Search Project' }) Map({ 'n' }, 'p', std.find_files, { desc = 'Search Project' }) Map({ 'n' }, 'gf', std.git_status, { desc = 'Search through Git status Files' }) Map({ 'n' }, 'sq', std.quickfix, { desc = 'Search Quickfix' }) Map({ 'n' }, 'sh', std.help_tags, { desc = 'Search Help' }) Map({ 'n' }, 'sk', std.keymaps, { desc = 'Search Keymaps' }) Map({ 'n' }, 'sf', std.find_files, { desc = 'Search Files' }) Map({ 'n' }, 'ss', std.builtin, { desc = 'Sarch Select telescope' }) Map({ 'n' }, 'sw', std.grep_string, { desc = 'Search current Word' }) Map({ 'n' }, 'sg', std.live_grep, { desc = 'Search by Grep' }) Map({ 'n' }, 'sd', std.diagnostics, { desc = 'Search Diagnostics' }) Map({ 'n' }, 'sr', std.resume, { desc = 'Search Resume' }) Map({ 'n' }, 's.', std.oldfiles, { desc = 'Search recent Files ("." for repeat)' }) Map({ 'n' }, '', std.buffers, { desc = 'find existing buffers' }) -- for fuzzily searching in the current buffer Map('n', '/', function() std.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false }) end, { desc = 'fuzzily search in current buffer' }) -- for executing grep Map('n', 's/', function() std.live_grep { grep_open_files = true, prompt_title = 'Live Grep in Open Files' } end, { desc = 'Search in open files' }) -- shortcut for searching neovim config files Map('n', 'sn', function() std.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = 'Search Neovim files' }) end, } }