local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, { desc = "Find Files"}) vim.keymap.set('n', 'fg', "lua require('telescope').extensions.live_grep_args.live_grep_args()", { desc = "Live Grep"}) vim.keymap.set('n', 'fc', 'lua require("telescope.builtin").live_grep({ glob_pattern = "!{spec,test}"})', { desc = "Live Grep Code"}) vim.keymap.set('n', 'fb', builtin.buffers, { desc = "Find Buffers"}) vim.keymap.set('n', 'fh', builtin.help_tags, { desc = "Find Help Tags"}) vim.keymap.set('n', 'fs', builtin.lsp_document_symbols, { desc = "Find Symbols"}) vim.keymap.set('n', 'fi', 'AdvancedGitSearch', { desc = "AdvancedGitSearch"}) vim.keymap.set('n', 'fo', builtin.oldfiles, { desc = "Find Old Files"}) vim.keymap.set('n', 'fw', builtin.grep_string, { desc = "Find Word under Cursor"}) local telescope = require("telescope") local telescopeConfig = require("telescope.config") -- Clone the default Telescope configuration local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) } -- I want to search in hidden/dot files. table.insert(vimgrep_arguments, "--hidden") -- I don't want to search in the `.git` directory. table.insert(vimgrep_arguments, "--glob") table.insert(vimgrep_arguments, "!**/.git/*") local actions = require "telescope.actions" telescope.setup({ defaults = { -- `hidden = true` is not supported in text grep commands. vimgrep_arguments = vimgrep_arguments, path_display = { "truncate" }, mappings = { n = { [""] = actions.send_selected_to_qflist + actions.open_qflist, }, i = { [""] = actions.cycle_history_next, [""] = actions.cycle_history_prev, [""] = actions.send_selected_to_qflist + actions.open_qflist, } }, }, pickers = { find_files = { -- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d. find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, }, }, extensions = { undo = { use_delta = true, use_custom_command = nil, -- setting this implies `use_delta = false`. Accepted format is: { "bash", "-c", "echo '$DIFF' | delta" } side_by_side = false, diff_context_lines = vim.o.scrolloff, entry_format = "state #$ID, $STAT, $TIME", mappings = { i = { [""] = require("telescope-undo.actions").yank_additions, [""] = require("telescope-undo.actions").yank_deletions, [""] = require("telescope-undo.actions").restore, }, }, }, } }) require("telescope").load_extension "neoclip" require('telescope').load_extension('fzf') require('telescope').load_extension('ui-select') vim.g.zoxide_use_select = true require("telescope").load_extension("undo") require("telescope").load_extension("advanced_git_search") require("telescope").load_extension("live_grep_args")