local telescope = require('telescope') local actions = require('telescope.actions') local builtin = require('telescope.builtin') local telescope_last = 0 function telescope_resume() if telescope_last == 0 then telescope_last = 1 builtin.live_grep() else builtin.resume() end end telescope.setup { defaults = { sorting_strategy = "ascending", live_grep_arguments = { 'rg', '--hidden', '--no-ignore', '--color=never', '--with-filename', '--line-number', '--column', '--smart-case', '--no-heading', }, preview = { treesitter = false }, }, pickers = { live_grep = { mappings = { i = { [""] = actions.to_fuzzy_refine }, n = { [""] = telescope_resume }, }, }, find_files = { cache_picker = false, }, git_files = { cache_picker = false, }, }, } -- Snippets can be useful. vim.keymap.set('n', 'ss', telescope.extensions.luasnip.luasnip, {}) -- Fuzzy * files, symbols, buffers, help, etc. vim.keymap.set('n', 'fa', builtin.find_files) -- f[ind]a[ll] vim.keymap.set('n', 'fb', builtin.buffers) vim.keymap.set('n', 'fd', builtin.diagnostics) vim.keymap.set('n', 'ff', builtin.git_files) vim.keymap.set('n', 'fh', builtin.help_tags) vim.keymap.set('n', 'fs', builtin.lsp_dynamic_workspace_symbols) -- Grep (the only one). vim.keymap.set('n', 'gg', builtin.live_grep) -- LSP navigation. vim.keymap.set('n', 'gd', builtin.lsp_definitions) vim.keymap.set('n', 'gr', builtin.lsp_references) vim.keymap.set('n', 'gi', builtin.lsp_implementations) vim.keymap.set('n', 'ci', builtin.lsp_incoming_calls) vim.keymap.set('n', 'co', builtin.lsp_outgoing_calls)