Skip to content

Grep in project files. Start query and setting search directory (cwd) #1977

Closed Answered by ibhagwan
RayZ0rr asked this question in Q&A
Discussion options

You must be logged in to vote

I want to ask whether the following is an optimal way to grep a project (by providing the project root as cwd) or all files with the cwd as root. I like the feature of grep_project which avoids searching the path components during the fuzzy search. So, I'll be using it here.

Yes, your code is great, if you’re only using this in git repos you can also fzf-lua path utils to get the git root (uses git rev-parse … behind the scenes):

:lua FzfLua.grep_project({ cwd = FzfLua.path.git_root({}) })

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@RayZ0rr
Comment options

@ibhagwan
Comment options

@RayZ0rr
Comment options

@ibhagwan
Comment options

@RayZ0rr
Comment options

Answer selected by RayZ0rr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants