return { 'nvim-telescope/telescope.nvim', dependencies = { { 'nvim-lua/plenary.nvim' }, { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, { 'nvim-telescope/telescope-smart-history.nvim' }, { 'kkharji/sqlite.lua' }, }, config = function() local data = assert(vim.fn.stdpath 'data') --[[@as string]] require('telescope').setup { extensions = { fzf = { fuzzy = true, override_generic_sorter = true, override_file_sorter = true, case_mode = 'smart_case', }, wrap_results = true, history = { path = vim.fs.joinpath(data, 'telescope_history.sqlite3'), limit = 100, }, }, } pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'smart_history') local builtin = require 'telescope.builtin' vim.keymap.set('n', 'fd', builtin.find_files) vim.keymap.set('n', 'fh', builtin.help_tags) vim.keymap.set('n', 'fg', builtin.live_grep) vim.keymap.set('n', '/', builtin.current_buffer_fuzzy_find) vim.keymap.set('n', 'gw', builtin.grep_string) vim.keymap.set('n', 'fa', function() ---@diagnostic disable-next-line: param-type-mismatch builtin.find_files { cwd = vim.fs.joinpath(vim.fn.stdpath 'data', 'lazy') } end) vim.keymap.set('n', 'en', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end) end, }