local config = require('config') return { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim', { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make', }, }, config = function() require('plugins.telescope.config') -- normal mappings local u = require('utils') local map = u.set_keymap map('n', 'ff', ':Telescope find_files', { desc = 'Find project file' }) map('n', 'fk', ':Telescope buffers', { desc = 'Find buffer' }) map('n', 'fs', ':Telescope live_grep', { desc = 'Grep string' }) map('n', 'fw', ':Telescope grep_string', { desc = 'Grep current word' }) -- git navigation map('n', 'vc', ':Telescope git_commits', { desc = 'Git commits' }) config.lsp.add_on_attach_mapping(function(_, bufnr) local buf_map = u.create_buf_map(bufnr) buf_map('n', 'gd', 'Telescope lsp_definitions', { desc = 'Go to definition' }) buf_map('n', 'gi', 'Telescope lsp_implementations', { desc = 'Go to implementation' }) buf_map('n', 'gt', 'Telescope lsp_type_definitions', { desc = 'Go to type definition' }) buf_map('n', 'gr', 'Telescope lsp_references', { desc = 'Go to reference' }) buf_map('n', 'ldb', 'Telescope diagnostics bufnr=0', { desc = 'Show buffer diagnostics' }) buf_map('n', 'ldw', 'Telescope diagnostics', { desc = 'Workspace diagnostics' }) end) end, cmd = { 'Telescope' }, }