Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
+1 vote
in vifm by

Is there an equivalent of ls -R?

Use-case: "Show files in all subdirectories and filter-out some extensions".

I'd imagine it as following:

  1. Execute imaginary :set flatview
  2. :filter \.ext1$|\.ext1$ and so on
  3. Do something on files that are left as the result
  4. Go back to the defaults, :set nomillerview | :set nolsview

Here is the video showing similar concept in TC: https://www.youtube.com/watch?v=OZzNENOPMvc

2 Answers

+2 votes
by
selected by
 
Best answer

I have this in my config file:

" flatten current directory, ie list all files in directory and its
" subdirectories and directories of subdirectories etc
command flatten :execute '!find -not -path "*/\.*" 2>/dev/null %%U'
command flat    :execute '!find -not -path "*/\.*" 2>/dev/null %%U'
nnoremap fl :flat<cr>

" the same as flatten but display only files
command! flattenf :execute '!find -type f -not -path "*/\.*" 2>/dev/null %%U'
command! flatf    :execute '!find -type f -not -path "*/\.*" 2>/dev/null %%U'
nnoremap ff :flatf<cr>

" the same as flatten but display only directories
command! flattend :execute '!find -type d -not -path "*/\.*" %%U'
command! flatd    :execute '!find -type d -not -path "*/\.*" %%U'
nnoremap fd :flatd<cr>
by

This is quite cool, thanks!

+2 votes
by
  1. :!find -type f%u to build a custom view
  2. :select! {*.ext1,*.ext2} followed by zd (only local filter affects custom views)
  3. ...
  4. h or any other directory change command.
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.

Support Ukraine
...