import { fn } from "https://deno.land/x/ddc_vim@v3.8.0/deps.ts";
const { globpath } = fn;
Perform glob() for String {expr} on all directories in {path} and concatenate the results. Example:
:echo globpath(&rtp, "syntax/c.vim")
{path} is a comma-separated list of directory names. Each
directory name is prepended to {expr} and expanded like with
glob()
. A path separator is inserted when needed.
To add a comma inside a directory name escape it with a
backslash. Note that on MS-Windows a directory may have a
trailing backslash, remove it if you put a comma after it.
If the expansion fails for one of the directories, there is no
error message.
Unless the optional {nosuf} argument is given and is TRUE
,
the 'suffixes' and 'wildignore' options apply: Names matching
one of the patterns in 'wildignore' will be skipped and
'suffixes' affect the ordering of matches.
When {list} is present and it is TRUE
the result is a List
with all matching files. The advantage of using a List is, you
also get filenames containing newlines correctly. Otherwise
the result is a String and when there are several matches,
they are separated by <NL>
characters. Example:
:echo globpath(&rtp, "syntax/c.vim", 0, 1)
{alllinks} is used as with glob()
.
The "**" item can be used to search in a directory tree. For example, to find all "README.txt" files in the directories in 'runtimepath' and below:
:echo globpath(&rtp, "** /README.txt")
Upwards search and limiting the depth of "**" is not supported, thus using 'path' will not always work properly.
Can also be used as a method
, the base is passed as the
second argument:
GetExpr()->globpath(&rtp)