function names defined in
the script. Present only when a particular
script is specified using the "sid" item in
{opts}.
name Vim script file name.
sid Script ID |<SID>|.
variables A dictionary with the script-local variables.
Present only when a particular script is
specified using the "sid" item in {opts}.
Note that this is a copy, the value of
script-local variables cannot be changed using
this dictionary.
version Vim script version, always 1
Examples: >vim
echo getscriptinfo({'name': 'myscript'})
echo getscriptinfo({'sid': 15})[0].variables
<
Parameters: ~
• {opts} (`table?`)
Return: ~
(`vim.fn.getscriptinfo.ret[]`)
getstacktrace() *getstacktrace()*
Returns the current stack trace of Vim scripts.
Stack trace is a |List|, of which each item is a |Dictionary|
with the following items:
funcref The funcref if the stack is at a function,
otherwise this item is omitted.
event The string of the event description if the
stack is at an autocmd event, otherwise this
item is omitted.
lnum The line number in the script on the stack.
filepath The file path of the script on the stack.
Return: ~
(`table[]`)
gettabinfo([{tabnr}]) *gettabinfo()*
If {tabnr} is not specified, then information about all the
tab pages is returned as a |List|. Each List item is a
|Dictionary|. Otherwise, {tabnr} specifies the tab page
number and information about that one is returned. If the tab
page does not exist an empty List is returned.
Each List item is a |Dictionary| with the following entries:
tabnr tab page number.
variables a reference to the dictionary with
tabpage-local variables
windows List of |window-ID|s in the tab page.
Parameters: ~
• {tabnr} (`integer?`)
Return: ~
(`any`)
gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()*
Get the value of a tab-local variable {varname} in tab page
{tabnr}. |t:var|
Tabs are numbered starting with one.
The {varname} argument is a string. When {varname} is empty a
dictionary with all tab-local variables is returned.
Note that the name without "t:" must be used.
When the tab or variable doesn't exist {def} or an empty
string is returned, there is no error message.
Parameters: ~
• {tabnr} (`integer`)
• {varname} (`string`)
• {def} (`any?`)
Return: ~
(`any`)
gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
Get the value of window-local variable {varname} in window
{winnr} in tab page {tabnr}.
The {varname} argument is a string. When {varname} is empty a
dictionary with all window-local variables is returned.
When {varname} is equal to "&" get the values of all
window-local options in a |Dictionary|.
Otherwise, when {varname} starts with "&" get the value of a
window-local option.
Note that {varname} must be the name without "w:".
Tabs are numbered starting with one. For the current tabpage
use |getwinvar()|.
{winnr} can be the window number or the |window-ID|.
When {winnr} is zero the current window is used.
This also works for a global option, buffer-local option and
window-local option, but it doesn't work for a global variable
or buffer-local variable.
When the tab, window or variable doesn't exist {def} or an
empty string is returned, there is no error message.
Examples: >vim
let list_is_on = gettabwinvar(1, 2, '&list')
echo "myvar = " .. gettabwinvar(3, 1, 'myvar')
<
To obtain all window-local variables use: >vim
gettabwinvar({tabnr}, {winnr}, '&')
<
Parameters: