return { 'FabianWirth/search.nvim', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope.nvim', }, version = '0.1.6', config = function() local telescope = require('telescope') local telescopeConfig = require('telescope.config') local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) } table.insert(vimgrep_arguments, '--hidden') table.insert(vimgrep_arguments, '--glob') table.insert(vimgrep_arguments, '!**/.git/*') telescope.setup({ defaults = { vimgrep_arguments = vimgrep_arguments, file_ignore_patterns = { 'node_modules', } }, pickers = { find_files = { find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' }, } } }) local search = require('search') local builtin = require('telescope.builtin') search.setup({ mappings = { -- optional: configure the mappings for switching tabs (will be set in normal and insert mode(!)) next = '', prev = '' }, tabs = { { name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = true, hidden = true } }, { name = 'Grep', tele_func = builtin.live_grep }, { name = 'Buffers', tele_func = builtin.buffers }, }, append_tabs = { -- append_tabs will add the provided tabs to the default ones { 'Commits', -- or name = 'Commits' builtin.git_commits, -- or tele_func = require('telescope.builtin').git_commits available = function() -- optional return vim.fn.isdirectory('.git') == 1 end }, }, }) vim.keymap.set('n', 'pf', search.open, {}) vim.keymap.set('n', 'pb', function() search.open({ tab_name = 'Buffers' }) end) vim.keymap.set('n', 'pws', function() local word = vim.fn.expand('') builtin.grep_string({ search = word }) end) vim.keymap.set('n', 'pWs', function() local word = vim.fn.expand('') builtin.grep_string({ search = word }) end) vim.keymap.set('n', 'ps', function() builtin.grep_string({ search = vim.fn.input('Grep > ') }) end) vim.keymap.set('n', 'vh', builtin.help_tags, {}) end }