local trouble = require('trouble.providers.telescope') local telescope = require('telescope') telescope.setup { defaults = { mappings = { i = { [''] = trouble.open_with_trouble, [''] = 'which_key', }, n = { [''] = trouble.open_with_trouble, [''] = 'which_key', }, }, }, extensions = { project = { theme = 'dropdown', } } } require('telescope').load_extension('fzf') require('telescope').load_extension('gh') require('telescope').load_extension('env') require('telescope').load_extension('emoji') require('telescope').load_extension('ui-select') require('telescope').load_extension('project') require('telescope').load_extension('session-lens') vim.keymap.set( 'n', '', [[lua require('telescope.builtin').git_files({ show_untracked = true })]], { noremap = true, silent = true, desc = "Find git files" } ) vim.keymap.set( 'n', 'f.', [[lua require('telescope.builtin').git_files({ no_ignore = true })]], { noremap = true, silent = true, desc = "[F]ind ALL git files including ignored [.]" } ) vim.keymap.set( 'n', '_', [[lua require('telescope.builtin').live_grep()]], { noremap = true, silent = true, desc = "Search by live grep" } ) vim.keymap.set( 'n', '_', [[lua require('telescope.builtin').live_grep({ search_dirs = { vim.fn.expand('%:p:h') } })]], { noremap = true, silent = true, desc = "Search by live grep in current (present) working directory" } ) vim.keymap.set( 'n', '8', [[lua require('telescope.builtin').grep_string()]], { noremap = true, silent = true, desc = "Search by grep" } ) vim.keymap.set( 'n', '3', [[lua require('telescope.builtin').grep_string()]], { noremap = true, silent = true, desc = "Search by grep" } ) vim.keymap.set( "n", "fd", [[lua require('telescope.builtin').find_files({cwd=require('telescope.utils').buffer_dir()})]], { noremap = true, silent = true, desc = "[F]ind [D]irectories" } ) vim.keymap.set( 'n', 'fb', [[lua require('telescope.builtin').buffers()]], { noremap = true, silent = true, desc = "[F]ind [B]uffers" } ) vim.keymap.set( 'n', 'fh', [[lua require('telescope.builtin').help_tags()]], { noremap = true, silent = true, desc = "[F]ind [T]ags" } ) vim.keymap.set( 'n', 'ft', [[lua require('telescope.builtin').treesitter()]], { noremap = true, silent = true, desc = "[F]ind [T]reesitter objects" } ) vim.keymap.set( 'n', 'fr', [[lua require('telescope.builtin').resume()]], { noremap = true, silent = true, desc = "[R]esume last [F]ind" } ) vim.keymap.set( 'n', 'fs', [[lua require('telescope.builtin').spell_suggest()]], { noremap = true, silent = true, desc = "[F]ind [S]pelling suggestion" } ) vim.keymap.set( 'n', 'fgc', [[lua require('telescope.builtin').git_commits()]], { noremap = true, silent = true, desc = "[F]ind [G]it [C]ommits" } ) vim.keymap.set( "n", 'fga', [[lua require('telescope.builtin').git_bcommits()]], { noremap = true, silent = true, desc = "[F]ind [G]it commits for current buffer" } ) vim.keymap.set( 'n', 'fgb', [[lua require('telescope.builtin').git_branches()]], { noremap = true, silent = true, desc = "[F]ind [G]it [B]ranches" } ) vim.keymap.set( 'n', 'fe', [[Telescope emoji]], { noremap = true, silent = true, desc = "[F]ind [E]moji" } ) vim.keymap.set( 'n', 'f"', [[lua require('telescope.builtin').registers()]], { noremap = true, silent = true, desc = "[F]ind registers [\"]" } ) vim.keymap.set( 'n', 'fm', [[lua require('telescope.builtin').keymaps()]], { noremap = true, silent = true, desc = "[F]ind key [M]appings" } ) vim.keymap.set( 'n', 'ff', [[lua require('telescope.builtin').builtin()]], { noremap = true, silent = true, desc = "[F]ind telescope [F]inders" } ) vim.keymap.set( 'n', 'fl', [[lua require('telescope.builtin').reloader()]], { noremap = true, silent = true, desc = "[F]ind [L]ua module to reload" } ) vim.keymap.set( 'n', '', [[lua require('telescope').extensions.project.project({ display_type = 'full' })]], { noremap = true, silent = true, desc = "Find projects" } ) vim.keymap.set( 'n', '`', [[lua require('session-lens').search_session()]], { noremap = true, silent = true, desc = "Find sessions" } )