I'm using neovim and Telescope as a finder (find_files, live_grep, file_browser), by default Telescope is ignoring hidden files and files included in .gitignore - how can I add exception (e.g. .gitlab-ci file/folder) to this list? so Telescope will still ignore hidden files except .gitlab-ci file/folder?
Telescope uses ripgrep to search through files. By default, ripgrep ignores several groups of files, including hidden files (dotfiles) and files ignored by git. Adding --no-ignore-vcs and --hidden flags will make it to search through those files.
Arguments for ripgrep can be configured via defaults.vimgrep_arguments.
In your case, to search through hidden files, which are not in .gitignore --hidden flag should be added:
require('telescope').setup{
defaults = {
vimgrep_arguments = {
'rg',
'--color=never',
'--no-heading',
'--with-filename',
'--line-number',
'--column',
'--smart-case',
'--hidden',
},
}
You can always test the command from the terminal before changing the Telescope configuration:
rg ... --hidden <search string>
As --hidden will enable search through all hidden files, you might want to look into .ignore or .rgignore files. They tell ripgrep which files to ignore during search. See ripgrep's documentation for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With