Home Explore Blog CI



neovim

12th chunk of `runtime/doc/lua.txt`
e859a523926bdab3dcf65783b62594c53180d5225933b7260000000100000fb4
 string.

    Parameters: ~
      • {obj}   (`any`)
      • {opts}  (`table<string,any>?`) Options table with keys:
                • escape_slash: (boolean) (default false) Escape slash
                  characters "/" in string values.

    Return: ~
        (`string`)


==============================================================================
VIM.BASE64                                                        *vim.base64*

vim.base64.decode({str})                                 *vim.base64.decode()*
    Decode a Base64 encoded string.

    Parameters: ~
      • {str}  (`string`) Base64 encoded string

    Return: ~
        (`string`) Decoded string

vim.base64.encode({str})                                 *vim.base64.encode()*
    Encode {str} using Base64.

    Parameters: ~
      • {str}  (`string`) String to encode

    Return: ~
        (`string`) Encoded string


==============================================================================
VIM.SPELL                                                          *vim.spell*

vim.spell.check({str})                                     *vim.spell.check()*
    Check {str} for spelling errors. Similar to the Vimscript function
    |spellbadword()|.

    Note: The behaviour of this function is dependent on: 'spelllang',
    'spellfile', 'spellcapcheck' and 'spelloptions' which can all be local to
    the buffer. Consider calling this with |nvim_buf_call()|.

    Example: >lua
        vim.spell.check("the quik brown fox")
        -- =>
        -- {
        --     {'quik', 'bad', 5}
        -- }
<

    Parameters: ~
      • {str}  (`string`)

    Return: ~
        (`[string, 'bad'|'rare'|'local'|'caps', integer][]`) List of tuples
        with three items:
        • The badly spelled word.
        • The type of the spelling error: "bad" spelling mistake "rare" rare
          word "local" word only valid in another region "caps" word should
          start with Capital
        • The position in {str} where the word begins.


==============================================================================
VIM                                                              *vim.builtin*


vim.api.{func}({...})                                                *vim.api*
    Invokes Nvim |API| function {func} with arguments {...}.
    Example: call the "nvim_get_current_line()" API function: >lua
        print(tostring(vim.api.nvim_get_current_line()))

vim.NIL                                                              *vim.NIL*
    Special value representing NIL in |RPC| and |v:null| in Vimscript
    conversion, and similar cases. Lua `nil` cannot be used as part of a Lua
    table representing a Dictionary or Array, because it is treated as
    missing: `{"foo", nil}` is the same as `{"foo"}`.

vim.type_idx                                                    *vim.type_idx*
    Type index for use in |lua-special-tbl|. Specifying one of the values from
    |vim.types| allows typing the empty table (it is unclear whether empty Lua
    table represents empty list or empty array) and forcing integral numbers
    to be |Float|. See |lua-special-tbl| for more details.

vim.val_idx                                                      *vim.val_idx*
    Value index for tables representing |Float|s. A table representing
    floating-point value 1.0 looks like this: >lua
        {
          [vim.type_idx] = vim.types.float,
          [vim.val_idx] = 1.0,
        }
<    See also |vim.type_idx| and |lua-special-tbl|.

vim.types                                                          *vim.types*
    Table with possible values for |vim.type_idx|. Contains two sets of
    key-value pairs: first maps possible values for |vim.type_idx| to
    human-readable strings, second maps human-readable type names to values
    for |vim.type_idx|. Currently contains pairs for `float`, `array` and
        `dictionary` types.

    Note: One must expect that values corresponding to `vim.types.float`,
    `vim.types.array`

Title: vim.base64, vim.spell, vim.builtin: Encoding, Spelling, and Built-in Functions
Summary
This section details three modules: `vim.base64`, `vim.spell`, and `vim.builtin`. `vim.base64` provides functions for Base64 encoding and decoding. `vim.spell` allows checking a string for spelling errors. `vim.builtin` contains built-in functions like `vim.api` for calling Nvim API functions, special values like `vim.NIL`, and functions related to type indexing and value indexing for Lua tables.