How can I search files just like with /
command but recursively scanning subfolders?
Or maybe there are other approaches to get a list of files that match some pattern in the current folder including all subfolders.
How can I search files just like with /
command but recursively scanning subfolders?
Or maybe there are other approaches to get a list of files that match some pattern in the current folder including all subfolders.
:find command
There is :fin[d] command for that. Internally it invokes
find
utility (this is configurable via 'findprg' option), so you can do everythingfind
is capable of. That said, in most cases the simple form of the command suffices:Note that by default argument is treated as regular file pattern (
-name
option offind
), which is different from regular expressions accepted by/
. For searching via regexp, use:If you want to scan only specific subfolders, just select them before running the command and search will be limited only to those directories.
:find
command brings up a menu with search results. If you want to process them like regular files (e.g. delete, copy, move), hit b to change list representation.Alternative that uses
/
Alternatively you can populate current view with list of files in all subdirectories with command like (see %u):
and then use
/
, although this might be less efficient.