neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

vvars.lua (31124B)


      1 local M = {}
      2 
      3 M.vars = {
      4  argf = {
      5    type = 'string[]',
      6    desc = [=[
      7      The list of file arguments passed on the command line at startup.
      8 
      9      Each filename is expanded to an absolute path, so that v:argf
     10      remains valid even if the current working directory changes later.
     11 
     12      Unlike |v:argv|, this does not include option arguments
     13      such as `-u`, `--cmd`, or `+cmd`. Unlike |argv()|, it is not
     14      affected by later |:args|, |:argadd|, or plugin modifications.
     15      It also handles the `--` separator correctly, including only
     16      files specified after it.
     17 
     18      This is a read-only snapshot of the original startup file arguments.
     19    ]=],
     20  },
     21  argv = {
     22    type = 'string[]',
     23    desc = [=[
     24      The command line arguments Vim was invoked with.  This is a
     25      list of strings.  The first item is the Vim command.
     26      See |v:progpath| for the command with full path.
     27    ]=],
     28  },
     29  char = {
     30    type = 'string',
     31    desc = [=[
     32      Argument for evaluating 'formatexpr' and used for the typed
     33      character when using <expr> in an abbreviation |:map-<expr>|.
     34      It is also used by the |InsertCharPre|, |InsertEnter|,
     35      |CmdlineLeave| and |CmdlineLeavePre| events.
     36    ]=],
     37  },
     38  charconvert_from = {
     39    type = 'string',
     40    desc = [=[
     41      The name of the character encoding of a file to be converted.
     42      Only valid while evaluating the 'charconvert' option.
     43    ]=],
     44  },
     45  charconvert_to = {
     46    type = 'string',
     47    desc = [=[
     48      The name of the character encoding of a file after conversion.
     49      Only valid while evaluating the 'charconvert' option.
     50    ]=],
     51  },
     52  cmdarg = {
     53    type = 'string',
     54    desc = [=[
     55      The extra arguments ("++p", "++enc=", "++ff=") given to a file
     56      read/write command.  This is set before an autocommand event
     57      for a file read/write command is triggered.  There is a
     58      leading space to make it possible to append this variable
     59      directly after the read/write command. Note: "+cmd" isn't
     60      included here, because it will be executed anyway.
     61    ]=],
     62  },
     63  cmdbang = {
     64    type = 'integer',
     65    desc = [=[
     66      Set like v:cmdarg for a file read/write command.  When a "!"
     67      was used the value is 1, otherwise it is 0.  Note that this
     68      can only be used in autocommands.  For user commands |<bang>|
     69      can be used.
     70    ]=],
     71  },
     72  collate = {
     73    type = 'string',
     74    desc = [=[
     75      The current locale setting for collation order of the runtime
     76      environment.  This allows Vim scripts to be aware of the
     77      current locale encoding.  Technical: it's the value of
     78      LC_COLLATE.  When not using a locale the value is "C".
     79      This variable can not be set directly, use the |:language|
     80      command.
     81      See |multi-lang|.
     82    ]=],
     83  },
     84  completed_item = {
     85    type = 'vim.v.completed_item',
     86    desc = [=[
     87      Dictionary containing the |complete-items| for the most
     88      recently completed word after |CompleteDone|.  Empty if the
     89      completion failed, or after leaving and re-entering insert
     90      mode.
     91      Note: Plugins can modify the value to emulate the builtin
     92      |CompleteDone| event behavior.
     93    ]=],
     94  },
     95  count = {
     96    type = 'integer',
     97    desc = [=[
     98      The count given for the last Normal mode command.  Can be used
     99      to get the count before a mapping.  Read-only.  Example: >vim
    100        :map _x :<C-U>echo "the count is " .. v:count<CR>
    101      <
    102      Note: The <C-U> is required to remove the line range that you
    103      get when typing ':' after a count.
    104      When there are two counts, as in "3d2w", they are multiplied,
    105      just like what happens in the command, "d6w" for the example.
    106      Also used for evaluating the 'formatexpr' option.
    107    ]=],
    108  },
    109  count1 = {
    110    type = 'integer',
    111    desc = [=[
    112      Just like "v:count", but defaults to one when no count is
    113      used.
    114    ]=],
    115  },
    116  ctype = {
    117    type = 'string',
    118    desc = [=[
    119      The current locale setting for characters of the runtime
    120      environment.  This allows Vim scripts to be aware of the
    121      current locale encoding.  Technical: it's the value of
    122      LC_CTYPE.  When not using a locale the value is "C".
    123      This variable can not be set directly, use the |:language|
    124      command.
    125      See |multi-lang|.
    126    ]=],
    127  },
    128  dying = {
    129    type = 'integer',
    130    desc = [=[
    131      Normally zero.  When a deadly signal is caught it's set to
    132      one.  When multiple signals are caught the number increases.
    133      Can be used in an autocommand to check if Vim didn't
    134      terminate normally.
    135      Example: >vim
    136        :au VimLeave * if v:dying | echo "\nAAAAaaaarrrggghhhh!!!\n" | endif
    137      <
    138      Note: if another deadly signal is caught when v:dying is one,
    139      VimLeave autocommands will not be executed.
    140    ]=],
    141  },
    142  echospace = {
    143    type = 'integer',
    144    desc = [=[
    145      Number of screen cells that can be used for an `:echo` message
    146      in the last screen line before causing the |hit-enter-prompt|.
    147      Depends on 'showcmd', 'ruler' and 'columns'.  You need to
    148      check 'cmdheight' for whether there are full-width lines
    149      available above the last line.
    150    ]=],
    151  },
    152  errmsg = {
    153    type = 'string',
    154    desc = [=[
    155      Last error message that occurred (not necessarily displayed).
    156      Modifiable (can be set).
    157      Example: >vim
    158        let v:errmsg = ""
    159        silent! next
    160        if v:errmsg != ""
    161          " ... handle error
    162      <
    163    ]=],
    164  },
    165  errors = {
    166    type = 'string[]',
    167    tags = { 'assert-return' },
    168    desc = [=[
    169      Errors found by assert functions, such as |assert_true()|.
    170      This is a list of strings.
    171      The assert functions append an item when an assert fails.
    172      The return value indicates this: a one is returned if an item
    173      was added to v:errors, otherwise zero is returned.
    174      To remove old results make it empty: >vim
    175        let v:errors = []
    176      <
    177      If v:errors is set to anything but a list it is made an empty
    178      list by the assert function.
    179    ]=],
    180  },
    181  event = {
    182    type = 'vim.v.event',
    183    desc = [=[
    184      Dictionary of event data for the current |autocommand|.  Valid
    185      only during the event lifetime; storing or passing v:event is
    186      invalid!  Copy it instead: >vim
    187        au TextYankPost * let g:foo = deepcopy(v:event)
    188      <
    189      Keys vary by event; see the documentation for the specific
    190      event, e.g. |DirChanged| or |TextYankPost|.
    191        KEY              DESCRIPTION ~
    192        abort            Whether the event triggered during
    193                         an aborting condition (e.g. |c_Esc| or
    194                         |c_CTRL-C| for |CmdlineLeave|).
    195        chan             |channel-id|
    196        changed_window   Is |v:true| if the event fired while
    197                         changing window  (or tab) on |DirChanged|.
    198        cmdlevel         Level of cmdline.
    199        cmdtype          Type of cmdline, |cmdline-char|.
    200        col              Column count of popup menu on |CompleteChanged|,
    201                         relative to screen.
    202        complete_type    See |complete_info_mode|
    203        complete_word    The selected word, or empty if completion
    204                         was abandoned/discarded.
    205        completed_item   Current selected item on |CompleteChanged|,
    206                         or `{}` if no item selected.
    207        cwd              Current working directory.
    208        height           Height of popup menu on |CompleteChanged|
    209        inclusive        Motion is |inclusive|, else exclusive.
    210        info             Dict of arbitrary event data.
    211        operator         Current |operator|.  Also set for Ex
    212                         commands (unlike |v:operator|). For
    213                         example if |TextYankPost| is triggered
    214                         by the |:yank| Ex command then
    215                         `v:event.operator` is "y".
    216        reason           |CompleteDone| reason.
    217        regcontents      Text stored in the register as a
    218                         |readfile()|-style list of lines.
    219        regname          Requested register (e.g "x" for "xyy), or
    220                         empty string for an unnamed operation.
    221        regtype          Type of register as returned by
    222                         |getregtype()|.
    223        row              Row count of popup menu on |CompleteChanged|,
    224                         relative to screen.
    225        scope            Event-specific scope name.
    226        scrollbar        |v:true| if popup menu has a scrollbar, or
    227                         |v:false| if not.
    228        size             Total number of completion items on
    229                         |CompleteChanged|.
    230        status           Job status or exit code, -1 means "unknown". |TermClose|
    231        visual           Selection is visual (as opposed to e.g. a motion range).
    232        width            Width of popup menu on |CompleteChanged|
    233        windows          List of window IDs that changed on |WinResized|
    234    ]=],
    235  },
    236  exception = {
    237    type = 'string',
    238    desc = [=[
    239      The value of the exception most recently caught and not
    240      finished.  See also |v:stacktrace|, |v:throwpoint|, and
    241      |throw-variables|.
    242      Example: >vim
    243        try
    244          throw "oops"
    245        catch /.*/
    246          echo "caught " .. v:exception
    247        endtry
    248      <
    249      Output: "caught oops".
    250    ]=],
    251  },
    252  ['false'] = {
    253    type = 'boolean',
    254    desc = [=[
    255      Special value used to put "false" in JSON and msgpack.  See
    256      |json_encode()|.  This value is converted to "v:false" when used
    257      as a String (e.g. in |expr5| with string concatenation
    258      operator) and to zero when used as a Number (e.g. in |expr5|
    259      or |expr7| when used with numeric operators).  Read-only.
    260    ]=],
    261  },
    262  exiting = {
    263    type = 'integer?',
    264    desc = [=[
    265      Exit code, or |v:null| before invoking the |VimLeavePre|
    266      and |VimLeave| autocmds.  See |:q|, |:x| and |:cquit|.
    267      Example: >vim
    268        :au VimLeave * echo "Exit value is " .. v:exiting
    269      <
    270    ]=],
    271  },
    272  fcs_choice = {
    273    type = 'string',
    274    desc = [=[
    275      What should happen after a |FileChangedShell| event was
    276      triggered.  Can be used in an autocommand to tell Vim what to
    277      do with the affected buffer:
    278        reload  Reload the buffer (does not work if
    279                the file was deleted).
    280        edit    Reload the buffer and detect the
    281                values for options such as
    282                'fileformat', 'fileencoding', 'binary'
    283                (does not work if the file was
    284                deleted).
    285        ask     Ask the user what to do, as if there
    286                was no autocommand.  Except that when
    287                only the timestamp changed nothing
    288                will happen.
    289        <empty> Nothing, the autocommand should do
    290                everything that needs to be done.
    291      The default is empty.  If another (invalid) value is used then
    292      Vim behaves like it is empty, there is no warning message.
    293    ]=],
    294  },
    295  fcs_reason = {
    296    type = 'string',
    297    desc = [=[
    298      The reason why the |FileChangedShell| event was triggered.
    299      Can be used in an autocommand to decide what to do and/or what
    300      to set v:fcs_choice to.  Possible values:
    301        deleted   file no longer exists
    302        conflict  file contents, mode or timestamp was
    303                  changed and buffer is modified
    304        changed   file contents has changed
    305        mode      mode of file changed
    306        time      only file timestamp changed
    307    ]=],
    308  },
    309  fname = {
    310    type = 'string',
    311    desc = [=[
    312      When evaluating 'includeexpr': the file name that was
    313      detected.  Empty otherwise.
    314    ]=],
    315  },
    316  fname_diff = {
    317    type = 'string',
    318    desc = [=[
    319      The name of the diff (patch) file.  Only valid while
    320      evaluating 'patchexpr'.
    321    ]=],
    322  },
    323  fname_in = {
    324    type = 'string',
    325    desc = [=[
    326      The name of the input file.  Valid while evaluating:
    327        option         used for ~
    328        'charconvert'  file to be converted
    329        'diffexpr'     original file
    330        'patchexpr'    original file
    331      And set to the swap file name for |SwapExists|.
    332    ]=],
    333  },
    334  fname_new = {
    335    type = 'string',
    336    desc = [=[
    337      The name of the new version of the file.  Only valid while
    338      evaluating 'diffexpr'.
    339    ]=],
    340  },
    341  fname_out = {
    342    type = 'string',
    343    desc = [=[
    344      The name of the output file.  Only valid while
    345      evaluating:
    346        option           used for ~
    347        'charconvert'    resulting converted file [1]
    348        'diffexpr'       output of diff
    349        'patchexpr'      resulting patched file
    350      [1] When doing conversion for a write command (e.g., ":w
    351      file") it will be equal to v:fname_in.  When doing conversion
    352      for a read command (e.g., ":e file") it will be a temporary
    353      file and different from v:fname_in.
    354    ]=],
    355  },
    356  folddashes = {
    357    type = 'string',
    358    desc = [=[
    359      Used for 'foldtext': dashes representing foldlevel of a closed
    360      fold.
    361      Read-only in the |sandbox|. |fold-foldtext|
    362    ]=],
    363  },
    364  foldend = {
    365    type = 'integer',
    366    desc = [=[
    367      Used for 'foldtext': last line of closed fold.
    368      Read-only in the |sandbox|. |fold-foldtext|
    369    ]=],
    370  },
    371  foldlevel = {
    372    type = 'integer',
    373    desc = [=[
    374      Used for 'foldtext': foldlevel of closed fold.
    375      Read-only in the |sandbox|. |fold-foldtext|
    376    ]=],
    377  },
    378  foldstart = {
    379    type = 'integer',
    380    desc = [=[
    381      Used for 'foldtext': first line of closed fold.
    382      Read-only in the |sandbox|. |fold-foldtext|
    383    ]=],
    384  },
    385  hlsearch = {
    386    type = 'integer',
    387    desc = [=[
    388      Variable that indicates whether search highlighting is on.
    389      Setting it makes sense only if 'hlsearch' is enabled.  Setting
    390      this variable to zero acts like the |:nohlsearch| command,
    391      setting it to one acts like >vim
    392        let &hlsearch = &hlsearch
    393      <
    394      Note that the value is restored when returning from a
    395      function. |function-search-undo|.
    396    ]=],
    397  },
    398  insertmode = {
    399    type = 'string',
    400    desc = [=[
    401      Used for the |InsertEnter| and |InsertChange| autocommand
    402      events.  Values:
    403        i    Insert mode
    404        r    Replace mode
    405        v    Virtual Replace mode
    406    ]=],
    407  },
    408  key = {
    409    type = 'string',
    410    desc = [=[
    411      Key of the current item of a |Dictionary|.  Only valid while
    412      evaluating the expression used with |map()| and |filter()|.
    413      Read-only.
    414    ]=],
    415  },
    416  lang = {
    417    type = 'string',
    418    desc = [=[
    419      The current locale setting for messages of the runtime
    420      environment.  This allows Vim scripts to be aware of the
    421      current language.  Technical: it's the value of LC_MESSAGES.
    422      The value is system dependent.
    423      This variable can not be set directly, use the |:language|
    424      command.
    425      It can be different from |v:ctype| when messages are desired
    426      in a different language than what is used for character
    427      encoding.  See |multi-lang|.
    428    ]=],
    429  },
    430  lc_time = {
    431    type = 'string',
    432    desc = [=[
    433      The current locale setting for time messages of the runtime
    434      environment.  This allows Vim scripts to be aware of the
    435      current language.  Technical: it's the value of LC_TIME.
    436      This variable can not be set directly, use the |:language|
    437      command.  See |multi-lang|.
    438    ]=],
    439  },
    440  lnum = {
    441    type = 'integer',
    442    desc = [=[
    443      Line number for the 'foldexpr' |fold-expr|, 'formatexpr',
    444      'indentexpr' and 'statuscolumn' expressions, tab page number
    445      for 'guitablabel' and 'guitabtooltip'.  Only valid while one of
    446      these expressions is being evaluated.  Read-only when in the
    447      |sandbox|.
    448    ]=],
    449  },
    450  lua = {
    451    desc = [=[
    452      Prefix for calling Lua functions from expressions.
    453      See |v:lua-call| for more information.
    454    ]=],
    455  },
    456  maxcol = {
    457    type = 'integer',
    458    desc = [=[
    459      Maximum line length.  Depending on where it is used it can be
    460      screen columns, characters or bytes.  The value currently is
    461      2147483647 on all systems.
    462    ]=],
    463  },
    464  mouse_col = {
    465    type = 'integer',
    466    desc = [=[
    467      Column number for a mouse click obtained with |getchar()|.
    468      This is the screen column number, like with |virtcol()|.  The
    469      value is zero when there was no mouse button click.
    470    ]=],
    471  },
    472  mouse_lnum = {
    473    type = 'integer',
    474    desc = [=[
    475      Line number for a mouse click obtained with |getchar()|.
    476      This is the text line number, not the screen line number.  The
    477      value is zero when there was no mouse button click.
    478    ]=],
    479  },
    480  mouse_win = {
    481    type = 'integer',
    482    desc = [=[
    483      Window number for a mouse click obtained with |getchar()|.
    484      First window has number 1, like with |winnr()|.  The value is
    485      zero when there was no mouse button click.
    486    ]=],
    487  },
    488  mouse_winid = {
    489    type = 'integer',
    490    desc = [=[
    491      |window-ID| for a mouse click obtained with |getchar()|.
    492      The value is zero when there was no mouse button click.
    493    ]=],
    494  },
    495  msgpack_types = {
    496    type = 'table',
    497    desc = [=[
    498      Dictionary containing msgpack types used by |msgpackparse()|
    499      and |msgpackdump()|. All types inside dictionary are fixed
    500      (not editable) empty lists. To check whether some list is one
    501      of msgpack types, use |is| operator.
    502    ]=],
    503  },
    504  null = {
    505    type = 'vim.NIL',
    506    desc = [=[
    507      Special value used to put "null" in JSON and NIL in msgpack.
    508      See |json_encode()|.  This value is converted to "v:null" when
    509      used as a String (e.g. in |expr5| with string concatenation
    510      operator) and to zero when used as a Number (e.g. in |expr5|
    511      or |expr7| when used with numeric operators).  Read-only.
    512      In some places `v:null` can be used for a List, Dict, etc.
    513      that is not set.  That is slightly different than an empty
    514      List, Dict, etc.
    515    ]=],
    516  },
    517  numbermax = {
    518    type = 'integer',
    519    desc = 'Maximum value of a number.',
    520  },
    521  numbermin = {
    522    type = 'integer',
    523    desc = 'Minimum value of a number (negative).',
    524  },
    525  numbersize = {
    526    type = 'integer',
    527    desc = [=[
    528      Number of bits in a Number.  This is normally 64, but on some
    529      systems it may be 32.
    530    ]=],
    531  },
    532  oldfiles = {
    533    type = 'string[]',
    534    desc = [=[
    535      List of file names that is loaded from the |shada| file on
    536      startup.  These are the files that Vim remembers marks for.
    537      The length of the List is limited by the ' argument of the
    538      'shada' option (default is 100).
    539      When the |shada| file is not used the List is empty.
    540      Also see |:oldfiles| and |c_#<|.
    541      The List can be modified, but this has no effect on what is
    542      stored in the |shada| file later.  If you use values other
    543      than String this will cause trouble.
    544    ]=],
    545  },
    546  operator = {
    547    type = 'string',
    548    desc = [=[
    549      The last operator given in Normal mode.  This is a single
    550      character except for commands starting with <g> or <z>,
    551      in which case it is two characters.  Best used alongside
    552      |v:prevcount| and |v:register|.  Useful if you want to cancel
    553      Operator-pending mode and then use the operator, e.g.: >vim
    554        :omap O <Esc>:call MyMotion(v:operator)<CR>
    555      <
    556      The value remains set until another operator is entered, thus
    557      don't expect it to be empty.
    558      v:operator is not set for |:delete|, |:yank| or other Ex
    559      commands.
    560      Read-only.
    561    ]=],
    562  },
    563  option_command = {
    564    type = 'string',
    565    desc = [=[
    566      Command used to set the option.  Valid while executing an
    567      |OptionSet| autocommand.
    568        value        option was set via ~
    569        "setlocal"   |:setlocal| or `:let l:xxx`
    570        "setglobal"  |:setglobal| or `:let g:xxx`
    571        "set"        |:set| or |:let|
    572        "modeline"   |modeline|
    573    ]=],
    574  },
    575  option_new = {
    576    desc = [=[
    577      New value of the option.  Valid while executing an |OptionSet|
    578      autocommand.
    579    ]=],
    580  },
    581  option_old = {
    582    desc = [=[
    583      Old value of the option.  Valid while executing an |OptionSet|
    584      autocommand.  Depending on the command used for setting and
    585      the kind of option this is either the local old value or the
    586      global old value.
    587    ]=],
    588  },
    589  option_oldglobal = {
    590    desc = [=[
    591      Old global value of the option.  Valid while executing an
    592      |OptionSet| autocommand.
    593    ]=],
    594  },
    595  option_oldlocal = {
    596    desc = [=[
    597      Old local value of the option.  Valid while executing an
    598      |OptionSet| autocommand.
    599    ]=],
    600  },
    601  option_type = {
    602    type = 'string',
    603    desc = [=[
    604      Scope of the set command.  Valid while executing an
    605      |OptionSet| autocommand.  Can be either "global" or "local"
    606    ]=],
    607  },
    608  prevcount = {
    609    type = 'integer',
    610    desc = [=[
    611      The count given for the last but one Normal mode command.
    612      This is the v:count value of the previous command.  Useful if
    613      you want to cancel Visual or Operator-pending mode and then
    614      use the count, e.g.: >vim
    615        :vmap % <Esc>:call MyFilter(v:prevcount)<CR>
    616      <
    617      Read-only.
    618    ]=],
    619  },
    620  profiling = {
    621    type = 'integer',
    622    desc = [=[
    623      Normally zero.  Set to one after using ":profile start".
    624      See |profiling|.
    625    ]=],
    626  },
    627  progname = {
    628    type = 'string',
    629    desc = [=[
    630      The name by which Nvim was invoked (with path removed).
    631      Read-only.
    632    ]=],
    633  },
    634  progpath = {
    635    type = 'string',
    636    desc = [=[
    637      Absolute path to the current running Nvim.
    638      Read-only.
    639    ]=],
    640  },
    641  register = {
    642    type = 'string',
    643    desc = [=[
    644      The name of the register in effect for the current normal mode
    645      command (regardless of whether that command actually used a
    646      register).  Or for the currently executing normal mode mapping
    647      (use this in custom commands that take a register).
    648      If none is supplied it is the default register '"', unless
    649      'clipboard' contains "unnamed" or "unnamedplus", then it is
    650      "*" or '+'.
    651      Also see |getreg()| and |setreg()|
    652    ]=],
    653  },
    654  relnum = {
    655    type = 'integer',
    656    desc = [=[
    657      Relative line number for the 'statuscolumn' expression.
    658      Read-only.
    659    ]=],
    660  },
    661  scrollstart = {
    662    type = 'string',
    663    desc = [=[
    664      String describing the script or function that caused the
    665      screen to scroll up.  It's only set when it is empty, thus the
    666      first reason is remembered.  It is set to "Unknown" for a
    667      typed command.
    668      This can be used to find out why your script causes the
    669      hit-enter prompt.
    670    ]=],
    671  },
    672  searchforward = {
    673    type = 'integer',
    674    desc = [=[
    675      Search direction:  1 after a forward search, 0 after a
    676      backward search.  It is reset to forward when directly setting
    677      the last search pattern, see |quote/|.
    678      Note that the value is restored when returning from a
    679      function. |function-search-undo|.
    680      Read-write.
    681    ]=],
    682  },
    683  servername = {
    684    type = 'string',
    685    desc = [=[
    686      Primary listen-address of Nvim, the first item returned by
    687      |serverlist()|. Usually this is the named pipe created by Nvim
    688      at |startup| or given by |--listen| (or the deprecated
    689      |$NVIM_LISTEN_ADDRESS| env var).
    690 
    691      See also |serverstart()| |serverstop()|.
    692      Read-only.
    693 
    694                                                           *$NVIM*
    695      $NVIM is set to v:servername by |terminal| and |jobstart()|,
    696      and is thus a hint that the current environment is a child
    697      (direct subprocess) of Nvim.
    698 
    699      Example: a child Nvim process can detect and make requests to
    700      its parent Nvim: >lua
    701 
    702        if vim.env.NVIM then
    703          local ok, chan = pcall(vim.fn.sockconnect, 'pipe', vim.env.NVIM, {rpc=true})
    704          if ok and chan then
    705            local client = vim.api.nvim_get_chan_info(chan).client
    706            local rv = vim.rpcrequest(chan, 'nvim_exec_lua', [[return ... + 1]], { 41 })
    707            vim.print(('got "%s" from parent Nvim'):format(rv))
    708          end
    709        end
    710      <
    711    ]=],
    712  },
    713  shell_error = {
    714    type = 'integer',
    715    desc = [=[
    716      Result of the last shell command.  When non-zero, the last
    717      shell command had an error.  When zero, there was no problem.
    718      This only works when the shell returns the error code to Vim.
    719      The value -1 is often used when the command could not be
    720      executed.  Read-only.
    721      Example: >vim
    722        !mv foo bar
    723        if v:shell_error
    724          echo 'could not rename "foo" to "bar"!'
    725        endif
    726      <
    727    ]=],
    728  },
    729  stacktrace = {
    730    type = 'table[]',
    731    desc = [=[
    732      The stack trace of the exception most recently caught and
    733      not finished.  Refer to |getstacktrace()| for the structure of
    734      stack trace.  See also |v:exception|, |v:throwpoint|, and
    735      |throw-variables|.
    736    ]=],
    737  },
    738  statusmsg = {
    739    type = 'string',
    740    desc = [=[
    741      Last given status message.
    742      Modifiable (can be set).
    743    ]=],
    744  },
    745  stderr = {
    746    type = 'integer',
    747    desc = [=[
    748      |channel-id| corresponding to stderr. The value is always 2;
    749      use this variable to make your code more descriptive.
    750      Unlike stdin and stdout (see |stdioopen()|), stderr is always
    751      open for writing. Example: >vim
    752      :call chansend(v:stderr, "error: toaster empty\n")
    753      <
    754    ]=],
    755  },
    756  swapchoice = {
    757    type = 'string',
    758    desc = [=[
    759      |SwapExists| autocommands can set this to the selected choice
    760      for handling an existing swapfile:
    761        'o'    Open read-only
    762        'e'    Edit anyway
    763        'r'    Recover
    764        'd'    Delete swapfile
    765        'q'    Quit
    766        'a'    Abort
    767      The value should be a single-character string.  An empty value
    768      results in the user being asked, as would happen when there is
    769      no SwapExists autocommand.  The default is empty.
    770    ]=],
    771  },
    772  swapcommand = {
    773    type = 'string',
    774    desc = [=[
    775      Normal mode command to be executed after a file has been
    776      opened.  Can be used for a |SwapExists| autocommand to have
    777      another Vim open the file and jump to the right place.  For
    778      example, when jumping to a tag the value is ":tag tagname\r".
    779      For ":edit +cmd file" the value is ":cmd\r".
    780    ]=],
    781  },
    782  swapname = {
    783    type = 'string',
    784    desc = [=[
    785      Name of the swapfile found.
    786      Only valid during |SwapExists| event.
    787      Read-only.
    788    ]=],
    789  },
    790  t_blob = {
    791    type = 'integer',
    792    tags = { 'v:t_TYPE' },
    793    desc = 'Value of |Blob| type.  Read-only.  See: |type()|',
    794  },
    795  t_bool = {
    796    type = 'integer',
    797    desc = 'Value of |Boolean| type.  Read-only.  See: |type()|',
    798  },
    799  t_dict = {
    800    type = 'integer',
    801    desc = 'Value of |Dictionary| type.  Read-only.  See: |type()|',
    802  },
    803  t_float = {
    804    type = 'integer',
    805    desc = 'Value of |Float| type.  Read-only.  See: |type()|',
    806  },
    807  t_func = {
    808    type = 'integer',
    809    desc = 'Value of |Funcref| type.  Read-only.  See: |type()|',
    810  },
    811  t_list = {
    812    type = 'integer',
    813    desc = 'Value of |List| type.  Read-only.  See: |type()|',
    814  },
    815  t_number = {
    816    type = 'integer',
    817    desc = 'Value of |Number| type.  Read-only.  See: |type()|',
    818  },
    819  t_string = {
    820    type = 'integer',
    821    desc = 'Value of |String| type.  Read-only.  See: |type()|',
    822  },
    823  termrequest = {
    824    type = 'string',
    825    desc = [=[
    826      The value of the most recent OSC, DCS or APC control sequence
    827      sent from a process running in the embedded |terminal|.
    828      This can be read in a |TermRequest| event handler to respond
    829      to queries from embedded applications.
    830    ]=],
    831  },
    832  termresponse = {
    833    type = 'string',
    834    desc = [=[
    835      The value of the most recent OSC or DCS control sequence
    836      received by Nvim from the terminal. This can be read in a
    837      |TermResponse| event handler after querying the terminal using
    838      another escape sequence.
    839    ]=],
    840  },
    841  testing = {
    842    type = 'integer',
    843    desc = [=[
    844      Must be set before using `test_garbagecollect_now()`.
    845    ]=],
    846  },
    847  this_session = {
    848    type = 'string',
    849    desc = [=[
    850      Full filename of the last loaded or saved session file.
    851      Empty when no session file has been saved.  See |:mksession|.
    852      Modifiable (can be set).
    853    ]=],
    854  },
    855  throwpoint = {
    856    type = 'string',
    857    desc = [=[
    858      The point where the exception most recently caught and not
    859      finished was thrown.  Not set when commands are typed.  See
    860      also |v:exception|, |v:stacktrace|, and |throw-variables|.
    861      Example: >vim
    862        try
    863          throw "oops"
    864        catch /.*/
    865          echo "Exception from" v:throwpoint
    866        endtry
    867      <
    868      Output: "Exception from test.vim, line 2"
    869    ]=],
    870  },
    871  ['true'] = {
    872    type = 'boolean',
    873    desc = [=[
    874      Special value used to put "true" in JSON and msgpack.  See
    875      |json_encode()|.  This value is converted to "v:true" when used
    876      as a String (e.g. in |expr5| with string concatenation
    877      operator) and to one when used as a Number (e.g. in |expr5| or
    878      |expr7| when used with numeric operators).  Read-only.
    879    ]=],
    880  },
    881  val = {
    882    desc = [=[
    883      Value of the current item of a |List| or |Dictionary|.  Only
    884      valid while evaluating the expression used with |map()| and
    885      |filter()|.  Read-only.
    886    ]=],
    887  },
    888  version = {
    889    type = 'integer',
    890    desc = [=[
    891      Vim version number: major version times 100 plus minor
    892      version.  Vim 5.0 is 500, Vim 5.1 is 501.
    893      Read-only.
    894      Use |has()| to check the Nvim (not Vim) version: >vim
    895        :if has("nvim-0.2.1")
    896      <
    897    ]=],
    898  },
    899  versionlong = {
    900    type = 'integer',
    901    desc = [=[
    902      Like v:version, but also including the patchlevel in the last
    903      four digits.  Version 8.1 with patch 123 has value 8010123.
    904      This can be used like this: >
    905        if v:versionlong >= 8010123
    906      <
    907      However, if there are gaps in the list of patches included
    908      this will not work well.  This can happen if a recent patch
    909      was included into an older version, e.g. for a security fix.
    910      Use the has() function to make sure the patch is actually
    911      included.
    912    ]=],
    913  },
    914  vim_did_enter = {
    915    type = 'integer',
    916    desc = [=[
    917      0 during startup, 1 just before |VimEnter|.
    918      Read-only.
    919    ]=],
    920  },
    921  vim_did_init = {
    922    type = 'integer',
    923    desc = [=[
    924      0 during initialization, 1 after sourcing |vimrc| and just
    925      before |load-plugins|.
    926      Read-only.
    927    ]=],
    928  },
    929  virtnum = {
    930    type = 'integer',
    931    desc = [=[
    932      Virtual line number for the 'statuscolumn' expression.
    933      Negative when drawing the status column for virtual lines, zero
    934      when drawing an actual buffer line, and positive when drawing
    935      the wrapped part of a buffer line.
    936      Read-only.
    937    ]=],
    938  },
    939  warningmsg = {
    940    type = 'string',
    941    desc = [=[
    942      Last given warning message.
    943      Modifiable (can be set).
    944    ]=],
    945  },
    946  windowid = {
    947    type = 'integer',
    948    desc = [=[
    949      Application-specific window "handle" which may be set by any
    950      attached UI. Defaults to zero.
    951      Note: For Nvim |windows| use |winnr()| or |win_getid()|, see
    952      |window-ID|.
    953    ]=],
    954  },
    955 }
    956 
    957 return M