Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

a feature that I find useful, grep on selected folders or files.

1st method:

position on the desired folders or files and press the t key and repeat - once the selection is made - run the grep command for example:

search for the string "main thread" with:
:grep main thread

2nd method:

in visual mode with the v key and leaving it with Enter to keep the selection and re-entering with av to select more files. Then grep.

How to recall the lost selection (a bit like copen) after the grep command ?

1 Answer

0 votes
by

3rd method: use a command-line range (mostly useful for searching in a single file/directory with :.grep ...).

How to recall the lost selection (a bit like copen) after the grep command?

Use gs key for this. There is a similar gv key, but it restores only the last visually selected range, so not suitable for complex cases.

by

4th method °°: grep in the Custom View with :%grep ...

After performing a first text search in a folder, you get a list of results within a frame made of continuous lines called the menu

From menu, import the files into the custom view by pressing the b key.

The top line of the custom view looks like this: [Grep main thread] @ ~.....

Finally, to perform a second text search within the files that matched the first grep, use the command :% grep ...

°° hopefully, this fits into the discussion

by

@xaizek gs is the solution, thank you very much

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...