Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: option to not preform completion if project_root_marker is not found #103

Closed
joshzcold opened this issue Jan 9, 2025 · 7 comments

Comments

@joshzcold
Copy link

It would be helpful if blink-ripgrep.nvim only preformed completion if project_root_marker was found.

For instance I only want ripgrep to run if I am actually in a git directory and not editing some file at $HOME which searches way too many directories in my case.

blink-ripgrep.nvim falls back to neovim's cwd, but some setting like project_root_marker_fallback = false to disable completion would be handy.

@mikavilpas
Copy link
Owner

Nice idea - I like it!

I can finish the PR later, I definitely want this included.

By the way, do you think it would make for a good default? I think it could be better to be conservative.

For example, some people using yazi.nvim have said that they use a workflow where they constantly change Neovim's current working directory when they exit the file browser. If a case like this changes the cwd to ~/, ripgrep is going to cause a lot of performance issues right away 🤔

@joshzcold
Copy link
Author

Yeah personally I think for ripgrep it's always safe to be in a git directory by minimum. I think your users would appreciate it if that was the default behavior

@Kaiser-Yang
Copy link

This is definitely good for me. When I edit some files in home directory, rg will return too many items which make it slow to fzf for blink.

@mikavilpas
Copy link
Owner

In #105, the search can now be avoided in non-project contexts.

As for setting it the default, a timeout feature has been suggested here and I'd like to see how that affects things #110

It might still need to be the default though. @Kaiser-Yang what would you think about having default ignore_paths? Any ideas?

@Kaiser-Yang
Copy link

Some paths related to the system configurations and home directory.

@Kaiser-Yang
Copy link

I found that there is new option: project_root_fallback. With this option it have solved the problem I was facing. Actually, I use .root as my root markers too. I just set project_root_fallback with false, then I will never be facing the problem. If I want to search in a directory, I just need to create a new empty .root directory.

@mikavilpas
Copy link
Owner

I see - nice! Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants