diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index cbee22b..27699fb 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -117,6 +117,18 @@ return { if not ok then require "telescope.builtin".find_files(opts) end end + + 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/*") + require('telescope').setup({ defaults = { mappings = { @@ -126,6 +138,8 @@ return { [''] = actions.smart_send_to_qflist, }, }, + -- `hidden = true` is not supported in text grep commands. + vimgrep_arguments = vimgrep_arguments, }, pickers = { -- Your special builtin config goes in here @@ -145,6 +159,8 @@ return { find_files = { theme = 'ivy', previewer = false, + -- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d. + find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, }, oldfiles = { theme = 'ivy',