Closed dylan-chong closed 8 months ago
This is just the default behavior of ripgrep but you can adjust this for telescope a few ways.
vimgrep_arguments
. This will have grep_string
and live_grep
both show hidden files
require("telescope").setup({
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--hidden", -- add this
}
-- your other options
}
})
additional_args
option on grep_string
(also works for live_grep
) to pass --hidden
require('telescope.builtin').grep_string({
use_regex = true,
search = 'abc',
additional_args = { "--hidden" },
})
Both of these should work. Feel free to reopen if I've missed something.
@jamestrew How can I pass rg
arguments in the vim command itself, so that I can have different arguments depending on my mapping? I basically want it to respect file_ignore_patterns
, but I still want to add some arguments for one mapping to search through untracked and hidden files, while just searching normal for the other mapping.
Can this be done?
The mapping <CMD>Telescope live_grep hidden=true no_ignore=false<CR>
will not work, because you don't wish to implement all the options from find_files
into live_grep
.
EDIT: Reading the docs is sometimes helpful. 😅
<CMD>Telescope live_grep vimgrep_arguments=rg,--color=never,--no-heading,--no-heading,--line-number,--column,--smart-case,--hidden,--no-ignore<CR>
Works!
Description
when you use grep_string in a git repo, it will not find results in a
.bla
file, even if it is committedthere should be a
hidden
andignore
options like thefind_files
option, or at least search them by defaultNeovim version
Operating system and version
Linux DESKTOP-PP5T68A 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Telescope version / branch / rev
20bf20500c95208c3ac0ef07245065
checkhealth telescope
Steps to reproduce
first create a file called vimrc (outside the test directory)
Expected behavior
i should see the result from the hidden file
Actual behavior
i do not see the result
Minimal config