Repository navigation
ignore filenames in grep module - #84
Conversation
This commit makes it so that fzf ignores the filenames and line numbers in the recursive grep module. I really couldn't find a nicer place to add these fzf-args, but I'm very open to fixing this PR with feedback from whoever. Basically fzf requires all grep tools to return filename:line_number:text, so we can ignore filename and line number with a column delimiter and then only looking from column 3 onward.
|
fzf.kak uses filename and line number information to jump, if we ignore it, the jump is impossible. But applying your patch I can't see what is actually changed, so I'm not sure what is the impact and what problem you're trying to solve? Can you elaborate a bit more on this? From the manpage for fzf I see that But we don't use |
|
Hi, Let's say you are in this project, and you try searching for the line Since the program is currently considering the entire string returned by grep/ripgrep/etc., if you search for a phrase contained in a filename, you will get a bunch of results, equal to the number of lines in that file. With my patch, searching for The string and filename are still in the results, so jumping using them is still possible, but they are ignored by fzf for searching purposes, so you don't get a ton of duplicate results if there is a filename matching your search string. You can read a similar issue in the vim fzf repo: junegunn/fzf.vim#346. Overall, this only affects the functionality of the grep module, and makes it so it actually only greps, instead of also searching by filename and returning a ton of results. |
|
Ah, I see, thanks for explanation. Yeah, this is definitively useful change! I think I can use it in some other modules as well |
|
@purxiz Thanks for the tip! If you use |




This commit makes it so that fzf ignores the filenames and line numbers in the recursive grep module. I really couldn't find a nicer place to add these fzf-args, but I'm very open to fixing this PR with feedback from whoever. Basically fzf requires all grep tools to return filename:line_number:text, so we can ignore filename and line number with a column delimiter and then only looking from column 3 onward.