On 2020-01-05 06:28, Jason Franklin wrote:
> Is there a concise, clean method to omit directories from the
> arglist when populating it with all files below the current project
> directory?
I was unable to find anything inherent to the "**" token, but at
least on *nix-like platforms you might be able to use
:args `find . -type f`
as detailed at
:help backtick-expansion
If you're stuck on Windows without a find(1) command, you *should*
*in theory* be able to do it in pure vim with a bit more typing:
:args `=filter(expand('**', v:true, v:true), '!isdirectory(v:val)')`
because
:echo filter(expand('**', v:true, v:true), '!isdirectory(v:val)')
returns the right results. However I'm not getting this to work.
Can another set of eyes confirm if this is a bug? I'm basing my
determination on
:help `=
"""
You can have the backticks expanded as a Vim expression, instead of
as an external command, by putting an equal sign right after the
first backtick
...
When the result is a |List| then each item is used as a name.
"""
So I would expect the ":args `=…`" to work because the filter()
returns a list according to type().
Am I missing something?
-tim