Show multiple instances of files in content search mode
Say we have the following file:
foo bar
qux foo
baz bar
foo qux
searching for foo in the content will result in:

In doesn't help much if I need to have a full overview of matches in each file. I would suggest extended mode where multiple instances of the file are shown in the search result. Each instance would correspond to one match:

In other words, I would love to see something that can replace grep -r foo.
Did you look at the workflow described here: https://dystroy.org/blog/broot-c-search/ ?
I think it's generally much more convenient than having a long list of all the matches
Actually you are right. It does pretty much what I need. I just need to get used to it. The only minor issue: when I open preview window and change query afterwards, preview is not refreshed.
E.g. I hit c/bar (query is bar) ctrl+Right (preview opens) backspace z (query changes to baz, but preview keeps on showing bar.
Re-opening preview (ctrl+Left ctrl+Right) updates it.
The only minor issue: when I open preview window and change query afterwards, preview is not refreshed.
I never even felt the need for a refresh here but I now think it would be more consistent. I'll have a try.
I'm new to using broot and while I'm finding a lot of use for it this did cause me some brief confusion. I thought a codebase wasn't using function_name because I only searched function_ and broot only showed function_other as a result (names generalized to make my point). I then did Ctrl-s to do a total search but obviously the search was already total as it had searched all files in the project and it either stopped at one occurrence or didn't present the others.
While I admit some of this is due to me not being fully used to the workflow of the tool, I do wonder how hard it would be for either:
- A verb like total search which shows all results
- Showing something like
...or(more occurrences in file)after a content search result entry.
If it would degrade performance too much or be a maintenance burden I don't think it's that important in the grand scheme of things but it could be useful sometimes.