Namespace
• {opts} Optional parameters to set:
• wins: a list of windows to be scoped in
==============================================================================
Window Functions *api-window*
nvim_win_call({window}, {fun}) *nvim_win_call()*
Calls a function with window as temporary current window.
Attributes: ~
Lua |vim.api| only
Since: 0.5.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
• {fun} Function to call inside the window (currently Lua callable
only)
Return: ~
Return value of function.
See also: ~
• |win_execute()|
• |nvim_buf_call()|
nvim_win_close({window}, {force}) *nvim_win_close()*
Closes the window (like |:close| with a |window-ID|).
Attributes: ~
not allowed when |textlock| is active
Since: 0.4.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
• {force} Behave like `:close!` The last window of a buffer with
unwritten changes can be closed. The buffer will become
hidden, even if 'hidden' is not set.
nvim_win_del_var({window}, {name}) *nvim_win_del_var()*
Removes a window-scoped (w:) variable
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
• {name} Variable name
nvim_win_get_buf({window}) *nvim_win_get_buf()*
Gets the current buffer in a window
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
Return: ~
Buffer id
nvim_win_get_cursor({window}) *nvim_win_get_cursor()*
Gets the (1,0)-indexed, buffer-relative cursor position for a given window
(different windows showing the same buffer have independent cursor
positions). |api-indexing|
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
Return: ~
(row, col) tuple
See also: ~
• |getcurpos()|
nvim_win_get_height({window}) *nvim_win_get_height()*
Gets the window height
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
Return: ~
Height as a count of rows
nvim_win_get_number({window}) *nvim_win_get_number()*
Gets the window number
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
Return: ~
Window number
nvim_win_get_position({window}) *nvim_win_get_position()*
Gets the window position in display cells. First position is zero.
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
Return: ~
(row, col) tuple with the window position
nvim_win_get_tabpage({window}) *nvim_win_get_tabpage()*
Gets the window tabpage
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
Return: ~
Tabpage that contains the window
nvim_win_get_var({window}, {name}) *nvim_win_get_var()*
Gets a window-scoped (w:) variable
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
• {name} Variable name
Return: ~
Variable value
nvim_win_get_width({window}) *nvim_win_get_width()*
Gets the window width
Attributes: ~
Since: 0.1.0
Parameters: ~
• {window} |window-ID|, or 0 for current window
Return: ~
Width as a count of columns
nvim_win_hide({window})