available.
The value can be used with `:winpos`.
Return: ~
(`integer`)
getwinvar({winnr}, {varname} [, {def}]) *getwinvar()*
Like |gettabwinvar()| for the current tabpage.
Examples: >vim
let list_is_on = getwinvar(2, '&list')
echo "myvar = " .. getwinvar(1, 'myvar')
Parameters: ~
• {winnr} (`integer`)
• {varname} (`string`)
• {def} (`any?`)
Return: ~
(`any`)
glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()*
Expand the file wildcards in {expr}. See |wildcards| for the
use of special characters.
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.
'wildignorecase' always applies.
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.
If the expansion fails, the result is an empty String or List.
You can also use |readdir()| if you need to do complicated
things, such as limiting the number of matches.
A name for a non-existing file is not included. A symbolic
link is only included if it points to an existing file.
However, when the {alllinks} argument is present and it is
|TRUE| then all symbolic links are included.
For most systems backticks can be used to get files names from
any external command. Example: >vim
let tagfiles = glob("`find . -name tags -print`")
let &tags = substitute(tagfiles, "\n", ",", "g")
< The result of the program inside the backticks should be one
item per line. Spaces inside an item are allowed.
See |expand()| for expanding special Vim variables. See
|system()| for getting the raw output of an external command.
Parameters: ~
• {expr} (`string`)
• {nosuf} (`boolean?`)
• {list} (`boolean?`)
• {alllinks} (`boolean?`)
Return: ~
(`any`)
glob2regpat({string}) *glob2regpat()*
Convert a file pattern, as used by glob(), into a search
pattern. The result can be used to match with a string that
is a file name. E.g. >vim
if filename =~ glob2regpat('Make*.mak')
" ...
endif
< This is equivalent to: >vim
if filename =~ '^Make.*\.mak$'
" ...
endif
< When {string} is an empty string the result is "^$", match an
empty string.
Note that the result depends on the system. On MS-Windows
a backslash usually means a path separator.
Parameters: ~
• {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