• {string} (`string`)
Return: ~
(`string`)
globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]]) *globpath()*
Perform glob() for String {expr} on all directories in {path}
and concatenate the results. Example: >vim
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: >vim
echo globpath(&rtp, "syntax/c.vim", 0, 1)
<
{allinks} 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: >vim
echo globpath(&rtp, "**/README.txt")
< Upwards search and limiting the depth of "**" is not
supported, thus using 'path' will not always work properly.
Parameters: ~
• {path} (`string`)
• {expr} (`string`)
• {nosuf} (`boolean?`)
• {list} (`boolean?`)
• {allinks} (`boolean?`)
Return: ~
(`any`)
has({feature}) *has()*
Returns 1 if {feature} is supported, 0 otherwise. The
{feature} argument is a feature name like "nvim-0.2.1" or
"win32", see below. See also |exists()|.
To get the system name use |vim.uv|.os_uname() in Lua: >lua
print(vim.uv.os_uname().sysname)
< If the code has a syntax error then Vimscript may skip the
rest of the line. Put |:if| and |:endif| on separate lines to
avoid the syntax error: >vim
if has('feature')
let x = this_breaks_without_the_feature()
endif
<
Vim's compile-time feature-names (prefixed with "+") are not
recognized because Nvim is always compiled with all possible
features. |feature-compile|
Feature names can be:
1. Nvim version. For example the "nvim-0.2.1" feature means
that Nvim is version 0.2.1 or later: >vim
if has("nvim-0.2.1")
" ...
endif
< 2. Runtime condition or other pseudo-feature. For example the
"win32" feature checks if the current system is Windows: >vim
if has("win32")
" ...
endif
< *feature-list*
List of supported pseudo-feature names:
acl |ACL| support.
bsd BSD system (not macOS, use "mac" for that).
clipboard |clipboard| provider is available.
fname_case Case in file names matters (for Darwin and MS-Windows
this is not present).
gui_running Nvim has a GUI.
hurd GNU/Hurd system.
iconv Can use |iconv()| for conversion.
linux Linux system.
mac MacOS system.
nvim This is Nvim.
python3 Legacy Vim |python3| interface. |has-python|
pythonx Legacy Vim |python_x| interface. |has-pythonx|
sun SunOS system.
ttyin input is a terminal (tty).
ttyout output is a terminal (tty).
unix Unix system.
*vim_starting* True during |startup|.
win32 Windows system (32 or 64 bit).
win64 Windows system (64 bit).
wsl WSL (Windows Subsystem for Linux) system.
*has-patch*
3. Vim patch. For example the "patch123" feature