'']}]`
The "submatches" List always contains 9 items. If a submatch
is not found, then an empty string is returned for that
submatch.
Parameters: ~
• {list} (`string[]`)
• {pat} (`string`)
• {dict} (`table?`)
Return: ~
(`any`)
matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()*
Same as |matchstr()|, but return the matched string, the start
position and the end position of the match. Example: >vim
echo matchstrpos("testing", "ing")
< results in ["ing", 4, 7].
When there is no match ["", -1, -1] is returned.
The {start}, if given, has the same meaning as for |match()|. >vim
echo matchstrpos("testing", "ing", 2)
< results in ["ing", 4, 7]. >vim
echo matchstrpos("testing", "ing", 5)
< result is ["", -1, -1].
When {expr} is a |List| then the matching item, the index
of first item where {pat} matches, the start position and the
end position of the match are returned. >vim
echo matchstrpos([1, '__x'], '\a')
< result is ["x", 1, 2, 3].
The type isn't changed, it's not necessarily a String.
Parameters: ~
• {expr} (`any`)
• {pat} (`string`)
• {start} (`integer?`)
• {count} (`integer?`)
Return: ~
(`any`)
max({expr}) *max()*
Return the maximum value of all items in {expr}. Example: >vim
echo max([apples, pears, oranges])
< {expr} can be a |List| or a |Dictionary|. For a Dictionary,
it returns the maximum of all values in the Dictionary.
If {expr} is neither a List nor a Dictionary, or one of the
items in {expr} cannot be used as a Number this results in
an error. An empty |List| or |Dictionary| results in zero.
Parameters: ~
• {expr} (`any`)
Return: ~
(`number`)
menu_get({path} [, {modes}]) *menu_get()*
Returns a |List| of |Dictionaries| describing |menus| (defined
by |:menu|, |:amenu|, …), including |hidden-menus|.
{path} matches a menu by name, or all menus if {path} is an
empty string. Example: >vim
echo menu_get('File','')
echo menu_get('')
<
{modes} is a string of zero or more modes (see |maparg()| or
|creating-menus| for the list of modes). "a" means "all".
Example: >vim
nnoremenu &Test.Test inormal
inoremenu Test.Test insert
vnoremenu Test.Test x
echo menu_get("")
< returns something like this: >
[ {
"hidden": 0,
"name": "Test",
"priority": 500,
"shortcut": 84,
"submenus": [ {
"hidden": 0,
"mappings": {
i": {
"enabled": 1,
"noremap": 1,
"rhs": "insert",
"sid": 1,
"silent": 0
},
n": { ... },
s": { ... },
v": { ... }
},
"name": "Test",
"priority": 500,
"shortcut": 0
} ]
} ]
<
Parameters: ~
• {path} (`string`)
• {modes} (`string?`)
Return: ~
(`any`)
menu_info({name} [, {mode}]) *menu_info()*
Return information about the specified menu {name} in
mode {mode}. The menu name should be specified without the
shortcut character ('&'). If {name} is "", then the top-level
menu names are returned.
{mode} can be one of these strings:
"n" Normal
"v" Visual (including Select)
"o" Operator-pending
"i" Insert
"c" Cmd-line
"s" Select
"x" Visual
"t" Terminal-Job
"" Normal, Visual and Operator-pending
"!" Insert and Cmd-line
When {mode} is omitted, the modes for "" are used.
Returns a |Dictionary| containing the following items:
accel menu item accelerator text |menu-text|
display display name (name without '&')