Home Explore Blog CI



neovim

49th chunk of `runtime/doc/api.txt`
c61ce80e96b3e5b1e6c04086b12374a0327b137f53d4223c0000000100000fe7
 Parameters: ~
      • {tabpage}  |tab-ID|, or 0 for current tabpage

    Return: ~
        Tabpage number

nvim_tabpage_get_var({tabpage}, {name})               *nvim_tabpage_get_var()*
    Gets a tab-scoped (t:) variable

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {tabpage}  |tab-ID|, or 0 for current tabpage
      • {name}     Variable name

    Return: ~
        Variable value

nvim_tabpage_get_win({tabpage})                       *nvim_tabpage_get_win()*
    Gets the current window in a tabpage

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {tabpage}  |tab-ID|, or 0 for current tabpage

    Return: ~
        |window-ID|

nvim_tabpage_is_valid({tabpage})                     *nvim_tabpage_is_valid()*
    Checks if a tabpage is valid

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {tabpage}  |tab-ID|, or 0 for current tabpage

    Return: ~
        true if the tabpage is valid, false otherwise

nvim_tabpage_list_wins({tabpage})                   *nvim_tabpage_list_wins()*
    Gets the windows in a tabpage

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {tabpage}  |tab-ID|, or 0 for current tabpage

    Return: ~
        List of windows in `tabpage`

                                                      *nvim_tabpage_set_var()*
nvim_tabpage_set_var({tabpage}, {name}, {value})
    Sets a tab-scoped (t:) variable

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {tabpage}  |tab-ID|, or 0 for current tabpage
      • {name}     Variable name
      • {value}    Variable value

nvim_tabpage_set_win({tabpage}, {win})                *nvim_tabpage_set_win()*
    Sets the current window in a tabpage

    Attributes: ~
        Since: 0.10.0

    Parameters: ~
      • {tabpage}  |tab-ID|, or 0 for current tabpage
      • {win}      |window-ID|, must already belong to {tabpage}


==============================================================================
Autocmd Functions                                                *api-autocmd*

nvim_clear_autocmds({opts})                            *nvim_clear_autocmds()*
    Clears all autocommands selected by {opts}. To delete autocmds see
    |nvim_del_autocmd()|.

    Attributes: ~
        Since: 0.7.0

    Parameters: ~
      • {opts}  Parameters
                • event: (string|table) Examples:
                  • event: "pat1"
                  • event: { "pat1" }
                  • event: { "pat1", "pat2", "pat3" }
                • pattern: (string|table)
                  • pattern or patterns to match exactly.
                    • For example, if you have `*.py` as that pattern for the
                      autocmd, you must pass `*.py` exactly to clear it.
                      `test.py` will not match the pattern.
                  • defaults to clearing all patterns.
                  • NOTE: Cannot be used with {buffer}
                • buffer: (bufnr)
                  • clear only |autocmd-buflocal| autocommands.
                  • NOTE: Cannot be used with {pattern}
                • group: (string|int) The augroup name or id.
                  • NOTE: If not passed, will only delete autocmds not in any
                    group.

nvim_create_augroup({name}, {opts})                    *nvim_create_augroup()*
    Create or get an autocommand group |autocmd-groups|.

    To get an existing group id, do: >lua
        local id = vim.api.nvim_create_augroup('my.lsp.config', {
            clear = false
        })
<

    Attributes: ~
        Since: 0.7.0

    Parameters: ~
      • {name}  String: The name of the group
      • {opts}  Dict Parameters
                • clear (bool) optional: defaults to true. Clear existing
                  commands if the group already exists |autocmd-groups|.

    Return: ~
        Integer id of the created group.

    See also: ~
      • |autocmd-groups|

nvim_create_autocmd({event}, {opts})                   *nvim_create_autocmd()*
    Creates an |autocommand|

Title: Neovim API: Tabpage Functions and Autocmd Management
Summary
This section outlines Neovim API functions for working with tabpages, including getting and setting tab-scoped variables, retrieving the current window, checking tabpage validity, and listing windows within a tabpage. It also introduces functions for managing autocommands, such as clearing autocommands based on specified criteria, creating autocommand groups, and creating individual autocommands.