-- Install and configure Telescope -- https://github.com/nvim-telescope/telescope.nvim return { "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim", -- C implementation of fzf to improve performance { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, "nvim-tree/nvim-web-devicons", -- Extension to telescope to use Ag (or ripgrep) to filter results 'kelly-lin/telescope-ag', -- Allow to search for snippets 'benfowler/telescope-luasnip.nvim', -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter-textobjects', }, -- Configure Telescope config = function() local telescope = require("telescope") local actions = require("telescope.actions") telescope.setup({ defaults = { -- Parce que c'est joli prompt_prefix = " ", selection_caret = " ", path_display = { "smart" }, file_ignore_patterns = { ".git/", "node_modules" }, mappings = { i = { }, }, pickers = { command_history = { theme = "dropdown", } } }, }) telescope.load_extension("fzf") -- telescope.load_extension("luasnip") -- telescope.load_extension("ag") -- set keymaps -- of for oldfiles vim.keymap.set( "n", "of", "Telescope oldfiles", { desc = " [?] Find recently opened files " } ) -- sb vim.keymap.set( "n", "sb", "Telescope buffers", { desc = "[S]earch [B]uffers " } ) -- / to fuzzily search in current buffer vim.keymap.set( 'n', '/', "Telescope current_buffer_fuzzy_find", { desc = '[/] Fuzzily search in current buffer' }) -- sh to search help vim.keymap.set( "n", "sh", "Telescope help_tags", { desc = "[S]earch [H]elp" } ) -- sf to search files vim.keymap.set( "n", "sf", "Telescope find_files", { desc = "[S]earch [F]iles" } ) -- gf to search files in git history vim.keymap.set( "n", "gf", "Telescope git_files", { desc = "Search [G]it [F]iles" } ) -- sg to (rip)grep through files vim.keymap.set( "n", "sg", "Telescope live_grep", { desc = "[S]earch by [G]rep" } ) -- sw to search for other occurrences of the current word vim.keymap.set( "n", "sw", "Telescope grep_string", { desc = "[S]earch current [W]ord" } ) -- ch to search in the command history vim.keymap.set( "n", "sw", "Telescope command_history", { desc = "[C]command [H]istory" } ) end, }