Home Explore Blog CI



neovim

19th chunk of `runtime/doc/api.txt`
865806182579fc80a6dea280b0ba8a04f40bc97dbbec59cc0000000100000fe4
 Client homepage URL (e.g. GitHub
                        repository)
                      • "license": License description ("Apache 2", "GPLv3",
                        "MIT", …)
                      • "logo": URI or path to image, preferably small logo or
                        icon. .png or .svg format is preferred.

nvim_set_current_buf({buffer})                        *nvim_set_current_buf()*
    Sets the current window's buffer to `buffer`.

    Attributes: ~
        not allowed when |textlock| is active or in the |cmdwin|
        Since: 0.1.0

    Parameters: ~
      • {buffer}  Buffer id

nvim_set_current_dir({dir})                           *nvim_set_current_dir()*
    Changes the global working directory.

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {dir}  Directory path

nvim_set_current_line({line})                        *nvim_set_current_line()*
    Sets the text on the current line.

    Attributes: ~
        not allowed when |textlock| is active
        Since: 0.1.0

    Parameters: ~
      • {line}  Line contents

nvim_set_current_tabpage({tabpage})               *nvim_set_current_tabpage()*
    Sets the current tabpage.

    Attributes: ~
        not allowed when |textlock| is active or in the |cmdwin|
        Since: 0.1.0

    Parameters: ~
      • {tabpage}  |tab-ID| to focus

nvim_set_current_win({window})                        *nvim_set_current_win()*
    Sets the current window (and tabpage, implicitly).

    Attributes: ~
        not allowed when |textlock| is active or in the |cmdwin|
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID| to focus

nvim_set_hl({ns_id}, {name}, {val})                            *nvim_set_hl()*
    Sets a highlight group.

    Note: ~
      • Unlike the `:highlight` command which can update a highlight group,
        this function completely replaces the definition. For example:
        `nvim_set_hl(0, 'Visual', {})` will clear the highlight group
        'Visual'.
      • The fg and bg keys also accept the string values `"fg"` or `"bg"`
        which act as aliases to the corresponding foreground and background
        values of the Normal group. If the Normal group has not been defined,
        using these values results in an error.
      • If `link` is used in combination with other attributes; only the
        `link` will take effect (see |:hi-link|).

    Attributes: ~
        Since: 0.5.0

    Parameters: ~
      • {ns_id}  Namespace id for this highlight |nvim_create_namespace()|.
                 Use 0 to set a highlight group globally |:highlight|.
                 Highlights from non-global namespaces are not active by
                 default, use |nvim_set_hl_ns()| or |nvim_win_set_hl_ns()| to
                 activate them.
      • {name}   Highlight group name, e.g. "ErrorMsg"
      • {val}    Highlight definition map, accepts the following keys:
                 • fg: color name or "#RRGGBB", see note.
                 • bg: color name or "#RRGGBB", see note.
                 • sp: color name or "#RRGGBB"
                 • blend: integer between 0 and 100
                 • bold: boolean
                 • standout: boolean
                 • underline: boolean
                 • undercurl: boolean
                 • underdouble: boolean
                 • underdotted: boolean
                 • underdashed: boolean
                 • strikethrough: boolean
                 • italic: boolean
                 • reverse: boolean
                 • nocombine: boolean
                 • link: name of another highlight group to link to, see
                   |:hi-link|.
                 • default: Don't override existing definition |:hi-default|
                 • ctermfg: Sets foreground of cterm color |ctermfg|
                 • ctermbg: Sets background of cterm color |ctermbg|
                 • cterm: cterm attribute map, like |highlight-args|. If not
                   set, cterm attributes will match those from

Title: Nvim API: Buffer/Directory/Line/Tabpage/Window Management and Highlight Group Settings
Summary
This section details Nvim API functions for manipulating the environment: `nvim_set_current_buf()`, `nvim_set_current_dir()`, `nvim_set_current_line()`, `nvim_set_current_tabpage()`, and `nvim_set_current_win()` functions to manage buffer, directory, line, tabpage, and window. Additionally, it describes the `nvim_set_hl()` API function for setting highlight groups, including details on attributes and the definition map.