Open comatory opened 6 months ago
The difference between CLI ag something **/somewhere/**
and Telescope Live Grep "something" **/somewhere/**
is that in the first case your shell expands the path (see „globbing“). When Telescope invokes the command the args are passed directly to the command. Means there is no globbing.
Long story short, you should use "something" -G .*/somewhere/.*
(or see other options from man ag
).
Does that work for you @comatory ?
Long story short, you should use "something" -G ./somewhere/.
Did you mean type it like this into telescope? Because that did not work for me. Can I check somehow that telescope is indeed using ag
in runtime?
Did you mean type it like this into telescope?
Into the prompt field, when the live grepper is open. E.g. with ripgrep --iglob
as a similar option
Can I check somehow that telescope is indeed using ag in runtime?
Yes, you can check your vimgrep command with :lua print(vim.o.grepprg)
@weeman1337
As soon as I add --iglob
flag, I get :nil
in the result list:
Yes, you can check your vimgrep command with
:lua print(vim.o.grepprg)
Ok running it gave me this:
rg --vimgrep -uu
Does not look like ag
binary :(
I have this set up inside of config
function for telescipe:
-- replace ripgrep with ag
-- https://github.com/nvim-telescope/telescope.nvim/issues/2083
local ag = os.execute("command -v " .. "ag")
if ag == 0 then
opts.defaults.vimgrep_arguments = {
"ag",
"--nocolor",
"--noheading",
"--numbers",
"--column",
"--smart-case",
"--silent",
"--vimgrep",
}
end
I definitely have ag
on my system. Am I doing something wrong?
Description
I'm used to using
ag
with searching like this `ag "some.*regex" path/**/some-subfolder. When I trigger the search window and type:"some.*regex" path/**/some-subfolder
I don't get any results. I checked the query with
ag
on command line and I get results. This is how my telescope is set up:In order to get results I have to specifically narrow down the path with specific subdirectories. Perhaps I'm not really searching with
ag
? I'm not sure how I could find out.I use
lazy.nvim
as my package manager.Thanks for any suggestions.
Neovim version
Operating system and version
macOS 14.3.1
Telescope version / branch / rev
e9e01d699843af530ef4ad2c8679a7e273bb3dd1
Telescope live grep args version / branch / rev
731a046da7dd3adff9de871a42f9b7fb85f60f47
checkhealth telescope
Steps to reproduce
<C-k>
"<your regex here>" <path>/**/<subdirectory>
Expected behavior
Get the same list of files as if launching it with command-line:
ag "<your regex here>" <path>/**/<subdirectory>
Actual behavior
No files present
Minimal config