robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

robinmerge: 1dc9728daa1d8a2702

master
501.8 KiB14219 linesraw
1-- Defines all "vimfn" (builtin/"eval"/"Vimscript") functions.
2--
3--- @class vim.EvalFn
4--- @field name? string
5--- @field args? integer|integer[] (default: 0) Number of arguments, list with maximum and minimum number of arguments or list with a minimum number of arguments only.
6--- @field base? integer For methods: the argument to use as the base argument (1-indexed): base->method(). Defaults to BASE_NONE (function cannot be used as a method).
7--- @field func? string (default: "f_{funcname}") C function which implements the vimfn.
8--- @field func_float? string Floating-point C function. Sets func="float_op_wrapper".
9--- @field func_lua? string Function name in `vim._core.vimfn.*` (e.g. "f_hostname"). Sets func="lua_wrapper".
10--- @field fast? boolean Function can run in |api-fast| events. Defaults to false.
11--- @field deprecated? true
12--- @field returns? string|false
13--- @field returns_desc? string
14--- @field generics? string[] Used to write `---@generic` annotations over a function.
15--- @field signature? string
16--- @field desc? string
17--- @field params [string, string, string?][] Each entry is `{name, type, desc?}`; `desc` is only present in API-meta entries.
18--- @field notes? string[]
19--- @field see? string[]
20---
21--- Recommended alternatives if calling from Lua.
22--- `false` means there is no useful Lua replacement to suggest.
23--- @field see_lua? string[]|false
24--- @field lua? false Do not render type information
25--- @field tags? string[] Extra tags
26--- @field data? string Used by gen_eval.lua
27
28-- Usable with the base key: use the last function argument as the method base.
29-- Value is from funcs.h file. "BASE_" prefix is omitted.
30-- local LAST = "BASE_LAST" (currently unused after port of v8.2.1168)
31
32local M = {}
33
34local VARARGS = { { '...', 'any' } }
35
36--- @type table<string,vim.EvalFn>
37M.funcs = {
38  abs = {
39    args = 1,
40    base = 1,
41    desc = [=[
42      Return the absolute value of {expr}.  When {expr} evaluates to
43      a |Float| abs() returns a |Float|.  When {expr} can be
44      converted to a |Number| abs() returns a |Number|.  Otherwise
45      abs() gives an error message and returns -1.
46      Examples: >vim
47      	echo abs(1.456)
48      <	1.456  >vim
49      	echo abs(-5.456)
50      <	5.456  >vim
51      	echo abs(-4)
52      <	4
53
54    ]=],
55    name = 'abs',
56    params = { { 'expr', 'number' } },
57    signature = 'abs({expr})',
58    returns = 'number',
59    see_lua = { '|math.abs()|' },
60  },
61  acos = {
62    args = 1,
63    base = 1,
64    desc = [=[
65      Return the arc cosine of {expr} measured in radians, as a
66      |Float| in the range of [0, pi].
67      {expr} must evaluate to a |Float| or a |Number| in the range
68      [-1, 1].
69      Returns NaN if {expr} is outside the range [-1, 1].  Returns
70      0.0 if {expr} is not a |Float| or a |Number|.
71      Examples: >vim
72      	echo acos(0)
73      <	1.570796 >vim
74      	echo acos(-0.5)
75      <	2.094395
76
77    ]=],
78    func_float = 'acos',
79    name = 'acos',
80    params = { { 'expr', 'number' } },
81    returns = 'number',
82    signature = 'acos({expr})',
83    see_lua = { '|math.acos()|' },
84  },
85  add = {
86    args = 2,
87    base = 1,
88    desc = [=[
89      Append the item {expr} to |List| or |Blob| {object}.  Returns
90      the resulting |List| or |Blob|.  Examples: >vim
91      	let alist = add([1, 2, 3], item)
92      	call add(mylist, "woodstock")
93      <Note that when {expr} is a |List| it is appended as a single
94      item.  Use |extend()| to concatenate |Lists|.
95      When {object} is a |Blob| then {expr} must be a number.
96      Use |insert()| to add an item at another position.
97      Returns 1 if {object} is not a |List| or a |Blob|.
98
99    ]=],
100    name = 'add',
101    params = { { 'object', 'any' }, { 'expr', 'any' } },
102    returns = 'any',
103    returns_desc = [=[Resulting |List| or |Blob|, or 1 if {object} is not a |List| or a |Blob|.]=],
104    signature = 'add({object}, {expr})',
105    see_lua = { '|table.insert()| for lists and `..` for blobs' },
106  },
107  ['and'] = {
108    args = 2,
109    base = 1,
110    desc = [=[
111      Bitwise AND on the two arguments.  The arguments are converted
112      to a number.  A List, Dict or Float argument causes an error.
113      Also see |or()| and |xor()|.
114      Example: >vim
115      	let flag = and(bits, 0x80)
116      <
117    ]=],
118    name = 'and',
119    params = { { 'expr', 'number' }, { 'expr', 'number' } },
120    returns = 'integer',
121    signature = 'and({expr}, {expr})',
122    see_lua = { '|bit.band()|' },
123  },
124  api_info = {
125    desc = [=[
126      Returns Dictionary of |api-metadata|.
127
128      View it in a nice human-readable format: >vim
129             lua vim.print(vim.fn.api_info())
130      <
131    ]=],
132    fast = true,
133    name = 'api_info',
134    params = {},
135    returns = 'table',
136    signature = 'api_info()',
137  },
138  append = {
139    args = 2,
140    base = 2,
141    desc = [=[
142      When {text} is a |List|: Append each item of the |List| as a
143      text line below line {lnum} in the current buffer.
144      Otherwise append {text} as one text line below line {lnum} in
145      the current buffer.
146      Any type of item is accepted and converted to a String.
147      {lnum} can be zero to insert a line before the first one.
148      {lnum} is used like with |getline()|.
149      Returns 1 for failure ({lnum} out of range or out of memory),
150      0 for success.  When {text} is an empty list zero is returned,
151      no matter the value of {lnum}.  Example: >vim
152      	let failed = append(line('$'), "# THE END")
153      	let failed = append(0, ["Chapter 1", "the beginning"])
154      <
155
156    ]=],
157    name = 'append',
158    params = { { 'lnum', 'integer|string' }, { 'text', 'string|string[]' } },
159    returns = '0|1',
160    signature = 'append({lnum}, {text})',
161    see_lua = { '|nvim_buf_set_lines()|' },
162  },
163  appendbufline = {
164    args = 3,
165    base = 3,
166    desc = [=[
167      Like |append()| but append the text in buffer {buf}.
168
169      This function works only for loaded buffers.  First call
170      |bufload()| if needed.
171
172      For the use of {buf}, see |bufname()|.
173
174      {lnum} is the line number to append below.  Note that using
175      |line()| would use the current buffer, not the one appending
176      to.  Use "$" to append at the end of the buffer.  Other string
177      values are not supported.
178
179      On success 0 is returned, on failure 1 is returned.
180
181      If {buf} is not a valid buffer or {lnum} is not valid, an
182      error message is given.  Example: >vim
183      	let failed = appendbufline(13, 0, "# THE START")
184      <However, when {text} is an empty list then no error is given
185      for an invalid {lnum}, since {lnum} isn't actually used.
186
187    ]=],
188    name = 'appendbufline',
189    params = { { 'buf', 'integer|string' }, { 'lnum', 'integer' }, { 'text', 'string' } },
190    returns = '0|1',
191    signature = 'appendbufline({buf}, {lnum}, {text})',
192    see_lua = { '|nvim_buf_set_lines()|' },
193  },
194  argc = {
195    args = { 0, 1 },
196    desc = [=[
197      The result is the number of files in the argument list.  See
198      |arglist|.
199      If {winid} is not supplied, the argument list of the current
200      window is used.
201      If {winid} is -1, the global argument list is used.
202      Otherwise {winid} (a |window-number| or |window-ID|) specifies
203      the window of which the argument list is used.
204      Returns -1 if the {winid} argument is invalid.
205    ]=],
206    name = 'argc',
207    params = { { 'winid', 'integer' } },
208    returns = 'integer',
209    signature = 'argc([{winid}])',
210  },
211  argidx = {
212    desc = [=[
213      The result is the current index in the argument list.  0 is
214      the first file.  |argc()| - 1 is the last one.  See |arglist|.
215    ]=],
216    name = 'argidx',
217    params = {},
218    returns = 'integer',
219    signature = 'argidx()',
220  },
221  arglistid = {
222    args = { 0, 2 },
223    desc = [=[
224      Return the argument list ID.  This is a number which
225      identifies the argument list being used.  Zero is used for the
226      global argument list.  See |arglist|.
227      Returns -1 if the arguments are invalid.
228
229      Without arguments use the current window.
230      With {winnr} only use this window in the current tabpage.
231      With {winnr} and {tabnr} use the window in the specified tab
232      page.
233      {winnr} is a |window-number| or |window-ID|.
234    ]=],
235    name = 'arglistid',
236    params = { { 'winnr', 'integer' }, { 'tabnr', 'integer' } },
237    returns = 'integer',
238    signature = 'arglistid([{winnr} [, {tabnr}]])',
239  },
240  argv = {
241    args = { 0, 2 },
242    desc = [=[
243      The result is the {nr}th file in the argument list.  See
244      |arglist|.  "argv(0)" is the first one.  Example: >vim
245      	let i = 0
246      	while i < argc()
247      	  let f = escape(fnameescape(argv(i)), '.')
248      	  exe 'amenu Arg.' .. f .. ' :e ' .. f .. '<CR>'
249      	  let i = i + 1
250      	endwhile
251      <Without the {nr} argument, or when {nr} is -1, a |List| with
252      the whole |arglist| is returned.
253
254      The {winid} argument is a |window-ID|, see |argc()|.
255      For the Vim command line arguments see |v:argv|.
256
257      Returns an empty string if {nr}th argument is not present in
258      the argument list.  Returns an empty List if the {winid}
259      argument is invalid.
260    ]=],
261    name = 'argv',
262    params = { { 'nr', 'integer' }, { 'winid', 'integer' } },
263    returns = 'string|string[]',
264    signature = 'argv([{nr} [, {winid}]])',
265  },
266  asin = {
267    args = 1,
268    base = 1,
269    desc = [=[
270      Return the arc sine of {expr} measured in radians, as a |Float|
271      in the range of [-pi/2, pi/2].
272      {expr} must evaluate to a |Float| or a |Number| in the range
273      [-1, 1].
274      Returns NaN if {expr} is outside the range [-1, 1].  Returns
275      0.0 if {expr} is not a |Float| or a |Number|.
276      Examples: >vim
277      	echo asin(0.8)
278      <	0.927295 >vim
279      	echo asin(-0.5)
280      <	-0.523599
281
282    ]=],
283    func_float = 'asin',
284    name = 'asin',
285    params = { { 'expr', 'any' } },
286    returns = 'number',
287    signature = 'asin({expr})',
288    see_lua = { '|math.asin()|' },
289  },
290  assert_beeps = {
291    args = 1,
292    base = 1,
293    desc = [=[
294      Run {cmd} and add an error message to |v:errors| if it does
295      NOT produce a beep or visual bell.
296      Also see |assert_fails()|, |assert_nobeep()| and
297      |assert-return|.
298
299    ]=],
300    name = 'assert_beeps',
301    params = { { 'cmd', 'string' } },
302    returns = '0|1',
303    signature = 'assert_beeps({cmd})',
304  },
305  assert_equal = {
306    args = { 2, 3 },
307    base = 2,
308    desc = [=[
309      When {expected} and {actual} are not equal an error message is
310      added to |v:errors| and 1 is returned.  Otherwise zero is
311      returned. |assert-return|
312      The error is in the form "Expected {expected} but got
313      {actual}".  When {msg} is present it is prefixed to that,
314      along with the location of the assert when run from a script.
315
316      There is no automatic conversion, the String "4" is different
317      from the Number 4.  And the number 4 is different from the
318      Float 4.0.  The value of 'ignorecase' is not used here, case
319      always matters.
320      Example: >vim
321      	call assert_equal('foo', 'bar', 'baz')
322      <Will add the following to |v:errors|: >
323      	test.vim line 12: baz: Expected 'foo' but got 'bar'
324      <
325    ]=],
326    name = 'assert_equal',
327    params = { { 'expected', 'any' }, { 'actual', 'any' }, { 'msg', 'any' } },
328    returns = '0|1',
329    signature = 'assert_equal({expected}, {actual} [, {msg}])',
330    see_lua = { '|assert()| with |vim.deep_equal()|' },
331  },
332  assert_equalfile = {
333    args = { 2, 3 },
334    base = 1,
335    desc = [=[
336      When the files {fname_one} and {fname_two} do not contain
337      exactly the same text an error message is added to |v:errors|.
338      Also see |assert-return|.
339      When {fname_one} or {fname_two} does not exist the error will
340      mention that.
341
342    ]=],
343    name = 'assert_equalfile',
344    params = { { 'fname_one', 'string' }, { 'fname_two', 'string' } },
345    returns = '0|1',
346    signature = 'assert_equalfile({fname_one}, {fname_two})',
347  },
348  assert_exception = {
349    args = { 1, 2 },
350    desc = [=[
351      When v:exception does not contain the string {error} an error
352      message is added to |v:errors|.  Also see |assert-return|.
353      This can be used to assert that a command throws an exception.
354      Using the error number, followed by a colon, avoids problems
355      with translations: >vim
356      	try
357      	  commandthatfails
358      	  call assert_false(1, 'command should have failed')
359      	catch
360      	  call assert_exception('E492:')
361      	endtry
362      <
363    ]=],
364    name = 'assert_exception',
365    params = { { 'error', 'any' }, { 'msg', 'any' } },
366    returns = '0|1',
367    signature = 'assert_exception({error} [, {msg}])',
368    see_lua = false,
369  },
370  assert_fails = {
371    args = { 1, 5 },
372    base = 1,
373    desc = [=[
374      Run {cmd} and add an error message to |v:errors| if it does
375      NOT produce an error or when {error} is not found in the
376      error message.  Also see |assert-return|.
377
378      When {error} is a string it must be found literally in the
379      first reported error. Most often this will be the error code,
380      including the colon, e.g. "E123:". >vim
381      	call assert_fails('bad cmd', 'E987:')
382      <
383      When {error} is a |List| with one or two strings, these are
384      used as patterns.  The first pattern is matched against the
385      first reported error: >vim
386      	call assert_fails('cmd', ['E987:.*expected bool'])
387      <The second pattern, if present, is matched against the last
388      reported error.  To only match the last error use an empty
389      string for the first error: >vim
390      	call assert_fails('cmd', ['', 'E987:'])
391      <
392      If {msg} is empty then it is not used.  Do this to get the
393      default message when passing the {lnum} argument.
394      					*E1115*
395      When {lnum} is present and not negative, and the {error}
396      argument is present and matches, then this is compared with
397      the line number at which the error was reported. That can be
398      the line number in a function or in a script.
399      					*E1116*
400      When {context} is present it is used as a pattern and matched
401      against the context (script name or function name) where
402      {lnum} is located in.
403
404      Note that beeping is not considered an error, and some failing
405      commands only beep.  Use |assert_beeps()| for those.
406
407    ]=],
408    name = 'assert_fails',
409    params = {
410      { 'cmd', 'string' },
411      { 'error', 'any' },
412      { 'msg', 'any' },
413      { 'lnum', 'integer' },
414      { 'context', 'any' },
415    },
416    returns = '0|1',
417    signature = 'assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])',
418    see_lua = false,
419  },
420  assert_false = {
421    args = { 1, 2 },
422    base = 1,
423    desc = [=[
424      When {actual} is not false an error message is added to
425      |v:errors|, like with |assert_equal()|.
426      The error is in the form "Expected False but got {actual}".
427      When {msg} is present it is prefixed to that, along with the
428      location of the assert when run from a script.
429      Also see |assert-return|.
430
431      A value is false when it is zero. When {actual} is not a
432      number the assert fails.
433
434    ]=],
435    name = 'assert_false',
436    params = { { 'actual', 'any' }, { 'msg', 'any' } },
437    returns = '0|1',
438    signature = 'assert_false({actual} [, {msg}])',
439    see_lua = { '|assert()|' },
440  },
441  assert_inrange = {
442    args = { 3, 4 },
443    base = 3,
444    desc = [=[
445      This asserts number and |Float| values.  When {actual}  is lower
446      than {lower} or higher than {upper} an error message is added
447      to |v:errors|.  Also see |assert-return|.
448      The error is in the form "Expected range {lower} - {upper},
449      but got {actual}".  When {msg} is present it is prefixed to
450      that.
451    ]=],
452    name = 'assert_inrange',
453    params = {
454      { 'lower', 'number' },
455      { 'upper', 'number' },
456      { 'actual', 'number' },
457      { 'msg', 'string' },
458    },
459    returns = '0|1',
460    signature = 'assert_inrange({lower}, {upper}, {actual} [, {msg}])',
461    see_lua = { '|assert()|' },
462  },
463  assert_match = {
464    args = { 2, 3 },
465    base = 2,
466    desc = [=[
467      When {pattern} does not match {actual} an error message is
468      added to |v:errors|.  Also see |assert-return|.
469      The error is in the form "Pattern {pattern} does not match
470      {actual}".  When {msg} is present it is prefixed to that,
471      along with the location of the assert when run from a script.
472
473      {pattern} is used as with |expr-=~|: The matching is always done
474      like 'magic' was set and 'cpoptions' is empty, no matter what
475      the actual value of 'magic' or 'cpoptions' is.
476
477      {actual} is used as a string, automatic conversion applies.
478      Use "^" and "$" to match with the start and end of the text.
479      Use both to match the whole text.
480
481      Example: >vim
482      	call assert_match('^f.*o$', 'foobar')
483      <Will result in a string to be added to |v:errors|: >
484      	test.vim line 12: Pattern '^f.*o$' does not match 'foobar'
485      <
486    ]=],
487    name = 'assert_match',
488    params = { { 'pattern', 'string' }, { 'actual', 'string' }, { 'msg', 'string' } },
489    returns = '0|1',
490    signature = 'assert_match({pattern}, {actual} [, {msg}])',
491  },
492  assert_nobeep = {
493    args = 1,
494    base = 1,
495    desc = [=[
496      Run {cmd} and add an error message to |v:errors| if it
497      produces a beep or visual bell.
498      Also see |assert_beeps()|.
499
500    ]=],
501    name = 'assert_nobeep',
502    params = { { 'cmd', 'string' } },
503    returns = '0|1',
504    signature = 'assert_nobeep({cmd})',
505  },
506  assert_notequal = {
507    args = { 2, 3 },
508    base = 2,
509    desc = [=[
510      The opposite of `assert_equal()`: add an error message to
511      |v:errors| when {expected} and {actual} are equal.
512      Also see |assert-return|.
513
514    ]=],
515    name = 'assert_notequal',
516    params = { { 'expected', 'any' }, { 'actual', 'any' }, { 'msg', 'any' } },
517    returns = '0|1',
518    signature = 'assert_notequal({expected}, {actual} [, {msg}])',
519  },
520  assert_notmatch = {
521    args = { 2, 3 },
522    base = 2,
523    desc = [=[
524      The opposite of `assert_match()`: add an error message to
525      |v:errors| when {pattern} matches {actual}.
526      Also see |assert-return|.
527
528    ]=],
529    name = 'assert_notmatch',
530    params = { { 'pattern', 'string' }, { 'actual', 'string' }, { 'msg', 'string' } },
531    returns = '0|1',
532    signature = 'assert_notmatch({pattern}, {actual} [, {msg}])',
533  },
534  assert_report = {
535    args = 1,
536    base = 1,
537    desc = [=[
538      Report a test failure directly, using String {msg}.
539      Always returns one.
540
541    ]=],
542    name = 'assert_report',
543    params = { { 'msg', 'string' } },
544    returns = '0|1',
545    signature = 'assert_report({msg})',
546  },
547  assert_true = {
548    args = { 1, 2 },
549    base = 1,
550    desc = [=[
551      When {actual} is not true an error message is added to
552      |v:errors|, like with |assert_equal()|.
553      Also see |assert-return|.
554      A value is |TRUE| when it is a non-zero number or |v:true|.
555      When {actual} is not a number or |v:true| the assert fails.
556      When {msg} is given it is prefixed to the default message,
557      along with the location of the assert when run from a script.
558
559    ]=],
560    name = 'assert_true',
561    params = { { 'actual', 'any' }, { 'msg', 'string' } },
562    returns = '0|1',
563    signature = 'assert_true({actual} [, {msg}])',
564    see_lua = { '|assert()|' },
565  },
566  atan = {
567    args = 1,
568    base = 1,
569    desc = [=[
570      Return the principal value of the arc tangent of {expr}, in
571      the range [-pi/2, +pi/2] radians, as a |Float|.
572      {expr} must evaluate to a |Float| or a |Number|.
573      Returns 0.0 if {expr} is not a |Float| or a |Number|.
574      Examples: >vim
575      	echo atan(100)
576      <	1.560797 >vim
577      	echo atan(-4.01)
578      <	-1.326405
579
580    ]=],
581    func_float = 'atan',
582    name = 'atan',
583    params = { { 'expr', 'number' } },
584    returns = 'number',
585    signature = 'atan({expr})',
586    see_lua = { '|math.atan()|' },
587  },
588  atan2 = {
589    args = 2,
590    base = 1,
591    desc = [=[
592      Return the arc tangent of {expr1} / {expr2}, measured in
593      radians, as a |Float| in the range [-pi, pi].
594      {expr1} and {expr2} must evaluate to a |Float| or a |Number|.
595      Returns 0.0 if {expr1} or {expr2} is not a |Float| or a
596      |Number|.
597      Examples: >vim
598      	echo atan2(-1, 1)
599      <	-0.785398 >vim
600      	echo atan2(1, -1)
601      <	2.356194
602
603    ]=],
604    name = 'atan2',
605    params = { { 'expr1', 'number' }, { 'expr2', 'number' } },
606    returns = 'number',
607    signature = 'atan2({expr1}, {expr2})',
608    see_lua = { '|math.atan2()|' },
609  },
610  blob2list = {
611    args = 1,
612    base = 1,
613    desc = [=[
614      Return a List containing the number value of each byte in Blob
615      {blob}.  Examples: >vim
616      	blob2list(0z0102.0304)	" returns [1, 2, 3, 4]
617      	blob2list(0z)		" returns []
618      <Returns an empty List on error.  |list2blob()| does the
619      opposite.
620
621    ]=],
622    name = 'blob2list',
623    params = { { 'blob', 'any' } },
624    returns = 'any[]',
625    signature = 'blob2list({blob})',
626    see_lua = false,
627  },
628  browse = {
629    args = 4,
630    desc = [=[
631      Put up a file requester.  This only works when "has("browse")"
632      returns |TRUE| (only in some GUI versions).
633      The input fields are:
634          {save}	when |TRUE|, select file to write
635          {title}	title for the requester
636          {initdir}	directory to start browsing in
637          {default}	default file name
638      An empty string is returned when the "Cancel" button is hit,
639      something went wrong, or browsing is not possible.
640    ]=],
641    name = 'browse',
642    params = {
643      { 'save', 'any' },
644      { 'title', 'string' },
645      { 'initdir', 'string' },
646      { 'default', 'string' },
647    },
648    returns = '0|1',
649    signature = 'browse({save}, {title}, {initdir}, {default})',
650  },
651  browsedir = {
652    args = 2,
653    desc = [=[
654      Put up a directory requester.  This only works when
655      "has("browse")" returns |TRUE| (only in some GUI versions).
656      On systems where a directory browser is not supported a file
657      browser is used.  In that case: select a file in the directory
658      to be used.
659      The input fields are:
660          {title}	title for the requester
661          {initdir}	directory to start browsing in
662      When the "Cancel" button is hit, something went wrong, or
663      browsing is not possible, an empty string is returned.
664    ]=],
665    name = 'browsedir',
666    params = { { 'title', 'string' }, { 'initdir', 'string' } },
667    returns = '0|1',
668    signature = 'browsedir({title}, {initdir})',
669  },
670  bufadd = {
671    args = 1,
672    base = 1,
673    desc = [=[
674      Adds buffer {name} to the |buffer-list| literally: no special
675      chars or expansion are applied (including "~"). Returns the
676      new (or existing matching) buffer number, or 0 on error.
677
678      The buffer is not loaded and 'buflisted' is not set. When
679      {name} is an empty string, a new buffer is always created.
680
681      Example (Lua): >lua
682      	local buf = vim.fn.bufadd(vim.fs.normalize('someName'))
683      	-- Set 'buflisted'; trigger BufReadPre/BufReadPost/FileType.
684      	vim.api.nvim_buf_call(buf, vim.cmd.edit)
685      <
686    ]=],
687    name = 'bufadd',
688    params = { { 'name', 'string' } },
689    returns = 'integer',
690    signature = 'bufadd({name})',
691    see_lua = false,
692  },
693  bufexists = {
694    args = 1,
695    base = 1,
696    desc = [=[
697      Checks whether a buffer with the name or number {buf} exists.
698      Returns |TRUE| if the buffer exists, |FALSE| otherwise.
699      If the {buf} argument is a number, buffer numbers are used.
700      Number zero is the alternate buffer for the current window.
701
702      If the {buf} argument is a string it must match a buffer name
703      exactly.  The name can be:
704      - Relative to the current directory.
705      - A full path.
706      - The name of a buffer with 'buftype' set to "nofile".
707      - A URL name.
708      Unlisted buffers will be found.
709      Note that help files are listed by their short name in the
710      output of |:buffers|, but bufexists() requires using their
711      long name to be able to find them.
712      bufexists() may report a buffer exists, but to use the name
713      with a |:buffer| command you may need to use |expand()|.  Esp
714      for MS-Windows 8.3 names in the form "c:\DOCUME~1"
715      Use "bufexists(0)" to test for the existence of an alternate
716      file name.
717
718    ]=],
719    name = 'bufexists',
720    params = { { 'buf', 'any' } },
721    returns = '0|1',
722    signature = 'bufexists({buf})',
723    see_lua = { '|nvim_buf_is_valid()| after resolving {buf} to a bufnr' },
724  },
725  buffer_exists = {
726    args = 1,
727    base = 1,
728    deprecated = true,
729    desc = [=[
730      Obsolete name for |bufexists()|.
731    ]=],
732    func = 'f_bufexists',
733    name = 'buffer_exists',
734    params = VARARGS,
735    returns = '0|1',
736    signature = 'buffer_exists({buf})',
737    see_lua = { '|nvim_buf_is_valid()| after resolving {buf} to a bufnr' },
738  },
739  buffer_name = {
740    args = { 0, 1 },
741    base = 1,
742    deprecated = true,
743    desc = [=[
744      Obsolete name for |bufname()|.
745    ]=],
746    func = 'f_bufname',
747    name = 'buffer_name',
748    params = VARARGS,
749    returns = 'string',
750    signature = 'buffer_name([{buf}])',
751    see_lua = { '|nvim_buf_get_name()| after resolving {buf} to a bufnr' },
752  },
753  buffer_number = {
754    args = { 0, 1 },
755    base = 1,
756    deprecated = true,
757    desc = [=[
758      Obsolete name for |bufnr()|.
759    ]=],
760    func = 'f_bufnr',
761    name = 'buffer_number',
762    params = VARARGS,
763    returns = 'integer',
764    signature = 'buffer_number([{buf} [, {create}]])',
765    see_lua = {
766      '|nvim_get_current_buf()| when omitted, or |nvim_create_buf()| with |nvim_buf_set_name()| for creating; name lookup, "$", "%", "#", and {create} semantics differ',
767    },
768  },
769  buflisted = {
770    args = 1,
771    base = 1,
772    desc = [=[
773      Checks whether a buffer called {buf} exists and is listed
774      (has the 'buflisted' option set).  Returns |TRUE| if so,
775      |FALSE| otherwise.
776      The {buf} argument is used like with |bufexists()|.
777
778    ]=],
779    name = 'buflisted',
780    params = { { 'buf', 'any' } },
781    returns = '0|1',
782    signature = 'buflisted({buf})',
783    see_lua = { '|vim.bo| or |nvim_get_option_value()| after resolving {buf} to a bufnr' },
784  },
785  bufload = {
786    args = 1,
787    base = 1,
788    desc = [=[
789      Ensure the buffer {buf} is loaded.  When the buffer name
790      refers to an existing file then the file is read.  Otherwise
791      the buffer will be empty.  If the buffer was already loaded
792      then there is no change.  If the buffer is not related to a
793      file then no file is read (e.g., when 'buftype' is "nofile").
794      If there is an existing swap file for the file of the buffer,
795      there will be no dialog, the buffer will be loaded anyway.
796      The {buf} argument is used like with |bufexists()|.
797
798    ]=],
799    name = 'bufload',
800    params = { { 'buf', 'any' } },
801    returns = false,
802    signature = 'bufload({buf})',
803  },
804  bufloaded = {
805    args = 1,
806    base = 1,
807    desc = [=[
808      Checks whether a buffer called {buf} exists and is loaded
809      (shown in a window or hidden).  Returns |TRUE| if so,
810      |FALSE| otherwise.
811      The {buf} argument is used like with |bufexists()|.
812
813    ]=],
814    name = 'bufloaded',
815    params = { { 'buf', 'any' } },
816    returns = '0|1',
817    signature = 'bufloaded({buf})',
818    see_lua = { '|nvim_buf_is_loaded()| after resolving {buf} to a bufnr' },
819  },
820  bufname = {
821    args = { 0, 1 },
822    base = 1,
823    desc = [=[
824      The result is the name of a buffer.  Mostly as it is displayed
825      by the `:ls` command, but not using special names such as
826      "[No Name]".  If the buffer represents a directory, the name
827      ends with a path separator, unless it was changed by |:file| or
828      |nvim_buf_set_name()|.
829      If {buf} is omitted the current buffer is used.
830      If {buf} is a Number, that buffer number's name is given.
831      Number zero is the alternate buffer for the current window.
832      If {buf} is a String, it is used as a |file-pattern| to match
833      with the buffer names.  This is always done like 'magic' is
834      set and 'cpoptions' is empty.  When there is more than one
835      match an empty string is returned.
836      "" or "%" can be used for the current buffer, "#" for the
837      alternate buffer.
838      A full match is preferred, otherwise a match at the start, end
839      or middle of the buffer name is accepted.  If you only want a
840      full match then put "^" at the start and "$" at the end of the
841      pattern.
842      Listed buffers are found first.  If there is a single match
843      with a listed buffer, that one is returned.  Next unlisted
844      buffers are searched for.
845      If the {buf} is a String, but you want to use it as a buffer
846      number, force it to be a Number by adding zero to it: >vim
847      	echo bufname("3" + 0)
848      <If the buffer doesn't exist, or doesn't have a name, an empty
849      string is returned. >vim
850      	echo bufname("#")	" alternate buffer name
851      	echo bufname(3)		" name of buffer 3
852      	echo bufname("%")	" name of current buffer
853      	echo bufname("file2")	" name of buffer where "file2" matches.
854      <
855    ]=],
856    name = 'bufname',
857    params = { { 'buf', 'integer|string' } },
858    returns = 'string',
859    signature = 'bufname([{buf}])',
860    see_lua = { '|nvim_buf_get_name()| after resolving {buf} to a bufnr' },
861  },
862  bufnr = {
863    args = { 0, 2 },
864    base = 1,
865    desc = [=[
866      The result is the number of a buffer, as it is displayed by
867      the `:ls` command.  For the use of {buf}, see |bufname()|
868      above.
869      If the buffer doesn't exist, -1 is returned.  Or, if the
870      {create} argument is present and TRUE, a new, unlisted,
871      buffer is created and its number is returned.  Example: >vim
872      	let newbuf = bufnr('Scratch001', 1)
873      <Using an empty name uses the current buffer.  To create a new
874      buffer with an empty name use |bufadd()|.
875
876      bufnr("$") is the last buffer: >vim
877      	let last_buffer = bufnr("$")
878      <The result is a Number, which is the highest buffer number
879      of existing buffers.  Note that not all buffers with a smaller
880      number necessarily exist, because ":bwipeout" may have removed
881      them.  Use |bufexists()| to test for the existence of a buffer.
882
883    ]=],
884    name = 'bufnr',
885    params = { { 'buf', 'integer|string' }, { 'create', 'any' } },
886    returns = 'integer',
887    signature = 'bufnr([{buf} [, {create}]])',
888    see_lua = {
889      '|nvim_get_current_buf()| when omitted, or |nvim_create_buf()| with |nvim_buf_set_name()| for creating; name lookup, "$", "%", "#", and {create} semantics differ',
890    },
891  },
892  bufwinid = {
893    args = 1,
894    base = 1,
895    desc = [=[
896      Returns the |window-ID| of the first window associated with
897      buffer {buf}.  For the use of {buf}, see |bufname()| above.
898      If buffer {buf} doesn't exist or there is no such window, -1
899      is returned.  Example: >vim
900
901      	echo "A window containing buffer 1 is " .. (bufwinid(1))
902      <
903      Only deals with the current tabpage.  See |win_findbuf()| for
904      finding more.
905
906    ]=],
907    name = 'bufwinid',
908    params = { { 'buf', 'any' } },
909    returns = 'integer',
910    signature = 'bufwinid({buf})',
911    see_lua = {
912      '|nvim_tabpage_list_wins()| with |nvim_win_get_buf()| after resolving {buf}; only the current tabpage is checked and no-match semantics differ',
913    },
914  },
915  bufwinnr = {
916    args = 1,
917    base = 1,
918    desc = [=[
919      Like |bufwinid()| but returns a |window-number| instead of a
920      |window-ID|.
921      If buffer {buf} doesn't exist or there is no such window, -1
922      is returned.  Example: >vim
923
924      	echo "A window containing buffer 1 is " .. (bufwinnr(1))
925
926      <The number can be used with |CTRL-W_w| and ":wincmd w"
927      |:wincmd|.
928
929    ]=],
930    name = 'bufwinnr',
931    params = { { 'buf', 'any' } },
932    returns = 'integer',
933    signature = 'bufwinnr({buf})',
934    see_lua = {
935      '|nvim_tabpage_list_wins()| with |nvim_win_get_buf()| and |nvim_win_get_number()| after resolving {buf}; only the current tabpage is checked and no-match semantics differ',
936    },
937  },
938  byte2line = {
939    args = 1,
940    base = 1,
941    desc = [=[
942      Return the line number that contains the character at byte
943      count {byte} in the current buffer.  This includes the
944      end-of-line character, depending on the 'fileformat' option
945      for the current buffer.  The first character has byte count
946      one.
947      Also see |line2byte()|, |go| and |:goto|.
948
949      Returns -1 if the {byte} value is invalid.
950
951    ]=],
952    name = 'byte2line',
953    params = { { 'byte', 'any' } },
954    returns = 'integer',
955    signature = 'byte2line({byte})',
956  },
957  byteidx = {
958    args = { 2, 3 },
959    base = 1,
960    desc = [=[
961      Return byte index of the {nr}th character in the String
962      {expr}.  Use zero for the first character, it then returns
963      zero.
964      If there are no multibyte characters the returned value is
965      equal to {nr}.
966      Composing characters are not counted separately, their byte
967      length is added to the preceding base character.  See
968      |byteidxcomp()| below for counting composing characters
969      separately.
970      When {utf16} is present and TRUE, {nr} is used as the UTF-16
971      index in the String {expr} instead of as the character index.
972      The UTF-16 index is the index in the string when it is encoded
973      with 16-bit words.  If the specified UTF-16 index is in the
974      middle of a character (e.g. in a 4-byte character), then the
975      byte index of the first byte in the character is returned.
976      Refer to |string-offset-encoding| for more information.
977      Example : >vim
978      	echo matchstr(str, ".", byteidx(str, 3))
979      <will display the fourth character.  Another way to do the
980      same: >vim
981      	let s = strpart(str, byteidx(str, 3))
982      	echo strpart(s, 0, byteidx(s, 1))
983      <Also see |strgetchar()| and |strcharpart()|.
984
985      If there are less than {nr} characters -1 is returned.
986      If there are exactly {nr} characters the length of the string
987      in bytes is returned.
988      See |charidx()| and |utf16idx()| for getting the character and
989      UTF-16 index respectively from the byte index.
990      Examples: >vim
991      	echo byteidx('a😊😊', 2)	" returns 5
992      	echo byteidx('a😊😊', 2, 1)	" returns 1
993      	echo byteidx('a😊😊', 3, 1)	" returns 5
994      <
995    ]=],
996    fast = true,
997    name = 'byteidx',
998    params = { { 'expr', 'any' }, { 'nr', 'integer' }, { 'utf16', 'any' } },
999    returns = 'integer',
1000    signature = 'byteidx({expr}, {nr} [, {utf16}])',
1001    see_lua = {
1002      '|vim.str_byteindex()| for string input with `"utf-32"` or `"utf-16"` and `strict_indexing = false`; composing characters and out-of-range semantics differ',
1003    },
1004  },
1005  byteidxcomp = {
1006    args = { 2, 3 },
1007    base = 1,
1008    desc = [=[
1009      Like |byteidx()|, except that a composing character is counted
1010      as a separate character.  Example: >vim
1011      	let s = 'e' .. nr2char(0x301)
1012      	echo byteidx(s, 1)
1013      	echo byteidxcomp(s, 1)
1014      	echo byteidxcomp(s, 2)
1015      <The first and third echo result in 3 ('e' plus composing
1016      character is 3 bytes), the second echo results in 1 ('e' is
1017      one byte).
1018
1019    ]=],
1020    fast = true,
1021    name = 'byteidxcomp',
1022    params = { { 'expr', 'any' }, { 'nr', 'integer' }, { 'utf16', 'any' } },
1023    returns = 'integer',
1024    signature = 'byteidxcomp({expr}, {nr} [, {utf16}])',
1025    see_lua = {
1026      '|vim.str_byteindex()| with `"utf-32"` or `"utf-16"` and `strict_indexing = false`',
1027    },
1028  },
1029  call = {
1030    args = { 2, 3 },
1031    base = 1,
1032    desc = [=[
1033      Call function {func} with the items in |List| {arglist} as
1034      arguments.
1035      {func} can either be a |Funcref| or the name of a function.
1036      a:firstline and a:lastline are set to the cursor line.
1037      Returns the return value of the called function.
1038      {dict} is for functions with the "dict" attribute.  It will be
1039      used to set the local variable "self". |Dictionary-function|
1040
1041    ]=],
1042    name = 'call',
1043    params = { { 'func', 'any' }, { 'arglist', 'any' }, { 'dict', 'any' } },
1044    returns = 'any',
1045    signature = 'call({func}, {arglist} [, {dict}])',
1046    tags = { 'E699' },
1047    see_lua = false,
1048  },
1049  ceil = {
1050    args = 1,
1051    base = 1,
1052    desc = [=[
1053      Return the smallest integral value greater than or equal to
1054      {expr} as a |Float| (round up).
1055      {expr} must evaluate to a |Float| or a |Number|.
1056      Examples: >vim
1057      	echo ceil(1.456)
1058      <	2.0  >vim
1059      	echo ceil(-5.456)
1060      <	-5.0  >vim
1061      	echo ceil(4.0)
1062      <	4.0
1063
1064      Returns 0.0 if {expr} is not a |Float| or a |Number|.
1065
1066    ]=],
1067    func_float = 'ceil',
1068    name = 'ceil',
1069    params = { { 'expr', 'number' } },
1070    returns = 'number',
1071    signature = 'ceil({expr})',
1072    see_lua = { '|math.ceil()|' },
1073  },
1074  chanclose = {
1075    args = { 1, 2 },
1076    desc = [=[
1077      Close a channel or a specific stream associated with it.
1078      For a job, {stream} can be one of "stdin", "stdout",
1079      "stderr" or "rpc" (closes stdin/stdout for a job started
1080      with `"rpc":v:true`) If {stream} is omitted, all streams
1081      are closed. If the channel is a pty, this will then close the
1082      pty master, sending SIGHUP to the job process.
1083      For a socket, there is only one stream, and {stream} should be
1084      omitted.
1085    ]=],
1086    name = 'chanclose',
1087    params = { { 'id', 'integer' }, { 'stream', 'string' } },
1088    returns = '0|1',
1089    signature = 'chanclose({id} [, {stream}])',
1090  },
1091  changenr = {
1092    desc = [=[
1093      Return the number of the most recent change.  This is the same
1094      number as what is displayed with |:undolist| and can be used
1095      with the |:undo| command.
1096      When a change was made it is the number of that change.  After
1097      redo it is the number of the redone change.  After undo it is
1098      one less than the number of the undone change.
1099      Returns 0 if the undo list is empty.
1100    ]=],
1101    name = 'changenr',
1102    params = {},
1103    returns = 'integer',
1104    signature = 'changenr()',
1105  },
1106  chansend = {
1107    args = 2,
1108    desc = [=[
1109      Send data to channel {id}. For a job, it writes it to the
1110      stdin of the process. For the stdio channel |channel-stdio|,
1111      it writes to Nvim's stdout.  Returns the number of bytes
1112      written if the write succeeded, 0 otherwise.
1113      See |channel-bytes| for more information.
1114
1115      {data} may be a string, string convertible, |Blob|, or a list.
1116
1117      If {data} is a list, the items will be joined by newlines; any
1118      newlines in an item will be sent as NUL; to send a final
1119      newline, include a final empty string. |NL-used-for-Nul|
1120
1121      Example: >vim
1122      	call chansend(id, ["abc", "123\n456", ""])
1123      <will send "abc<NL>123<NUL>456<NL>".
1124
1125      chansend() writes raw data, not RPC messages.  If the channel
1126      was created with `"rpc":v:true` then the channel expects RPC
1127      messages, use |rpcnotify()| and |rpcrequest()| instead.
1128    ]=],
1129    name = 'chansend',
1130    params = { { 'id', 'number' }, { 'data', 'string|string[]' } },
1131    returns = 'integer',
1132    signature = 'chansend({id}, {data})',
1133    see_lua = { '|nvim_chan_send()| for string (binary) data' },
1134  },
1135  char2nr = {
1136    args = { 1, 2 },
1137    base = 1,
1138    desc = [=[
1139      Return Number value of the first char in {string}.
1140      Examples: >vim
1141      	echo char2nr(" ")	" returns 32
1142      	echo char2nr("ABC")	" returns 65
1143      	echo char2nr("á")	" returns 225
1144      	echo char2nr("á"[0])	" returns 195
1145      	echo char2nr("\<M-x>")	" returns 128
1146      <Non-ASCII characters are always treated as UTF-8 characters.
1147      {utf8} is ignored, it exists only for backwards-compatibility.
1148      A combining character is a separate character.
1149      |nr2char()| does the opposite.
1150
1151      Returns 0 if {string} is not a |String|.
1152
1153    ]=],
1154    fast = true,
1155    name = 'char2nr',
1156    params = { { 'string', 'string' }, { 'utf8', 'any' } },
1157    returns = '0|1',
1158    signature = 'char2nr({string} [, {utf8}])',
1159    see_lua = { '|string.byte()|: only works with ASCII' },
1160  },
1161  charclass = {
1162    args = 1,
1163    base = 1,
1164    desc = [=[
1165      Return the character class of the first character in {string}.
1166      The character class is one of:
1167      	0	blank
1168      	1	punctuation
1169      	2	word character (depends on 'iskeyword')
1170      	3	emoji
1171      	other	specific Unicode class
1172      The class is used in patterns and word motions.
1173      Returns 0 if {string} is not a |String|.
1174    ]=],
1175    name = 'charclass',
1176    params = { { 'string', 'string' } },
1177    returns = "0|1|2|3|'other'",
1178    signature = 'charclass({string})',
1179  },
1180  charcol = {
1181    args = { 1, 2 },
1182    base = 1,
1183    desc = [=[
1184      Same as |col()| but returns the character index of the column
1185      position given with {expr} instead of the byte position.
1186
1187      Example:
1188      With the cursor on '세' in line 5 with text "여보세요": >vim
1189      	echo charcol('.')	" returns 3
1190      	echo col('.')		" returns 7
1191      <
1192
1193    ]=],
1194    name = 'charcol',
1195    params = { { 'expr', 'string|any[]' }, { 'winid', 'integer' } },
1196    returns = 'integer',
1197    signature = 'charcol({expr} [, {winid}])',
1198    see_lua = {
1199      '|nvim_win_get_cursor()| with |vim.str_utfindex()| for ".", or |nvim_get_current_line()| with |vim.str_utfindex()| for "$"; marks, list input, and window semantics differ',
1200    },
1201  },
1202  charidx = {
1203    args = { 2, 4 },
1204    base = 1,
1205    desc = [=[
1206      Return the character index of the byte at {idx} in {string}.
1207      The index of the first character is zero.
1208      If there are no multibyte characters the returned value is
1209      equal to {idx}.
1210
1211      When {countcc} is omitted or |FALSE|, then composing characters
1212      are not counted separately, their byte length is added to the
1213      preceding base character.
1214      When {countcc} is |TRUE|, then composing characters are
1215      counted as separate characters.
1216
1217      When {utf16} is present and TRUE, {idx} is used as the UTF-16
1218      index in the String {expr} instead of as the byte index.
1219
1220      Returns -1 if the arguments are invalid or if there are less
1221      than {idx} bytes.  If there are exactly {idx} bytes the length
1222      of the string in characters is returned.
1223
1224      An error is given and -1 is returned if the first argument is
1225      not a string, the second argument is not a number or when the
1226      third argument is present and is not zero or one.
1227
1228      See |byteidx()| and |byteidxcomp()| for getting the byte index
1229      from the character index and |utf16idx()| for getting the
1230      UTF-16 index from the character index.
1231      Refer to |string-offset-encoding| for more information.
1232      Examples: >vim
1233      	echo charidx('áb́ć', 3)		" returns 1
1234      	echo charidx('áb́ć', 6, 1)	" returns 4
1235      	echo charidx('áb́ć', 16)		" returns -1
1236      	echo charidx('a😊😊', 4, 0, 1)	" returns 2
1237      <
1238    ]=],
1239    fast = true,
1240    name = 'charidx',
1241    params = {
1242      { 'string', 'string' },
1243      { 'idx', 'integer' },
1244      { 'countcc', 'boolean' },
1245      { 'utf16', 'boolean' },
1246    },
1247    returns = 'integer',
1248    signature = 'charidx({string}, {idx} [, {countcc} [, {utf16}]])',
1249    see_lua = {
1250      '|vim.str_utfindex()| for string input with `"utf-32"` or `"utf-16"` and `strict_indexing = false`; `countcc = false` and out-of-range semantics differ',
1251    },
1252  },
1253  chdir = {
1254    args = { 1, 2 },
1255    base = 1,
1256    desc = [=[
1257      Sets the |current-directory| of the given {scope}:
1258          - "buffer"    Changes the buffer-local directory.  |:bcd|
1259          - "window"    Changes the window-local directory.  |:lcd|
1260          - "tabpage"   Changes the tabpage-local directory.  |:tcd|
1261          - "global"    Changes the global directory.  |:cd|
1262
1263      If {scope} is not given it is decided as follows:
1264          - If buffer-local directory (|:bcd|) is set, scope is
1265            "buffer".
1266          - If the window-local directory (|:lcd|) is set, scope is
1267            "window".
1268          - If the tabpage-local directory (|:tcd|) is set, scope is
1269            "tabpage".
1270          - Otherwise, scope is "global".
1271
1272      If successful, returns the previous working directory.
1273      On failure, returns an empty string.
1274
1275      Example: >vim
1276      	let save_dir = chdir(newdir)
1277      	if save_dir != ""
1278      	   " ... do some work
1279      	   call chdir(save_dir)
1280      	endif
1281      <
1282
1283    ]=],
1284    name = 'chdir',
1285    params = { { 'dir', 'string' }, { 'scope', 'string' } },
1286    returns = 'string',
1287    signature = 'chdir({dir} [, {scope}])',
1288  },
1289  cindent = {
1290    args = 1,
1291    base = 1,
1292    desc = [=[
1293      Get the amount of indent for line {lnum} according the
1294      |C-indenting| rules, as with 'cindent'.
1295      The indent is counted in spaces, the value of 'tabstop' is
1296      relevant.  {lnum} is used just like in |getline()|.
1297      When {lnum} is invalid -1 is returned.
1298
1299      To get or set indent of lines in a string, see |vim.text.indent()|.
1300
1301    ]=],
1302    name = 'cindent',
1303    params = { { 'lnum', 'integer|string' } },
1304    returns = 'integer',
1305    signature = 'cindent({lnum})',
1306    see_lua = false,
1307  },
1308  clearmatches = {
1309    args = { 0, 1 },
1310    base = 1,
1311    desc = [=[
1312      Clears all matches previously defined for the current window
1313      by |matchadd()| and the |:match| commands.
1314      If {win} is specified, use this |window-number| or |window-ID|
1315      instead of the current window.
1316
1317    ]=],
1318    name = 'clearmatches',
1319    params = { { 'win', 'integer' } },
1320    returns = false,
1321    signature = 'clearmatches([{win}])',
1322  },
1323  cmdcomplete_info = {
1324    args = 0,
1325    desc = [=[
1326      Returns a |Dictionary| with information about cmdline
1327      completion.  See |cmdline-completion|.
1328      The items are:
1329         cmdline_orig	The original command-line string before
1330      		completion began.
1331         pum_visible	|TRUE| if popup menu is visible.
1332      		See |pumvisible()|.
1333         matches	List of all completion candidates.  Each item
1334      		is a string.
1335         selected	Selected item index.  First index is zero.
1336      		Index is -1 if no item is selected (showing
1337      		typed text only, or the last completion after
1338      		no item is selected when using the <Up> or
1339      		<Down> keys)
1340
1341      Returns an empty |Dictionary| if no completion was attempted,
1342      if there was only one candidate and it was fully completed, or
1343      if an error occurred.
1344    ]=],
1345    name = 'cmdcomplete_info',
1346    params = {},
1347    returns = 'table<string,any>',
1348    signature = 'cmdcomplete_info()',
1349  },
1350  col = {
1351    args = { 1, 2 },
1352    base = 1,
1353    desc = [=[
1354      Returns the byte index of the column position given with
1355      {expr}.
1356      For accepted positions see |getpos()|.
1357      When {expr} is "$", it means the end of the cursor line, so
1358      the result is the number of bytes in the cursor line plus one.
1359      Additionally {expr} can be [lnum, col]: a |List| with the line
1360      and column number.  Most useful when the column is "$", to get
1361      the last column of a specific line.  When "lnum" or "col" is
1362      out of range then col() returns zero.
1363
1364      With the optional {winid} argument the values are obtained for
1365      that window instead of the current window.
1366
1367      To get the line number use |line()|.  To get both use
1368      |getpos()|.
1369
1370      For the screen column position use |virtcol()|.  For the
1371      character position use |charcol()|.
1372
1373      Note that only marks in the current file can be used.
1374
1375      Examples: >vim
1376      	echo col(".")			" column of cursor
1377      	echo col("$")			" length of cursor line plus one
1378      	echo col("'t")			" column of mark t
1379      	echo col("'" .. markname)	" column of mark markname
1380      <
1381      The first column is 1.  Returns 0 if {expr} is invalid or when
1382      the window with ID {winid} is not found.
1383      For an uppercase mark the column may actually be in another
1384      buffer.
1385      For the cursor position, when 'virtualedit' is active, the
1386      column is one higher if the cursor is after the end of the
1387      line.  Also, when using a <Cmd> mapping the cursor isn't
1388      moved, this can be used to obtain the column in Insert mode: >vim
1389      	imap <F2> <Cmd>echo col(".").."\n"<CR>
1390      <
1391
1392    ]=],
1393    name = 'col',
1394    params = { { 'expr', 'string|any[]' }, { 'winid', 'integer' } },
1395    returns = 'integer',
1396    signature = 'col({expr} [, {winid}])',
1397    see_lua = {
1398      '|nvim_win_get_cursor()| for "." (add 1), or Lua `#` on |nvim_get_current_line()| for "$"; marks, list input, and `virtualedit` differ',
1399    },
1400  },
1401  complete = {
1402    args = 2,
1403    base = 2,
1404    desc = [=[
1405      Set the matches for Insert mode completion.  Can only be used
1406      in Insert mode.  Typically invoked from a mapping with
1407      CTRL-R = (see |i_CTRL-R|), but may also be called from a
1408      |<Cmd>| mapping.  It does not work after CTRL-O or with an
1409      expression mapping.
1410      {startcol} is the byte offset in the line where the completed
1411      text start.  The text up to the cursor is the original text
1412      that will be replaced by the matches.  Use col('.') for an
1413      empty string.  "col('.') - 1" will replace one character by a
1414      match.
1415      {matches} must be a |List|.  Each |List| item is one match.
1416      See |complete-items| for the kind of items that are possible.
1417      "longest" in 'completeopt' is ignored.
1418      Note that the after calling this function you need to avoid
1419      inserting anything that would cause completion to stop.
1420      The match can be selected with CTRL-N and CTRL-P as usual with
1421      Insert mode completion.  The popup menu will appear if
1422      specified, see |ins-completion-menu|.
1423      Unlike with other |ins-completion| modes, the CTRL-N and
1424      CTRL-P keys can be mapped while this completion is active.
1425      For example, to make CTRL-N move the selection without
1426      inserting the match: >vim
1427
1428      inoremap <expr> <C-N> complete_info().mode ==# 'eval'
1429      			\ ? '<Down>' : '<C-N>'
1430      <
1431
1432      Example: >vim
1433
1434      inoremap <F5> <C-R>=ListMonths()<CR>
1435
1436      func ListMonths()
1437        call complete(col('.'), ['January', 'February', 'March',
1438      	\ 'April', 'May', 'June', 'July', 'August',
1439      	\ 'September', 'October', 'November', 'December'])
1440        return ''
1441      endfunc
1442
1443      <This isn't very useful, but it shows how it works.  Note that
1444      an empty string is returned to avoid a zero being inserted.
1445
1446    ]=],
1447    name = 'complete',
1448    params = { { 'startcol', 'integer' }, { 'matches', 'any[]' } },
1449    returns = false,
1450    signature = 'complete({startcol}, {matches})',
1451    tags = { 'E785' },
1452  },
1453  complete_add = {
1454    args = 1,
1455    base = 1,
1456    desc = [=[
1457      Add {expr} to the list of matches.  Only to be used by the
1458      function specified with the 'completefunc' option.
1459      Returns 0 for failure (empty string or out of memory),
1460      1 when the match was added, 2 when the match was already in
1461      the list.
1462      See |complete-functions| for an explanation of {expr}.  It is
1463      the same as one item in the list that 'omnifunc' would return.
1464
1465    ]=],
1466    name = 'complete_add',
1467    params = { { 'expr', 'any' } },
1468    returns = '0|1|2',
1469    signature = 'complete_add({expr})',
1470  },
1471  complete_check = {
1472    desc = [=[
1473      Check for a key typed while looking for completion matches.
1474      This is to be used when looking for matches takes some time.
1475      Returns |TRUE| when searching for matches is to be aborted,
1476      zero otherwise.
1477      Only to be used by the function specified with the
1478      'completefunc' option.
1479    ]=],
1480    name = 'complete_check',
1481    params = {},
1482    returns = '0|1',
1483    signature = 'complete_check()',
1484  },
1485  complete_info = {
1486    args = { 0, 1 },
1487    base = 1,
1488    desc = [=[
1489      Returns a |Dictionary| with information about Insert mode
1490      completion.  See |ins-completion|.
1491      The items are:
1492         auto		|TRUE| when Vim started this completion by
1493      		itself, which is what 'autocomplete' does,
1494      		and |FALSE| when a key asked for it, such as
1495      		|i_CTRL-X_CTRL-O|.  A |complete-functions|
1496      		function can read this to tell the two apart.
1497      		Returned only when asked for in {what}.
1498         completed	Return a dictionary containing the entries of
1499      		the currently selected index item.
1500         items	List of all completion candidates.  Each item
1501      		is a dictionary containing the entries "word",
1502      		"abbr", "menu", "kind", "info",
1503      		"abbr_hlgroup", "kind_hlgroup" and
1504      		"user_data". The highlight group entries hold
1505      		the name that the item was added with,
1506      		or an empty string.
1507      		"equal", "preselect" and "commit_chars" are
1508      		included only for items that set them.
1509      		See |complete-items|.
1510         matches	Same as "items", but only returns items that
1511      		are matching current query.  If both "matches"
1512      		and "items" are in "what", the returned list
1513      		will still be named "items", but each item
1514      		will have an additional "match" field.
1515         mode		Current completion mode name string.
1516      		See |complete_info_mode| for the values.
1517         preinserted_text
1518      		The actual text that is pre-inserted, see
1519      		|preinserted()|.
1520         pum_visible	|TRUE| if popup menu is visible.
1521      		See |pumvisible()|.
1522         selected	Selected item index.  First index is zero.
1523      		Index is -1 if no item is selected (showing
1524      		typed text only, or the last completion after
1525      		no item is selected when using the <Up> or
1526      		<Down> keys)
1527         preview_winid     Info floating preview window id.
1528         preview_bufnr     Info floating preview buffer id.
1529
1530      					*complete_info_mode*
1531      mode values are:
1532         ""		     Not in completion mode
1533         "keyword"	     Keyword completion |i_CTRL-X_CTRL-N|
1534         "ctrl_x"	     Just pressed CTRL-X |i_CTRL-X|
1535         "scroll"	     Scrolling with |i_CTRL-X_CTRL-E| or
1536      		     |i_CTRL-X_CTRL-Y|
1537         "whole_line"	     Whole lines |i_CTRL-X_CTRL-L|
1538         "files"	     File names |i_CTRL-X_CTRL-F|
1539         "tags"	     Tags |i_CTRL-X_CTRL-]|
1540         "path_defines"    Definition completion |i_CTRL-X_CTRL-D|
1541         "path_patterns"   Include completion |i_CTRL-X_CTRL-I|
1542         "dictionary"	     Dictionary |i_CTRL-X_CTRL-K|
1543         "thesaurus"	     Thesaurus |i_CTRL-X_CTRL-T|
1544         "cmdline"	     Vim Command line |i_CTRL-X_CTRL-V|
1545         "function"	     User defined completion |i_CTRL-X_CTRL-U|
1546         "omni"	     Omni completion |i_CTRL-X_CTRL-O|
1547         "spell"	     Spelling suggestions |i_CTRL-X_s|
1548         "eval"	     |complete()| completion
1549         "register"	     Words from registers |i_CTRL-X_CTRL-R|
1550         "unknown"	     Other internal modes
1551
1552      If the optional {what} list argument is supplied, then only
1553      the items listed in {what} are returned.  Unsupported items in
1554      {what} are silently ignored.
1555
1556      To get the position and size of the popup menu, see
1557      |pum_getpos()|.  It's also available in |v:event| during the
1558      |CompleteChanged| event.
1559
1560      Returns an empty |Dictionary| on error.
1561
1562      Examples: >vim
1563      	" Get all items
1564      	call complete_info()
1565      	" Get only 'mode'
1566      	call complete_info(['mode'])
1567      	" Get only 'mode' and 'pum_visible'
1568      	call complete_info(['mode', 'pum_visible'])
1569      <
1570
1571    ]=],
1572    name = 'complete_info',
1573    params = { { 'what', 'any[]' } },
1574    returns = 'table',
1575    signature = 'complete_info([{what}])',
1576  },
1577  confirm = {
1578    args = { 1, 4 },
1579    base = 1,
1580    desc = [=[
1581      confirm() offers the user a dialog, from which a choice can be
1582      made.  It returns the number of the choice.  For the first
1583      choice this is 1.
1584
1585      {msg} is displayed in a dialog with {choices} as the
1586      alternatives.  When {choices} is missing or empty, "&OK" is
1587      used (and translated).
1588      {msg} is a String, use '\n' to include a newline.  Only on
1589      some systems the string is wrapped when it doesn't fit.
1590
1591      {choices} is a String, with the individual choices separated
1592      by '\n', e.g. >vim
1593      	confirm("Save changes?", "&Yes\n&No\n&Cancel")
1594      <The letter after the '&' is the shortcut key for that choice.
1595      Thus you can type 'c' to select "Cancel".  The shortcut does
1596      not need to be the first letter: >vim
1597      	confirm("file has been modified", "&Save\nSave &All")
1598      <For the console, the first letter of each choice is used as
1599      the default shortcut key.  Case is ignored.
1600
1601      The optional {type} String argument gives the type of dialog.
1602      It can be one of these values: "Error", "Question", "Info",
1603      "Warning" or "Generic".  Only the first character is relevant.
1604      When {type} is omitted, "Generic" is used.
1605
1606      The optional {type} argument gives the type of dialog.  This
1607      is only used for the icon of the Win32 GUI.  It can be one of
1608      these values: "Error", "Question", "Info", "Warning" or
1609      "Generic".  Only the first character is relevant.
1610      When {type} is omitted, "Generic" is used.
1611
1612      If the user aborts the dialog by pressing <Esc>, CTRL-C,
1613      or another valid interrupt key, confirm() returns 0.
1614
1615      An example: >vim
1616         let choice = confirm("What do you want?",
1617      			\ "&Apples\n&Oranges\n&Bananas", 2)
1618         if choice == 0
1619      	echo "make up your mind!"
1620         elseif choice == 3
1621      	echo "tasteful"
1622         else
1623      	echo "I prefer bananas myself."
1624         endif
1625      <In a GUI dialog, buttons are used.  The layout of the buttons
1626      depends on the 'v' flag in 'guioptions'.  If it is included,
1627      the buttons are always put vertically.  Otherwise,  confirm()
1628      tries to put the buttons in one horizontal line.  If they
1629      don't fit, a vertical layout is used anyway.  For some systems
1630      the horizontal layout is always used.
1631
1632    ]=],
1633    name = 'confirm',
1634    params = {
1635      { 'msg', 'string' },
1636      { 'choices', 'string' },
1637      { 'default', 'integer' },
1638      { 'type', 'string' },
1639    },
1640    returns = 'integer',
1641    signature = 'confirm({msg} [, {choices} [, {default} [, {type}]]])',
1642  },
1643  copy = {
1644    args = 1,
1645    base = 1,
1646    desc = [=[
1647      Make a copy of {expr}.  For Numbers and Strings this isn't
1648      different from using {expr} directly.
1649      When {expr} is a |List| a shallow copy is created.  This means
1650      that the original |List| can be changed without changing the
1651      copy, and vice versa.  But the items are identical, thus
1652      changing an item changes the contents of both |Lists|.
1653      A |Dictionary| is copied in a similar way as a |List|.
1654      Also see |deepcopy()|.
1655    ]=],
1656    generics = { 'T' },
1657    name = 'copy',
1658    params = { { 'expr', 'T' } },
1659    returns = 'T',
1660    signature = 'copy({expr})',
1661    see_lua = { '|vim.deepcopy()|; deeper than Vimscript |copy()|' },
1662  },
1663  cos = {
1664    args = 1,
1665    base = 1,
1666    desc = [=[
1667      Return the cosine of {expr}, measured in radians, as a |Float|.
1668      {expr} must evaluate to a |Float| or a |Number|.
1669      Returns 0.0 if {expr} is not a |Float| or a |Number|.
1670      Examples: >vim
1671      	echo cos(100)
1672      <	0.862319 >vim
1673      	echo cos(-4.01)
1674      <	-0.646043
1675
1676    ]=],
1677    func_float = 'cos',
1678    name = 'cos',
1679    params = { { 'expr', 'number' } },
1680    returns = 'number',
1681    signature = 'cos({expr})',
1682    see_lua = { '|math.cos()|' },
1683  },
1684  cosh = {
1685    args = 1,
1686    base = 1,
1687    desc = [=[
1688      Return the hyperbolic cosine of {expr} as a |Float| in the range
1689      [1, inf].
1690      {expr} must evaluate to a |Float| or a |Number|.
1691      Returns 0.0 if {expr} is not a |Float| or a |Number|.
1692      Examples: >vim
1693      	echo cosh(0.5)
1694      <	1.127626 >vim
1695      	echo cosh(-0.5)
1696      <	1.127626
1697
1698    ]=],
1699    func_float = 'cosh',
1700    name = 'cosh',
1701    params = { { 'expr', 'number' } },
1702    returns = 'number',
1703    signature = 'cosh({expr})',
1704    see_lua = { '|math.cosh()|' },
1705  },
1706  count = {
1707    args = { 2, 4 },
1708    base = 1,
1709    tags = { 'E706' },
1710    desc = [=[
1711      Return the number of times an item with value {expr} appears
1712      in |String|, |List| or |Dictionary| {comp}.
1713
1714      If {start} is given then start with the item with this index.
1715      {start} can only be used with a |List|.
1716
1717      When {ic} is given and it's |TRUE| then case is ignored.
1718
1719      When {comp} is a string then the number of not overlapping
1720      occurrences of {expr} is returned.  Zero is returned when
1721      {expr} is an empty string.
1722
1723    ]=],
1724    name = 'count',
1725    params = {
1726      { 'comp', 'string|table|any[]' },
1727      { 'expr', 'any' },
1728      { 'ic', 'boolean' },
1729      { 'start', 'integer' },
1730    },
1731    returns = 'integer',
1732    signature = 'count({comp}, {expr} [, {ic} [, {start}]])',
1733  },
1734  cursor = {
1735    args = { 1, 3 },
1736    base = 1,
1737    name = 'cursor',
1738    params = { { 'lnum', 'integer|string' }, { 'col', 'integer' }, { 'off', 'integer' } },
1739    signature = 'cursor({lnum}, {col} [, {off}])',
1740    see_lua = false, -- see cursor__1
1741  },
1742  cursor__1 = {
1743    args = { 1, 3 },
1744    base = 1,
1745    desc = [=[
1746      Positions the cursor at the column (byte count) {col} in the
1747      line {lnum}.  The first column is one.
1748
1749      When there is one argument {list} this is used as a |List|
1750      with two, three or four item:
1751      	[{lnum}, {col}]
1752      	[{lnum}, {col}, {off}]
1753      	[{lnum}, {col}, {off}, {curswant}]
1754      This is like the return value of |getpos()| or |getcurpos()|,
1755      but without the first item.
1756
1757      To position the cursor using {col} as the character count, use
1758      |setcursorcharpos()|.
1759
1760      Does not change the jumplist.
1761      {lnum} is used like with |getline()|, except that if {lnum} is
1762      zero, the cursor will stay in the current line.
1763      If {lnum} is greater than the number of lines in the buffer,
1764      the cursor will be positioned at the last line in the buffer.
1765      If {col} is greater than the number of bytes in the line,
1766      the cursor will be positioned at the last character in the
1767      line.
1768      If {col} is zero, the cursor will stay in the current column.
1769      If {curswant} is given it is used to set the preferred column
1770      for vertical movement.  Otherwise {col} is used.
1771
1772      When 'virtualedit' is used {off} specifies the offset in
1773      screen columns from the start of the character.  E.g., a
1774      position within a <Tab> or after the last character.
1775      Returns 0 when the position could be set, -1 otherwise.
1776
1777    ]=],
1778    name = 'cursor',
1779    params = { { 'list', 'integer[]' } },
1780    signature = 'cursor({list})',
1781    see_lua = {
1782      '|nvim_win_set_cursor()| with `{lnum, col - 1}`; `off`, `curswant`, and failure semantics differ',
1783    },
1784  },
1785  debugbreak = {
1786    args = { 1, 1 },
1787    base = 1,
1788    desc = [=[
1789      Specifically used to interrupt a program being debugged.  It
1790      will cause process {pid} to get a SIGTRAP.  Behavior for other
1791      processes is undefined.  See |terminal-debug|.
1792      (Sends a SIGINT to a process {pid} other than MS-Windows)
1793
1794      Returns |TRUE| if successfully interrupted the program.
1795      Otherwise returns |FALSE|.
1796
1797    ]=],
1798    name = 'debugbreak',
1799    params = { { 'pid', 'integer' } },
1800    signature = 'debugbreak({pid})',
1801    see_lua = {
1802      '|uv.kill()| with `"sigtrap"` (or `"sigint"` outside MS-Windows); exact semantics differ',
1803    },
1804  },
1805  deepcopy = {
1806    args = { 1, 2 },
1807    base = 1,
1808    tags = { 'E698' },
1809    desc = [=[
1810      Make a copy of {expr}.  For Numbers and Strings this isn't
1811      different from using {expr} directly.
1812      When {expr} is a |List| a full copy is created.  This means
1813      that the original |List| can be changed without changing the
1814      copy, and vice versa.  When an item is a |List|, a copy for it
1815      is made, recursively.  Thus changing an item in the copy does
1816      not change the contents of the original |List|.
1817
1818      When {noref} is omitted or zero a contained |List| or
1819      |Dictionary| is only copied once.  All references point to
1820      this single copy.  With {noref} set to 1 every occurrence of a
1821      |List| or |Dictionary| results in a new copy.  This also means
1822      that a cyclic reference causes deepcopy() to fail.
1823      					*E724*
1824      Nesting is possible up to 100 levels.  When there is an item
1825      that refers back to a higher level making a deep copy with
1826      {noref} set to 1 will fail.
1827      Also see |copy()|.
1828
1829    ]=],
1830    generics = { 'T' },
1831    name = 'deepcopy',
1832    params = { { 'expr', 'T' }, { 'noref', 'boolean' } },
1833    returns = 'T',
1834    signature = 'deepcopy({expr} [, {noref}])',
1835    see_lua = { '|vim.deepcopy()|' },
1836  },
1837  delete = {
1838    args = { 1, 2 },
1839    base = 1,
1840    desc = [=[
1841      Without {flags} or with {flags} empty: Deletes the file by the
1842      name {fname}.
1843
1844      This also works when {fname} is a symbolic link.  The symbolic
1845      link itself is deleted, not what it points to.
1846
1847      When {flags} is "d": Deletes the directory by the name
1848      {fname}.  This fails when directory {fname} is not empty.
1849
1850      When {flags} is "rf": Deletes the directory by the name
1851      {fname} and everything in it, recursively.  BE CAREFUL!
1852      Note: on MS-Windows it is not possible to delete a directory
1853      that is being used.
1854
1855      The result is a Number, which is 0/false if the delete
1856      operation was successful and -1/true when the deletion failed
1857      or partly failed.
1858
1859    ]=],
1860    name = 'delete',
1861    params = { { 'fname', 'string' }, { 'flags', 'string' } },
1862    returns = 'integer',
1863    signature = 'delete({fname} [, {flags}])',
1864    see_lua = { '|vim.fs.rm()|' },
1865  },
1866  deletebufline = {
1867    args = { 2, 3 },
1868    base = 1,
1869    desc = [=[
1870      Delete lines {first} to {last} (inclusive) from buffer {buf}.
1871      If {last} is omitted then delete line {first} only.
1872      On success 0 is returned, on failure 1 is returned.
1873
1874      This function works only for loaded buffers.  First call
1875      |bufload()| if needed.
1876
1877      For the use of {buf}, see |bufname()| above.
1878
1879      {first} and {last} are used like with |getline()|.  Note that
1880      when using |line()| this refers to the current buffer.  Use "$"
1881      to refer to the last line in buffer {buf}.
1882
1883    ]=],
1884    name = 'deletebufline',
1885    params = {
1886      { 'buf', 'integer|string' },
1887      { 'first', 'integer|string' },
1888      { 'last', 'integer|string' },
1889    },
1890    signature = 'deletebufline({buf}, {first} [, {last}])',
1891    see_lua = { '|nvim_buf_set_lines()|' },
1892  },
1893  dictwatcheradd = {
1894    args = 3,
1895    desc = [=[
1896      Adds a watcher to a dictionary. A dictionary watcher is
1897      identified by three components:
1898
1899      - A dictionary({dict});
1900      - A key pattern({pattern}).
1901      - A function({callback}).
1902
1903      After this is called, every change on {dict} and on keys
1904      matching {pattern} will result in {callback} being invoked.
1905
1906      For example, to watch all global variables: >vim
1907      	silent! call dictwatcherdel(g:, '*', 'OnDictChanged')
1908      	function! OnDictChanged(d,k,z)
1909      	  echomsg string(a:k) string(a:z)
1910      	endfunction
1911      	call dictwatcheradd(g:, '*', 'OnDictChanged')
1912      <
1913      For now {pattern} only accepts very simple patterns that can
1914      contain a "*" at the end of the string, in which case it will
1915      match every key that begins with the substring before the "*".
1916      That means if "*" is not the last character of {pattern}, only
1917      keys that are exactly equal as {pattern} will be matched.
1918
1919      The {callback} receives three arguments:
1920
1921      - The dictionary being watched.
1922      - The key which changed.
1923      - A dictionary containing the new and old values for the key.
1924
1925      The type of change can be determined by examining the keys
1926      present on the third argument:
1927
1928      - If contains both `old` and `new`, the key was updated.
1929      - If it contains only `new`, the key was added.
1930      - If it contains only `old`, the key was deleted.
1931
1932      This function can be used by plugins to implement options with
1933      validation and parsing logic.
1934    ]=],
1935    name = 'dictwatcheradd',
1936    params = { { 'dict', 'table' }, { 'pattern', 'string' }, { 'callback', 'function' } },
1937    signature = 'dictwatcheradd({dict}, {pattern}, {callback})',
1938    see_lua = false,
1939  },
1940  dictwatcherdel = {
1941    args = 3,
1942    desc = [=[
1943      Removes a watcher added  with |dictwatcheradd()|. All three
1944      arguments must match the ones passed to |dictwatcheradd()| in
1945      order for the watcher to be successfully deleted.
1946    ]=],
1947    name = 'dictwatcherdel',
1948    params = { { 'dict', 'any' }, { 'pattern', 'string' }, { 'callback', 'function' } },
1949    signature = 'dictwatcherdel({dict}, {pattern}, {callback})',
1950    see_lua = false,
1951  },
1952  did_filetype = {
1953    desc = [=[
1954      Returns |TRUE| when autocommands are being executed and the
1955      FileType event triggered at least once for a buffer with
1956      a non-empty 'filetype'.  Can be used to avoid triggering
1957      the FileType event again in the |ftdetect| scripts. |FileType|
1958      Returns |FALSE| when `:setf FALLBACK` was used.
1959
1960      When editing another file, the counter is reset, thus this
1961      really checks if the FileType event has been triggered for the
1962      current buffer.  This allows an autocommand that starts
1963      editing another buffer to set 'filetype' and load a syntax
1964      file.
1965    ]=],
1966    fast = true,
1967    name = 'did_filetype',
1968    params = {},
1969    returns = 'integer',
1970    signature = 'did_filetype()',
1971  },
1972  diff_filler = {
1973    args = 1,
1974    base = 1,
1975    desc = [=[
1976      Returns the number of filler lines above line {lnum}.
1977      These are the lines that were inserted at this point in
1978      another diff'ed window.  These filler lines are shown in the
1979      display but don't exist in the buffer.
1980      {lnum} is used like with |getline()|.  Thus "." is the current
1981      line, "'m" mark m, etc.
1982
1983      To get the filler lines after the last buffer line, use: >vim
1984      	echo diff_filler(line('$')+1)
1985      <
1986      Returns 0 if the current window is not in diff mode or filler
1987      lines have been disabled using 'diffopt'.
1988    ]=],
1989    name = 'diff_filler',
1990    params = { { 'lnum', 'integer|string' } },
1991    returns = 'integer',
1992    signature = 'diff_filler({lnum})',
1993  },
1994  diff_hlID = {
1995    args = 2,
1996    base = 1,
1997    desc = [=[
1998      Returns the highlight ID for diff mode at line {lnum} column
1999      {col} (byte index).  When the current line does not have a
2000      diff change zero is returned.
2001      {lnum} is used like with |getline()|.  Thus "." is the current
2002      line, "'m" mark m, etc.
2003      {col} is 1 for the leftmost column, {lnum} is 1 for the first
2004      line.
2005      The highlight ID can be used with |synIDattr()| to obtain
2006      syntax information about the highlighting.
2007
2008    ]=],
2009    name = 'diff_hlID',
2010    params = { { 'lnum', 'integer|string' }, { 'col', 'integer' } },
2011    signature = 'diff_hlID({lnum}, {col})',
2012  },
2013  digraph_get = {
2014    args = 1,
2015    base = 1,
2016    tags = { 'E1214' },
2017    desc = [=[
2018      Return the digraph of {chars}.  This should be a string with
2019      exactly two characters.  If {chars} are not just two
2020      characters, or the digraph of {chars} does not exist, an error
2021      is given and an empty string is returned.
2022
2023      Also see |digraph_getlist()|.
2024
2025      Examples: >vim
2026      " Get a built-in digraph
2027      echo digraph_get('00')		" Returns '∞'
2028
2029      " Get a user-defined digraph
2030      call digraph_set('aa', 'あ')
2031      echo digraph_get('aa')		" Returns 'あ'
2032      <
2033    ]=],
2034    name = 'digraph_get',
2035    params = { { 'chars', 'string' } },
2036    returns = 'string',
2037    signature = 'digraph_get({chars})',
2038  },
2039  digraph_getlist = {
2040    args = { 0, 1 },
2041    base = 1,
2042    desc = [=[
2043      Return a list of digraphs.  If the {listall} argument is given
2044      and it is TRUE, return all digraphs, including the default
2045      digraphs.  Otherwise, return only user-defined digraphs.
2046
2047      Also see |digraph_get()|.
2048
2049      Examples: >vim
2050      " Get user-defined digraphs
2051      echo digraph_getlist()
2052
2053      " Get all the digraphs, including default digraphs
2054      echo digraph_getlist(1)
2055      <
2056    ]=],
2057    name = 'digraph_getlist',
2058    params = { { 'listall', 'boolean' } },
2059    returns = 'string[][]',
2060    signature = 'digraph_getlist([{listall}])',
2061  },
2062  digraph_set = {
2063    args = 2,
2064    base = 1,
2065    desc = [=[
2066      Add digraph {chars} to the list.  {chars} must be a string
2067      with two characters.  {digraph} is a string with one UTF-8
2068      encoded character.  *E1215*
2069      Be careful, composing characters are NOT ignored.  This
2070      function is similar to |:digraphs| command, but useful to add
2071      digraphs start with a white space.
2072
2073      The function result is v:true if |digraph| is registered.  If
2074      this fails an error message is given and v:false is returned.
2075
2076      If you want to define multiple digraphs at once, you can use
2077      |digraph_setlist()|.
2078
2079      Example: >vim
2080      	call digraph_set('  ', 'あ')
2081      <
2082    ]=],
2083    name = 'digraph_set',
2084    params = { { 'chars', 'string' }, { 'digraph', 'string' } },
2085    signature = 'digraph_set({chars}, {digraph})',
2086  },
2087  digraph_setlist = {
2088    args = 1,
2089    base = 1,
2090    desc = [=[
2091      Similar to |digraph_set()| but this function can add multiple
2092      digraphs at once.  {digraphlist} is a list composed of lists,
2093      where each list contains two strings with {chars} and
2094      {digraph} as in |digraph_set()|. *E1216*
2095      Example: >vim
2096          call digraph_setlist([['aa', 'あ'], ['ii', 'い']])
2097      <
2098      It is similar to the following: >vim
2099          for [chars, digraph] in [['aa', 'あ'], ['ii', 'い']]
2100      	  call digraph_set(chars, digraph)
2101          endfor
2102      <Except that the function returns after the first error,
2103      following digraphs will not be added.
2104    ]=],
2105    name = 'digraph_setlist',
2106    params = { { 'digraphlist', 'table<integer,string[]>' } },
2107    signature = 'digraph_setlist({digraphlist})',
2108  },
2109  empty = {
2110    args = 1,
2111    base = 1,
2112    desc = [=[
2113      Return the Number 1 if {expr} is empty, zero otherwise.
2114      - A |List| or |Dictionary| is empty when it does not have any
2115        items.
2116      - A |String| is empty when its length is zero.
2117      - A |Number| and |Float| are empty when their value is zero.
2118      - |v:false| and |v:null| are empty, |v:true| is not.
2119      - A |Blob| is empty when its length is zero.
2120
2121    ]=],
2122    name = 'empty',
2123    params = { { 'expr', 'any' } },
2124    returns = 'integer',
2125    signature = 'empty({expr})',
2126    see_lua = { 'plain Lua emptiness checks, or |vim.tbl_isempty()| for tables' },
2127  },
2128  environ = {
2129    desc = [=[
2130      Return all of environment variables as dictionary.  You can
2131      check if an environment variable exists like this: >vim
2132      	echo has_key(environ(), 'HOME')
2133      <Note that the variable name may be CamelCase; to ignore case
2134      use this: >vim
2135      	echo index(keys(environ()), 'HOME', 0, 1) != -1
2136      <
2137    ]=],
2138    fast = true,
2139    func_lua = 'f_environ',
2140    name = 'environ',
2141    params = {},
2142    signature = 'environ()',
2143    see_lua = { '|uv.os_environ()| for the full environment table; |vim.env| for keyed access' },
2144  },
2145  escape = {
2146    args = 2,
2147    base = 1,
2148    desc = [=[
2149      Escape the characters in {chars} that occur in {string} with a
2150      backslash.  Example: >vim
2151      	echo escape('c:\program files\vim', ' \')
2152      <results in: >
2153      	c:\\program\ files\\vim
2154      <Also see |shellescape()| and |fnameescape()|.
2155
2156    ]=],
2157    fast = true,
2158    name = 'escape',
2159    params = { { 'string', 'string' }, { 'chars', 'string' } },
2160    returns = 'string',
2161    signature = 'escape({string}, {chars})',
2162  },
2163  eval = {
2164    args = 1,
2165    base = 1,
2166    desc = [=[
2167      Evaluate {string} and return the result.  Especially useful to
2168      turn the result of |string()| back into the original value.
2169      This works for Numbers, Floats, Strings, Blobs and composites
2170      of them.  Also works for |Funcref|s that refer to existing
2171      functions.
2172
2173    ]=],
2174    name = 'eval',
2175    params = { { 'string', 'string' } },
2176    signature = 'eval({string})',
2177    see_lua = false,
2178  },
2179  eventhandler = {
2180    desc = [=[
2181      Returns 1 when inside an event handler.  That is that Vim got
2182      interrupted while waiting for the user to type a character,
2183      e.g., when dropping a file on Vim.  This means interactive
2184      commands cannot be used.  Otherwise zero is returned.
2185    ]=],
2186    name = 'eventhandler',
2187    params = {},
2188    signature = 'eventhandler()',
2189  },
2190  executable = {
2191    args = 1,
2192    base = 1,
2193    desc = [=[
2194      This function checks if an executable with the name {expr}
2195      exists.  {expr} must be the name of the program without any
2196      arguments.
2197
2198      executable() uses the value of $PATH and/or the normal
2199      searchpath for programs.
2200      					*PATHEXT*
2201      On MS-Windows the ".exe", ".bat", etc. can optionally be
2202      included.  Then the extensions in $PATHEXT are tried.  Thus if
2203      "foo.exe" does not exist, "foo.exe.bat" can be found.  If
2204      $PATHEXT is not set then ".com;.exe;.bat;.cmd" is used.  A dot
2205      by itself can be used in $PATHEXT to try using the name
2206      without an extension.  When 'shell' looks like a Unix shell,
2207      then the name is also tried without adding an extension.
2208      On MS-Windows it only checks if the file exists and is not a
2209      directory, not if it's really executable.
2210
2211      On MS-Windows an executable in the same directory as the Vim
2212      executable is always found (it's added to $PATH at |startup|).
2213      			*$NoDefaultCurrentDirectoryInExePath*
2214      On MS-Windows when using cmd.exe as 'shell' an executable in
2215      Vim's current working directory is also normally found, which
2216      can be disabled by setting the
2217      `$NoDefaultCurrentDirectoryInExePath` environment variable.
2218      This variable is always set by Vim when executing external
2219      commands (e.g., via |:!|, |:make|, or |system()|) for security
2220      reasons.
2221
2222      The result is a Number:
2223      	1	exists
2224      	0	does not exist
2225      |exepath()| can be used to get the full path of an executable.
2226
2227    ]=],
2228    fast = true,
2229    name = 'executable',
2230    params = { { 'expr', 'string' } },
2231    returns = '0|1',
2232    signature = 'executable({expr})',
2233  },
2234  execute = {
2235    args = { 1, 2 },
2236    base = 1,
2237    desc = [=[
2238      Execute {command} and capture its output.
2239      If {command} is a |String|, returns {command} output.
2240      If {command} is a |List|, returns concatenated outputs.
2241      Line continuations in {command} are not recognized.
2242      Examples: >vim
2243      	echo execute('echon "foo"')
2244      <	foo >vim
2245      	echo execute(['echon "foo"', 'echon "bar"'])
2246      <	foobar
2247
2248      The optional {silent} argument can have these values:
2249      	""		no `:silent` used
2250      	"silent"	`:silent` used
2251      	"silent!"	`:silent!` used
2252      The default is "silent".  Note that with "silent!", unlike
2253      `:redir`, error messages are dropped.
2254
2255      To get a list of lines use `split()` on the result: >vim
2256      	execute('args')->split("\n")
2257
2258      <This function is not available in the |sandbox|.
2259      Note: If nested, an outer execute() will not observe output of
2260      the inner calls.
2261      Note: Text attributes (highlights) are not captured.
2262      To execute a command in another window than the current one
2263      use `win_execute()`.
2264
2265    ]=],
2266    name = 'execute',
2267    params = {
2268      { 'command', 'string|string[]' },
2269      { 'silent', "''|'silent'|'silent!'" },
2270    },
2271    returns = 'string',
2272    signature = 'execute({command} [, {silent}])',
2273    see_lua = { '|nvim_exec()|', '|vim.cmd()|' },
2274  },
2275  exepath = {
2276    args = 1,
2277    base = 1,
2278    desc = [=[
2279      Returns the full path of {expr} if it is an executable and
2280      given as a (partial or full) path or is found in $PATH.
2281      Returns empty string otherwise.
2282      If {expr} starts with "./" the |current-directory| is used.
2283
2284    ]=],
2285    fast = true,
2286    name = 'exepath',
2287    params = { { 'expr', 'string' } },
2288    signature = 'exepath({expr})',
2289    returns = 'string',
2290  },
2291  exists = {
2292    args = 1,
2293    base = 1,
2294    desc = [=[
2295      Checks whether the expression {expr} is defined.
2296      Returns |TRUE| if {expr} is defined, zero otherwise.
2297
2298      For checking for a supported feature use |has()|.
2299      For checking if a file exists use |filereadable()|.
2300
2301      The {expr} argument is a string, which contains one of these:
2302      	varname		internal variable (see
2303      	dict.key	|internal-variables|).  Also works
2304      	list[i]		for |curly-braces-names|, |Dictionary|
2305      			entries, |List| items, etc.
2306      			Beware that evaluating an index may
2307      			cause an error message for an invalid
2308      			expression.  E.g.: >vim
2309      			   let l = [1, 2, 3]
2310      			   echo exists("l[5]")
2311      <			   0 >vim
2312      			   echo exists("l[xx]")
2313      <			   E121: Undefined variable: xx
2314      			   0
2315      	&option-name	Vim option (only checks if it exists,
2316      			not if it really works)
2317      	+option-name	Vim option that works.
2318      	$ENVNAME	environment variable (could also be
2319      			done by comparing with an empty
2320      			string)
2321      	`*funcname`	built-in function (see |functions|)
2322      			or user defined function (see
2323      			|user-function|). Also works for a
2324      			variable that is a Funcref.
2325      	:cmdname	Ex command: built-in command, user
2326      			command or command modifier |:command|.
2327      			Returns:
2328      			1  for match with start of a command
2329      			2  full match with a command
2330      			3  matches several user commands
2331      			To check for a supported command
2332      			always check the return value to be 2.
2333      	:2match		The |:2match| command.
2334      	:3match		The |:3match| command (but you
2335      			probably should not use it, it is
2336      			reserved for internal usage)
2337      	#event		autocommand defined for this event
2338      	#event#pattern	autocommand defined for this event and
2339      			pattern (the pattern is taken
2340      			literally and compared to the
2341      			autocommand patterns character by
2342      			character)
2343      	#group		autocommand group exists
2344      	#group#event	autocommand defined for this group and
2345      			event.
2346      	#group#event#pattern
2347      			autocommand defined for this group,
2348      			event and pattern.
2349      	##event		autocommand for this event is
2350      			supported.
2351
2352      Examples: >vim
2353      	echo exists("&mouse")
2354      	echo exists("$HOSTNAME")
2355      	echo exists("*strftime")
2356      	echo exists("*s:MyFunc")
2357      	echo exists("*MyFunc")
2358      	echo exists("*v:lua.Func")
2359      	echo exists("bufcount")
2360      	echo exists(":Make")
2361      	echo exists("#CursorHold")
2362      	echo exists("#BufReadPre#*.gz")
2363      	echo exists("#filetypeindent")
2364      	echo exists("#filetypeindent#FileType")
2365      	echo exists("#filetypeindent#FileType#*")
2366      	echo exists("##ColorScheme")
2367      <There must be no space between the symbol (&/$/*/#) and the
2368      name.
2369      There must be no extra characters after the name, although in
2370      a few cases this is ignored.  That may become stricter in the
2371      future, thus don't count on it!
2372      Working example: >vim
2373      	echo exists(":make")
2374      <NOT working example: >vim
2375      	echo exists(":make install")
2376
2377      <Note that the argument must be a string, not the name of the
2378      variable itself.  For example: >vim
2379      	echo exists(bufcount)
2380      <This doesn't check for existence of the "bufcount" variable,
2381      but gets the value of "bufcount", and checks if that exists.
2382
2383    ]=],
2384    name = 'exists',
2385    params = { { 'expr', 'string' } },
2386    returns = '0|1',
2387    signature = 'exists({expr})',
2388  },
2389  exp = {
2390    args = 1,
2391    base = 1,
2392    desc = [=[
2393      Return the exponential of {expr} as a |Float| in the range
2394      [0, inf].
2395      {expr} must evaluate to a |Float| or a |Number|.
2396      Returns 0.0 if {expr} is not a |Float| or a |Number|.
2397      Examples: >vim
2398      	echo exp(2)
2399      <	7.389056 >vim
2400      	echo exp(-1)
2401      <	0.367879
2402
2403    ]=],
2404    func_float = 'exp',
2405    name = 'exp',
2406    params = { { 'expr', 'number' } },
2407    signature = 'exp({expr})',
2408    see_lua = { '|math.exp()|' },
2409  },
2410  expand = {
2411    args = { 1, 3 },
2412    base = 1,
2413    desc = [=[
2414      Expand wildcards and the following special keywords in
2415      {string}.  'wildignorecase' applies.
2416
2417      If {list} is given and it is |TRUE|, a List will be returned.
2418      Otherwise the result is a String and when there are several
2419      matches, they are separated by <NL> characters.
2420
2421      If the expansion fails, the result is an empty string.  A name
2422      for a non-existing file is not included, unless {string} does
2423      not start with '%', '#' or '<', see below.
2424
2425      When {string} starts with '%', '#' or '<', the expansion is
2426      done like for the |cmdline-special| variables with their
2427      associated modifiers.  Here is a short overview:
2428
2429      	%		Current file name
2430      	#		Alternate file name
2431      	#n		Alternate file name n
2432      	<cfile>		File name under the cursor
2433      	<afile>		Autocmd file name
2434      	<abuf>		Autocmd buffer number (as a String!)
2435      	<amatch>	Autocmd matched name
2436      	<cexpr>		C expression under the cursor
2437      	<sfile>		Deprecated, use <script> or <stack>
2438      	<slnum>		Sourced script line number or function
2439      			line number
2440      	<sflnum>	Script file line number, also when in
2441      			a function
2442      	<SID>		"<SNR>123_"  where "123" is the
2443      			current script ID  |<SID>|
2444      	<script>	Sourced script file, or script file
2445      			where the current function was defined.
2446      			Lua: see |lua-script-location|.
2447      	<stack>		Call stack
2448      	<cword>		Word under the cursor
2449      	<cWORD>		WORD under the cursor
2450      	<client>	The {clientid} of the last received
2451      			message
2452      Modifiers:
2453      	:p		Expand to full path
2454      	:h		Head (last path component removed)
2455      	:t		Tail (last path component only)
2456      	:r		Root (one extension removed)
2457      	:e		Extension only
2458
2459      More modifiers are supported, for the full list see
2460      |filename-modifiers|.
2461
2462      Example: >vim
2463      	let &tags = expand("%:p:h") .. "/tags"
2464      <Note that when expanding a string that starts with '%', '#' or
2465      '<', any following text is ignored.  This does NOT work: >vim
2466      	let doesntwork = expand("%:h.bak")
2467      <Use this: >vim
2468      	let doeswork = expand("%:h") .. ".bak"
2469      <Also note that expanding "<cfile>" and others only returns the
2470      referenced file name without further expansion.  If "<cfile>"
2471      is "~/.cshrc", you need to do another expand() to have the
2472      "~/" expanded into the path of the home directory: >vim
2473      	echo expand(expand("<cfile>"))
2474      <
2475      There cannot be white space between the variables and the
2476      following modifier.  The |fnamemodify()| function can be used
2477      to modify normal file names.
2478
2479      When using '%' or '#', and the current or alternate file name
2480      is not defined, an empty string is used.  Using "%:p" in a
2481      buffer with no name, results in the current directory, with a
2482      '/' added.
2483      When 'verbose' is set then expanding '%', '#' and <> items
2484      will result in an error message if the argument cannot be
2485      expanded.
2486
2487      When {string} does not start with '%', '#' or '<', it is
2488      expanded like a file name is expanded on the command line.
2489      'suffixes' and 'wildignore' are used, unless the optional
2490      {nosuf} argument is given and it is |TRUE|.
2491      Names for non-existing files are included.  The "**" item can
2492      be used to search in a directory tree.  For example, to find
2493      all "README" files in the current directory and below: >vim
2494      	echo expand("**/README")
2495      <
2496      expand() can also be used to expand variables and environment
2497      variables that are only known in a shell.  But this can be
2498      slow, because a shell may be used to do the expansion.  See
2499      |expr-env-expand|.
2500      The expanded variable is still handled like a list of file
2501      names.  When an environment variable cannot be expanded, it is
2502      left unchanged.  Thus ":echo expand('$FOOBAR')" results in
2503      "$FOOBAR".
2504
2505      See |glob()| for finding existing files.  See |system()| for
2506      getting the raw output of an external command.
2507
2508    ]=],
2509    name = 'expand',
2510    params = { { 'string', 'string' }, { 'nosuf', 'boolean' }, { 'list', 'nil|false' } },
2511    signature = 'expand({string} [, {nosuf} [, {list}]])',
2512    returns = 'string',
2513  },
2514  expand__1 = {
2515    args = { 3 },
2516    base = 1,
2517    name = 'expand',
2518    params = {
2519      { 'string', 'string' },
2520      { 'nosuf', 'boolean?' },
2521      { 'list', 'true|number|string|table' },
2522    },
2523    returns = 'string|string[]',
2524  },
2525  expandcmd = {
2526    args = { 1, 2 },
2527    base = 1,
2528    desc = [=[
2529      Expand special items in String {string} like what is done for
2530      an Ex command such as `:edit`.  This expands special keywords,
2531      like with |expand()|, and environment variables, anywhere in
2532      {string}.  "~user" and "~/path" are only expanded at the
2533      start.
2534      The expansion is done in two steps: the special keywords are
2535      evaluated first, then "~" and environment variables are
2536      expanded in the result.  Thus `expand('%:~')` keeps the "~",
2537      while `expandcmd('%:~')` returns the full path.
2538
2539      The following items are supported in the {options} Dict
2540      argument:
2541          errmsg	If set to TRUE, error messages are displayed
2542      		if an error is encountered during expansion.
2543      		By default, error messages are not displayed.
2544
2545      Returns the expanded string.  If an error is encountered
2546      during expansion, the unmodified {string} is returned.
2547
2548      Example: >vim
2549      	echo expandcmd('make %<.o')
2550      < >
2551      	make /path/runtime/doc/builtin.o
2552      < >vim
2553      	echo expandcmd('make %<.o', {'errmsg': v:true})
2554      <
2555    ]=],
2556    name = 'expandcmd',
2557    params = { { 'string', 'string' }, { 'options', 'table' } },
2558    signature = 'expandcmd({string} [, {options}])',
2559  },
2560  extend = {
2561    args = { 2, 3 },
2562    base = 1,
2563    desc = [=[
2564      {expr1} and {expr2} must be both |Lists| or both
2565      |Dictionaries|.
2566
2567      If they are |Lists|: Append {expr2} to {expr1}.
2568      If {expr3} is given insert the items of {expr2} before the
2569      item with index {expr3} in {expr1}.  When {expr3} is zero
2570      insert before the first item.  When {expr3} is equal to
2571      len({expr1}) then {expr2} is appended.
2572      Examples: >vim
2573      	echo sort(extend(mylist, [7, 5]))
2574      	call extend(mylist, [2, 3], 1)
2575      <When {expr1} is the same List as {expr2} then the number of
2576      items copied is equal to the original length of the List.
2577      E.g., when {expr3} is 1 you get N new copies of the first item
2578      (where N is the original length of the List).
2579      Use |add()| to concatenate one item to a list.  To concatenate
2580      two lists into a new list use the + operator: >vim
2581      	let newlist = [1, 2, 3] + [4, 5]
2582      <
2583      If they are |Dictionaries|:
2584      Add all entries from {expr2} to {expr1}.
2585      If a key exists in both {expr1} and {expr2} then {expr3} is
2586      used to decide what to do:
2587      {expr3} = "keep": keep the value of {expr1}
2588      {expr3} = "force": use the value of {expr2}
2589      {expr3} = "error": give an error message		*E737*
2590      When {expr3} is omitted then "force" is assumed.
2591
2592      {expr1} is changed when {expr2} is not empty.  If necessary
2593      make a copy of {expr1} first or use |extendnew()| to return a
2594      new List/Dictionary.
2595      {expr2} remains unchanged.
2596      When {expr1} is locked and {expr2} is not empty the operation
2597      fails.
2598      Returns {expr1}.  Returns 0 on error.
2599
2600    ]=],
2601    name = 'extend',
2602    params = { { 'expr1', 'table' }, { 'expr2', 'table' }, { 'expr3', 'table' } },
2603    signature = 'extend({expr1}, {expr2} [, {expr3}])',
2604    see_lua = {
2605      '|vim.list_extend()| for lists, or |vim.tbl_extend()| and |vim.tbl_deep_extend()| for dicts; insertion and keep/force/error behavior differ',
2606    },
2607  },
2608  extendnew = {
2609    args = { 2, 3 },
2610    base = 1,
2611    desc = [=[
2612      Like |extend()| but instead of adding items to {expr1} a new
2613      List or Dictionary is created and returned.  {expr1} remains
2614      unchanged.
2615    ]=],
2616    name = 'extendnew',
2617    params = { { 'expr1', 'table' }, { 'expr2', 'table' }, { 'expr3', 'table' } },
2618    signature = 'extendnew({expr1}, {expr2} [, {expr3}])',
2619    see_lua = {
2620      '|vim.list_extend()| on a copy for lists, or |vim.tbl_extend()| and |vim.tbl_deep_extend()| for dicts; insertion and keep/force/error behavior differ',
2621    },
2622  },
2623  feedkeys = {
2624    args = { 1, 2 },
2625    base = 1,
2626    desc = [=[
2627      Characters in {string} are queued for processing as if they
2628      come from a mapping or were typed by the user.
2629
2630      By default the string is added to the end of the typeahead
2631      buffer, thus if a mapping is still being executed the
2632      characters come after them.  Use the 'i' flag to insert before
2633      other characters, they will be executed next, before any
2634      characters from a mapping.
2635
2636      The function does not wait for processing of keys contained in
2637      {string}.
2638
2639      To include special keys into {string}, use double-quotes
2640      and "\..." notation |expr-quote|.  For example,
2641      feedkeys("\<CR>") simulates pressing of the <Enter> key.  But
2642      feedkeys('\<CR>') pushes 5 characters.
2643      The |<Ignore>| keycode may be used to exit the
2644      wait-for-character without doing anything.
2645
2646      {mode} is a String, which can contain these character flags:
2647      'm'	Remap keys.  This is default.  If {mode} is absent,
2648      	keys are remapped.
2649      'n'	Do not remap keys.
2650      't'	Handle keys as if typed; otherwise they are handled as
2651      	if coming from a mapping.  This matters for undo,
2652      	opening folds, etc.
2653      'L'	Lowlevel input.  Other flags are not used.
2654      'i'	Insert the string instead of appending (see above).
2655      'x'	Execute commands until typeahead is empty.  This is
2656      	similar to using ":normal!".  You can call feedkeys()
2657      	several times without 'x' and then one time with 'x'
2658      	(possibly with an empty {string}) to execute all the
2659      	typeahead.  Note that when Vim ends in Insert mode it
2660      	will behave as if <Esc> is typed, to avoid getting
2661      	stuck, waiting for a character to be typed before the
2662      	script continues.
2663      	Note that if you manage to call feedkeys() while
2664      	executing commands, thus calling it recursively, then
2665      	all typeahead will be consumed by the last call.
2666      '!'	When used with 'x' will not end Insert mode.  Can be
2667      	used in a test when a timer is set to exit Insert mode
2668      	a little later.  Useful for testing CursorHoldI.
2669
2670      Return value is always 0.
2671
2672    ]=],
2673    name = 'feedkeys',
2674    params = { { 'string', 'string' }, { 'mode', 'string' } },
2675    signature = 'feedkeys({string} [, {mode}])',
2676    see_lua = { '|nvim_feedkeys()|' },
2677  },
2678  file_readable = {
2679    args = 1,
2680    base = 1,
2681    deprecated = true,
2682    desc = [=[
2683      Obsolete name for |filereadable()|.
2684    ]=],
2685    func = 'f_filereadable',
2686    name = 'file_readable',
2687    params = { { 'file', 'string' } },
2688    signature = 'file_readable({file})',
2689    see_lua = { '|uv.fs_access()| with `"R"` and |uv.fs_stat()| to exclude directories' },
2690  },
2691  filecopy = {
2692    args = 2,
2693    base = 1,
2694    desc = [[
2695      Copy the file pointed to by the name {from} to {to}.  The
2696      result is a Number, which is |TRUE| if the file was copied
2697      successfully, and |FALSE| when it failed.
2698      If a file with name {to} already exists, it will fail.
2699      Note that it does not handle directories (yet).
2700
2701      This function is not available in the |sandbox|.
2702    ]],
2703    name = 'filecopy',
2704    params = { { 'from', 'string' }, { 'to', 'string' } },
2705    returns = '0|1',
2706    signature = 'filecopy({from}, {to})',
2707    see_lua = { '|uv.fs_copyfile()| with `{ excl = true }`; return semantics differ' },
2708  },
2709  filereadable = {
2710    args = 1,
2711    base = 1,
2712    desc = [=[
2713      Returns |TRUE| if {file} exists, can be read, and is not
2714      a directory, else |FALSE|.
2715
2716      {file} is any expression, which is used as a String. If you
2717      don't care about the file being readable you can use |glob()|.
2718
2719      {file} is used as-is, you may want to expand wildcards first: >vim
2720      	echo filereadable('~/.vimrc')
2721      < >
2722      	0
2723      < >vim
2724      	echo filereadable(expand('~/.vimrc'))
2725      < >
2726      	1
2727      <
2728
2729    ]=],
2730    fast = true,
2731    name = 'filereadable',
2732    params = { { 'file', 'string' } },
2733    returns = '0|1',
2734    signature = 'filereadable({file})',
2735    see_lua = { '|uv.fs_access()| with `"R"` and |uv.fs_stat()| to exclude directories' },
2736  },
2737  filewritable = {
2738    args = 1,
2739    base = 1,
2740    desc = [=[
2741      Checks whether a file with the name {file} exists and can
2742      be written.  Returns 1 if so.  If {file} doesn't exist, or
2743      is not writable, the result is 0.  If {file} is a
2744      directory, and we can write to it, the result is 2.
2745
2746    ]=],
2747    fast = true,
2748    name = 'filewritable',
2749    params = { { 'file', 'string' } },
2750    returns = '0|1',
2751    signature = 'filewritable({file})',
2752    see_lua = {
2753      '|uv.fs_access()| with `"W"` and |uv.fs_stat()| if you need Vim\'s `2` return for directories',
2754    },
2755  },
2756  filter = {
2757    args = 2,
2758    base = 1,
2759    desc = [=[
2760      {expr1} must be a |List|, |String|, |Blob| or |Dictionary|.
2761      For each item in {expr1} evaluate {expr2} and when the result
2762      is zero or false remove the item from the |List| or
2763      |Dictionary|.  Similarly for each byte in a |Blob| and each
2764      character in a |String|.
2765
2766      {expr2} must be a |string| or |Funcref|.
2767
2768      If {expr2} is a |string|, inside {expr2} |v:val| has the value
2769      of the current item.  For a |Dictionary| |v:key| has the key
2770      of the current item and for a |List| |v:key| has the index of
2771      the current item.  For a |Blob| |v:key| has the index of the
2772      current byte.  For a |String| |v:key| has the index of the
2773      current character.
2774      Examples: >vim
2775      	call filter(mylist, 'v:val !~ "OLD"')
2776      <Removes the items where "OLD" appears. >vim
2777      	call filter(mydict, 'v:key >= 8')
2778      <Removes the items with a key below 8. >vim
2779      	call filter(var, 0)
2780      <Removes all the items, thus clears the |List| or |Dictionary|.
2781
2782      Note that {expr2} is the result of expression and is then
2783      used as an expression again.  Often it is good to use a
2784      |literal-string| to avoid having to double backslashes.
2785
2786      If {expr2} is a |Funcref| it must take two arguments:
2787      	1. the key or the index of the current item.
2788      	2. the value of the current item.
2789      The function must return |TRUE| if the item should be kept.
2790      Example that keeps the odd items of a list: >vim
2791      	func Odd(idx, val)
2792      	  return a:idx % 2 == 1
2793      	endfunc
2794      	call filter(mylist, function('Odd'))
2795      <It is shorter when using a |lambda|: >vim
2796      	call filter(myList, {idx, val -> idx * val <= 42})
2797      <If you do not use "val" you can leave it out: >vim
2798      	call filter(myList, {idx -> idx % 2 == 1})
2799      <
2800      For a |List| and a |Dictionary| the operation is done
2801      in-place.  If you want it to remain unmodified make a copy
2802      first: >vim
2803      	let l = filter(copy(mylist), 'v:val =~ "KEEP"')
2804
2805      <Returns {expr1}, the |List| or |Dictionary| that was filtered,
2806      or a new |Blob| or |String|.
2807      When an error is encountered while evaluating {expr2} no
2808      further items in {expr1} are processed.
2809      When {expr2} is a Funcref errors inside a function are
2810      ignored, unless it was defined with the "abort" flag.
2811
2812    ]=],
2813    name = 'filter',
2814    params = { { 'expr1', 'string|table' }, { 'expr2', 'string|function' } },
2815    signature = 'filter({expr1}, {expr2})',
2816    see_lua = { '|vim.tbl_filter()| for lists; dicts, strings, and blobs differ' },
2817  },
2818  finddir = {
2819    args = { 1, 3 },
2820    base = 1,
2821    desc = [=[
2822      Find directory {name} in {path}.  Supports both downwards and
2823      upwards recursive directory searches.  See |file-searching|
2824      for the syntax of {path}.
2825
2826      Returns the path of the first found match.  When the found
2827      directory is below the current directory a relative path is
2828      returned.  Otherwise a full path is returned.
2829      If {path} is omitted or empty then 'path' is used.
2830
2831      If the optional {count} is given, find {count}'s occurrence of
2832      {name} in {path} instead of the first one.
2833      When {count} is negative return all the matches in a |List|.
2834
2835      Returns an empty string if the directory is not found.
2836
2837      This is quite similar to the ex-command `:find`.
2838
2839    ]=],
2840    name = 'finddir',
2841    params = { { 'name', 'string' }, { 'path', 'string' }, { 'count', 'integer' } },
2842    returns = 'string|string[]',
2843    signature = 'finddir({name} [, {path} [, {count}]])',
2844    see_lua = {
2845      "|vim.fs.find()| with `type = 'directory'`; `path`, `count`, and return semantics differ",
2846    },
2847  },
2848  findfile = {
2849    args = { 1, 3 },
2850    base = 1,
2851    desc = [=[
2852      Just like |finddir()|, but find a file instead of a directory.
2853      Uses 'suffixesadd'.
2854      Example: >vim
2855      	echo findfile("tags.vim", ".;")
2856      <Searches from the directory of the current file upwards until
2857      it finds the file "tags.vim".
2858
2859    ]=],
2860    name = 'findfile',
2861    params = { { 'name', 'string' }, { 'path', 'string' }, { 'count', 'integer' } },
2862    returns = 'string|string[]',
2863    signature = 'findfile({name} [, {path} [, {count}]])',
2864    see_lua = {
2865      "|vim.fs.find()|; `path`, `count`, return semantics, and |'suffixesadd'| handling differ",
2866    },
2867  },
2868  flatten = {
2869    args = { 1, 2 },
2870    base = 1,
2871    desc = [=[
2872      Flatten {list} up to {maxdepth} levels.  Without {maxdepth}
2873      the result is a |List| without nesting, as if {maxdepth} is
2874      a very large number.
2875      The {list} is changed in place, use |flattennew()| if you do
2876      not want that.
2877      					*E900*
2878      {maxdepth} means how deep in nested lists changes are made.
2879      {list} is not modified when {maxdepth} is 0.
2880      {maxdepth} must be positive number.
2881
2882      If there is an error the number zero is returned.
2883
2884      Example: >vim
2885      	echo flatten([1, [2, [3, 4]], 5])
2886      <	[1, 2, 3, 4, 5] >vim
2887      	echo flatten([1, [2, [3, 4]], 5], 1)
2888      <	[1, 2, [3, 4], 5]
2889
2890    ]=],
2891    name = 'flatten',
2892    params = { { 'list', 'any[]' }, { 'maxdepth', 'integer' } },
2893    returns = 'any[]|0',
2894    signature = 'flatten({list} [, {maxdepth}])',
2895    see_lua = {
2896      '`vim.iter(list):flatten():totable()` for a new flattened list; in-place updates and `maxdepth` differ',
2897    },
2898  },
2899  flattennew = {
2900    args = { 1, 2 },
2901    base = 1,
2902    desc = [=[
2903      Like |flatten()| but first make a copy of {list}.
2904    ]=],
2905    name = 'flattennew',
2906    params = { { 'list', 'any[]' }, { 'maxdepth', 'integer' } },
2907    returns = 'any[]|0',
2908    signature = 'flattennew({list} [, {maxdepth}])',
2909    see_lua = {
2910      '`vim.iter(list):flatten():totable()` for a new flattened list; `maxdepth` differs',
2911    },
2912  },
2913  float2nr = {
2914    args = 1,
2915    base = 1,
2916    desc = [=[
2917      Convert {expr} to a Number by omitting the part after the
2918      decimal point.
2919      {expr} must evaluate to a |Float| or a |Number|.
2920      Returns 0 if {expr} is not a |Float| or a |Number|.
2921      When the value of {expr} is out of range for a |Number| the
2922      result is truncated to 0x7fffffff or -0x7fffffff (or when
2923      64-bit Number support is enabled, 0x7fffffffffffffff or
2924      -0x7fffffffffffffff).  NaN results in -0x80000000 (or when
2925      64-bit Number support is enabled, -0x8000000000000000).
2926      Examples: >vim
2927      	echo float2nr(3.95)
2928      <	3  >vim
2929      	echo float2nr(-23.45)
2930      <	-23  >vim
2931      	echo float2nr(1.0e100)
2932      <	2147483647  (or 9223372036854775807) >vim
2933      	echo float2nr(-1.0e150)
2934      <	-2147483647 (or -9223372036854775807) >vim
2935      	echo float2nr(1.0e-100)
2936      <	0
2937
2938    ]=],
2939    name = 'float2nr',
2940    params = { { 'expr', 'number' } },
2941    signature = 'float2nr({expr})',
2942    see_lua = { '|math.modf()| (first return value)' },
2943  },
2944  floor = {
2945    args = 1,
2946    base = 1,
2947    desc = [=[
2948      Return the largest integral value less than or equal to
2949      {expr} as a |Float| (round down).
2950      {expr} must evaluate to a |Float| or a |Number|.
2951      Returns 0.0 if {expr} is not a |Float| or a |Number|.
2952      Examples: >vim
2953      	echo floor(1.856)
2954      <	1.0  >vim
2955      	echo floor(-5.456)
2956      <	-6.0  >vim
2957      	echo floor(4.0)
2958      <	4.0
2959
2960    ]=],
2961    func_float = 'floor',
2962    name = 'floor',
2963    params = { { 'expr', 'number' } },
2964    signature = 'floor({expr})',
2965    see_lua = { '|math.floor()|' },
2966  },
2967  fmod = {
2968    args = 2,
2969    base = 1,
2970    desc = [=[
2971      Return the remainder of {expr1} / {expr2}, even if the
2972      division is not representable.  Returns {expr1} - i * {expr2}
2973      for some integer i such that if {expr2} is non-zero, the
2974      result has the same sign as {expr1} and magnitude less than
2975      the magnitude of {expr2}.  If {expr2} is zero, the value
2976      returned is zero.  The value returned is a |Float|.
2977      {expr1} and {expr2} must evaluate to a |Float| or a |Number|.
2978      Returns 0.0 if {expr1} or {expr2} is not a |Float| or a
2979      |Number|.
2980      Examples: >vim
2981      	echo fmod(12.33, 1.22)
2982      <	0.13 >vim
2983      	echo fmod(-12.33, 1.22)
2984      <	-0.13
2985
2986    ]=],
2987    name = 'fmod',
2988    params = { { 'expr1', 'number' }, { 'expr2', 'number' } },
2989    signature = 'fmod({expr1}, {expr2})',
2990    see_lua = { '|math.fmod()|' },
2991  },
2992  fnameescape = {
2993    args = 1,
2994    base = 1,
2995    desc = [=[
2996      Escapes {filepath} for use as a command argument.
2997
2998      (Note: To open a literal filepath programmatically use
2999      `bufadd(vim.fs.normalize(…))`, see |open-file|.)
3000
3001      All characters that have a special meaning, such as `'%'` and
3002      `'|'` are escaped with a backslash. For most systems the
3003      characters escaped are: >
3004      	\t\n *?[{`$\\%#'\"|!<
3005      <For systems where a backslash appears in a filename, it
3006      depends on the value of 'isfname'. A leading '+' and '>' is
3007      also escaped (special after |:edit| and |:write|).  And a "-"
3008      by itself (special after |:cd|).
3009      Returns an empty string on error.
3010      Example: >vim
3011      	let fname = '+some str%nge|name'
3012      	exe "edit " .. fnameescape(fname)
3013      <results in executing: >vim
3014      	edit \+some\ str\%nge\|name
3015      <
3016    ]=],
3017    fast = true,
3018    name = 'fnameescape',
3019    params = { { 'filepath', 'string' } },
3020    returns = 'string',
3021    signature = 'fnameescape({filepath})',
3022  },
3023  fnamemodify = {
3024    args = 2,
3025    base = 1,
3026    desc = [=[
3027      Modify file name {fname} according to {mods}.  {mods} is a
3028      string of characters like it is used for file names on the
3029      command line.  See |filename-modifiers|.
3030      Example: >vim
3031      	echo fnamemodify("main.c", ":p:h")
3032      <results in: >
3033      	/home/user/vim/vim/src
3034      <If {mods} is empty or an unsupported modifier is used then
3035      {fname} is returned.
3036      When {fname} is empty then with {mods} ":h" returns ".", so
3037      that `:cd` can be used with it.  This is different from
3038      expand('%:h') without a buffer name, which returns an empty
3039      string.
3040      Note: Environment variables don't work in {fname}, use
3041      |expand()| first then.
3042
3043    ]=],
3044    fast = true,
3045    name = 'fnamemodify',
3046    params = { { 'fname', 'string' }, { 'mods', 'string' } },
3047    returns = 'string',
3048    signature = 'fnamemodify({fname}, {mods})',
3049    see_lua = {
3050      '|vim.fs.dirname()|, |vim.fs.basename()|, |vim.fs.abspath()|, and |vim.fs.normalize()| for common path modifiers; modifier coverage differs',
3051    },
3052  },
3053  foldclosed = {
3054    args = 1,
3055    base = 1,
3056    desc = [=[
3057      Returns the first line number of the closed fold containing
3058      line {lnum}.  If the line {lnum} is not in a closed fold,
3059      -1 is returned.
3060      {lnum} is used like with |getline()|.  Thus "." is the current
3061      line, "'m" mark m, etc.
3062
3063    ]=],
3064    name = 'foldclosed',
3065    params = { { 'lnum', 'integer|string' } },
3066    returns = 'integer',
3067    signature = 'foldclosed({lnum})',
3068  },
3069  foldclosedend = {
3070    args = 1,
3071    base = 1,
3072    desc = [=[
3073      Returns the last line number of the closed fold containing
3074      line {lnum}.  If the line {lnum} is not in a closed fold,
3075      -1 is returned.
3076      {lnum} is used like with |getline()|.  Thus "." is the current
3077      line, "'m" mark m, etc.
3078
3079    ]=],
3080    name = 'foldclosedend',
3081    params = { { 'lnum', 'integer|string' } },
3082    returns = 'integer',
3083    signature = 'foldclosedend({lnum})',
3084  },
3085  foldlevel = {
3086    args = 1,
3087    base = 1,
3088    desc = [=[
3089      Returns the fold nesting level of line {lnum} in the current
3090      buffer.  {lnum} is used like with |getline()| ("." is the
3091      current line, "'m" mark m, etc).
3092
3093      For nested folds the deepest level is returned.  If there is
3094      no fold at line {lnum}, zero is returned.  It doesn't matter
3095      if the folds are open or closed. When used while updating
3096      folds (from 'foldexpr') -1 is returned for lines where folds
3097      are still to be updated and the foldlevel is unknown.  As
3098      a special case the level of the previous line is usually
3099      available.
3100    ]=],
3101    name = 'foldlevel',
3102    params = { { 'lnum', 'integer|string' } },
3103    returns = 'integer',
3104    signature = 'foldlevel({lnum})',
3105  },
3106  foldtext = {
3107    desc = [=[
3108      Returns a String, to be displayed for a closed fold.  This is
3109      the default function used for the 'foldtext' option and should
3110      only be called from evaluating 'foldtext'.  It uses the
3111      |v:foldstart|, |v:foldend| and |v:folddashes| variables.
3112      The returned string looks like this: >
3113      	+-- 45 lines: abcdef
3114      <The number of leading dashes depends on the foldlevel.  The
3115      "45" is the number of lines in the fold.  "abcdef" is the text
3116      in the first non-blank line of the fold.  Leading white space,
3117      "//" or "/*" and the text from the 'foldmarker' and
3118      'commentstring' options is removed.
3119      When used to draw the actual foldtext, the rest of the line
3120      will be filled with the fold char from the 'fillchars'
3121      setting.
3122      Returns an empty string when there is no fold.
3123    ]=],
3124    name = 'foldtext',
3125    params = {},
3126    returns = 'string',
3127    signature = 'foldtext()',
3128  },
3129  foldtextresult = {
3130    args = 1,
3131    base = 1,
3132    desc = [=[
3133      Returns the text that is displayed for the closed fold at line
3134      {lnum}.  Evaluates 'foldtext' in the appropriate context.
3135      When there is no closed fold at {lnum} an empty string is
3136      returned.
3137      {lnum} is used like with |getline()|.  Thus "." is the current
3138      line, "'m" mark m, etc.
3139      Useful when exporting folded text, e.g., to HTML.
3140
3141    ]=],
3142    name = 'foldtextresult',
3143    params = { { 'lnum', 'integer|string' } },
3144    returns = 'string',
3145    signature = 'foldtextresult({lnum})',
3146  },
3147  foreach = {
3148    args = 2,
3149    base = 1,
3150    desc = [=[
3151      {expr1} must be a |List|, |String|, |Blob| or |Dictionary|.
3152      For each item in {expr1} execute {expr2}.  {expr1} is not
3153      modified; its values may be, as with |:lockvar| 1. |E741|
3154      See |map()| and |filter()| to modify {expr1}.
3155
3156      {expr2} must be a |string| or |Funcref|.
3157
3158      If {expr2} is a |string|, inside {expr2} |v:val| has the value
3159      of the current item.  For a |Dictionary| |v:key| has the key
3160      of the current item and for a |List| |v:key| has the index of
3161      the current item.  For a |Blob| |v:key| has the index of the
3162      current byte.  For a |String| |v:key| has the index of the
3163      current character.
3164      Examples: >vim
3165      	call foreach(mylist, 'let used[v:val] = v:true')
3166      <This records the items that are in the {expr1} list.
3167
3168      Note that {expr2} is the result of expression and is then used
3169      as a command.  Often it is good to use a |literal-string| to
3170      avoid having to double backslashes.
3171
3172      If {expr2} is a |Funcref| it must take two arguments:
3173      	1. the key or the index of the current item.
3174      	2. the value of the current item.
3175      With a lambda you don't get an error if it only accepts one
3176      argument.
3177      If the function returns a value, it is ignored.
3178
3179      Returns {expr1} in all cases.
3180      When an error is encountered while executing {expr2} no
3181      further items in {expr1} are processed.
3182      When {expr2} is a Funcref errors inside a function are
3183      ignored, unless it was defined with the "abort" flag.
3184    ]=],
3185    name = 'foreach',
3186    params = { { 'expr1', 'string|table' }, { 'expr2', 'string|function' } },
3187    returns = 'string|table',
3188    signature = 'foreach({expr1}, {expr2})',
3189    see_lua = { '|pairs()|', '|ipairs()|' },
3190  },
3191  foreground = {
3192    args = 0,
3193    params = {},
3194    lua = false,
3195  },
3196  fullcommand = {
3197    args = 1,
3198    base = 1,
3199    desc = [=[
3200      Get the full command name from a short abbreviated command
3201      name; see |20.2| for details on command abbreviations.
3202
3203      The string argument {name} may start with a `:` and can
3204      include a [range], these are skipped and not returned.
3205      Returns an empty string if a command doesn't exist or if it's
3206      ambiguous (for user-defined commands).
3207
3208      Note: Command validation is not performed.  Results depend on
3209      Vim's internal command-specific identification rules.
3210      Examples:
3211      >vim
3212        echo [fullcommand('s')]		|" ['substitute']
3213        echo [fullcommand('sub')]		|" ['substitute']
3214        echo [fullcommand(': mark word')]	|" ['mark']
3215        echo [fullcommand(': markword')]	|" ['']
3216        echo [fullcommand('en')]		|" ['endif']
3217      <
3218    ]=],
3219    name = 'fullcommand',
3220    params = { { 'name', 'string' } },
3221    returns = 'string',
3222    signature = 'fullcommand({name})',
3223  },
3224  funcref = {
3225    args = { 1, 3 },
3226    base = 1,
3227    desc = [=[
3228      Just like |function()|, but the returned Funcref will lookup
3229      the function by reference, not by name.  This matters when the
3230      function {name} is redefined later.
3231
3232      Unlike |function()|, {name} must be an existing user function.
3233      It only works for an autoloaded function if it has already
3234      been loaded (to avoid mistakenly loading the autoload script
3235      when only intending to use the function name, use |function()|
3236      instead).  {name} cannot be a builtin function.
3237      Returns 0 on error.
3238
3239    ]=],
3240    name = 'funcref',
3241    params = { { 'name', 'string' }, { 'arglist', 'any' }, { 'dict', 'any' } },
3242    signature = 'funcref({name} [, {arglist}] [, {dict}])',
3243    see_lua = false,
3244  },
3245  ['function'] = {
3246    args = { 1, 3 },
3247    base = 1,
3248    desc = [=[
3249      Return a |Funcref| variable that refers to function {name}.
3250      {name} can be the name of a user defined function or an
3251      internal function.
3252
3253      {name} can also be a Funcref or a partial. When it is a
3254      partial the dict stored in it will be used and the {dict}
3255      argument is not allowed.  E.g.: >vim
3256      	let FuncWithArg = function(dict.Func, [arg])
3257      	let Broken = function(dict.Func, [arg], dict)
3258      <
3259      When using the Funcref the function will be found by {name},
3260      also when it was redefined later. Use |funcref()| to keep the
3261      same function.
3262
3263      When {arglist} or {dict} is present this creates a partial.
3264      That means the argument list and/or the dictionary is stored
3265      in the Funcref and will be used when the Funcref is called.
3266
3267      The arguments are passed to the function in front of other
3268      arguments, but after any argument from |method|.  Example: >vim
3269      	func Callback(arg1, arg2, name)
3270      	"...
3271      	endfunc
3272      	let Partial = function('Callback', ['one', 'two'])
3273      	"...
3274      	call Partial('name')
3275      <Invokes the function as with: >vim
3276      	call Callback('one', 'two', 'name')
3277
3278      <With a |method|: >vim
3279      	func Callback(one, two, three)
3280      	"...
3281      	endfunc
3282      	let Partial = function('Callback', ['two'])
3283      	"...
3284      	eval 'one'->Partial('three')
3285      <Invokes the function as with: >vim
3286      	call Callback('one', 'two', 'three')
3287
3288      <The function() call can be nested to add more arguments to the
3289      Funcref.  The extra arguments are appended to the list of
3290      arguments.  Example: >vim
3291      	func Callback(arg1, arg2, name)
3292      	"...
3293      	endfunc
3294      	let Func = function('Callback', ['one'])
3295      	let Func2 = function(Func, ['two'])
3296      	"...
3297      	call Func2('name')
3298      <Invokes the function as with: >vim
3299      	call Callback('one', 'two', 'name')
3300
3301      <The Dictionary is only useful when calling a "dict" function.
3302      In that case the {dict} is passed in as "self".  Example: >vim
3303      	function Callback() dict
3304      	   echo "called for " .. self.name
3305      	endfunction
3306      	"...
3307      	let context = {"name": "example"}
3308      	let Func = function('Callback', context)
3309      	"...
3310      	call Func()	" will echo: called for example
3311      <The use of function() is not needed when there are no extra
3312      arguments, these two are equivalent, if Callback() is defined
3313      as context.Callback(): >vim
3314      	let Func = function('Callback', context)
3315      	let Func = context.Callback
3316
3317      <The argument list and the Dictionary can be combined: >vim
3318      	function Callback(arg1, count) dict
3319      	"...
3320      	endfunction
3321      	let context = {"name": "example"}
3322      	let Func = function('Callback', ['one'], context)
3323      	"...
3324      	call Func(500)
3325      <Invokes the function as with: >vim
3326      	call context.Callback('one', 500)
3327      <
3328      Returns 0 on error.
3329
3330    ]=],
3331    name = 'function',
3332    params = { { 'name', 'string' }, { 'arglist', 'any' }, { 'dict', 'any' } },
3333    signature = 'function({name} [, {arglist}] [, {dict}])',
3334    tags = { 'partial', 'E700', 'E923' },
3335    see_lua = false,
3336  },
3337  garbagecollect = {
3338    args = { 0, 1 },
3339    desc = [=[
3340      Cleanup unused |Lists| and |Dictionaries| that have circular
3341      references.
3342
3343      There is hardly ever a need to invoke this function, as it is
3344      automatically done when Vim runs out of memory or is waiting
3345      for the user to press a key after 'updatetime'.  Items without
3346      circular references are always freed when they become unused.
3347      This is useful if you have deleted a very big |List| and/or
3348      |Dictionary| with circular references in a script that runs
3349      for a long time.
3350
3351      When the optional {atexit} argument is one, garbage
3352      collection will also be done when exiting Vim, if it wasn't
3353      done before.  This is useful when checking for memory leaks.
3354
3355      The garbage collection is not done immediately but only when
3356      it's safe to perform.  This is when waiting for the user to
3357      type a character.
3358    ]=],
3359    name = 'garbagecollect',
3360    params = { { 'atexit', 'boolean' } },
3361    signature = 'garbagecollect([{atexit}])',
3362    see_lua = false,
3363  },
3364  get = {
3365    args = { 2, 3 },
3366    base = 1,
3367    desc = [=[
3368      Get item {idx} from |List| {list}.  When this item is not
3369      available return {default}.  Return zero when {default} is
3370      omitted.
3371    ]=],
3372    name = 'get',
3373    params = { { 'list', 'any[]' }, { 'idx', 'integer' }, { 'default', 'any' } },
3374    signature = 'get({list}, {idx} [, {default}])',
3375    tags = { 'get()-list' },
3376    see_lua = false,
3377  },
3378  get__1 = {
3379    args = { 2, 3 },
3380    base = 1,
3381    desc = [=[
3382      Get byte {idx} from |Blob| {blob}.  When this byte is not
3383      available return {default}.  Return -1 when {default} is
3384      omitted.
3385    ]=],
3386    name = 'get',
3387    params = { { 'blob', 'string' }, { 'idx', 'integer' }, { 'default', 'any' } },
3388    signature = 'get({blob}, {idx} [, {default}])',
3389    tags = { 'get()-blob' },
3390    see_lua = false,
3391  },
3392  get__2 = {
3393    args = { 2, 3 },
3394    base = 1,
3395    desc = [=[
3396      Get item with key {key} from |Dictionary| {dict}.  When this
3397      item is not available return {default}.  Return zero when
3398      {default} is omitted.  Useful example: >vim
3399      	let val = get(g:, 'var_name', 'default')
3400      <This gets the value of g:var_name if it exists, and uses
3401      "default" when it does not exist.
3402    ]=],
3403    name = 'get',
3404    params = { { 'dict', 'table<string,any>' }, { 'key', 'string' }, { 'default', 'any' } },
3405    signature = 'get({dict}, {key} [, {default}])',
3406    tags = { 'get()-dict' },
3407    see_lua = false,
3408  },
3409  get__3 = {
3410    args = { 2, 3 },
3411    base = 1,
3412    desc = [=[
3413      Get item {what} from |Funcref| {func}.  Possible values for
3414      {what} are:
3415        "name"    The function name
3416        "func"    The function
3417        "dict"    The dictionary
3418        "args"    The list with arguments
3419        "arity"   A dictionary with information about the number of
3420      	    arguments accepted by the function (minus the
3421      	    {arglist}) with the following fields:
3422      		required    the number of positional arguments
3423      		optional    the number of optional arguments,
3424      			    in addition to the required ones
3425      		varargs     |TRUE| if the function accepts a
3426      			    variable number of arguments |...|
3427
3428      		Note: There is no error, if the {arglist} of
3429      		the Funcref contains more arguments than the
3430      		Funcref expects, it's not validated.
3431
3432      Returns zero on error.
3433    ]=],
3434    name = 'get',
3435    params = { { 'func', 'function' }, { 'what', 'string' } },
3436    returns = 'any',
3437    signature = 'get({func}, {what})',
3438    tags = { 'get()-func' },
3439    see_lua = false,
3440  },
3441  getbufinfo = {
3442    args = { 0, 1 },
3443    base = 1,
3444    name = 'getbufinfo',
3445    params = { { 'buf', 'integer|string' } },
3446    signature = 'getbufinfo([{buf}])',
3447    returns = 'vim.fn.getbufinfo.ret.item[]',
3448  },
3449  getbufinfo__1 = {
3450    args = { 0, 1 },
3451    base = 1,
3452    desc = [=[
3453      Get information about buffers as a List of Dictionaries.
3454
3455      Without an argument information about all the buffers is
3456      returned.
3457
3458      When the argument is a |Dictionary| only the buffers matching
3459      the specified criteria are returned.  The following keys can
3460      be specified in {dict}:
3461      	buflisted	include only listed buffers.
3462      	bufloaded	include only loaded buffers.
3463      	bufmodified	include only modified buffers.
3464
3465      Otherwise, {buf} specifies a particular buffer to return
3466      information for.  For the use of {buf}, see |bufname()|
3467      above.  If the buffer is found the returned List has one item.
3468      Otherwise the result is an empty list.
3469
3470      Each returned List item is a dictionary with the following
3471      entries:
3472      	bufnr		Buffer number.
3473      	changed		TRUE if the buffer is modified.
3474      	changedtick	Number of changes made to the buffer.
3475      	command		TRUE if the buffer belongs to the
3476      			command-line window |cmdwin|.
3477      	hidden		TRUE if the buffer is hidden.
3478      	lastused	Timestamp in seconds, like
3479      			|localtime()|, when the buffer was
3480      			last used.
3481      	listed		TRUE if the buffer is listed.
3482      	lnum		Line number used for the buffer when
3483      			opened in the current window.
3484      			Only valid if the buffer has been
3485      			displayed in the window in the past.
3486      			If you want the line number of the
3487      			last known cursor position in a given
3488      			window, use |line()|: >vim
3489      				echo line('.', {winid})
3490      <
3491      	linecount	Number of lines in the buffer (only
3492      			valid when loaded)
3493      	loaded		TRUE if the buffer is loaded.
3494      	name		Full path to the file in the buffer.
3495      	signs		List of signs placed in the buffer.
3496      			Each list item is a dictionary with
3497      			the following fields:
3498      			    id	  sign identifier
3499      			    lnum  line number
3500      			    name  sign name
3501      	variables	A reference to the dictionary with
3502      			buffer-local variables.
3503      	windows		List of |window-ID|s that display this
3504      			buffer
3505
3506      Examples: >vim
3507      	for buf in getbufinfo()
3508      	    echo buf.name
3509      	endfor
3510      	for buf in getbufinfo({'buflisted':1})
3511      	    if buf.changed
3512      		" ....
3513      	    endif
3514      	endfor
3515      <
3516      To get buffer-local options use: >vim
3517      	getbufvar({bufnr}, '&option_name')
3518      <
3519    ]=],
3520    name = 'getbufinfo',
3521    params = { { 'dict', 'vim.fn.getbufinfo.dict' } },
3522    signature = 'getbufinfo([{dict}])',
3523    returns = 'vim.fn.getbufinfo.ret.item[]',
3524  },
3525  getbufline = {
3526    args = { 2, 3 },
3527    base = 1,
3528    desc = [=[
3529      Return a |List| with the lines starting from {lnum} to {end}
3530      (inclusive) in the buffer {buf}.  If {end} is omitted, a
3531      |List| with only the line {lnum} is returned.  See
3532      `getbufoneline()` for only getting the line.
3533
3534      For the use of {buf}, see |bufname()| above.
3535
3536      For {lnum} and {end} "$" can be used for the last line of the
3537      buffer.  Otherwise a number must be used.
3538
3539      When {lnum} is smaller than 1 or bigger than the number of
3540      lines in the buffer, an empty |List| is returned.
3541
3542      When {end} is greater than the number of lines in the buffer,
3543      it is treated as {end} is set to the number of lines in the
3544      buffer.  When {end} is before {lnum} an empty |List| is
3545      returned.
3546
3547      This function works only for loaded buffers.  For unloaded and
3548      non-existing buffers, an empty |List| is returned.
3549
3550      Example: >vim
3551      	let lines = getbufline(bufnr("myfile"), 1, "$")
3552      <
3553
3554    ]=],
3555    name = 'getbufline',
3556    params = { { 'buf', 'integer|string' }, { 'lnum', 'integer' }, { 'end', 'integer' } },
3557    returns = 'string[]',
3558    signature = 'getbufline({buf}, {lnum} [, {end}])',
3559    see_lua = { '|nvim_buf_get_lines()|' },
3560  },
3561  getbufoneline = {
3562    args = 2,
3563    base = 1,
3564    desc = [=[
3565      Just like `getbufline()` but only get one line and return it
3566      as a string.
3567    ]=],
3568    name = 'getbufoneline',
3569    params = { { 'buf', 'integer|string' }, { 'lnum', 'integer' } },
3570    signature = 'getbufoneline({buf}, {lnum})',
3571    returns = 'string',
3572    see_lua = { '|nvim_buf_get_lines()|' },
3573  },
3574  getbufvar = {
3575    args = { 2, 3 },
3576    base = 1,
3577    desc = [=[
3578      Gets the value of a buffer-local variable or option {varname}
3579      in buffer {buf}.
3580
3581      {varname} is a string:
3582      - Name of the variable (without "b:").
3583      - If empty, gets a |Dictionary| of all buffer-local variables.
3584      - If "&", gets a |Dictionary| of all buffer-local options.
3585      - If it starts with "&", gets the value of a buffer-local
3586        option.
3587
3588      {buf} has the same form as in |bufname()|.
3589
3590      Also works for a global or buffer-local option. But not for
3591      a global variable, window-local variable or window-local
3592      option.
3593
3594      When the buffer or variable doesn't exist, {def} or an empty
3595      string is returned; there is no error.
3596
3597      Examples: >vim
3598      	let bufmodified = getbufvar(1, "&mod")
3599      	echo "todo myvar = " .. getbufvar("todo", "myvar")
3600      <
3601    ]=],
3602    name = 'getbufvar',
3603    params = { { 'buf', 'integer|string' }, { 'varname', 'string' }, { 'def', 'any' } },
3604    signature = 'getbufvar({buf}, {varname} [, {def}])',
3605    see_lua = {
3606      '|nvim_buf_get_var()| or |vim.b| after resolving {buf} to a bufnr; option names use |nvim_get_option_value()| or |vim.bo|',
3607    },
3608  },
3609  getcellwidths = {
3610    desc = [=[
3611      Returns a |List| of cell widths of character ranges overridden
3612      by |setcellwidths()|.  The format is equal to the argument of
3613      |setcellwidths()|.  If no character ranges have their cell
3614      widths overridden, an empty List is returned.
3615    ]=],
3616    name = 'getcellwidths',
3617    params = {},
3618    signature = 'getcellwidths()',
3619  },
3620  getchangelist = {
3621    args = { 0, 1 },
3622    base = 1,
3623    desc = [=[
3624      Returns the |changelist| for the buffer {buf}.  For the use
3625      of {buf}, see |bufname()| above.  If buffer {buf} doesn't
3626      exist, an empty list is returned.
3627
3628      The returned list contains two entries: a list with the change
3629      locations and the current position in the list.  Each
3630      entry in the change list is a dictionary with the following
3631      entries:
3632      	col		column number
3633      	coladd		column offset for 'virtualedit'
3634      	lnum		line number
3635      If buffer {buf} is the current buffer, then the current
3636      position refers to the position in the list.  For other
3637      buffers, it is set to the length of the list.
3638
3639    ]=],
3640    name = 'getchangelist',
3641    params = { { 'buf', 'integer|string' } },
3642    returns = 'table[]',
3643    signature = 'getchangelist([{buf}])',
3644  },
3645  getchar = {
3646    args = { 0, 2 },
3647    desc = [=[
3648      Get a single character from the user or input stream.
3649      If {expr} is omitted or is -1, wait until a character is
3650      	available.
3651      If {expr} is 0, only get a character when one is available.
3652      	Return zero otherwise.
3653      If {expr} is 1, only check if a character is available, it is
3654      	not consumed.  Return zero if no character available.
3655      To always get a string, specify "number" as |FALSE| in {opts}.
3656
3657      Without {expr} and when {expr} is 0 a whole character or
3658      special key is returned.  If it is a single character, the
3659      result is a Number.  Use |nr2char()| to convert it to a String.
3660      Otherwise a String is returned with the encoded character.
3661      For a special key it's a String with a sequence of bytes
3662      starting with 0x80 (decimal: 128).  This is the same value as
3663      the String "\<Key>", e.g., "\<Left>".  The returned value is
3664      also a String when a modifier (shift, control, alt) was used
3665      that is not included in the character.  |keytrans()| can also
3666      be used to convert a returned String into a readable form.
3667
3668      When {expr} is 0 and Esc is typed, there will be a short delay
3669      while Vim waits to see if this is the start of an escape
3670      sequence.
3671
3672      When {expr} is 1 only the first byte is returned.  For a
3673      one-byte character it is the character itself as a number.
3674      Use |nr2char()| to convert it to a String.
3675
3676      Use |getcharmod()| to obtain any additional modifiers.
3677
3678      The optional argument {opts} is a Dict and supports the
3679      following items:
3680
3681      	cursor		A String specifying cursor behavior
3682      			when waiting for a character.
3683      			"hide": hide the cursor.
3684      			"keep": keep current cursor unchanged.
3685      			"msg": move cursor to message area.
3686      			(default: automagically decide
3687      			between "keep" and "msg")
3688
3689      	number		If |TRUE|, return a Number when getting
3690      			a single character.
3691      			If |FALSE|, the return value is always
3692      			converted to a String, and an empty
3693      			String (instead of 0) is returned when
3694      			no character is available.
3695      			(default: |TRUE|)
3696
3697      	simplify	If |TRUE|, include modifiers in the
3698      			character if possible.  E.g., return
3699      			the same value for CTRL-I and <Tab>.
3700      			If |FALSE|, don't include modifiers in
3701      			the character.
3702      			(default: |TRUE|)
3703
3704      When the user clicks a mouse button, the mouse event will be
3705      returned.  The position can then be found in |v:mouse_col|,
3706      |v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|.
3707      |getmousepos()| can also be used.  Mouse move events will be
3708      ignored.
3709      This example positions the mouse as it would normally happen: >vim
3710      	let c = getchar()
3711      	if c == "\<LeftMouse>" && v:mouse_win > 0
3712      	  exe v:mouse_win .. "wincmd w"
3713      	  exe v:mouse_lnum
3714      	  exe "normal " .. v:mouse_col .. "|"
3715      	endif
3716      <
3717      There is no prompt, you will somehow have to make clear to the
3718      user that a character has to be typed.  The screen is not
3719      redrawn, e.g. when resizing the window.
3720
3721      There is no mapping for the character.
3722      Key codes are replaced, thus when the user presses the <Del>
3723      key you get the code for the <Del> key, not the raw character
3724      sequence.  Examples: >vim
3725      	getchar() == "\<Del>"
3726      	getchar() == "\<S-Left>"
3727      <This example redefines "f" to ignore case: >vim
3728      	nmap f :call FindChar()<CR>
3729      	function FindChar()
3730      	  let c = nr2char(getchar())
3731      	  while col('.') < col('$') - 1
3732      	    normal l
3733      	    if getline('.')[col('.') - 1] ==? c
3734      	      break
3735      	    endif
3736      	  endwhile
3737      	endfunction
3738      <
3739    ]=],
3740    name = 'getchar',
3741    params = { { 'expr', '-1|0|1' }, { 'opts', 'table' } },
3742    returns = 'integer|string',
3743    signature = 'getchar([{expr} [, {opts}]])',
3744  },
3745  getcharmod = {
3746    desc = [=[
3747      Returns the state of the keyboard modifiers for the last
3748      character obtained with |getchar()| or in another way.
3749      These values are added together:
3750      	2	shift
3751      	4	control
3752      	8	alt (meta)
3753      	16	meta (when it's different from ALT)
3754      	32	mouse double click
3755      	64	mouse triple click
3756      	96	mouse quadruple click (== 32 + 64)
3757      	128	command (Mac) or super
3758      Only the modifiers that have not been included in the
3759      character itself are obtained.  Thus Shift-a results in "A"
3760      without a modifier.  Returns 0 if no modifiers are used.
3761    ]=],
3762    name = 'getcharmod',
3763    params = {},
3764    returns = 'integer',
3765    signature = 'getcharmod()',
3766  },
3767  getcharpos = {
3768    args = 1,
3769    base = 1,
3770    desc = [=[
3771      Same as |getpos()|, except the column-number is
3772      character-indexed (UTF-8) instead of byte-indexed.
3773
3774      If |getpos()| returns |v:maxcol|, then getcharpos() returns
3775      the index of the last character.
3776
3777      Example:
3778      With the cursor on '세' in line 5 with text "여보세요": >vim
3779      	getcharpos('.')		returns [0, 5, 3, 0]
3780      	getpos('.')		returns [0, 5, 7, 0]
3781      <
3782    ]=],
3783    name = 'getcharpos',
3784    params = { { 'expr', 'string' } },
3785    returns = 'integer[]',
3786    signature = 'getcharpos({expr})',
3787  },
3788  getcharsearch = {
3789    desc = [=[
3790      Return the current character search information as a {dict}
3791      with the following entries:
3792
3793          char	character previously used for a character
3794      		search (|t|, |f|, |T|, or |F|); empty string
3795      		if no character search has been performed
3796          forward	direction of character search; 1 for forward,
3797      		0 for backward
3798          until	type of character search; 1 for a |t| or |T|
3799      		character search, 0 for an |f| or |F|
3800      		character search
3801
3802      This can be useful to always have |;| and |,| search
3803      forward/backward regardless of the direction of the previous
3804      character search: >vim
3805      	nnoremap <expr> ; getcharsearch().forward ? ';' : ','
3806      	nnoremap <expr> , getcharsearch().forward ? ',' : ';'
3807      <Also see |setcharsearch()|.
3808    ]=],
3809    name = 'getcharsearch',
3810    params = {},
3811    returns = '{ char: string, forward: 1|0, until: 1|0 }',
3812    signature = 'getcharsearch()',
3813  },
3814  getcharstr = {
3815    args = { 0, 2 },
3816    desc = [=[
3817      The same as |getchar()|, except that this always returns a
3818      String, and "number" isn't allowed in {opts}.
3819    ]=],
3820    name = 'getcharstr',
3821    params = { { 'expr', '-1|0|1' }, { 'opts', 'table' } },
3822    returns = 'string',
3823    signature = 'getcharstr([{expr} [, {opts}]])',
3824  },
3825  getcmdcomplpat = {
3826    desc = [=[
3827      Return completion pattern of the current command-line.
3828      Only works when the command line is being edited, thus
3829      requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
3830      Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
3831      |getcmdprompt()|, |getcmdcompltype()| and |setcmdline()|.
3832      Returns an empty string when completion is not defined.
3833    ]=],
3834    name = 'getcmdcomplpat',
3835    params = {},
3836    returns = 'string',
3837    signature = 'getcmdcomplpat()',
3838  },
3839  getcmdcompltype = {
3840    desc = [=[
3841      Return the type of the current command-line completion.
3842      Only works when the command line is being edited, thus
3843      requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
3844      See |:command-completion| for the return string.
3845      Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
3846      |getcmdprompt()|, |getcmdcomplpat()| and |setcmdline()|.
3847      Returns an empty string when completion is not defined.
3848
3849      To get the type of the command-line completion for a specified
3850      string, use |getcompletiontype()|.
3851    ]=],
3852    name = 'getcmdcompltype',
3853    params = {},
3854    returns = 'string',
3855    signature = 'getcmdcompltype()',
3856  },
3857  getcmdline = {
3858    desc = [=[
3859      Return the current command-line input.  Only works when the
3860      command line is being edited, thus requires use of
3861      |c_CTRL-\_e| or |c_CTRL-R_=|.
3862      Example: >vim
3863      	cmap <F7> <C-\>eescape(getcmdline(), ' \')<CR>
3864      <Also see |getcmdtype()|, |getcmdpos()|, |setcmdpos()|,
3865      |getcmdprompt()| and |setcmdline()|.
3866      Returns an empty string when entering a password or using
3867      |inputsecret()|.
3868    ]=],
3869    name = 'getcmdline',
3870    params = {},
3871    returns = 'string',
3872    signature = 'getcmdline()',
3873  },
3874  getcmdpos = {
3875    desc = [=[
3876      Return the position of the cursor in the command line as a
3877      byte count.  The first column is 1.
3878      Only works when editing the command line, thus requires use of
3879      |c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
3880      Returns 0 otherwise.
3881      Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
3882      |getcmdprompt()| and |setcmdline()|.
3883    ]=],
3884    name = 'getcmdpos',
3885    params = {},
3886    returns = 'integer',
3887    signature = 'getcmdpos()',
3888  },
3889  getcmdprompt = {
3890    desc = [=[
3891      Return the current command-line prompt when using functions
3892      like |input()| or |confirm()|.
3893      Only works when the command line is being edited, thus
3894      requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
3895      Also see |getcmdtype()|, |getcmdline()|, |getcmdpos()|,
3896      |setcmdpos()| and |setcmdline()|.
3897    ]=],
3898    name = 'getcmdprompt',
3899    params = {},
3900    returns = 'string',
3901    signature = 'getcmdprompt()',
3902  },
3903  getcmdscreenpos = {
3904    desc = [=[
3905      Return the screen position of the cursor in the command line
3906      as a byte count.  The first column is 1.
3907      Instead of |getcmdpos()|, it adds the prompt position.
3908      Only works when editing the command line, thus requires use of
3909      |c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
3910      Returns 0 otherwise.
3911      Also see |getcmdpos()|, |setcmdpos()|, |getcmdline()| and
3912      |setcmdline()|.
3913    ]=],
3914    name = 'getcmdscreenpos',
3915    params = {},
3916    returns = 'integer',
3917    signature = 'getcmdscreenpos()',
3918  },
3919  getcmdtype = {
3920    desc = [=[
3921      Return the current command-line type.  Possible return values
3922      are:
3923          :	normal Ex command
3924          >	debug mode command |debug-mode|
3925          /	forward search command
3926          ?	backward search command
3927          @	|input()| command
3928          `-`	|:insert| or |:append| command
3929          =	|i_CTRL-R_=|
3930      Only works when editing the command line, thus requires use of
3931      |c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
3932      Returns an empty string otherwise.
3933      Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|.
3934    ]=],
3935    name = 'getcmdtype',
3936    params = {},
3937    returns = "':'|'>'|'/'|'?'|'@'|'-'|'='|''",
3938    signature = 'getcmdtype()',
3939  },
3940  getcmdwintype = {
3941    desc = [=[
3942      Return the current |command-line-window| type.  Possible return
3943      values are the same as |getcmdtype()|.  Returns an empty string
3944      when not in the command-line window.
3945    ]=],
3946    name = 'getcmdwintype',
3947    params = {},
3948    returns = "':'|'>'|'/'|'?'|'@'|'-'|'='|''",
3949    signature = 'getcmdwintype()',
3950  },
3951  getcompletion = {
3952    args = { 2, 3 },
3953    base = 1,
3954    desc = [=[
3955      Return a list of command-line completion matches.  The String
3956      {type} argument specifies what for.  The following completion
3957      types are supported:
3958
3959      arglist		file names in argument list
3960      augroup		autocmd groups
3961      buffer		buffer names
3962      breakpoint	|:breakadd| and |:breakdel| suboptions
3963      cmdline		|cmdline-completion| result
3964      color		color schemes
3965      command		Ex command
3966      compiler	compilers
3967      custom,{func}	custom completion, defined via {func}
3968      customlist,{func} custom completion, defined via {func}
3969      diff_buffer	|:diffget| and |:diffput| completion
3970      dir		directory names
3971      dir_in_path	directory names in 'cdpath'
3972      environment	environment variable names
3973      event		autocommand events
3974      expression	Vim expression
3975      file		file and directory names
3976      file_in_path	file and directory names in 'path'
3977      filetype	filetype names 'filetype'
3978      filetypecmd	|:filetype| suboptions
3979      function	function name
3980      help		help subjects
3981      highlight	highlight groups
3982      history		|:history| suboptions
3983      keymap		keyboard mappings
3984      locale		locale names (as output of locale -a)
3985      mapclear	buffer argument
3986      mapping		mapping name
3987      menu		menus
3988      messages	|:messages| suboptions
3989      option		options
3990      packadd		optional package |pack-add| names
3991      retab		|:retab| suboptions
3992      runtime		|:runtime| completion
3993      scriptnames	sourced script names |:scriptnames|
3994      shellcmd	Shell command
3995      shellcmdline	Shell command line with filename arguments
3996      sign		|:sign| suboptions
3997      syntax		syntax file names 'syntax'
3998      syntime		|:syntime| suboptions
3999      tag		tags
4000      tag_listfiles	tags, file names
4001      user		user names
4002      var		user variables
4003
4004      If {pat} is an empty string, then all the matches are
4005      returned.  Otherwise only items matching {pat} are returned.
4006      See |wildcards| for the use of special characters in {pat}.
4007
4008      If the optional {filtered} flag is set to 1, then 'wildignore'
4009      is applied to filter the results.  Otherwise all the matches
4010      are returned.  The 'wildignorecase' option always applies.
4011
4012      If the 'wildoptions' option contains "fuzzy", then fuzzy
4013      matching is used to get the completion matches.  Otherwise
4014      regular expression matching is used.  Thus this function
4015      follows the user preference, what happens on the command line.
4016      If you do not want this you can make 'wildoptions' empty
4017      before calling getcompletion() and restore it afterwards.
4018
4019      If {type} is "cmdline", then the |cmdline-completion| result is
4020      returned.  For example, to complete the possible values after
4021      a ":call" command: >vim
4022      	echo getcompletion('call ', 'cmdline')
4023      <
4024      If there are no matches, an empty list is returned.  An
4025      invalid value for {type} produces an error.
4026
4027    ]=],
4028    name = 'getcompletion',
4029    params = { { 'pat', 'string' }, { 'type', 'string' }, { 'filtered', 'boolean' } },
4030    returns = 'string[]',
4031    signature = 'getcompletion({pat}, {type} [, {filtered}])',
4032  },
4033  getcompletiontype = {
4034    args = 1,
4035    base = 1,
4036    desc = [=[
4037      Return the type of the command-line completion using {pat}.
4038      When no corresponding completion type is found, an empty
4039      string is returned.
4040      To get the current command-line completion type, use
4041      |getcmdcompltype()|.
4042    ]=],
4043    name = 'getcompletiontype',
4044    params = { { 'pat', 'string' } },
4045    returns = 'string',
4046    signature = 'getcompletiontype({pat})',
4047  },
4048  getcurpos = {
4049    args = { 0, 1 },
4050    base = 1,
4051    desc = [=[
4052      Get the position of the cursor.  This is like getpos('.'), but
4053      includes an extra "curswant" item in the list:
4054          [0, lnum, col, off, curswant] ~
4055      The "curswant" number is the preferred column when moving the
4056      cursor vertically.  After |$| command it will be a very large
4057      number equal to |v:maxcol|.  Also see |getcursorcharpos()| and
4058      |getpos()|.
4059      The first "bufnum" item is always zero.  The byte position of
4060      the cursor is returned in "col".  To get the character
4061      position, use |getcursorcharpos()|.
4062
4063      The optional {winid} (|window-number| or |window-ID|) specifies
4064      the window. The last known cursor position is returned, this
4065      may be invalid for the current value of the buffer if it is not
4066      the current window.
4067      If {winid} is invalid a list with zeroes is returned.
4068
4069      This can be used to save and restore the cursor position: >vim
4070      	let save_cursor = getcurpos()
4071      	MoveTheCursorAround
4072      	call setpos('.', save_cursor)
4073      <Note that this only works within the window.  See
4074      |winrestview()| for restoring more state.
4075
4076    ]=],
4077    name = 'getcurpos',
4078    params = { { 'winid', 'integer' } },
4079    returns = '[integer, integer, integer, integer, integer]',
4080    signature = 'getcurpos([{winid}])',
4081    see_lua = {
4082      '|nvim_win_get_cursor()|; return shape, 0-based column, and `curswant`/invalid-window semantics differ',
4083    },
4084  },
4085  getcursorcharpos = {
4086    args = { 0, 1 },
4087    base = 1,
4088    desc = [=[
4089      Same as |getcurpos()| but the column number in the returned
4090      List is a character index instead of a byte index.
4091
4092      Example:
4093      With the cursor on '보' in line 3 with text "여보세요": >vim
4094      	getcursorcharpos()	" returns [0, 3, 2, 0, 3]
4095      	getcurpos()		" returns [0, 3, 4, 0, 3]
4096      <
4097    ]=],
4098    name = 'getcursorcharpos',
4099    params = { { 'winid', 'integer' } },
4100    signature = 'getcursorcharpos([{winid}])',
4101  },
4102  getcwd = {
4103    args = { 0, 3 },
4104    base = 1,
4105    desc = [=[
4106      Without arguments, returns the effective |current-directory|.
4107      With {winnr} (|window-number| or |window-ID|), {tabnr} or
4108      {bufnr} the working directory of that scope is returned,
4109      ignoring 'autochdir'.
4110
4111      - If {winnr} is -1: gets the tabpage directory.
4112      - If {winnr} and {tabnr} are both -1: gets the global
4113        directory.
4114        - Note: Vim returns an empty string when {tabnr} is -1.
4115      - If {bufnr} is given: gets the buffer-local directory.
4116        ({winnr} and {tabnr} must be -1.)
4117      - An argument may be -1 only if preceding args are -1. *E5001*
4118
4119      Tabs, windows and buffers are identified by their respective
4120      numbers, 0 means current tab/window/buffer. Missing {tabnr}
4121      implies 0 (missing {bufnr} does not; see below). Thus the
4122      following are equivalent: >vim
4123          getcwd(0)
4124          getcwd(0, 0)
4125      <
4126      Each form reports its own scope or "wider", so e.g. {winnr}
4127      never reports a buffer-local directory.  The {bufnr} form
4128      falls back to the global directory, because a buffer belongs
4129      to no particular window or tabpage.
4130
4131      Examples: >vim
4132            getcwd(-1, -1, 0)  " Get current buffer's directory
4133            getcwd(-1, -1, 3)  " Get directory of buffer 3
4134            getcwd(-1, -1, -1) " Get global directory
4135            getcwd(-1, -1)     " Get global directory
4136      <
4137    ]=],
4138    name = 'getcwd',
4139    params = { { 'winnr', 'integer' }, { 'tabnr', 'integer' }, { 'bufnr', 'integer' } },
4140    returns = 'string',
4141    signature = 'getcwd([{winnr} [, {tabnr} [, {bufnr}]]])',
4142    tags = { 'E5000', 'E5002', 'E5006', 'E5007' },
4143  },
4144  getenv = {
4145    args = 1,
4146    base = 1,
4147    desc = [=[
4148      Return the value of environment variable {name}.  The {name}
4149      argument is a string, without a leading '$'.  Example: >vim
4150      	myHome = getenv('HOME')
4151
4152      <When the variable does not exist |v:null| is returned.  That
4153      is different from a variable set to an empty string.
4154      See also |expr-env|.
4155
4156    ]=],
4157    name = 'getenv',
4158    params = { { 'name', 'string' } },
4159    returns = 'string',
4160    signature = 'getenv({name})',
4161    see_lua = { '|vim.env|' },
4162  },
4163  getfontname = {
4164    args = { 0, 1 },
4165    desc = [=[
4166      Without an argument returns the name of the normal font being
4167      used.  Like what is used for the Normal highlight group
4168      |hl-Normal|.
4169      With an argument a check is done whether String {name} is a
4170      valid font name.  If not then an empty string is returned.
4171      Otherwise the actual font name is returned, or {name} if the
4172      GUI does not support obtaining the real name.
4173      Only works when the GUI is running, thus not in your vimrc or
4174      gvimrc file.  Use the |GUIEnter| autocommand to use this
4175      function just after the GUI has started.
4176    ]=],
4177    name = 'getfontname',
4178    params = { { 'name', 'string' } },
4179    returns = 'string',
4180    signature = 'getfontname([{name}])',
4181  },
4182  getfperm = {
4183    args = 1,
4184    base = 1,
4185    desc = [=[
4186      Returns the file permissions of the given file {fname} as a
4187      String.  If {fname} does not exist or its directory cannot be
4188      read, an empty string is returned.
4189      The result is of the form "rwxrwxrwx", where each group of
4190      "rwx" flags represent, in turn, the permissions of the owner
4191      of the file, the group the file belongs to, and other users.
4192      If a user does not have a given permission the flag for this
4193      is replaced with the string "-".  Examples: >vim
4194      	echo getfperm("/etc/passwd")
4195      	echo getfperm(expand("~/.config/nvim/init.vim"))
4196      <This will hopefully (from a security point of view) display
4197      the string "rw-r--r--" or even "rw-------".
4198
4199      For setting permissions use |setfperm()|.
4200    ]=],
4201    fast = true,
4202    name = 'getfperm',
4203    params = { { 'fname', 'string' } },
4204    returns = 'string',
4205    signature = 'getfperm({fname})',
4206    see_lua = { '|uv.fs_stat()|' },
4207  },
4208  getfsize = {
4209    args = 1,
4210    base = 1,
4211    desc = [=[
4212      Returns the size in bytes of the given file {fname}.
4213      If {fname} is a directory, 0 is returned.
4214      If the file {fname} can't be found, -1 is returned.
4215      If the size of {fname} is too big to fit in a Number then -2
4216      is returned.
4217
4218    ]=],
4219    fast = true,
4220    name = 'getfsize',
4221    params = { { 'fname', 'string' } },
4222    returns = 'integer',
4223    signature = 'getfsize({fname})',
4224    see_lua = { '|uv.fs_stat()|' },
4225  },
4226  getftime = {
4227    args = 1,
4228    base = 1,
4229    desc = [=[
4230      Returns the last modification time ("mtime") of file {fname}.
4231      The value is measured as seconds since 1st Jan 1970, and may
4232      be passed to |strftime()|.  See also
4233      |localtime()| and |strftime()|.
4234      If the file {fname} can't be found -1 is returned.
4235
4236    ]=],
4237    fast = true,
4238    name = 'getftime',
4239    params = { { 'fname', 'string' } },
4240    returns = 'integer',
4241    signature = 'getftime({fname})',
4242    see_lua = { '|uv.fs_stat()|' },
4243  },
4244  getftype = {
4245    args = 1,
4246    base = 1,
4247    desc = [=[
4248      Returns a description of the type of file {fname} as a
4249      String.  If {fname} does not exist an empty string is
4250      returned.
4251      Here is a table over different kinds of files and their
4252      results:
4253      	Normal file		"file"
4254      	Directory		"dir"
4255      	Symbolic link		"link"
4256      	Block device		"bdev"
4257      	Character device	"cdev"
4258      	Socket			"socket"
4259      	FIFO			"fifo"
4260      	All other		"other"
4261      Example: >vim
4262      	getftype("/home")
4263      <Note that a type such as "link" will only be returned on
4264      systems that support it.  On some systems only "dir" and
4265      "file" are returned.
4266
4267    ]=],
4268    fast = true,
4269    name = 'getftype',
4270    params = { { 'fname', 'string' } },
4271    returns = "'file'|'dir'|'link'|'bdev'|'cdev'|'socket'|'fifo'|'other'",
4272    signature = 'getftype({fname})',
4273    see_lua = { '|uv.fs_stat()|' },
4274  },
4275  getjumplist = {
4276    args = { 0, 2 },
4277    base = 1,
4278    desc = [=[
4279      Returns the |jumplist| for the specified window.
4280
4281      Without arguments use the current window.
4282      With {winnr} (|window-number| or |window-ID|) only use this
4283      window in the current tabpage.
4284      With {winnr} and {tabnr} use the window in the specified tab
4285      page.   If {winnr} or {tabnr} is invalid, an empty list is
4286      returned.
4287
4288      The returned list contains two entries: a list with the jump
4289      locations and the last used jump position number in the list.
4290      Each entry in the jump location list is a dictionary with
4291      the following entries:
4292      	bufnr		buffer number
4293      	col		column number
4294      	coladd		column offset for 'virtualedit'
4295      	filename	filename if available
4296      	lnum		line number
4297
4298    ]=],
4299    name = 'getjumplist',
4300    params = { { 'winnr', 'integer' }, { 'tabnr', 'integer' } },
4301    signature = 'getjumplist([{winnr} [, {tabnr}]])',
4302    returns = 'vim.fn.getjumplist.ret',
4303    see_lua = {
4304      '|nvim_get_context()| for current jump history; window/tab arguments and return shape differ',
4305    },
4306  },
4307  getline = {
4308    args = { 1, 2 },
4309    base = 1,
4310    desc = [=[
4311      Without {end} the result is a String, which is line {lnum}
4312      from the current buffer.  Example: >vim
4313      	getline(1)
4314      <When {lnum} is a String that doesn't start with a
4315      digit, |line()| is called to translate the String into a Number.
4316      To get the line under the cursor: >vim
4317      	getline(".")
4318      <When {lnum} is a number smaller than 1 or bigger than the
4319      number of lines in the buffer, an empty string is returned.
4320
4321    ]=],
4322    name = 'getline',
4323    params = { { 'lnum', 'integer|string' } },
4324    signature = 'getline({lnum})',
4325    returns = 'string',
4326    see_lua = { '|nvim_get_current_line()|', '|nvim_buf_get_lines()|' },
4327  },
4328  getline__1 = {
4329    args = { 2 },
4330    base = 1,
4331    desc = [=[
4332      When {end} is given the result is a |List| where each item is
4333      a line from the current buffer in the range {lnum} to {end},
4334      including line {end}.
4335      {end} is used in the same way as {lnum}.
4336      Non-existing lines are silently omitted.
4337      When {end} is before {lnum} an empty |List| is returned.
4338      Example: >vim
4339      	let start = line('.')
4340      	let end = search("^$") - 1
4341      	let lines = getline(start, end)
4342
4343      <To get lines from another buffer see |getbufline()| and
4344      |getbufoneline()|
4345    ]=],
4346    name = 'getline',
4347    params = { { 'lnum', 'integer|string' }, { 'end', 'integer|string' } },
4348    signature = 'getline({lnum}, {end})',
4349    returns = 'string[]',
4350    see_lua = { '|nvim_buf_get_lines()|' },
4351  },
4352  getloclist = {
4353    args = { 1, 2 },
4354    desc = [=[
4355      Returns a |List| with all the entries in the location list for
4356      window {nr} (|window-number| or |window-ID|).
4357      When {nr} is zero the current window is used.
4358
4359      For a location list window, the displayed location list is
4360      returned.  For an invalid {nr}, an empty list is returned.
4361      Otherwise, same as |getqflist()|.
4362    ]=],
4363    name = 'getloclist',
4364    params = { { 'nr', 'integer' } },
4365    returns = 'vim.fn.getqflist.ret.item[]',
4366    signature = 'getloclist({nr})',
4367  },
4368  getloclist__1 = {
4369    args = { 2 },
4370    desc = [=[
4371      If the optional {what} dictionary argument is supplied, then
4372      returns the items listed in {what} as a dictionary.  Refer to
4373      |getqflist()| for the supported items in {what}.
4374
4375      In addition to the items supported by |getqflist()| in {what},
4376      the following item is supported by |getloclist()|:
4377
4378      	filewinid	id of the window used to display files
4379      			from the location list.  This field is
4380      			applicable only when called from a
4381      			location list window.  See
4382      			|location-list-file-window| for more
4383      			details.
4384
4385      Returns a |Dictionary| with default values if there is no
4386      location list for the window {nr}.
4387      Returns an empty Dictionary if window {nr} does not exist.
4388
4389      Examples (See also |getqflist-examples|): >vim
4390      	echo getloclist(3, {'all': 0})
4391      	echo getloclist(5, {'filewinid': 0})
4392      <
4393    ]=],
4394    name = 'getloclist',
4395    params = { { 'nr', 'integer' }, { 'what', 'vim.fn.getloclist.what' } },
4396    returns = 'vim.fn.getloclist.ret',
4397    signature = 'getloclist({nr}, {what})',
4398  },
4399  getmarklist = {
4400    args = { 0, 1 },
4401    base = 1,
4402    desc = [=[
4403      Without the {buf} argument returns a |List| with information
4404      about all the global marks. |mark|
4405
4406      If the optional {buf} argument is specified, returns the
4407      local marks defined in buffer {buf}.  For the use of {buf},
4408      see |bufname()|.  If {buf} is invalid, an empty list is
4409      returned.  For a |prompt-buffer| the result includes the
4410      |':| mark.
4411
4412      Each item in the returned List is a |Dict| with the following:
4413          mark   name of the mark prefixed by "'"
4414          pos	   a |List| with the position of the mark:
4415      		[bufnum, lnum, col, off]
4416      	   Refer to |getpos()| for more information.
4417          file   file name
4418
4419      Refer to |getpos()| for getting information about a specific
4420      mark.
4421
4422    ]=],
4423    name = 'getmarklist',
4424    params = { { 'buf', 'integer?' } },
4425    signature = 'getmarklist([{buf}])',
4426    returns = 'vim.fn.getmarklist.ret.item[]',
4427  },
4428  getmatches = {
4429    args = { 0, 1 },
4430    desc = [=[
4431      Returns a |List| with all matches previously defined for the
4432      current window by |matchadd()| and the |:match| commands.
4433      |getmatches()| is useful in combination with |setmatches()|,
4434      as |setmatches()| can restore a list of matches saved by
4435      |getmatches()|.
4436      If {win} is specified, use this |window-number| or |window-ID|
4437      instead of the current window.  If {win} is invalid, an empty
4438      list is returned.
4439      Example: >vim
4440      	echo getmatches()
4441      < >
4442      	[{"group": "MyGroup1", "pattern": "TODO",
4443      	"priority": 10, "id": 1}, {"group": "MyGroup2",
4444      	"pattern": "FIXME", "priority": 10, "id": 2}]
4445      < >vim
4446      	let m = getmatches()
4447      	call clearmatches()
4448      	echo getmatches()
4449      < >
4450      	[]
4451      < >vim
4452      	call setmatches(m)
4453      	echo getmatches()
4454      < >
4455      	[{"group": "MyGroup1", "pattern": "TODO",
4456      	"priority": 10, "id": 1}, {"group": "MyGroup2",
4457      	"pattern": "FIXME", "priority": 10, "id": 2}]
4458      < >vim
4459      	unlet m
4460      <
4461    ]=],
4462    name = 'getmatches',
4463    params = { { 'win', 'integer' } },
4464    returns = 'vim.fn.getmatches.ret.item[]',
4465    signature = 'getmatches([{win}])',
4466  },
4467  getmousepos = {
4468    desc = [=[
4469      Returns a |Dictionary| with the last known position of the
4470      mouse.  This can be used in a mapping for a mouse click.  The
4471      items are:
4472      	screenrow	screen row
4473      	screencol	screen column
4474      	winid		Window ID of the click
4475      	winrow		row inside "winid"
4476      	wincol		column inside "winid"
4477      	line		text line inside "winid"
4478      	column		text column inside "winid"
4479      	coladd		offset (in screen columns) from the
4480      			start of the clicked char
4481      All numbers are 1-based.
4482
4483      If not over a window, e.g. when in the command line, then only
4484      "screenrow" and "screencol" are valid, the others are zero.
4485
4486      When on the status line below a window or the vertical
4487      separator right of a window, the "line" and "column" values
4488      are zero.
4489
4490      When the position is after the text then "column" is the
4491      length of the text in bytes plus one.
4492
4493      If the mouse is over a focusable floating window then that
4494      window is used.
4495
4496      When using |getchar()| the Vim variables |v:mouse_lnum|,
4497      |v:mouse_col| and |v:mouse_winid| also provide these values.
4498    ]=],
4499    name = 'getmousepos',
4500    params = {},
4501    signature = 'getmousepos()',
4502    returns = 'vim.fn.getmousepos.ret',
4503  },
4504  getpid = {
4505    desc = [=[
4506      Return a Number which is the process ID of the Vim process.
4507      This is a unique number, until Vim exits.
4508    ]=],
4509    fast = true,
4510    name = 'getpid',
4511    params = {},
4512    returns = 'integer',
4513    signature = 'getpid()',
4514    see_lua = { '|uv.os_getpid()|' },
4515  },
4516  getpos = {
4517    args = 1,
4518    base = 1,
4519    desc = [=[
4520      Gets a position, where {expr} is one of:
4521          .	    Cursor position.
4522          $	    Last line in the current buffer.
4523          'x	    Position of mark x (if the mark is not set, 0 is
4524      	    returned for all values).
4525          w0	    First line visible in current window (one if the
4526      	    display isn't updated, e.g. in |silent-mode|).
4527          w$	    Last line visible in current window (this is one
4528      	    less than "w0" if no lines are visible).
4529          v	    End of the current Visual selection (unlike |'<|
4530      	    |'>| which give the previous, not current, Visual
4531      	    selection), or the cursor position if not in Visual
4532      	    mode.
4533
4534      	    To get the current selected region: >vim
4535      	      let region = getregionpos(getpos('v'), getpos('.'))
4536      <
4537      	    Explanation: in Visual mode "v" and "." complement each
4538      	    other.  While "." refers to the cursor position, "v"
4539      	    refers to where |v_o| would move the cursor.  So you can
4540      	    use "v" and "." together to get the selected region.
4541
4542      Note that if a mark in another file is used, the line number
4543      applies to that buffer.
4544
4545      The result is a |List| with four numbers:
4546          [bufnum, lnum, col, off]
4547      "bufnum" is zero, unless a mark like '0 or 'A is used, then it
4548      is the buffer number of the mark.
4549      "lnum" and "col" are the position in the buffer.  The first
4550      column is 1.
4551      The "off" number is zero, unless 'virtualedit' is used.  Then
4552      it is the offset in screen columns from the start of the
4553      character.  E.g., a position within a <Tab> or after the last
4554      character.
4555
4556      For getting the cursor position see |getcurpos()|.
4557      The column number in the returned List is the byte position
4558      within the line.  To get the character position in the line,
4559      use |getcharpos()|.
4560
4561      The visual marks |'<| and |'>| refer to the beginning and end
4562      of the visual selection relative to the buffer.  Note that
4563      this differs from |setpos()|, where they are relative to the
4564      cursor position.
4565
4566      Note that for '< and '> Visual mode matters: when it is "V"
4567      (visual line mode) the column of '< is zero and the column of
4568      '> is a large number equal to |v:maxcol|.
4569      A very large column number equal to |v:maxcol| can be returned,
4570      in which case it means "after the end of the line".
4571      If {expr} is invalid, returns a list with all zeros.
4572
4573      This can be used to save and restore the position of a mark: >vim
4574      	let save_a_mark = getpos("'a")
4575      	" ...
4576      	call setpos("'a", save_a_mark)
4577      <
4578      Also see |getcharpos()|, |getcurpos()| and |setpos()|.
4579
4580    ]=],
4581    name = 'getpos',
4582    params = { { 'expr', 'string' } },
4583    returns = '[integer, integer, integer, integer]',
4584    signature = 'getpos({expr})',
4585    see_lua = {
4586      '|nvim_win_get_cursor()| for "." or |nvim_buf_get_mark()| for marks; return shape, `off`, and special-position semantics differ',
4587    },
4588  },
4589  getqflist = {
4590    args = { 0, 1 },
4591    desc = [=[
4592      Returns a |List| with all the current quickfix errors.  Each
4593      list item is a dictionary with these entries:
4594      	bufnr	number of buffer that has the file name, use
4595      		|bufname()| to get the name
4596      	module	module name
4597      	lnum	line number in the buffer (first line is 1)
4598      	end_lnum
4599      		end of line number if the item is multiline
4600      	col	column number (first column is 1)
4601      	end_col	end of column number if the item has range
4602      	vcol	|TRUE|: "col" is visual column
4603      		|FALSE|: "col" is byte index
4604      	nr	error number
4605      	pattern	search pattern used to locate the error
4606      	text	description of the error
4607      	type	type of the error, 'E', '1', etc.
4608      	valid	|TRUE|: recognized error message
4609      	user_data
4610      		any type.  This entry is present only when
4611      		user data was set for this item.
4612
4613      When there is no error list or it's empty, an empty list is
4614      returned.  Quickfix list entries with a non-existing buffer
4615      number are returned with "bufnr" set to zero (Note: some
4616      functions accept buffer number zero for the alternate buffer,
4617      you may need to explicitly check for zero).
4618
4619      Useful application: Find pattern matches in multiple files and
4620      do something with them: >vim
4621      	vimgrep /theword/jg *.c
4622      	for d in getqflist()
4623      	   echo bufname(d.bufnr) ':' d.lnum '=' d.text
4624      	endfor
4625      <
4626    ]=],
4627    name = 'getqflist',
4628    params = {},
4629    returns = 'vim.fn.getqflist.ret.item[]',
4630    signature = 'getqflist()',
4631  },
4632  getqflist__1 = {
4633    args = { 1 },
4634    desc = [=[
4635      If the optional {what} dictionary argument is supplied, then
4636      returns only the items listed in {what} as a dictionary.  The
4637      following string items are supported in {what}:
4638      	changedtick	get the total number of changes made
4639      			to the list |quickfix-changedtick|
4640      	context	get the |quickfix-context|
4641      	efm	errorformat to use when parsing "lines".  If
4642      		not present, then the 'errorformat' option
4643      		value is used.
4644      	id	get information for the quickfix list with
4645      		|quickfix-ID|; zero means the id for the
4646      		current list or the list specified by "nr"
4647      	idx	get information for the quickfix entry at this
4648      		index in the list specified by "id" or "nr".
4649      		If set to zero, then uses the current entry.
4650      		See |quickfix-index|
4651      	items	quickfix list entries
4652      	lines	parse a list of lines using 'efm' and return
4653      		the resulting entries.  Only a |List| type is
4654      		accepted.  The current quickfix list is not
4655      		modified.  See |quickfix-parse|.
4656      	nr	get information for this quickfix list; zero
4657      		means the current quickfix list and "$" means
4658      		the last quickfix list
4659      	qfbufnr number of the buffer displayed in the quickfix
4660      		window.  Returns 0 if the quickfix buffer is
4661      		not present.  See |quickfix-buffer|.
4662      	quickfixtextfunc
4663      		function to get the text to display in the
4664      		quickfix window.  Returns an empty string if
4665      		this function is not set for the list.  See
4666      		|quickfix-window-function|.
4667      	size	number of entries in the quickfix list
4668      	title	get the list title |quickfix-title|
4669      	winid	get the quickfix |window-ID|
4670      	all	all of the above quickfix properties
4671      Non-string items in {what} are ignored.  To get the value of a
4672      particular item, set it to zero.
4673      If "nr" is not present then the current quickfix list is used.
4674      If both "nr" and a non-zero "id" are specified, then the list
4675      specified by "id" is used.
4676      To get the number of lists in the quickfix stack, set "nr" to
4677      "$" in {what}.  The "nr" value in the returned dictionary
4678      contains the quickfix stack size.
4679      When "lines" is specified, all the other items except "efm"
4680      are ignored.  The returned dictionary contains the entry
4681      "items" with the list of entries.
4682
4683      The returned dictionary contains the following entries:
4684      	changedtick	total number of changes made to the
4685      			list |quickfix-changedtick|
4686      	context	quickfix list context.  See |quickfix-context|
4687      		If not present, set to "".
4688      	id	quickfix list ID |quickfix-ID|.  If not
4689      		present, set to 0.
4690      	idx	index of the quickfix entry in the list.  If
4691      		not present, set to 0.
4692      	items	quickfix list entries.  If not present, set to
4693      		an empty list.
4694      	nr	quickfix list number.  If not present, set to
4695      		0
4696      	qfbufnr	number of the buffer displayed in the quickfix
4697      		window.  If not present, set to 0.
4698      	quickfixtextfunc
4699      		'quickfixtextfunc' setting of the list.  If
4700      		not present, set to "".
4701      	size	number of entries in the quickfix list.  If
4702      		not present, set to 0.
4703      	title	quickfix list title text.  If not present, set
4704      		to "".
4705      	winid	quickfix |window-ID|.  If not present, set to 0
4706
4707      Examples (See also |getqflist-examples|): >vim
4708      	echo getqflist({'all': 1})
4709      	echo getqflist({'nr': 2, 'title': 1})
4710      	echo getqflist({'lines' : ["F1:10:L10"]})
4711      <
4712    ]=],
4713    name = 'getqflist',
4714    params = { { 'what', 'vim.fn.getqflist.what' } },
4715    returns = 'vim.fn.getqflist.ret',
4716    signature = 'getqflist({what})',
4717  },
4718  getreg = {
4719    args = { 0, 3 },
4720    base = 1,
4721    desc = [=[
4722      Returns the contents of register {regname} as a String.
4723      Example: >vim
4724      	let cliptext = getreg('*')
4725      <When register {regname} was not set the result is an empty
4726      string.
4727      The {regname} argument must be a string.
4728
4729      getreg('=') returns the last evaluated value of the expression
4730      register.  (For use in maps.)
4731      getreg('=', 1) returns the expression itself, so that it can
4732      be restored with |setreg()|.  For other registers the extra
4733      argument is ignored, thus you can always give it.
4734
4735      If {list} is present and |TRUE|, the result type is changed
4736      to |List|.  Each list item is one text line.  Use it if you care
4737      about zero bytes possibly present inside register: without
4738      third argument both NLs and zero bytes are represented as NLs
4739      (see |NL-used-for-Nul|).
4740      When the register was not set an empty list is returned.
4741
4742      If {regname} is not specified, |v:register| is used.
4743
4744    ]=],
4745    name = 'getreg',
4746    params = { { 'regname', 'string' }, { 'expr', 'any' }, { 'list', 'nil|false' } },
4747    signature = 'getreg([{regname} [, 1 [, {list}]]])',
4748    returns = 'string',
4749  },
4750  getreg__1 = {
4751    args = { 3 },
4752    base = 1,
4753    name = 'getreg',
4754    params = { { 'regname', 'string' }, { 'expr', 'any' }, { 'list', 'true|number|string|table' } },
4755    returns = 'string[]',
4756  },
4757  getreginfo = {
4758    args = { 0, 1 },
4759    base = 1,
4760    desc = [=[
4761      Returns detailed information about register {regname} as a
4762      Dictionary with the following entries:
4763      	regcontents	List of lines contained in register
4764      			{regname}, like
4765      			getreg({regname}, 1, 1).
4766      	regtype		the type of register {regname}, as in
4767      			|getregtype()|.
4768      	isunnamed	Boolean flag, v:true if this register
4769      			is currently pointed to by the unnamed
4770      			register.
4771      	points_to	for the unnamed register, gives the
4772      			single letter name of the register
4773      			currently pointed to (see |quotequote|).
4774      			For example, after deleting a line
4775      			with `dd`, this field will be "1",
4776      			which is the register that got the
4777      			deleted text.
4778
4779      The {regname} argument is a string.  If {regname} is invalid
4780      or not set, an empty Dictionary will be returned.
4781      If {regname} is not specified, |v:register| is used.
4782      The returned Dictionary can be passed to |setreg()|.
4783
4784    ]=],
4785    name = 'getreginfo',
4786    params = { { 'regname', 'string' } },
4787    returns = 'table',
4788    signature = 'getreginfo([{regname}])',
4789  },
4790  getregion = {
4791    args = { 2, 3 },
4792    base = 1,
4793    desc = [=[
4794      Returns the list of strings from {pos1} to {pos2} from a
4795      buffer.
4796
4797      {pos1} and {pos2} must both be |List|s with four numbers.
4798      See |getpos()| for the format of the list.  It's possible
4799      to specify positions from a different buffer, but please
4800      note the limitations at |getregion-notes|.
4801
4802      The optional argument {opts} is a Dict and supports the
4803      following items:
4804
4805      	type		Specify the region's selection type.
4806      			See |getregtype()| for possible values,
4807      			except that the width can be omitted
4808      			and an empty string cannot be used.
4809      			(default: "v")
4810
4811      	exclusive	If |TRUE|, use exclusive selection
4812      			for the end position.
4813      			(default: follow 'selection')
4814
4815      You can get the last selection type by |visualmode()|.
4816      If Visual mode is active, use |mode()| to get the Visual mode
4817      (e.g., in a |:vmap|).
4818      This function is useful to get text starting and ending in
4819      different columns, such as a |charwise-visual| selection.
4820
4821      					*getregion-notes*
4822      Note that:
4823      - Order of {pos1} and {pos2} doesn't matter, it will always
4824        return content from the upper left position to the lower
4825        right position.
4826      - If 'virtualedit' is enabled and the region is past the end
4827        of the lines, resulting lines are padded with spaces.
4828      - If the region is blockwise and it starts or ends in the
4829        middle of a multi-cell character, it is not included but
4830        its selected part is substituted with spaces.
4831      - If {pos1} and {pos2} are not in the same buffer, an empty
4832        list is returned.
4833      - {pos1} and {pos2} must belong to a |bufloaded()| buffer.
4834      - It is evaluated in current window context, which makes a
4835        difference if the buffer is displayed in a window with
4836        different 'virtualedit' or 'list' values.
4837      - When specifying an exclusive selection and {pos1} and {pos2}
4838        are equal, the returned list contains a single character as
4839        if selection is inclusive, to match the behavior of an empty
4840        exclusive selection in Visual mode.
4841
4842      Examples: >vim
4843      	xnoremap <CR>
4844      	\ <Cmd>echom getregion(
4845      	\ getpos('v'), getpos('.'), #{ type: mode() })<CR>
4846      <
4847    ]=],
4848    name = 'getregion',
4849    params = {
4850      { 'pos1', '[integer, integer, integer, integer]' },
4851      { 'pos2', '[integer, integer, integer, integer]' },
4852      { 'opts', '{type?:string, exclusive?:boolean}' },
4853    },
4854    returns = 'string[]',
4855    signature = 'getregion({pos1}, {pos2} [, {opts}])',
4856  },
4857  getregionpos = {
4858    args = { 2, 3 },
4859    base = 1,
4860    desc = [=[
4861      Same as |getregion()|, but returns a list of positions
4862      describing the buffer text segments bound by {pos1} and
4863      {pos2}.
4864      The segments are a pair of positions for every line: >
4865      	[[{startpos}, {endpos}], ...]
4866      <
4867      The position is a |List| with four numbers:
4868          [bufnum, lnum, col, off]
4869      "bufnum" is the buffer number.
4870      "lnum" and "col" are the position in the buffer.  The first
4871      column is 1.
4872      If the "off" number of a starting position is non-zero, it is
4873      the offset in screen columns from the start of the character.
4874      E.g., a position within a <Tab> or after the last character.
4875      If the "off" number of an ending position is non-zero, it is
4876      the offset of the character's first cell not included in the
4877      selection, otherwise all its cells are included.
4878
4879      To get the current visual selection: >vim
4880        let region = getregionpos(getpos('v'), getpos('.'))
4881      <
4882      The {opts} Dict supports the following items:
4883
4884      	type		See |getregion()|.
4885
4886      	exclusive	See |getregion()|.
4887
4888      	eol		If |TRUE|, indicate positions beyond
4889      			the end of a line with "col" values
4890      			one more than the length of the line.
4891      			If |FALSE|, positions are limited
4892      			within their lines, and if a line is
4893      			empty or the selection is entirely
4894      			beyond the end of a line, a "col"
4895      			value of 0 is used for both positions.
4896      			(default: |FALSE|)
4897
4898      	bounds		If |TRUE|, return only the outer
4899      			bounds of the region as a single
4900      			pair: >
4901      				[[{startpos}, {endpos}]]
4902      <			{startpos} is the start position on
4903      			the first line of the region and
4904      			{endpos} the end position on its last
4905      			line.  The lines in between are not
4906      			visited, which is much faster for a
4907      			large region.
4908      			(default: |FALSE|)
4909
4910      Using "bounds" with the same {opts} is equivalent to taking
4911      the outer positions of the full result: >vim
4912      	let full = getregionpos(pos1, pos2, opts)
4913      	let bounds = [[full[0][0], full[-1][1]]]
4914      <When the full result is empty, e.g. because {pos1} and {pos2}
4915      are in different buffers, the result is empty as well.
4916      Note that the two positions then come from different lines, so
4917      they describe a diagonal of the region and not its shape.  For
4918      a blockwise region they are the start of the first line and
4919      the end of the last line, not the corners of the block.
4920      Likewise, when the first line is empty and "eol" is |FALSE|,
4921      {startpos} has a "col" of 0 while {endpos} may not.
4922    ]=],
4923    name = 'getregionpos',
4924    params = {
4925      { 'pos1', '[integer, integer, integer, integer]' },
4926      { 'pos2', '[integer, integer, integer, integer]' },
4927      { 'opts', '{type?:string, exclusive?:boolean, eol?:boolean, bounds?:boolean}' },
4928    },
4929    returns = '[ [integer, integer, integer, integer], [integer, integer, integer, integer] ][]',
4930    signature = 'getregionpos({pos1}, {pos2} [, {opts}])',
4931  },
4932  getregtype = {
4933    args = { 0, 1 },
4934    base = 1,
4935    desc = [=[
4936      Returns the type of register {regname} as a String.
4937      The value will be one of:
4938          "v"			for |charwise| text
4939          "V"			for |linewise| text
4940          "<CTRL-V>{width}"	for |blockwise-visual| text
4941          ""			for an empty or unknown register
4942      <CTRL-V> is one character with value 0x16.
4943      The {regname} argument is a string.  If {regname} is not
4944      specified, |v:register| is used.
4945
4946    ]=],
4947    name = 'getregtype',
4948    params = { { 'regname', 'string' } },
4949    returns = 'string',
4950    signature = 'getregtype([{regname}])',
4951  },
4952  getscriptinfo = {
4953    args = { 0, 1 },
4954    desc = [=[
4955      Returns a |List| with information about all the sourced Vim
4956      scripts in the order they were sourced, like what
4957      `:scriptnames` shows.
4958
4959      The optional Dict argument {opts} supports the following
4960      optional items:
4961          name	Script name match pattern.  If specified,
4962      		and "sid" is not specified, information about
4963      		scripts with a name that match the pattern
4964      		"name" are returned.
4965          sid		Script ID |<SID>|.  If specified, only
4966      		information about the script with ID "sid" is
4967      		returned and "name" is ignored.
4968
4969      Each item in the returned List is a |Dict| with the following
4970      items:
4971          autoload	Always set to FALSE.
4972          functions   List of script-local function names defined in
4973      		the script.  Present only when a particular
4974      		script is specified using the "sid" item in
4975      		{opts}.
4976          name	Vim script file name.
4977          sid		Script ID |<SID>|.
4978          variables   A dictionary with the script-local variables.
4979      		Present only when a particular script is
4980      		specified using the "sid" item in {opts}.
4981      		Note that this is a copy, the value of
4982      		script-local variables cannot be changed using
4983      		this dictionary.
4984          version	Vim script version, always 1
4985
4986      Examples: >vim
4987      	echo getscriptinfo({'name': 'myscript'})
4988      	echo getscriptinfo({'sid': 15})[0].variables
4989      <
4990    ]=],
4991    name = 'getscriptinfo',
4992    params = { { 'opts', 'table' } },
4993    returns = 'vim.fn.getscriptinfo.ret[]',
4994    signature = 'getscriptinfo([{opts}])',
4995  },
4996  getstacktrace = {
4997    args = 0,
4998    desc = [=[
4999      Returns the current stack trace of Vim scripts.
5000      Stack trace is a |List|, of which each item is a |Dictionary|
5001      with the following items:
5002          funcref	The funcref if the stack is at a function,
5003      		otherwise this item is omitted.
5004          event	The string of the event description if the
5005      		stack is at an autocmd event, otherwise this
5006      		item is omitted.
5007          lnum	The line number in the script on the stack.
5008          filepath	The file path of the script on the stack.
5009    ]=],
5010    name = 'getstacktrace',
5011    params = {},
5012    returns = 'table[]',
5013    signature = 'getstacktrace()',
5014    see_lua = { '|debug.traceback()|' },
5015  },
5016  gettabinfo = {
5017    args = { 0, 1 },
5018    base = 1,
5019    desc = [=[
5020      If {tabnr} is not specified, then information about all the
5021      tabpages is returned as a |List|.  Each List item is a
5022      |Dictionary|.  Otherwise, {tabnr} specifies the tabpage
5023      number and information about that one is returned.  If the tab
5024      page does not exist an empty List is returned.
5025
5026      Each List item is a |Dictionary| with the following entries:
5027      	tabnr		|tabpage-number|
5028      	variables	a reference to the dictionary with
5029      			tabpage-local variables
5030      	windows		List of |window-ID|s in the tabpage.
5031
5032    ]=],
5033    name = 'gettabinfo',
5034    params = { { 'tabnr', 'integer' } },
5035    signature = 'gettabinfo([{tabnr}])',
5036  },
5037  gettabvar = {
5038    args = { 2, 3 },
5039    base = 1,
5040    desc = [=[
5041      Get the value of a tab-local variable {varname} in tabpage
5042      {tabnr}. |t:var|
5043      Tabs are numbered starting with one.
5044      The {varname} argument is a string.  When {varname} is empty a
5045      dictionary with all tab-local variables is returned.
5046      Note that the name without "t:" must be used.
5047      When the tab or variable doesn't exist {def} or an empty
5048      string is returned, there is no error message.
5049
5050    ]=],
5051    name = 'gettabvar',
5052    params = { { 'tabnr', 'integer' }, { 'varname', 'string' }, { 'def', 'any' } },
5053    signature = 'gettabvar({tabnr}, {varname} [, {def}])',
5054    see_lua = { '|nvim_tabpage_get_var()|', '|vim.t|' },
5055  },
5056  gettabwinvar = {
5057    args = { 3, 4 },
5058    base = 1,
5059    desc = [=[
5060      Gets the value of window-local variable {varname} in {winnr}
5061      (|window-number| or |window-ID|) in |tabpage-number| {tabnr}.
5062
5063      {varname} is a string:
5064      - Name of the variable (without "w:").
5065      - If empty, gets a dictionary with all window-local variables.
5066      - If "&", gets the values of all window-local options in
5067        a |Dictionary|.
5068      - If it starts with "&", gets the value of a window-local
5069        option.
5070
5071      To get window-local variables in the current tabpage use
5072      |getwinvar()|.
5073
5074      When {winnr} is zero the current window is used.
5075
5076      Also works for a global option, buffer-local option,
5077      window-local option, and tab-local option ('cmdheight').
5078      But not for a global variable or buffer-local variable.
5079
5080      When the tab, window or variable doesn't exist, {def} or an
5081      empty string is returned; there is no error.
5082
5083      Examples: >vim
5084      	let list_is_on = gettabwinvar(1, 2, '&list')
5085      	echo "myvar = " .. gettabwinvar(3, 1, 'myvar')
5086      <
5087      To get all window-local variables: >vim
5088      	gettabwinvar({tabnr}, {winnr}, '&')
5089      <
5090    ]=],
5091    name = 'gettabwinvar',
5092    params = {
5093      { 'tabnr', 'integer' },
5094      { 'winnr', 'integer' },
5095      { 'varname', 'string' },
5096      { 'def', 'any' },
5097    },
5098    signature = 'gettabwinvar({tabnr}, {winnr}, {varname} [, {def}])',
5099    see_lua = {
5100      '|nvim_win_get_var()| or |vim.w| after resolving {tabnr} and {winnr} to a winid; option names use |nvim_get_option_value()| or |vim.wo|',
5101    },
5102  },
5103  gettagstack = {
5104    args = { 0, 1 },
5105    base = 1,
5106    desc = [=[
5107      Returns the tag stack of window {winnr} (|window-number| or
5108      |window-ID|) as a Dict.
5109      When {winnr} is not specified, the current window is used.
5110      When window {winnr} doesn't exist, an empty Dict is returned.
5111
5112      The returned dictionary contains the following entries:
5113      	curidx		Current index in the stack.  When at
5114      			top of the stack, set to (length + 1).
5115      			Index of bottom of the stack is 1.
5116      	items		List of items in the stack.  Each item
5117      			is a dictionary containing the
5118      			entries described below.
5119      	length		Number of entries in the stack.
5120
5121      Each item in the stack is a dictionary with the following
5122      entries:
5123      	bufnr		buffer number of the current jump
5124      	from		cursor position before the tag jump.
5125      			See |getpos()| for the format of the
5126      			returned list.
5127      	matchnr		current matching tag number.  Used
5128      			when multiple matching tags are found
5129      			for a name.
5130      	tagname		name of the tag
5131
5132      See |tagstack| for more information about the tag stack.
5133
5134    ]=],
5135    name = 'gettagstack',
5136    params = { { 'winnr', 'integer' } },
5137    signature = 'gettagstack([{winnr}])',
5138  },
5139  gettext = {
5140    args = 1,
5141    base = 1,
5142    desc = [=[
5143      Translate String {text} if possible.
5144      This is mainly for use in the distributed Vim scripts.  When
5145      generating message translations the {text} is extracted by
5146      xgettext, the translator can add the translated message in the
5147      .po file and Vim will lookup the translation when gettext() is
5148      called.
5149      For {text} double quoted strings are preferred, because
5150      xgettext does not understand escaping in single quoted
5151      strings.
5152    ]=],
5153    name = 'gettext',
5154    params = { { 'text', 'string' } },
5155    returns = 'string',
5156    signature = 'gettext({text})',
5157  },
5158  getwininfo = {
5159    args = { 0, 1 },
5160    base = 1,
5161    desc = [=[
5162      Returns information about windows as a |List| with Dictionaries.
5163
5164      If {winid} is given Information about the window with that ID
5165      is returned, as a |List| with one item.  If the window does not
5166      exist the result is an empty list.
5167
5168      Without {winid} information about all the windows in all the
5169      tabpages is returned.
5170
5171      Each List item is a |Dictionary| with the following entries:
5172      	botline		last complete displayed buffer line
5173      	bufnr		number of buffer in the window
5174      	height		window height (excluding winbar)
5175      	leftcol		first column displayed; only used when
5176      			'wrap' is off
5177      	loclist		1 if showing a location list
5178      	quickfix	1 if quickfix or location list window
5179      	status_height	status lines height (0 or 1)
5180      	tabnr		|tabpage-number|
5181      	terminal	1 if a terminal window
5182      	textoff		number of columns occupied by any
5183      			'foldcolumn', 'signcolumn' and line
5184      			number in front of the text
5185      	topline		first displayed buffer line
5186      	variables	a reference to the dictionary with
5187      			window-local variables
5188      	width		window width
5189      	winbar		1 if the window has a toolbar, 0
5190      			otherwise
5191      	wincol		leftmost screen column of the window;
5192      			"col" from |win_screenpos()|
5193      	winid		|window-ID|
5194      	winnr		|window-number|
5195      	winrow		topmost screen line of the window;
5196      			"row" from |win_screenpos()|
5197
5198    ]=],
5199    name = 'getwininfo',
5200    params = { { 'winid', 'integer' } },
5201    signature = 'getwininfo([{winid}])',
5202    returns = 'vim.fn.getwininfo.ret.item[]',
5203  },
5204  getwinpos = {
5205    args = { 0, 1 },
5206    base = 1,
5207    desc = [=[
5208      Returns the [x, y] screen position of the Nvim GUI window as
5209      a |List| with two numbers (result of |getwinposx()| and
5210      |getwinposy()| combined).
5211
5212      {timeout} can be used to specify how long to wait in msec for
5213      a response.  When omitted 100 msec is used.
5214
5215      Use a longer time for a remote terminal.
5216      When using a value less than 10 and no response is received
5217      within that time, a previously reported position is returned,
5218      if available.  This can be used to poll for the position and
5219      do some work in the meantime: >vim
5220      	while 1
5221      	  let res = getwinpos(1)
5222      	  if res[0] >= 0
5223      	    break
5224      	  endif
5225      	  " Do some work here
5226      	endwhile
5227      <
5228    ]=],
5229    name = 'getwinpos',
5230    params = { { 'timeout', 'integer' } },
5231    signature = 'getwinpos([{timeout}])',
5232  },
5233  getwinposx = {
5234    desc = [=[
5235      Returns the X coordinate in pixels of the left hand side of
5236      the Nvim GUI window, or -1 if not available. The value can be
5237      used with `:winpos`.
5238    ]=],
5239    name = 'getwinposx',
5240    params = {},
5241    returns = 'integer',
5242    signature = 'getwinposx()',
5243  },
5244  getwinposy = {
5245    desc = [=[
5246      Returns the Y coordinate in pixels of the top of the Nvim GUI
5247      window, or -1 if not available. The value can be used with
5248      `:winpos`.
5249    ]=],
5250    name = 'getwinposy',
5251    params = {},
5252    returns = 'integer',
5253    signature = 'getwinposy()',
5254  },
5255  getwinvar = {
5256    args = { 2, 3 },
5257    base = 1,
5258    desc = [=[
5259      Like |gettabwinvar()| for the current tabpage.
5260      Examples: >vim
5261      	let list_is_on = getwinvar(2, '&list')
5262      	echo "myvar = " .. getwinvar(1, 'myvar')
5263      <
5264    ]=],
5265    name = 'getwinvar',
5266    params = { { 'winnr', 'integer' }, { 'varname', 'string' }, { 'def', 'any' } },
5267    signature = 'getwinvar({winnr}, {varname} [, {def}])',
5268    see_lua = {
5269      '|nvim_win_get_var()| or |vim.w| after resolving {winnr}; option names use |nvim_get_option_value()| or |vim.wo|',
5270    },
5271  },
5272  glob = {
5273    args = { 1, 4 },
5274    base = 1,
5275    desc = [=[
5276      Expand the file wildcards in {expr}.  See |wildcards| for the
5277      use of special characters.
5278
5279      Unless the optional {nosuf} argument is given and is |TRUE|,
5280      the 'suffixes' and 'wildignore' options apply: Names matching
5281      one of the patterns in 'wildignore' will be skipped and
5282      'suffixes' affect the ordering of matches.
5283      'wildignorecase' always applies.
5284
5285      When {list} is present and it is |TRUE| the result is a |List|
5286      with all matching files.  The advantage of using a List is,
5287      you also get filenames containing newlines correctly.
5288      Otherwise the result is a String and when there are several
5289      matches, they are separated by <NL> characters.
5290
5291      If the expansion fails, the result is an empty String or List.
5292
5293      You can also use |readdir()| if you need to do complicated
5294      things, such as limiting the number of matches.
5295
5296      A name for a non-existing file is not included.  A symbolic
5297      link is only included if it points to an existing file.
5298      However, when the {alllinks} argument is present and it is
5299      |TRUE| then all symbolic links are included.
5300
5301      For most systems backticks can be used to get files names from
5302      any external command.  Example: >vim
5303      	let tagfiles = glob("`find . -name tags -print`")
5304      	let &tags = substitute(tagfiles, "\n", ",", "g")
5305      <The result of the program inside the backticks should be one
5306      item per line.  Spaces inside an item are allowed.
5307
5308      See |expand()| for expanding special Vim variables.  See
5309      |system()| for getting the raw output of an external command.
5310
5311    ]=],
5312    name = 'glob',
5313    params = {
5314      { 'expr', 'string' },
5315      { 'nosuf', 'boolean' },
5316      { 'list', 'boolean' },
5317      { 'alllinks', 'boolean' },
5318    },
5319    signature = 'glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])',
5320  },
5321  glob2regpat = {
5322    args = 1,
5323    base = 1,
5324    desc = [=[
5325      Convert a file pattern, as used by |glob()|, into a search
5326      pattern.  The result can be used to match with a string that
5327      is a file name.  E.g. >vim
5328      	if filename =~ glob2regpat('Make*.mak')
5329	  " ...
5330	endif
5331      <This is equivalent to: >vim
5332      	if filename =~ '^Make.*\.mak$'
5333	  " ...
5334	endif
5335      <When {string} is an empty string the result is "^$", match an
5336      empty string.
5337      Note that the result depends on the system.  On MS-Windows
5338      a backslash usually means a path separator.
5339
5340    ]=],
5341    name = 'glob2regpat',
5342    params = { { 'string', 'string' } },
5343    returns = 'string',
5344    signature = 'glob2regpat({string})',
5345  },
5346  globpath = {
5347    args = { 2, 5 },
5348    base = 2,
5349    desc = [=[
5350      Perform |glob()| for String {expr} on all directories in {path}
5351      and concatenate the results.  Example: >vim
5352      	echo globpath(&rtp, "syntax/c.vim")
5353      <
5354      {path} is a comma-separated list of directory names.  Each
5355      directory name is prepended to {expr} and expanded like with
5356      |glob()|.  A path separator is inserted when needed.
5357      To add a comma inside a directory name escape it with a
5358      backslash.  Note that on MS-Windows a directory may have a
5359      trailing backslash, remove it if you put a comma after it.
5360      If the expansion fails for one of the directories, there is no
5361      error message.
5362
5363      Unless the optional {nosuf} argument is given and is |TRUE|,
5364      the 'suffixes' and 'wildignore' options apply: Names matching
5365      one of the patterns in 'wildignore' will be skipped and
5366      'suffixes' affect the ordering of matches.
5367
5368      When {list} is present and it is |TRUE| the result is a |List|
5369      with all matching files.  The advantage of using a List is,
5370      you also get filenames containing newlines correctly.
5371      Otherwise the result is a String and when there are several
5372      matches, they are separated by <NL> characters.  Example: >vim
5373      	echo globpath(&rtp, "syntax/c.vim", 0, 1)
5374      <
5375      {allinks} is used as with |glob()|.
5376
5377      The "**" item can be used to search in a directory tree.
5378      For example, to find all "README.txt" files in the directories
5379      in 'runtimepath' and below: >vim
5380      	echo globpath(&rtp, "**/README.txt")
5381      <Upwards search and limiting the depth of "**" is not
5382      supported, thus using 'path' will not always work properly.
5383
5384    ]=],
5385    name = 'globpath',
5386    params = {
5387      { 'path', 'string' },
5388      { 'expr', 'string' },
5389      { 'nosuf', 'boolean' },
5390      { 'list', 'boolean' },
5391      { 'allinks', 'boolean' },
5392    },
5393    signature = 'globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])',
5394  },
5395  has = {
5396    args = 1,
5397    desc = [=[
5398      Returns 1 if {feature} is supported, 0 otherwise.  The
5399      {feature} argument is a feature name like "nvim-0.2.1" or
5400      "win32", see below.  See also |exists()|.
5401
5402      To get the system name use |vim.uv|.os_uname() in Lua: >lua
5403      	print(vim.uv.os_uname().sysname)
5404
5405      <If the code has a syntax error then Vimscript may skip the
5406      rest of the line.  Put |:if| and |:endif| on separate lines to
5407      avoid the syntax error: >vim
5408      	if has('feature')
5409      	  let x = this_breaks_without_the_feature()
5410      	endif
5411      <
5412      Vim's compile-time feature-names (prefixed with "+") are not
5413      recognized because Nvim is always compiled with all possible
5414      features. |feature-compile|
5415
5416      Feature names can be:
5417      1.  Nvim version. For example the "nvim-0.2.1" feature means
5418          that Nvim is version 0.2.1 or later: >vim
5419      	if has("nvim-0.2.1")
5420      	  " ...
5421      	endif
5422
5423      <2.  Runtime condition or other pseudo-feature. For example the
5424          "win32" feature checks if the current system is Windows: >vim
5425      	if has("win32")
5426      	  " ...
5427      	endif
5428      <					*feature-list*
5429          List of supported pseudo-feature names:
5430      	acl		|ACL| support.
5431      	*android*	Android system (not necessarily |termux|).
5432      	bsd		BSD system (not macOS, use "mac" for that).
5433      	clipboard	|clipboard| provider is available.
5434      	fname_case	Case in file names matters (for Darwin and MS-Windows
5435      			this is not present).
5436      	gui_running	Nvim has a GUI.
5437      	hurd		GNU/Hurd system.
5438      	iconv		Can use |iconv()| for conversion.
5439      	linux		Linux system.
5440      	mac		MacOS system.
5441      	nvim		This is Nvim.
5442      	python3		Legacy Vim |python3| interface. |has-python|
5443      	pythonx		Legacy Vim |python_x| interface. |has-pythonx|
5444      	sun		SunOS system.
5445      	*termux*	Termux, an |android| terminal app and packaging environment.
5446      	ttyin		input is a terminal (tty).
5447      	ttyout		output is a terminal (tty).
5448      	unix		Unix system.
5449      	*vim_starting*	True during |startup|.
5450      	win32		Windows system (32 or 64 bit).
5451      	win64		Windows system (64 bit).
5452      	wsl		WSL (Windows Subsystem for Linux) system.
5453
5454      					*has-patch*
5455      3.  Vim patch. For example the "patch123" feature means that
5456          Vim patch 123 at the current |v:version| was included: >vim
5457      	if v:version > 602 || v:version == 602 && has("patch148")
5458      	  " ...
5459      	endif
5460
5461      <4.  Vim version. For example the "patch-7.4.237" feature means
5462          that Nvim is Vim-compatible to version 7.4.237 or later. >vim
5463      	if has("patch-7.4.237")
5464      	  " ...
5465      	endif
5466      <
5467    ]=],
5468    fast = true,
5469    name = 'has',
5470    params = { { 'feature', 'string' } },
5471    returns = '0|1',
5472    signature = 'has({feature})',
5473  },
5474  has_key = {
5475    args = 2,
5476    base = 1,
5477    desc = [=[
5478      Checks whether |Dictionary| {dict} has an entry with key
5479      {key}.  Returns TRUE if so, FALSE otherwise.  The {key}
5480      argument is a string.
5481
5482    ]=],
5483    name = 'has_key',
5484    params = { { 'dict', 'table' }, { 'key', 'string' } },
5485    returns = '0|1',
5486    signature = 'has_key({dict}, {key})',
5487    see_lua = { '`dict[key] ~= nil`' },
5488  },
5489  haslocaldir = {
5490    args = { 0, 3 },
5491    base = 1,
5492    desc = [=[
5493      Checks whether the tabpage, window or buffer has set a local
5494      working directory.  Returns 1 when the window has set a local
5495      path via |:lcd|, or when {winnr} is -1 and the tabpage has set
5496      a local path via |:tcd|, or when {winnr} and {tabnr} are -1
5497      and {bufnr} has set a local path via |:bcd|, otherwise 0.
5498
5499      Tabs, windows and buffers are identified by their respective
5500      numbers, 0 means current tab/window/buffer. Missing {winnr}
5501      or {tabnr} implies 0 (missing {bufnr} does not; see below).
5502      Thus the following are equivalent: >vim
5503      	echo haslocaldir()
5504      	echo haslocaldir(0)
5505      	echo haslocaldir(0, 0)
5506      <With {winnr} use that window in the current tabpage.
5507      With {winnr} and {tabnr} use the window in that tabpage.
5508      {winnr} is a |window-number| or |window-ID|.
5509      If {winnr} is -1 it is ignored, only the tab is resolved.
5510      If {bufnr} is provided, {winnr} and {tabnr} must be -1 and
5511      only the buffer is resolved.  An argument may be -1 only if
5512      all preceding arguments are -1.
5513      Examples of buffer usage: >vim
5514        haslocaldir(-1, -1, 0) " Current buf has a local directory?
5515        haslocaldir(-1, -1, 3) " Buf #3 has a local directory?
5516      <Throw error if the arguments are invalid.
5517      |E5000| |E5001| |E5002| |E5006| |E5007|
5518
5519    ]=],
5520    name = 'haslocaldir',
5521    params = { { 'winnr', 'integer' }, { 'tabnr', 'integer' }, { 'bufnr', 'integer' } },
5522    returns = '0|1',
5523    signature = 'haslocaldir([{winnr} [, {tabnr} [, {bufnr} ]]])',
5524  },
5525  hasmapto = {
5526    args = { 1, 3 },
5527    base = 1,
5528    desc = [=[
5529      Checks whether a mapping exists whose rhs contains {what}.
5530      Returns TRUE if there is such a mapping in one of the modes
5531      indicated by {mode}.
5532      The arguments {what} and {mode} are strings.
5533      When {abbr} is there and it is |TRUE| use abbreviations
5534      instead of mappings.  Don't forget to specify Insert and/or
5535      Command-line mode.
5536      Both the global mappings and the mappings local to the current
5537      buffer are checked for a match.
5538      If no matching mapping is found FALSE is returned.
5539      The following characters are recognized in {mode}:
5540      	n	Normal mode
5541      	v	Visual and Select mode
5542      	x	Visual mode
5543      	s	Select mode
5544      	o	Operator-pending mode
5545      	i	Insert mode
5546      	l	Language-Argument ("r", "f", "t", etc.)
5547      	c	Command-line mode
5548      When {mode} is omitted, "nvo" is used.
5549
5550      This function is useful to check if a mapping already exists
5551      to a function in a Vim script.  Example: >vim
5552      	if !hasmapto('\ABCdoit')
5553      	   map <Leader>d \ABCdoit
5554      	endif
5555      <This installs the mapping to "\ABCdoit" only if there isn't
5556      already a mapping to "\ABCdoit".
5557
5558    ]=],
5559    name = 'hasmapto',
5560    params = { { 'what', 'any' }, { 'mode', 'string' }, { 'abbr', 'boolean' } },
5561    returns = '0|1',
5562    signature = 'hasmapto({what} [, {mode} [, {abbr}]])',
5563  },
5564  highlightID = {
5565    args = 1,
5566    base = 1,
5567    deprecated = true,
5568    desc = [=[
5569      Obsolete name for |hlID()|.
5570    ]=],
5571    func = 'f_hlID',
5572    params = { { 'name', 'string' } },
5573    signature = 'highlightID({name})',
5574    see_lua = { '|nvim_get_hl()|' },
5575  },
5576  highlight_exists = {
5577    args = 1,
5578    base = 1,
5579    deprecated = true,
5580    desc = [=[
5581      Obsolete name for |hlexists()|.
5582    ]=],
5583    func = 'f_hlexists',
5584    params = { { 'name', 'string|number|boolean|nil' } },
5585    signature = 'highlight_exists({name})',
5586    see_lua = { '|nvim_get_hl()|' },
5587  },
5588  histadd = {
5589    args = 2,
5590    base = 2,
5591    desc = [=[
5592      Add the String {item} to the history {history} which can be
5593      one of:					*hist-names*
5594      	"cmd"	 or ":"	  command line history
5595      	"search" or "/"   search pattern history
5596      	"expr"	 or "="   typed expression history
5597      	"input"  or "@"	  input line history
5598      	"debug"  or ">"   debug command history
5599      	empty		  the current or last used history
5600      The {history} string does not need to be the whole name, one
5601      character is sufficient.
5602      If {item} does already exist in the history, it will be
5603      shifted to become the newest entry.
5604      The result is a Number: TRUE if the operation was successful,
5605      otherwise FALSE is returned.
5606
5607      Example: >vim
5608      	call histadd("input", strftime("%Y %b %d"))
5609      	let date=input("Enter date: ")
5610      <This function is not available in the |sandbox|.
5611
5612    ]=],
5613    name = 'histadd',
5614    params = { { 'history', 'string' }, { 'item', 'any' } },
5615    returns = '0|1',
5616    signature = 'histadd({history}, {item})',
5617  },
5618  histdel = {
5619    args = { 1, 2 },
5620    base = 1,
5621    desc = [=[
5622      Clear {history}, i.e. delete all its entries.  See |hist-names|
5623      for the possible values of {history}.
5624
5625      If the parameter {item} evaluates to a String, it is used as a
5626      regular expression.  All entries matching that expression will
5627      be removed from the history (if there are any).
5628      Upper/lowercase must match, unless "\c" is used |/\c|.
5629      If {item} evaluates to a Number, it will be interpreted as
5630      an index, see |:history-indexing|.  The respective entry will
5631      be removed if it exists.
5632
5633      The result is TRUE for a successful operation, otherwise FALSE
5634      is returned.
5635
5636      Examples:
5637      Clear expression register history: >vim
5638      	call histdel("expr")
5639      <
5640      Remove all entries starting with "*" from the search history: >vim
5641      	call histdel("/", '^\*')
5642      <
5643      The following three are equivalent: >vim
5644      	call histdel("search", histnr("search"))
5645      	call histdel("search", -1)
5646      	call histdel("search", '^' .. histget("search", -1) .. '$')
5647      <
5648      To delete the last search pattern and use the last-but-one for
5649      the "n" command and 'hlsearch': >vim
5650      	call histdel("search", -1)
5651      	let @/ = histget("search", -1)
5652      <
5653    ]=],
5654    name = 'histdel',
5655    params = { { 'history', 'string' }, { 'item', 'any' } },
5656    returns = '0|1',
5657    signature = 'histdel({history} [, {item}])',
5658  },
5659  histget = {
5660    args = { 1, 2 },
5661    base = 1,
5662    desc = [=[
5663      Returns an entry from the specified command-line {history}.
5664      See |hist-names| for the possible values of {history}, and
5665      |:history-indexing| for {index}.  If there is
5666      no such entry, an empty String is returned.  When {index} is
5667      omitted, the most recent item from the history is used.
5668
5669      Examples:
5670      Redo the second last search from history. >vim
5671      	execute '/' .. histget("search", -2)
5672
5673      <Define an Ex command ":H {num}" that supports re-execution of
5674      the {num}th entry from the output of |:history|. >vim
5675      	command -nargs=1 H execute histget("cmd", 0+<args>)
5676      <
5677    ]=],
5678    name = 'histget',
5679    params = { { 'history', 'string' }, { 'index', 'integer|string' } },
5680    returns = 'string',
5681    signature = 'histget({history} [, {index}])',
5682  },
5683  histnr = {
5684    args = 1,
5685    base = 1,
5686    desc = [=[
5687      The result is the Number of the current entry in {history}.
5688      See |hist-names| for the possible values of {history}.
5689      If an error occurred, -1 is returned.
5690
5691      Example: >vim
5692      	let inp_index = histnr("expr")
5693      <
5694
5695    ]=],
5696    name = 'histnr',
5697    params = { { 'history', 'string' } },
5698    returns = 'integer',
5699    signature = 'histnr({history})',
5700  },
5701  hlID = {
5702    args = 1,
5703    base = 1,
5704    desc = [=[
5705      Returns the numeric ID of the highlight group with name
5706      {name}.  When the highlight group doesn't exist, zero is
5707      returned.
5708      This can be used to retrieve information about the highlight
5709      group.  For example, to get the background color of the
5710      "Comment" group: >vim
5711      	echo synIDattr(synIDtrans(hlID("Comment")), "bg")
5712      <
5713    ]=],
5714    name = 'hlID',
5715    params = { { 'name', 'string' } },
5716    returns = 'integer',
5717    signature = 'hlID({name})',
5718    see_lua = { '|nvim_get_hl()|' },
5719  },
5720  hlexists = {
5721    args = 1,
5722    base = 1,
5723    desc = [=[
5724      Checks whether a highlight group called {name} exists.
5725      Returns TRUE if the group has been defined in some way.  Not
5726      necessarily when highlighting has been defined for it, it may
5727      also have been used for a syntax item.
5728
5729    ]=],
5730    name = 'hlexists',
5731    params = { { 'name', 'string|number|boolean|nil' } },
5732    returns = '0|1',
5733    signature = 'hlexists({name})',
5734    see_lua = { '|nvim_get_hl()|' },
5735  },
5736  hostname = {
5737    desc = [=[
5738      Returns the hostname of the machine on which the Nvim server
5739      (not the UI client) is currently running.
5740    ]=],
5741    fast = true,
5742    func_lua = 'f_hostname',
5743    name = 'hostname',
5744    params = {},
5745    returns = 'string',
5746    signature = 'hostname()',
5747    see_lua = { '|uv.os_gethostname()|' },
5748  },
5749  iconv = {
5750    args = 3,
5751    base = 1,
5752    desc = [=[
5753      Converts the encoding of {string} from {from} to {to}.
5754      Returns the converted String.
5755      When the conversion completely fails an empty string is
5756      returned.  When some characters could not be converted they
5757      are replaced with "?".
5758      The encoding names are whatever the iconv() library function
5759      can accept, see ":!man 3 iconv".
5760      Note that Vim uses UTF-8 for all Unicode encodings, conversion
5761      from/to UCS-2 is automatically changed to use UTF-8.  You
5762      cannot use UCS-2 in a string anyway, because of the NUL bytes.
5763
5764    ]=],
5765    fast = true,
5766    name = 'iconv',
5767    params = { { 'string', 'string' }, { 'from', 'string' }, { 'to', 'string' } },
5768    returns = 'string',
5769    signature = 'iconv({string}, {from}, {to})',
5770    see_lua = { '|vim.iconv()|' },
5771  },
5772  id = {
5773    args = 1,
5774    desc = [=[
5775      Returns a |String| which is a unique identifier of the
5776      container type (|List|, |Dict|, |Blob| and |Partial|). It is
5777      guaranteed that for the mentioned types `id(v1) ==# id(v2)`
5778      returns true iff `type(v1) == type(v2) && v1 is v2`.
5779      Note that `v:_null_string`, `v:_null_list`, `v:_null_dict` and
5780      `v:_null_blob` have the same `id()` with different types
5781      because they are internally represented as NULL pointers.
5782      `id()` returns a hexadecimal representation of the pointers to
5783      the containers (i.e. like `0x994a40`), same as `printf("%p",
5784      {expr})`, but it is advised against counting on the exact
5785      format of the return value.
5786
5787      It is not guaranteed that `id(no_longer_existing_container)`
5788      will not be equal to some other `id()`: new containers may
5789      reuse identifiers of the garbage-collected ones.
5790    ]=],
5791    name = 'id',
5792    params = { { 'expr', 'any' } },
5793    returns = 'string',
5794    signature = 'id({expr})',
5795    see_lua = false,
5796  },
5797  indent = {
5798    args = 1,
5799    base = 1,
5800    desc = [=[
5801      Returns the indent of line {lnum} in the current buffer.
5802      The indent is counted in spaces, the value of 'tabstop' is
5803      relevant.  {lnum} is used just like in
5804      |getline()|.
5805      When {lnum} is invalid -1 is returned.
5806
5807      To get or set indent of lines in a string, see |vim.text.indent()|.
5808
5809    ]=],
5810    name = 'indent',
5811    params = { { 'lnum', 'integer|string' } },
5812    returns = 'integer',
5813    signature = 'indent({lnum})',
5814  },
5815  index = {
5816    args = { 2, 4 },
5817    base = 1,
5818    desc = [=[
5819      Find {expr} in {object} and return its index.  See
5820      |indexof()| for using a lambda to select the item.
5821
5822      If {object} is a |List| return the lowest index where the item
5823      has a value equal to {expr}.  There is no automatic
5824      conversion, so the String "4" is different from the Number 4.
5825      And the Number 4 is different from the Float 4.0.  The value
5826      of 'ignorecase' is not used here, case matters as indicated by
5827      the {ic} argument.
5828
5829      If {object} is a |Blob| return the lowest index where the byte
5830      value is equal to {expr}.
5831
5832      If {start} is given then start looking at the item with index
5833      {start} (may be negative for an item relative to the end).
5834
5835      When {ic} is given and it is |TRUE|, ignore case.  Otherwise
5836      case must match.
5837
5838      -1 is returned when {expr} is not found in {object}.
5839      Example: >vim
5840      	let idx = index(words, "the")
5841      	if index(numbers, 123) >= 0
5842      	  " ...
5843      	endif
5844      <
5845
5846    ]=],
5847    name = 'index',
5848    params = { { 'object', 'any' }, { 'expr', 'any' }, { 'start', 'integer' }, { 'ic', 'boolean' } },
5849    returns = 'integer',
5850    signature = 'index({object}, {expr} [, {start} [, {ic}]])',
5851    see_lua = {
5852      '|vim.iter()| with |Iter:enumerate()| and |Iter:find()| for lists; result is 1-based, and `start`, `ic`, and Blob semantics differ',
5853    },
5854  },
5855  indexof = {
5856    args = { 2, 3 },
5857    base = 1,
5858    desc = [=[
5859      Returns the index of an item in {object} where {expr} is
5860      v:true.  {object} must be a |List| or a |Blob|.
5861
5862      If {object} is a |List|, evaluate {expr} for each item in the
5863      List until the expression is v:true and return the index of
5864      this item.
5865
5866      If {object} is a |Blob| evaluate {expr} for each byte in the
5867      Blob until the expression is v:true and return the index of
5868      this byte.
5869
5870      {expr} must be a |string| or |Funcref|.
5871
5872      If {expr} is a |string|: If {object} is a |List|, inside
5873      {expr} |v:key| has the index of the current List item and
5874      |v:val| has the value of the item.  If {object} is a |Blob|,
5875      inside {expr} |v:key| has the index of the current byte and
5876      |v:val| has the byte value.
5877
5878      If {expr} is a |Funcref| it must take two arguments:
5879      	1. the key or the index of the current item.
5880      	2. the value of the current item.
5881      The function must return |TRUE| if the item is found and the
5882      search should stop.
5883
5884      The optional argument {opts} is a Dict and supports the
5885      following items:
5886          startidx	start evaluating {expr} at the item with this
5887      		index; may be negative for an item relative to
5888      		the end
5889      Returns -1 when {expr} evaluates to v:false for all the items.
5890      Example: >vim
5891      	let l = [#{n: 10}, #{n: 20}, #{n: 30}]
5892      	echo indexof(l, "v:val.n == 20")
5893      	echo indexof(l, {i, v -> v.n == 30})
5894      	echo indexof(l, "v:val.n == 20", #{startidx: 1})
5895      <
5896
5897    ]=],
5898    name = 'indexof',
5899    params = { { 'object', 'any' }, { 'expr', 'any' }, { 'opts', 'table' } },
5900    returns = 'integer',
5901    signature = 'indexof({object}, {expr} [, {opts}])',
5902    see_lua = {
5903      '|vim.iter()| with |Iter:enumerate()| and |Iter:find()| for list predicates; result is 1-based, and `startidx` and Blob semantics differ',
5904    },
5905  },
5906  input = {
5907    args = { 1, 3 },
5908    base = 1,
5909    desc = '',
5910    name = 'input',
5911    params = { { 'prompt', 'string' }, { 'text', 'string' }, { 'completion', 'string' } },
5912    returns = 'string',
5913    signature = 'input({prompt} [, {text} [, {completion}]])',
5914    see_lua = { '|vim.ui.input()| for callback-based input' },
5915  },
5916  input__1 = {
5917    args = { 1, 3 },
5918    base = 1,
5919    desc = [=[
5920      Prompts the user to enter text on the command-line, and
5921      returns the text as a String.  The {prompt} argument is either
5922      a prompt string, or a blank string (for no prompt).  A '\n'
5923      can be used in the prompt to start a new line.
5924
5925      In the second form it accepts a single dictionary with the
5926      following keys, any of which may be omitted:
5927
5928      Key           Default  Description ~
5929      prompt        ""       Same as {prompt} in the first form.
5930      default       ""       Same as {text} in the first form.
5931      completion    nothing  Same as {completion} in the first form.
5932      cancelreturn  ""       The value returned when the dialog is
5933                             cancelled.
5934      highlight     nothing  Highlight handler: |Funcref|.
5935
5936      The highlighting set with |:echohl| is used for the prompt.
5937      The input is entered just like a command-line, with the same
5938      editing commands and mappings.  There is a separate history
5939      for lines typed for input().
5940      Example: >vim
5941      	if input("Coffee or beer? ") == "beer"
5942      	  echo "Cheers!"
5943      	endif
5944      <
5945      If the optional {text} argument is present and not empty, this
5946      is used for the default reply, as if the user typed this.
5947      Example: >vim
5948      	let color = input("Color? ", "white")
5949
5950      <The optional {completion} argument specifies the type of
5951      completion supported for the input.  Without it completion is
5952      not performed.  The supported completion types are the same as
5953      that can be supplied to a user-defined command using the
5954      "-complete=" argument.  Refer to |:command-completion| for
5955      more information.  Example: >vim
5956      	let fname = input("File: ", "", "file")
5957
5958      <			*input()-highlight* *E5400* *E5402*
5959      The optional `highlight` key allows specifying function which
5960      will be used for highlighting user input.  This function
5961      receives user input as its only argument and must return
5962      a list of 3-tuples [hl_start_col, hl_end_col + 1, hl_group]
5963      where
5964      	hl_start_col is the first highlighted column,
5965      	hl_end_col is the last highlighted column (+ 1!),
5966      	hl_group is |:hi| group used for highlighting.
5967      			      *E5403* *E5404* *E5405* *E5406*
5968      Both hl_start_col and hl_end_col + 1 must point to the start
5969      of the multibyte character (highlighting must not break
5970      multibyte characters), hl_end_col + 1 may be equal to the
5971      input length.  Start column must be in range [0, len(input)),
5972      end column must be in range (hl_start_col, len(input)],
5973      sections must be ordered so that next hl_start_col is greater
5974      then or equal to previous hl_end_col.
5975
5976      Example (try some input with parentheses): >vim
5977      	highlight RBP1 guibg=Red ctermbg=red
5978      	highlight RBP2 guibg=Yellow ctermbg=yellow
5979      	highlight RBP3 guibg=Green ctermbg=green
5980      	highlight RBP4 guibg=Blue ctermbg=blue
5981      	let g:rainbow_levels = 4
5982      	function! RainbowParens(cmdline)
5983      	  let ret = []
5984      	  let i = 0
5985      	  let lvl = 0
5986      	  while i < len(a:cmdline)
5987      	    if a:cmdline[i] is# '('
5988      	      call add(ret, [i, i + 1, 'RBP' .. ((lvl % g:rainbow_levels) + 1)])
5989      	      let lvl += 1
5990      	    elseif a:cmdline[i] is# ')'
5991      	      let lvl -= 1
5992      	      call add(ret, [i, i + 1, 'RBP' .. ((lvl % g:rainbow_levels) + 1)])
5993      	    endif
5994      	    let i += 1
5995      	  endwhile
5996      	  return ret
5997      	endfunction
5998      	call input({'prompt':'>','highlight':'RainbowParens'})
5999      <
6000      Highlight function is called at least once for each new
6001      displayed input string, before command-line is redrawn.  It is
6002      expected that function is pure for the duration of one input()
6003      call, i.e. it produces the same output for the same input, so
6004      output may be memoized.  Function is run like under |:silent|
6005      modifier. If the function causes any errors, it will be
6006      skipped for the duration of the current input() call.
6007
6008      Highlighting is disabled if command-line contains arabic
6009      characters.
6010
6011      NOTE: This function must not be used in a startup file, for
6012      the versions that only run in GUI mode (e.g., the Win32 GUI).
6013      Note: When input() is called from within a mapping it will
6014      consume remaining characters from that mapping, because a
6015      mapping is handled like the characters were typed.
6016      Use |inputsave()| before input() and |inputrestore()|
6017      after input() to avoid that.  Another solution is to avoid
6018      that further characters follow in the mapping, e.g., by using
6019      |:execute| or |:normal|.
6020
6021      Example with a mapping: >vim
6022      	nmap \x :call GetFoo()<CR>:exe "/" .. Foo<CR>
6023      	function GetFoo()
6024      	  call inputsave()
6025      	  let g:Foo = input("enter search pattern: ")
6026      	  call inputrestore()
6027      	endfunction
6028      <
6029
6030    ]=],
6031    name = 'input',
6032    params = { { 'opts', 'table' } },
6033    returns = 'string',
6034    signature = 'input({opts})',
6035    see_lua = { '|vim.ui.input()| for callback-based input' },
6036  },
6037  inputdialog = {
6038    args = { 1, 3 },
6039    base = 1,
6040    deprecated = true,
6041    desc = [=[
6042      Use |input()| instead.
6043    ]=],
6044    params = VARARGS,
6045    signature = 'input(...)',
6046    see_lua = { '|vim.ui.input()| for callback-based input' },
6047  },
6048  inputlist = {
6049    args = 1,
6050    base = 1,
6051    desc = [=[
6052      Displays a list of strings and prompts the user to select
6053      one by entering a number.  {textlist} must be a |List| of
6054      strings.  Returns the number the user entered.
6055      The user can also select an item by clicking on it with the
6056      mouse, if the mouse is enabled in the command line ('mouse' is
6057      "a" or includes "c").  For the first string 0 is returned.
6058      When clicking above the first item a negative number is
6059      returned.  When clicking on the prompt one more than the
6060      length of {textlist} is returned.
6061      Make sure {textlist} has less than 'lines' entries, otherwise
6062      it won't work.  It's a good idea to put the entry number at
6063      the start of the string.  And put a prompt in the first item.
6064      Example: >vim
6065      	let color = inputlist(['Select color:', '1. red',
6066      		\ '2. green', '3. blue'])
6067      <
6068    ]=],
6069    name = 'inputlist',
6070    params = { { 'textlist', 'string[]' } },
6071    signature = 'inputlist({textlist})',
6072    see_lua = {
6073      '|vim.ui.select()| for simple selection menus; callback, returned item, and out-of-range semantics differ',
6074    },
6075  },
6076  inputrestore = {
6077    desc = [=[
6078      Restore typeahead that was saved with a previous |inputsave()|.
6079      Should be called the same number of times |inputsave()| is
6080      called.  Calling it more often is harmless though.
6081      Returns TRUE when there is nothing to restore, FALSE
6082      otherwise.
6083    ]=],
6084    name = 'inputrestore',
6085    params = {},
6086    returns = 'integer',
6087    signature = 'inputrestore()',
6088  },
6089  inputsave = {
6090    desc = [=[
6091      Preserve typeahead (also from mappings) and clear it, so that
6092      a following prompt gets input from the user.  Should be
6093      followed by a matching |inputrestore()| after the prompt.  Can
6094      be used several times, in which case there must be just as
6095      many |inputrestore()| calls.
6096      Returns TRUE when out of memory, FALSE otherwise.
6097    ]=],
6098    name = 'inputsave',
6099    params = {},
6100    returns = 'integer',
6101    signature = 'inputsave()',
6102  },
6103  inputsecret = {
6104    args = { 1, 2 },
6105    base = 1,
6106    desc = [=[
6107      This function acts much like the |input()| function with but
6108      two exceptions:
6109      a) the user's response will be displayed as a sequence of
6110      asterisks ("*") thereby keeping the entry secret, and
6111      b) the user's response will not be recorded on the input
6112      |history| stack.
6113      The result is a String, which is whatever the user actually
6114      typed on the command-line in response to the issued prompt.
6115      NOTE: Command-line completion is not supported.
6116
6117    ]=],
6118    name = 'inputsecret',
6119    params = { { 'prompt', 'string' }, { 'text', 'string' } },
6120    returns = 'string',
6121    signature = 'inputsecret({prompt} [, {text}])',
6122  },
6123  insert = {
6124    args = { 2, 3 },
6125    base = 1,
6126    desc = [=[
6127      When {object} is a |List| or a |Blob| insert {item} at the start
6128      of it.
6129
6130      If {idx} is specified insert {item} before the item with index
6131      {idx}.  If {idx} is zero it goes before the first item, just
6132      like omitting {idx}.  A negative {idx} is also possible, see
6133      |list-index|.  -1 inserts just before the last item.
6134
6135      Returns the resulting |List| or |Blob|.  Examples: >vim
6136      	let mylist = insert([2, 3, 5], 1)
6137      	call insert(mylist, 4, -1)
6138      	call insert(mylist, 6, len(mylist))
6139      <The last example can be done simpler with |add()|.
6140      Note that when {item} is a |List| it is inserted as a single
6141      item.  Use |extend()| to concatenate |Lists|.
6142
6143    ]=],
6144    name = 'insert',
6145    params = { { 'object', 'any' }, { 'item', 'any' }, { 'idx', 'integer' } },
6146    signature = 'insert({object}, {item} [, {idx}])',
6147    see_lua = { '|table.insert()| for lists; blob insertion and negative indexes differ' },
6148  },
6149  interrupt = {
6150    args = 0,
6151    desc = [=[
6152      Interrupt script execution.  It works more or less like the
6153      user typing CTRL-C, most commands won't execute and control
6154      returns to the user.  This is useful to abort execution
6155      from lower down, e.g. in an autocommand.  Example: >vim
6156      function s:check_typoname(file)
6157         if fnamemodify(a:file, ':t') == '['
6158             echomsg 'Maybe typo'
6159             call interrupt()
6160         endif
6161      endfunction
6162      au BufWritePre * call s:check_typoname(expand('<amatch>'))
6163      <
6164    ]=],
6165    name = 'interrupt',
6166    params = {},
6167    signature = 'interrupt()',
6168    see_lua = false,
6169  },
6170  invert = {
6171    args = 1,
6172    base = 1,
6173    desc = [=[
6174      Bitwise invert.  The argument is converted to a number.  A
6175      List, Dict or Float argument causes an error.  Example: >vim
6176      	let bits = invert(bits)
6177      <
6178    ]=],
6179    name = 'invert',
6180    params = { { 'expr', 'integer' } },
6181    returns = 'integer',
6182    signature = 'invert({expr})',
6183    see_lua = { '|bit.bnot()|' },
6184  },
6185  isabsolutepath = {
6186    args = 1,
6187    base = 1,
6188    desc = [=[
6189      Checks whether {path} is an absolute path.  Returns |TRUE|
6190      if so, |FALSE| otherwise.
6191      On Unix, a path is considered absolute when it starts with
6192      '/'.
6193      On MS-Windows, it is considered absolute when it starts with
6194      an optional drive prefix and is followed by a '\' or '/'.  UNC
6195      paths are always absolute.
6196      Example: >vim
6197      	echo isabsolutepath('/usr/share/')	" 1
6198      	echo isabsolutepath('./foobar')		" 0
6199      	echo isabsolutepath('C:\Windows')	" 1
6200      	echo isabsolutepath('foobar')		" 0
6201      	echo isabsolutepath('\\remote\file')	" 1
6202      <
6203    ]=],
6204    fast = true,
6205    name = 'isabsolutepath',
6206    params = { { 'path', 'string' } },
6207    returns = '0|1',
6208    signature = 'isabsolutepath({path})',
6209  },
6210  isdirectory = {
6211    args = 1,
6212    base = 1,
6213    desc = [=[
6214      Returns |TRUE| if {directory} exists, or |FALSE| if it doesn't
6215      exist or isn't a directory.  {directory} is any expression,
6216      which is used as a String.
6217
6218    ]=],
6219    fast = true,
6220    name = 'isdirectory',
6221    params = { { 'directory', 'string' } },
6222    returns = '0|1',
6223    signature = 'isdirectory({directory})',
6224    see_lua = { '|uv.fs_stat()| and check `type == "directory"`' },
6225  },
6226  isinf = {
6227    args = 1,
6228    base = 1,
6229    desc = [=[
6230      Return 1 if {expr} is a positive infinity, or -1 a negative
6231      infinity, otherwise 0. >vim
6232      	echo isinf(1.0 / 0.0)
6233      <	1 >vim
6234      	echo isinf(-1.0 / 0.0)
6235      <	-1
6236
6237    ]=],
6238    name = 'isinf',
6239    params = { { 'expr', 'number' } },
6240    returns = '1|0|-1',
6241    signature = 'isinf({expr})',
6242    see_lua = { '`expr == math.huge and 1 or expr == -math.huge and -1 or 0`' },
6243  },
6244  islocked = {
6245    args = 1,
6246    base = 1,
6247    desc = [=[
6248      Returns |TRUE| if {expr} is the name of a locked variable,
6249      else |FALSE|.
6250      The string argument {expr} must be the name of a variable,
6251      |List| item or |Dictionary| entry, not the variable itself!
6252      Example: >vim
6253      	let alist = [0, ['a', 'b'], 2, 3]
6254      	lockvar 1 alist
6255      	echo islocked('alist')		" 1
6256      	echo islocked('alist[1]')	" 0
6257
6258      <When {expr} is a variable that does not exist you get an error
6259      message.  Use |exists()| to check for existence.
6260
6261    ]=],
6262    name = 'islocked',
6263    params = { { 'expr', 'any' } },
6264    returns = '0|1',
6265    signature = 'islocked({expr})',
6266    tags = { 'E786' },
6267    see_lua = false,
6268  },
6269  isnan = {
6270    args = 1,
6271    base = 1,
6272    desc = [=[
6273      Return |TRUE| if {expr} is a float with value NaN. >vim
6274      	echo isnan(0.0 / 0.0)
6275      <	1
6276
6277    ]=],
6278    name = 'isnan',
6279    params = { { 'expr', 'number' } },
6280    returns = '0|1',
6281    signature = 'isnan({expr})',
6282    see_lua = { '`expr ~= expr`' },
6283  },
6284  items = {
6285    args = 1,
6286    base = 1,
6287    desc = [=[
6288      Return a |List| with all key/index and value pairs of {expr}.
6289      Each |List| item is a list with two items:
6290      - for a |Dict|: the key and the value
6291      - for a |List|, |Blob| or |String|: the index and the value
6292      The returned |List| is in arbitrary order for a |Dict|,
6293      otherwise it's in ascending order of the index.
6294
6295      Also see |keys()| and |values()|.
6296
6297      Example: >vim
6298      	let mydict = #{a: 'red', b: 'blue'}
6299      	for [key, value] in items(mydict)
6300      	   echo $"{key} = {value}"
6301      	endfor
6302      	echo items([1, 2, 3])
6303      	echo items("foobar")
6304      	echo items(0z0102)
6305      <
6306    ]=],
6307    name = 'items',
6308    params = { { 'expr', 'table|string' } },
6309    signature = 'items({expr})',
6310    see_lua = { '|pairs()|', '|ipairs()|' },
6311  },
6312  jobclose = {
6313    args = { 1, 2 },
6314    deprecated = true,
6315    desc = [=[
6316      Obsolete name for |chanclose()|
6317    ]=],
6318    func = 'f_chanclose',
6319    params = VARARGS,
6320    signature = 'jobclose({id} [, {stream}])',
6321  },
6322  jobpid = {
6323    args = 1,
6324    desc = [=[
6325      Return the PID (process id) of |job-id| {job}.
6326    ]=],
6327    name = 'jobpid',
6328    params = { { 'job', 'integer' } },
6329    returns = 'integer',
6330    signature = 'jobpid({job})',
6331    see_lua = { '|vim.system()| object `.pid`; |job-id| and channel semantics differ' },
6332  },
6333  jobresize = {
6334    args = 3,
6335    desc = [=[
6336      Resize the pseudo terminal window of |job-id| {job} to {width}
6337      columns and {height} rows.
6338      Fails if the job was not started with `"pty":v:true`.
6339    ]=],
6340    name = 'jobresize',
6341    params = { { 'job', 'integer' }, { 'width', 'integer' }, { 'height', 'integer' } },
6342    signature = 'jobresize({job}, {width}, {height})',
6343  },
6344  jobsend = {
6345    args = 2,
6346    deprecated = true,
6347    desc = [=[
6348      Obsolete name for |chansend()|
6349    ]=],
6350    func = 'f_chansend',
6351    params = VARARGS,
6352    signature = 'jobsend({id}, {data})',
6353    see_lua = { '|nvim_chan_send()| for string data; list input and the return value differ' },
6354  },
6355  jobstart = {
6356    args = { 1, 2 },
6357    desc = [=[
6358      Spawns {cmd} as a job.
6359      If {cmd} is a List it runs directly (no 'shell').
6360      If {cmd} is a String it runs in the 'shell', like this: >vim
6361        call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}'])
6362      <(See |shell-unquoting| for details.)
6363
6364      Example: start a job and handle its output: >vim
6365        call jobstart(['nvim', '-h'], {'on_stdout':{j,d,e->append(line('.'),d)}})
6366      <
6367      Example: start a job in a |terminal| connected to the current buffer: >vim
6368        call jobstart(['nvim', '-h'], {'term':v:true})
6369      <
6370      Returns |job-id| on success, 0 on invalid arguments (or job
6371      table is full), -1 if {cmd}[0] or 'shell' is not executable.
6372      The returned job-id is a valid |channel-id| representing the
6373      job's stdio streams. Use |chansend()| (or |rpcnotify()| and
6374      |rpcrequest()| if "rpc" was enabled) to send data to stdin and
6375      |chanclose()| to close the streams without stopping the job.
6376
6377      See |job-control| and |RPC|.
6378
6379      NOTE: on Windows if {cmd} is a List:
6380        - cmd[0] must be an executable (not a "built-in"). If it is
6381          in $PATH it can be called by name, without an extension: >vim
6382            call jobstart(['ping', 'neovim.io'])
6383      <    If it is a full or partial path, extension is required: >vim
6384            call jobstart(['System32\ping.exe', 'neovim.io'])
6385      <  - {cmd} is collapsed to a string of quoted args as expected
6386          by CommandLineToArgvW https://msdn.microsoft.com/bb776391
6387          unless cmd[0] is some form of "cmd.exe".
6388
6389      					*jobstart-env*
6390      The job environment is initialized as follows:
6391        $NVIM                is set to |v:servername| of the parent Nvim
6392        $NVIM_LISTEN_ADDRESS is unset
6393        $NVIM_LOG_FILE       is unset
6394        $VIM                 is unset
6395        $VIMRUNTIME          is unset
6396      You can set these with the `env` option.
6397
6398      					*jobstart-options*
6399      {opts} is a dictionary with these keys:
6400        clear_env:  (boolean) `env` defines the job environment
6401      	      exactly, instead of merging current environment.
6402        cwd:	      (string, default=|current-directory|) Working
6403      	      directory of the job.
6404        detach:     (boolean) Detach the job process: it will not be
6405      	      killed when Nvim exits. If the process exits
6406      	      before Nvim, `on_exit` will be invoked.
6407        env:	      (dict) Map of environment variable name:value
6408      	      pairs extending (or replace with "clear_env")
6409      	      the current environment. |jobstart-env|
6410        height:     (number) Height of the `pty` terminal.
6411        |on_exit|:    (function) Callback invoked when the job exits.
6412        |on_stdout|:  (function) Callback invoked when the job emits
6413      	      stdout data.
6414        |on_stderr|:  (function) Callback invoked when the job emits
6415      	      stderr data.
6416        overlapped: (boolean) Sets FILE_FLAG_OVERLAPPED for the
6417      	      stdio passed to the child process. Only on
6418      	      MS-Windows; ignored on other platforms.
6419        pty:	      (boolean) Connect the job to a new pseudo
6420      	      terminal, and its streams to the master file
6421      	      descriptor. `on_stdout` receives all output,
6422      	      `on_stderr` is ignored. Note: if the child writes
6423      	      a query (DA1, OSC, …), it may hang or timeout waiting
6424      	      for a response! To avoid that, `on_stdout` should
6425      	      reply via |nvim_chan_send()| on the child's stdin.
6426      	      See |terminal-start| |terminal-concepts|
6427        rpc:	      (boolean) Use |msgpack-rpc| to communicate with
6428      	      the job over stdio. Then `on_stdout` is ignored,
6429      	      but `on_stderr` can still be used.
6430        stderr_buffered: (boolean) Collect data until EOF (stream closed)
6431      	      before invoking `on_stderr`. |channel-buffered|
6432        stdout_buffered: (boolean) Collect data until EOF (stream
6433      	      closed) before invoking `on_stdout`. |channel-buffered|
6434        stdin:      (string) Either "pipe" (default) to connect the
6435      	      job's stdin to a channel or "null" to disconnect
6436      	      stdin.
6437        term:       (boolean) Spawns {cmd} in a new pseudo-terminal
6438      	      session connected to the current (unmodified) buffer.
6439      	      Implies "pty". Defaults "height" and "width" to the
6440      	      current window dimensions. Defaults $TERM to
6441      	      "xterm-256color".
6442        width:      (number) Width of the `pty` pseudo-terminal.
6443
6444      {opts} is passed as |self| dictionary to the callback; the
6445      caller may set other keys to pass application-specific data.
6446
6447      Returns:
6448        - |channel-id| on success
6449        - 0 on invalid arguments
6450        - -1 if {cmd}[0] is not executable.
6451      See also |job-control|, |channel|, |msgpack-rpc|.
6452    ]=],
6453    name = 'jobstart',
6454    params = { { 'cmd', 'string|string[]' }, { 'opts', 'table' } },
6455    returns = 'integer',
6456    signature = 'jobstart({cmd} [, {opts}])',
6457    see_lua = {
6458      '|vim.system()| for simple processes; |RPC|, PTY/term, streaming callbacks, and shell-string behavior differ',
6459    },
6460  },
6461  jobstop = {
6462    args = 1,
6463    desc = [=[
6464      Stop |job-id| {id} by sending SIGTERM to the job process. If
6465      the process does not terminate after a timeout then SIGKILL
6466      will be sent. When the job terminates its |on_exit| handler
6467      (if any) will be invoked.
6468      See |job-control|.
6469
6470      Returns 1 for valid job id, 0 for invalid id, including jobs have
6471      exited or stopped.
6472    ]=],
6473    name = 'jobstop',
6474    params = { { 'id', 'integer' } },
6475    returns = 'integer',
6476    signature = 'jobstop({id})',
6477    see_lua = { '|SystemObj:kill()| on a |vim.system()| object; |job-id| semantics differ' },
6478  },
6479  jobwait = {
6480    args = { 1, 2 },
6481    desc = [=[
6482      Waits for jobs and their |on_exit| handlers to complete.
6483
6484      {jobs} is a List of |job-id|s to wait for.
6485      {timeout} is the maximum waiting time in milliseconds. If
6486      omitted or -1, wait forever.
6487
6488      Timeout of 0 can be used to check the status of a job: >vim
6489      	let running = jobwait([{job-id}], 0)[0] == -1
6490      <
6491      During jobwait() callbacks for jobs not in the {jobs} list may
6492      be invoked. The screen will not redraw unless |:redraw| is
6493      invoked by a callback.
6494
6495      Returns a list of len({jobs}) integers, where each integer is
6496      the status of the corresponding job:
6497      	Exit-code, if the job exited
6498      	-1 if the timeout was exceeded
6499      	-2 if the job was interrupted (by |CTRL-C|)
6500      	-3 if the job-id is invalid
6501    ]=],
6502    name = 'jobwait',
6503    params = { { 'jobs', 'integer[]' }, { 'timeout', 'integer' } },
6504    returns = 'integer[]',
6505    signature = 'jobwait({jobs} [, {timeout}])',
6506    see_lua = {
6507      '|SystemObj:wait()| on a |vim.system()| object; list input and status values differ',
6508    },
6509  },
6510  join = {
6511    args = { 1, 2 },
6512    base = 1,
6513    desc = [=[
6514      Join the items in {list} together into one String.
6515      When {sep} is specified it is put in between the items.  If
6516      {sep} is omitted a single space is used.
6517      Note that {sep} is not added at the end.  You might want to
6518      add it there too: >vim
6519      	let lines = join(mylist, "\n") .. "\n"
6520      <String items are used as-is.  |Lists| and |Dictionaries| are
6521      converted into a string like with |string()|.
6522      The opposite function is |split()|.
6523
6524    ]=],
6525    name = 'join',
6526    params = { { 'list', 'any[]' }, { 'sep', 'string' } },
6527    returns = 'string',
6528    signature = 'join({list} [, {sep}])',
6529    see_lua = { '|table.concat()| for string lists; non-string values stringify differently' },
6530  },
6531  json_decode = {
6532    args = 1,
6533    base = 1,
6534    desc = [=[
6535      Convert {expr} from JSON object.  Accepts |readfile()|-style
6536      list as the input, as well as regular string.  May output any
6537      Vim value. In the following cases it will output
6538      |msgpack-special-dict|:
6539      1. Dictionary contains duplicate key.
6540      2. String contains NUL byte.  Two special dictionaries: for
6541         dictionary and for string will be emitted in case string
6542         with NUL byte was a dictionary key.
6543
6544      Note: function treats its input as UTF-8 always.  The JSON
6545      standard allows only a few encodings, of which UTF-8 is
6546      recommended and the only one required to be supported.
6547      Non-UTF-8 characters are an error.
6548
6549    ]=],
6550    name = 'json_decode',
6551    params = { { 'expr', 'any' } },
6552    signature = 'json_decode({expr})',
6553    see_lua = { '|vim.json.decode()|' },
6554  },
6555  json_encode = {
6556    args = 1,
6557    base = 1,
6558    desc = [=[
6559      Convert {expr} into a JSON string.  Accepts
6560      |msgpack-special-dict| as the input.  Will not convert
6561      |Funcref|s, mappings with non-string keys (can be created as
6562      |msgpack-special-dict|), values with self-referencing
6563      containers, strings which contain non-UTF-8 characters,
6564      pseudo-UTF-8 strings which contain codepoints reserved for
6565      surrogate pairs (such strings are not valid UTF-8 strings).
6566      Non-printable characters are converted into "\u1234" escapes
6567      or special escapes like "\t", other are dumped as-is.
6568      |Blob|s are converted to arrays of the individual bytes.
6569
6570    ]=],
6571    name = 'json_encode',
6572    params = { { 'expr', 'any' } },
6573    returns = 'string',
6574    signature = 'json_encode({expr})',
6575    see_lua = { '|vim.json.encode()|' },
6576  },
6577  keys = {
6578    args = 1,
6579    base = 1,
6580    desc = [=[
6581      Return a |List| with all the keys of {dict}.  The |List| is in
6582      arbitrary order.  Also see |items()| and |values()|.
6583
6584    ]=],
6585    name = 'keys',
6586    params = { { 'dict', 'table' } },
6587    returns = 'string[]',
6588    signature = 'keys({dict})',
6589    see_lua = { '|vim.tbl_keys()|' },
6590  },
6591  keytrans = {
6592    args = 1,
6593    base = 1,
6594    desc = [=[
6595      Turn the internal byte representation of keys into a form that
6596      can be used for |:map|.  E.g. >vim
6597      	let xx = "\<C-Home>"
6598      	echo keytrans(xx)
6599      <	<C-Home>
6600
6601    ]=],
6602    fast = true,
6603    name = 'keytrans',
6604    params = { { 'string', 'string' } },
6605    returns = 'string',
6606    signature = 'keytrans({string})',
6607  },
6608  last_buffer_nr = {
6609    deprecated = true,
6610    desc = [=[
6611      Obsolete name for bufnr("$").
6612    ]=],
6613    params = {},
6614    signature = 'last_buffer_nr()',
6615  },
6616  len = {
6617    args = 1,
6618    base = 1,
6619    desc = [=[
6620      Returns the length of the argument.
6621      When {expr} is a String or a Number the length in bytes is
6622      used, as with |strlen()|.
6623      When {expr} is a |List| the number of items in the |List| is
6624      returned.
6625      When {expr} is a |Blob| the number of bytes is returned.
6626      When {expr} is a |Dictionary| the number of entries in the
6627      |Dictionary| is returned.
6628      Otherwise an error is given and returns zero.
6629
6630    ]=],
6631    name = 'len',
6632    params = { { 'expr', 'any[]' } },
6633    returns = 'integer',
6634    signature = 'len({expr})',
6635    tags = { 'E701' },
6636    see_lua = { 'Lua `#` operator for strings and lists', '`#vim.tbl_keys(expr)` for dicts' },
6637  },
6638  libcall = {
6639    args = 3,
6640    base = 3,
6641    desc = [=[
6642      Call function {funcname} in the run-time library {libname}
6643      with single argument {argument}.
6644      This is useful to call functions in a library that you
6645      especially made to be used with Vim.  Since only one argument
6646      is possible, calling standard library functions is rather
6647      limited.
6648      The result is the String returned by the function.  If the
6649      function returns NULL, this will appear as an empty string ""
6650      to Vim.
6651      If the function returns a number, use |libcallnr()|!
6652      If {argument} is a number, it is passed to the function as an
6653      int; if {argument} is a string, it is passed as a
6654      null-terminated string.
6655
6656      libcall() allows you to write your own 'plug-in' extensions to
6657      Vim without having to recompile the program.  It is NOT a
6658      means to call system functions!  If you try to do so Vim will
6659      very probably crash.
6660
6661      For Win32, the functions you write must be placed in a DLL
6662      and use the normal C calling convention (NOT Pascal which is
6663      used in Windows System DLLs).  The function must take exactly
6664      one parameter, either a character pointer or a long integer,
6665      and must return a character pointer or NULL.  The character
6666      pointer returned must point to memory that will remain valid
6667      after the function has returned (e.g. in static data in the
6668      DLL).  If it points to allocated memory, that memory will
6669      leak away.  Using a static buffer in the function should work,
6670      it's then freed when the DLL is unloaded.
6671
6672      WARNING: If the function returns a non-valid pointer, Vim may
6673      crash!	This also happens if the function returns a number,
6674      because Vim thinks it's a pointer.
6675      For Win32 systems, {libname} should be the filename of the DLL
6676      without the ".DLL" suffix.  A full path is only required if
6677      the DLL is not in the usual places.
6678      For Unix: When compiling your own plugins, remember that the
6679      object code must be compiled as position-independent ('PIC').
6680      Examples: >vim
6681      	echo libcall("libc.so", "getenv", "HOME")
6682      <
6683    ]=],
6684    name = 'libcall',
6685    params = { { 'libname', 'string' }, { 'funcname', 'string' }, { 'argument', 'any' } },
6686    signature = 'libcall({libname}, {funcname}, {argument})',
6687    tags = { 'E364', 'E368' },
6688    see_lua = { '|package.loadlib()|', '`ffi.load()`' },
6689  },
6690  libcallnr = {
6691    args = 3,
6692    base = 3,
6693    desc = [=[
6694      Just like |libcall()|, but used for a function that returns an
6695      int instead of a string.
6696      Examples: >vim
6697      	echo libcallnr("/usr/lib/libc.so", "getpid", "")
6698      	call libcallnr("libc.so", "printf", "Hello World!\n")
6699      	call libcallnr("libc.so", "sleep", 10)
6700      <
6701    ]=],
6702    name = 'libcallnr',
6703    params = { { 'libname', 'string' }, { 'funcname', 'string' }, { 'argument', 'any' } },
6704    signature = 'libcallnr({libname}, {funcname}, {argument})',
6705    see_lua = { '|package.loadlib()|', '`ffi.load()`' },
6706  },
6707  line = {
6708    args = { 1, 2 },
6709    base = 1,
6710    desc = [=[
6711      See |getpos()| for accepted positions.
6712
6713      To get the column number use |col()|.  To get both use
6714      |getpos()|.
6715
6716      With the optional {winid} argument the values are obtained for
6717      that window instead of the current window.
6718
6719      Returns 0 for invalid values of {expr} and {winid}.
6720
6721      Examples: >vim
6722      	echo line(".")			" line number of the cursor
6723      	echo line(".", winid)		" idem, in window "winid"
6724      	echo line("'t")			" line number of mark t
6725      	echo line("'" .. marker)	" line number of mark marker
6726      <
6727      To jump to the last known position when opening a file see
6728      |last-position-jump|.
6729
6730    ]=],
6731    name = 'line',
6732    params = { { 'expr', 'string|integer[]' }, { 'winid', 'integer' } },
6733    returns = 'integer',
6734    signature = 'line({expr} [, {winid}])',
6735    see_lua = {
6736      '|nvim_win_get_cursor()| for "." or |nvim_buf_line_count()| for "$"; marks, lists, and other position expressions differ',
6737    },
6738  },
6739  line2byte = {
6740    args = 1,
6741    base = 1,
6742    desc = [=[
6743      Return the byte count from the start of the buffer for line
6744      {lnum}.  This includes the end-of-line character, depending on
6745      the 'fileformat' option for the current buffer.  The first
6746      line returns 1. UTF-8 encoding is used, 'fileencoding' is
6747      ignored.  This can also be used to get the byte count for the
6748      line just below the last line: >vim
6749      	echo line2byte(line("$") + 1)
6750      <This is the buffer size plus one.  If 'fileencoding' is empty
6751      it is the file size plus one.  {lnum} is used like with
6752      |getline()|.  When {lnum} is invalid -1 is returned.
6753      Also see |byte2line()|, |go| and |:goto|.
6754
6755    ]=],
6756    name = 'line2byte',
6757    params = { { 'lnum', 'integer|string' } },
6758    returns = 'integer',
6759    signature = 'line2byte({lnum})',
6760    see_lua = {
6761      "|nvim_buf_get_offset()| with `lnum - 1`; 'fileformat' and invalid-line semantics differ",
6762    },
6763  },
6764  lispindent = {
6765    args = 1,
6766    base = 1,
6767    desc = [=[
6768      Get the amount of indent for line {lnum} according the lisp
6769      indenting rules, as with 'lisp'.
6770      The indent is counted in spaces, the value of 'tabstop' is
6771      relevant.  {lnum} is used just like in |getline()|.
6772      When {lnum} is invalid, -1 is returned.
6773
6774    ]=],
6775    name = 'lispindent',
6776    params = { { 'lnum', 'integer|string' } },
6777    returns = 'integer',
6778    signature = 'lispindent({lnum})',
6779  },
6780  list2blob = {
6781    args = 1,
6782    base = 1,
6783    desc = [=[
6784      Return a Blob concatenating all the number values in {list}.
6785      Examples: >vim
6786      	echo list2blob([1, 2, 3, 4])	" returns 0z01020304
6787      	echo list2blob([])		" returns 0z
6788      <Returns an empty Blob on error.  If one of the numbers is
6789      negative or more than 255 error *E1239* is given.
6790
6791      |blob2list()| does the opposite.
6792
6793    ]=],
6794    name = 'list2blob',
6795    params = { { 'list', 'any[]' } },
6796    returns = 'string',
6797    signature = 'list2blob({list})',
6798    see_lua = false,
6799  },
6800  list2str = {
6801    args = { 1, 2 },
6802    base = 1,
6803    desc = [=[
6804      Converts each codepoint in {list} to a UTF-8 character and
6805      returns the concatenated string.  Examples: >vim
6806      	echo list2str([32])		" returns " "
6807      	echo list2str([65, 66, 67])	" returns "ABC"
6808      <The same can be done (slowly) with: >vim
6809      	echo join(map(list, {nr, val -> nr2char(val)}), '')
6810      <|str2list()| does the opposite.
6811
6812      UTF-8 encoding is always used, {utf8} option has no effect,
6813      and exists only for backwards-compatibility.
6814      With UTF-8 composing characters work as expected: >vim
6815      	echo list2str([97, 769])	" returns "á"
6816      <
6817      Returns an empty string on error.
6818
6819    ]=],
6820    name = 'list2str',
6821    params = { { 'list', 'any[]' }, { 'utf8', 'boolean' } },
6822    returns = 'string',
6823    signature = 'list2str({list} [, {utf8}])',
6824    see_lua = false,
6825  },
6826  localtime = {
6827    desc = [=[
6828      Return the current time, measured as seconds since 1st Jan
6829      1970.  See also |strftime()|, |strptime()| and |getftime()|.
6830    ]=],
6831    name = 'localtime',
6832    params = {},
6833    returns = 'integer',
6834    signature = 'localtime()',
6835    see_lua = { '|os.time()|' },
6836  },
6837  log = {
6838    args = 1,
6839    base = 1,
6840    desc = [=[
6841      Return the natural logarithm (base e) of {expr} as a |Float|.
6842      {expr} must evaluate to a |Float| or a |Number| in the range
6843      (0, inf].
6844      Returns 0.0 if {expr} is not a |Float| or a |Number|.
6845      Examples: >vim
6846      	echo log(10)
6847      <	2.302585 >vim
6848      	echo log(exp(5))
6849      <	5.0
6850
6851    ]=],
6852    func_float = 'log',
6853    name = 'log',
6854    params = { { 'expr', 'number' } },
6855    returns = 'number',
6856    signature = 'log({expr})',
6857    see_lua = { '|math.log()|' },
6858  },
6859  log10 = {
6860    args = 1,
6861    base = 1,
6862    desc = [=[
6863      Return the logarithm of Float {expr} to base 10 as a |Float|.
6864      {expr} must evaluate to a |Float| or a |Number|.
6865      Returns 0.0 if {expr} is not a |Float| or a |Number|.
6866      Examples: >vim
6867      	echo log10(1000)
6868      <	3.0 >vim
6869      	echo log10(0.01)
6870      <	-2.0
6871
6872    ]=],
6873    func_float = 'log10',
6874    name = 'log10',
6875    params = { { 'expr', 'number' } },
6876    returns = 'number',
6877    signature = 'log10({expr})',
6878    see_lua = { '|math.log10()|' },
6879  },
6880  luaeval = {
6881    args = { 1, 2 },
6882    base = 1,
6883    desc = [=[
6884      Evaluate Lua expression {expr} and return its result converted
6885      to Vim data structures. See |lua-eval| for details.
6886
6887      See also |v:lua-call|.
6888
6889    ]=],
6890    lua = false,
6891    name = 'luaeval',
6892    params = { { 'expr', 'string' }, { 'expr', 'any[]' } },
6893    signature = 'luaeval({expr} [, {expr}])',
6894    see_lua = { 'plain Lua expressions and values directly' },
6895  },
6896  map = {
6897    args = 2,
6898    base = 1,
6899    desc = [=[
6900      {expr1} must be a |List|, |String|, |Blob| or |Dictionary|.
6901      When {expr1} is a |List| or |Dictionary|, replace each
6902      item in {expr1} with the result of evaluating {expr2}.
6903      For a |Blob| each byte is replaced.
6904      For a |String|, each character, including composing
6905      characters, is replaced.
6906      If the item type changes you may want to use |mapnew()| to
6907      create a new List or Dictionary.
6908
6909      {expr2} must be a |String| or |Funcref|.
6910
6911      If {expr2} is a |String|, inside {expr2} |v:val| has the value
6912      of the current item.  For a |Dictionary| |v:key| has the key
6913      of the current item and for a |List| |v:key| has the index of
6914      the current item.  For a |Blob| |v:key| has the index of the
6915      current byte.  For a |String| |v:key| has the index of the
6916      current character.
6917      Example: >vim
6918      	call map(mylist, '"> " .. v:val .. " <"')
6919      <This puts "> " before and " <" after each item in "mylist".
6920
6921      Note that {expr2} is the result of an expression and is then
6922      used as an expression again.  Often it is good to use a
6923      |literal-string| to avoid having to double backslashes.  You
6924      still have to double single (') quotes, though.
6925
6926      If {expr2} is a |Funcref| it is called with two arguments:
6927      	1. The key or the index of the current item.
6928      	2. the value of the current item.
6929      The function must return the new value of the item.  Example
6930      that changes each value by "key-value": >vim
6931      	func KeyValue(key, val)
6932      	  return a:key .. '-' .. a:val
6933      	endfunc
6934      	call map(myDict, function('KeyValue'))
6935      <It is shorter when using a |lambda|: >vim
6936      	call map(myDict, {key, val -> key .. '-' .. val})
6937      <If you do not use "val" you can leave it out: >vim
6938      	call map(myDict, {key -> 'item: ' .. key})
6939      <If you do not use "key" you can use a short name: >vim
6940      	call map(myDict, {_, val -> 'item: ' .. val})
6941      <
6942      The operation is done in-place for a |List| and |Dictionary|.
6943      If you want it to remain unmodified make a copy first: >vim
6944      	let tlist = map(copy(mylist), ' v:val .. "\t"')
6945
6946      <Returns {expr1}, the |List| or |Dictionary| that was filtered,
6947      or a new |Blob| or |String|.
6948      When an error is encountered while evaluating {expr2} no
6949      further items in {expr1} are processed.
6950      When {expr2} is a Funcref errors inside a function are
6951      ignored, unless it was defined with the "abort" flag.
6952
6953    ]=],
6954    name = 'map',
6955    params = { { 'expr1', 'string|table|any[]' }, { 'expr2', 'string|function' } },
6956    signature = 'map({expr1}, {expr2})',
6957    see_lua = {
6958      '|vim.tbl_map()| for array-like tables; dict, string, blob, and in-place behavior differ',
6959    },
6960  },
6961  maparg = {
6962    args = { 1, 4 },
6963    base = 1,
6964    desc = [=[
6965      When {dict} is omitted or zero: Return the rhs of mapping
6966      {name} in mode {mode}.  The returned String has special
6967      characters translated like in the output of the ":map" command
6968      listing.  When {dict} is TRUE a dictionary is returned, see
6969      below.  To get a list of all mappings see |maplist()|.
6970
6971      When there is no mapping for {name}, an empty String is
6972      returned if {dict} is FALSE, otherwise returns an empty Dict.
6973      When the mapping for {name} is empty, then "<Nop>" is
6974      returned.
6975
6976      The {name} can have special key names, like in the ":map"
6977      command.
6978
6979      {mode} can be one of these strings:
6980      	"n"	Normal
6981      	"v"	Visual (including Select)
6982      	"o"	Operator-pending
6983      	"i"	Insert
6984      	"c"	Cmd-line
6985      	"s"	Select
6986      	"x"	Visual
6987      	"l"	langmap |language-mapping|
6988      	"t"	Terminal
6989      	""	Normal, Visual and Operator-pending
6990      When {mode} is omitted, the modes for "" are used.
6991
6992      When {abbr} is there and it is |TRUE| use abbreviations
6993      instead of mappings.
6994
6995      When {dict} is |TRUE|, return a dictionary describing the
6996      mapping, with these items:		*mapping-dict*
6997        "lhs"	     The {lhs} of the mapping as it would be typed
6998        "lhsraw"   The {lhs} of the mapping as raw bytes
6999        "lhsrawalt" The {lhs} of the mapping as raw bytes, alternate
7000      	      form, only present when it differs from "lhsraw"
7001        "rhs"	     The {rhs} of the mapping as typed.
7002        "callback" Lua function, if RHS was defined as such.
7003        "silent"   1 for a |:map-silent| mapping, else 0.
7004        "noremap"  1 if the {rhs} of the mapping is not remappable.
7005        "script"   1 if mapping was defined with <script>.
7006        "expr"     1 for an expression mapping (|:map-<expr>|).
7007        "buffer"   1 for a buffer local mapping (|:map-local|).
7008        "mode"     Modes for which the mapping is defined.  In
7009      	     addition to the modes mentioned above, these
7010      	     characters will be used:
7011      	     " "     Normal, Visual and Operator-pending
7012      	     "!"     Insert and Commandline mode
7013      		     (|mapmode-ic|)
7014        "sid"	     The script local ID, used for <sid> mappings
7015      	     (|<SID>|).  Negative for special contexts.
7016        "scriptversion"  The version of the script, always 1.
7017        "lnum"     The line number in "sid", zero if unknown.
7018        "nowait"   Do not wait for other, longer mappings.
7019      	     (|:map-<nowait>|).
7020        "abbr"     True if this is an |abbreviation|.
7021        "mode_bits" Nvim's internal binary representation of "mode".
7022      	     |mapset()| ignores this; only "mode" is used.
7023      	     See |maplist()| for usage examples.  The values
7024      	     are from src/nvim/state_defs.h and may change in
7025      	     the future.
7026
7027      The dictionary can be used to restore a mapping with
7028      |mapset()|.
7029
7030      The mappings local to the current buffer are checked first,
7031      then the global mappings.
7032      This function can be used to map a key even when it's already
7033      mapped, and have it do the original mapping too.  Sketch: >vim
7034      	exe 'nnoremap <Tab> ==' .. maparg('<Tab>', 'n')
7035      <
7036
7037    ]=],
7038    name = 'maparg',
7039    params = {
7040      { 'name', 'string' },
7041      { 'mode', 'string' },
7042      { 'abbr', 'boolean' },
7043      { 'dict', 'false' },
7044    },
7045    signature = 'maparg({name} [, {mode} [, {abbr} [, {dict}]]])',
7046    returns = 'string',
7047  },
7048  maparg__1 = {
7049    args = { 4 },
7050    base = 1,
7051    name = 'maparg',
7052    params = {
7053      { 'name', 'string' },
7054      { 'mode', 'string' },
7055      { 'abbr', 'boolean' },
7056      { 'dict', 'true' },
7057    },
7058    returns = 'table<string,any>',
7059  },
7060  mapcheck = {
7061    args = { 1, 3 },
7062    base = 1,
7063    desc = [=[
7064      Check if there is a mapping that matches with {name} in mode
7065      {mode}.  See |maparg()| for {mode} and special names in
7066      {name}.
7067      When {abbr} is there and it is non-zero use abbreviations
7068      instead of mappings.
7069      A match happens with a mapping that starts with {name} and
7070      with a mapping which is equal to the start of {name}.
7071
7072      	matches mapping "a"	"ab"	"abc" ~
7073         mapcheck("a")	yes	yes	 yes
7074         mapcheck("abc")	yes	yes	 yes
7075         mapcheck("ax")	yes	no	 no
7076         mapcheck("b")	no	no	 no
7077
7078      The difference with |maparg()| is that mapcheck() finds a
7079      mapping that matches with {name}, while |maparg()| only finds a
7080      mapping for {name} exactly.
7081      When there is no mapping that starts with {name}, an empty
7082      String is returned.  If there is one, the RHS of that mapping
7083      is returned.  If there are several mappings that start with
7084      {name}, the RHS of one of them is returned.  This will be
7085      "<Nop>" if the RHS is empty.
7086      The mappings local to the current buffer are checked first,
7087      then the global mappings.
7088      This function can be used to check if a mapping can be added
7089      without being ambiguous.  Example: >vim
7090      	if mapcheck("_vv") == ""
7091      	   map _vv :set guifont=7x13<CR>
7092      	endif
7093      <This avoids adding the "_vv" mapping when there already is a
7094      mapping for "_v" or for "_vvv".
7095
7096    ]=],
7097    name = 'mapcheck',
7098    params = { { 'name', 'string' }, { 'mode', 'string' }, { 'abbr', 'boolean' } },
7099    signature = 'mapcheck({name} [, {mode} [, {abbr}]])',
7100  },
7101  maplist = {
7102    args = { 0, 1 },
7103    desc = [[
7104      Returns a |List| of all mappings.  Each List item is a |Dict|,
7105      the same as what is returned by |maparg()|, see
7106      |mapping-dict|.  When {abbr} is there and it is |TRUE| use
7107      abbreviations instead of mappings.
7108
7109      Example to show all mappings with "MultiMatch" in rhs: >vim
7110      	echo maplist()->filter({_, m ->
7111      		\ match(get(m, 'rhs', ''), 'MultiMatch') >= 0
7112      		\ })
7113      <It can be tricky to find mappings for particular |:map-modes|.
7114      |mapping-dict|'s "mode_bits" can simplify this.  For example,
7115      the mode_bits for Normal, Insert or Command-line modes are
7116      0x19.  To find all the mappings available in those modes you
7117      can do: >vim
7118      	let saved_maps = []
7119      	for m in maplist()
7120      	    if and(m.mode_bits, 0x19) != 0
7121      		eval saved_maps->add(m)
7122      	    endif
7123      	endfor
7124      	echo saved_maps->mapnew({_, m -> m.lhs})
7125      <The values of the mode_bits are defined in Nvim's
7126      src/nvim/state_defs.h file and they can be discovered at
7127      runtime using |:map-commands| and "maplist()".  Example: >vim
7128      	omap xyzzy <Nop>
7129      	let op_bit = maplist()->filter(
7130      	    \ {_, m -> m.lhs == 'xyzzy'})[0].mode_bits
7131      	ounmap xyzzy
7132      	echo printf("Operator-pending mode bit: 0x%x", op_bit)
7133      <
7134    ]],
7135    name = 'maplist',
7136    params = { { 'abbr', '0|1' } },
7137    returns = 'table[]',
7138    signature = 'maplist([{abbr}])',
7139  },
7140  mapnew = {
7141    args = 2,
7142    base = 1,
7143    desc = [=[
7144      Like |map()| but instead of replacing items in {expr1} a new
7145      List or Dictionary is created and returned.  {expr1} remains
7146      unchanged.  Items can still be changed by {expr2}, if you
7147      don't want that use |deepcopy()| first.
7148    ]=],
7149    name = 'mapnew',
7150    params = { { 'expr1', 'any' }, { 'expr2', 'any' } },
7151    signature = 'mapnew({expr1}, {expr2})',
7152    see_lua = {
7153      '|vim.tbl_map()| for tables; string, blob, and `v:key` callback behavior differ',
7154    },
7155  },
7156  mapset = {
7157    args = { 1, 3 },
7158    base = 1,
7159    name = 'mapset',
7160    params = { { 'mode', 'string' }, { 'abbr', 'boolean' }, { 'dict', 'table<string,any>' } },
7161    signature = 'mapset({mode}, {abbr}, {dict})',
7162  },
7163  mapset__1 = {
7164    args = { 1, 3 },
7165    base = 1,
7166    desc = [=[
7167      Restore a mapping from a dictionary, possibly returned by
7168      |maparg()| or |maplist()|.  A buffer mapping, when dict.buffer
7169      is true, is set on the current buffer; it is up to the caller
7170      to ensure that the intended buffer is the current buffer.
7171      This feature allows copying mappings from one buffer to
7172      another.
7173      The dict.mode value may restore a single mapping that covers
7174      more than one mode, like with mode values of '!', ' ', "nox",
7175      or 'v'. *E1276*
7176
7177      In the first form, {mode} and {abbr} should be the same as
7178      for the call to |maparg()|. *E460*
7179      {mode} is used to define the mode in which the mapping is set,
7180      not the "mode" entry in {dict}.
7181      Example for saving and restoring a mapping: >vim
7182      	let save_map = maparg('K', 'n', 0, 1)
7183      	nnoremap K somethingelse
7184      	" ...
7185      	call mapset('n', 0, save_map)
7186      <Note that if you are going to replace a map in several modes,
7187      e.g. with `:map!`, you need to save/restore the mapping for
7188      all of them, when they might differ.
7189
7190      In the second form, with {dict} as the only argument, mode
7191      and abbr are taken from the dict.
7192      Example: >vim
7193      	let save_maps = maplist()->filter(
7194      				\ {_, m -> m.lhs == 'K'})
7195      	nnoremap K somethingelse
7196      	cnoremap K somethingelse2
7197      	" ...
7198      	unmap K
7199      	for d in save_maps
7200      	    call mapset(d)
7201      	endfor
7202      <
7203    ]=],
7204    name = 'mapset',
7205    params = { { 'dict', 'table<string,any>' } },
7206    signature = 'mapset({dict})',
7207  },
7208  match = {
7209    args = { 2, 4 },
7210    base = 1,
7211    desc = [=[
7212      When {expr} is a |List| then this returns the index of the
7213      first item where {pat} matches.  Each item is used as a
7214      String, |Lists| and |Dictionaries| are used as echoed.
7215
7216      Otherwise, {expr} is used as a String.  The result is a
7217      Number, which gives the index (byte offset) in {expr} where
7218      {pat} matches.
7219
7220      A match at the first character or |List| item returns zero.
7221      If there is no match -1 is returned.
7222
7223      For getting submatches see |matchlist()|.
7224      Example: >vim
7225      	echo match("testing", "ing")	" results in 4
7226      	echo match([1, 'x'], '\a')	" results in 1
7227      <See |string-match| for how {pat} is used.
7228      					*strpbrk()*
7229      Vim doesn't have a strpbrk() function.  But you can do: >vim
7230      	let sepidx = match(line, '[.,;: \t]')
7231      <					*strcasestr()*
7232      Vim doesn't have a strcasestr() function.  But you can add
7233      "\c" to the pattern to ignore case: >vim
7234      	let idx = match(haystack, '\cneedle')
7235      <
7236      If {start} is given, the search starts from byte index
7237      {start} in a String or item {start} in a |List|.
7238      The result, however, is still the index counted from the
7239      first character/item.  Example: >vim
7240      	echo match("testing", "ing", 2)
7241      <result is again "4". >vim
7242      	echo match("testing", "ing", 4)
7243      <result is again "4". >vim
7244      	echo match("testing", "t", 2)
7245      <result is "3".
7246      For a String, if {start} > 0 then it is like the string starts
7247      {start} bytes later, thus "^" will match at {start}.  Except
7248      when {count} is given, then it's like matches before the
7249      {start} byte are ignored (this is a bit complicated to keep it
7250      backwards compatible).
7251      For a String, if {start} < 0, it will be set to 0.  For a list
7252      the index is counted from the end.
7253      If {start} is out of range ({start} > strlen({expr}) for a
7254      String or {start} > len({expr}) for a |List|) -1 is returned.
7255
7256      When {count} is given use the {count}th match.  When a match
7257      is found in a String the search for the next one starts one
7258      character further.  Thus this example results in 1: >vim
7259      	echo match("testing", "..", 0, 2)
7260      <In a |List| the search continues in the next item.
7261      Note that when {count} is added the way {start} works changes,
7262      see above.
7263
7264      				*match-pattern*
7265      See |pattern| for the patterns that are accepted.
7266      The 'ignorecase' option is used to set the ignore-caseness of
7267      the pattern.  'smartcase' is NOT used.  The matching is always
7268      done like 'magic' is set and 'cpoptions' is empty.
7269      Note that a match at the start is preferred, thus when the
7270      pattern is using "*" (any number of matches) it tends to find
7271      zero matches at the start instead of a number of matches
7272      further down in the text.
7273
7274    ]=],
7275    name = 'match',
7276    params = {
7277      { 'expr', 'string|any[]' },
7278      { 'pat', 'string' },
7279      { 'start', 'integer' },
7280      { 'count', 'integer' },
7281    },
7282    signature = 'match({expr}, {pat} [, {start} [, {count}]])',
7283    returns = 'integer',
7284  },
7285  matchadd = {
7286    args = { 2, 5 },
7287    base = 1,
7288    desc = [=[
7289      Defines a pattern to be highlighted in the current window (a
7290      "match").  It will be highlighted with {group}.  Returns an
7291      identification number (ID), which can be used to delete the
7292      match using |matchdelete()|.  The ID is bound to the window.
7293      Matching is case sensitive and magic, unless case sensitivity
7294      or magicness are explicitly overridden in {pattern}.  The
7295      'magic', 'smartcase' and 'ignorecase' options are not used.
7296      The "Conceal" value is special, it causes the match to be
7297      concealed.
7298
7299      The optional {priority} argument assigns a priority to the
7300      match.  A match with a high priority will have its
7301      highlighting overrule that of a match with a lower priority.
7302      A priority is specified as an integer (negative numbers are no
7303      exception).  If the {priority} argument is not specified, the
7304      default priority is 10.  The priority of 'hlsearch' is zero,
7305      hence all matches with a priority greater than zero will
7306      overrule it.  Syntax highlighting (see 'syntax') is a separate
7307      mechanism, and regardless of the chosen priority a match will
7308      always overrule syntax highlighting.
7309
7310      The optional {id} argument allows the request for a specific
7311      match ID.  If a specified ID is already taken, an error
7312      message will appear and the match will not be added.  An ID
7313      is specified as a positive integer (zero excluded).  IDs 1, 2
7314      and 3 are reserved for |:match|, |:2match| and |:3match|,
7315      respectively.  3 is reserved for use by the |matchparen|
7316      plugin.
7317      If the {id} argument is not specified or -1, |matchadd()|
7318      automatically chooses a free ID, which is at least 1000.
7319
7320      The optional {dict} argument allows for further custom
7321      values.  Currently this is used to specify a match specific
7322      conceal character that will be shown for |hl-Conceal|
7323      highlighted matches.  The dict can have the following members:
7324
7325      	conceal	    Special character to show instead of the
7326      		    match (only for |hl-Conceal| highlighted
7327      		    matches, see |:syn-cchar|)
7328      	window	    Use this |window-number| or |window-ID| instead
7329      		    of the current window.
7330
7331      The number of matches is not limited, as it is the case with
7332      the |:match| commands.
7333
7334      Returns -1 on error.
7335
7336      Example: >vim
7337      	highlight MyGroup ctermbg=green guibg=green
7338      	let m = matchadd("MyGroup", "TODO")
7339      <Deletion of the pattern: >vim
7340      	call matchdelete(m)
7341
7342      <A list of matches defined by |matchadd()| and |:match| are
7343      available from |getmatches()|.  All matches can be deleted in
7344      one operation by |clearmatches()|.
7345
7346    ]=],
7347    name = 'matchadd',
7348    params = {
7349      { 'group', 'integer|string' },
7350      { 'pattern', 'string' },
7351      { 'priority', 'integer' },
7352      { 'id', 'integer' },
7353      { 'dict', 'table' },
7354    },
7355    signature = 'matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])',
7356    tags = { 'E798', 'E799', 'E801', 'E957' },
7357    returns = 'integer',
7358  },
7359  matchaddpos = {
7360    args = { 2, 5 },
7361    base = 1,
7362    desc = [=[
7363      Same as |matchadd()|, but requires a list of positions {pos}
7364      instead of a pattern.  This command is faster than |matchadd()|
7365      because it does not handle regular expressions and it sets
7366      buffer line boundaries to redraw screen.  It is supposed to be
7367      used when fast match additions and deletions are required, for
7368      example to highlight matching parentheses.
7369      					*E5030* *E5031*
7370      {pos} is a list of positions.  Each position can be one of
7371      these:
7372      - A number.  This whole line will be highlighted.  The first
7373        line has number 1.
7374      - A list with one number, e.g., [23].  The whole line with
7375        this number will be highlighted.
7376      - A list with two numbers, e.g., [23, 11].  The first number
7377        is the line number, the second one is the column number
7378        (first column is 1, the value must correspond to the byte
7379        index as |col()| would return).  The character at this
7380        position will be highlighted.
7381      - A list with three numbers, e.g., [23, 11, 3].  As above, but
7382        the third number gives the length of the highlight in bytes.
7383
7384      Entries with zero and negative line numbers are silently
7385      ignored, as well as entries with negative column numbers and
7386      lengths.
7387
7388      Returns -1 on error.
7389
7390      Example: >vim
7391      	highlight MyGroup ctermbg=green guibg=green
7392      	let m = matchaddpos("MyGroup", [[23, 24], 34])
7393      <Deletion of the pattern: >vim
7394      	call matchdelete(m)
7395
7396      <Matches added by |matchaddpos()| are returned by
7397      |getmatches()|.
7398
7399    ]=],
7400    name = 'matchaddpos',
7401    params = {
7402      { 'group', 'integer|string' },
7403      { 'pos', 'any[]' },
7404      { 'priority', 'integer' },
7405      { 'id', 'integer' },
7406      { 'dict', 'table' },
7407    },
7408    signature = 'matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])',
7409    returns = 'integer|table',
7410  },
7411  matcharg = {
7412    args = 1,
7413    base = 1,
7414    desc = [=[
7415      Selects the {nr} match item, as set with a |:match|,
7416      |:2match| or |:3match| command.
7417      Return a |List| with two elements:
7418      	The name of the highlight group used
7419      	The pattern used.
7420      When {nr} is not 1, 2 or 3 returns an empty |List|.
7421      When there is no match item set returns ['', ''].
7422      This is useful to save and restore a |:match|.
7423      Highlighting matches using the |:match| commands are limited
7424      to three matches.  |matchadd()| does not have this limitation.
7425
7426    ]=],
7427    name = 'matcharg',
7428    params = { { 'nr', 'integer' } },
7429    signature = 'matcharg({nr})',
7430    returns = 'string[]',
7431  },
7432  matchbufline = {
7433    args = { 4, 5 },
7434    base = 1,
7435    desc = [=[
7436      Returns the |List| of matches in lines from {lnum} to {end} in
7437      buffer {buf} where {pat} matches.
7438
7439      {lnum} and {end} can either be a line number or the string "$"
7440      to refer to the last line in {buf}.
7441
7442      The {dict} argument supports following items:
7443          submatches	include submatch information (|/\(|)
7444
7445      For each match, a |Dict| with the following items is returned:
7446          byteidx	starting byte index of the match
7447          lnum	line number where there is a match
7448          text	matched string
7449      Note that there can be multiple matches in a single line.
7450
7451      This function works only for loaded buffers.  First call
7452      |bufload()| if needed.
7453
7454      See |match-pattern| for information about the effect of some
7455      option settings on the pattern.
7456
7457      When {buf} is not a valid buffer, the buffer is not loaded or
7458      {lnum} or {end} is not valid then an error is given and an
7459      empty |List| is returned.
7460
7461      Examples: >vim
7462          " Assuming line 3 in buffer 5 contains "a"
7463          echo matchbufline(5, '\<\k\+\>', 3, 3)
7464      <    `[{'lnum': 3, 'byteidx': 0, 'text': 'a'}]` >vim
7465          " Assuming line 4 in buffer 10 contains "tik tok"
7466          echo matchbufline(10, '\<\k\+\>', 1, 4)
7467      <    `[{'lnum': 4, 'byteidx': 0, 'text': 'tik'}, {'lnum': 4, 'byteidx': 4, 'text': 'tok'}]`
7468
7469      If {submatch} is present and is v:true, then submatches like
7470      "\1", "\2", etc. are also returned.  Example: >vim
7471          " Assuming line 2 in buffer 2 contains "acd"
7472          echo matchbufline(2, '\(a\)\?\(b\)\?\(c\)\?\(.*\)', 2, 2
7473      				\ {'submatches': v:true})
7474      <    `[{'lnum': 2, 'byteidx': 0, 'text': 'acd', 'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]`
7475      The "submatches" List always contains 9 items.  If a submatch
7476      is not found, then an empty string is returned for that
7477      submatch.
7478    ]=],
7479    name = 'matchbufline',
7480    params = {
7481      { 'buf', 'string|integer' },
7482      { 'pat', 'string' },
7483      { 'lnum', 'string|integer' },
7484      { 'end', 'string|integer' },
7485      { 'dict', 'table' },
7486    },
7487    signature = 'matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}])',
7488    returns = 'string[]',
7489  },
7490  matchdelete = {
7491    args = { 1, 2 },
7492    base = 1,
7493    desc = [=[
7494      Deletes a match with ID {id} previously defined by |matchadd()|
7495      or one of the |:match| commands.  Returns 0 if successful,
7496      otherwise -1.  See example for |matchadd()|.  All matches can
7497      be deleted in one operation by |clearmatches()|.
7498      {win} (if given) is a |window-number| or |window-ID|.
7499
7500    ]=],
7501    name = 'matchdelete',
7502    params = { { 'id', 'integer' }, { 'win', 'integer' } },
7503    signature = 'matchdelete({id} [, {win}])',
7504    tags = { 'E802', 'E803' },
7505  },
7506  matchend = {
7507    args = { 2, 4 },
7508    base = 1,
7509    desc = [=[
7510      Same as |match()|, but return the index of first character
7511      after the match.  Example: >vim
7512      	echo matchend("testing", "ing")
7513      <results in "7".
7514      					*strspn()* *strcspn()*
7515      Vim doesn't have a strspn() or strcspn() function, but you can
7516      do it with matchend(): >vim
7517      	let span = matchend(line, '[a-zA-Z]')
7518      	let span = matchend(line, '[^a-zA-Z]')
7519      <Except that -1 is returned when there are no matches.
7520
7521      The {start}, if given, has the same meaning as for |match()|. >vim
7522      	echo matchend("testing", "ing", 2)
7523      <results in "7". >vim
7524      	echo matchend("testing", "ing", 5)
7525      <result is "-1".
7526      When {expr} is a |List| the result is equal to |match()|.
7527
7528    ]=],
7529    name = 'matchend',
7530    params = {
7531      { 'expr', 'any' },
7532      { 'pat', 'string' },
7533      { 'start', 'integer' },
7534      { 'count', 'integer' },
7535    },
7536    signature = 'matchend({expr}, {pat} [, {start} [, {count}]])',
7537    returns = 'integer',
7538  },
7539  matchfuzzy = {
7540    args = { 2, 3 },
7541    base = 1,
7542    desc = [=[
7543      If {list} is a list of strings, then returns a |List| with all
7544      the strings in {list} that fuzzy match {str}.  The strings in
7545      the returned list are sorted based on the matching score.
7546
7547      The optional {dict} argument always supports the following
7548      items:
7549          matchseq	When this item is present return only matches
7550      		that contain the characters in {str} in the
7551      		given sequence.
7552          limit	Maximum number of matches in {list} to be
7553      		returned.  Zero means no limit.
7554
7555      If {list} is a list of dictionaries, then the optional {dict}
7556      argument supports the following additional items:
7557          key		Key of the item which is fuzzy matched against
7558      		{str}.  The value of this item should be a
7559      		string.
7560          text_cb	|Funcref| that will be called for every item
7561      		in {list} to get the text for fuzzy matching.
7562      		This should accept a dictionary item as the
7563      		argument and return the text for that item to
7564      		use for fuzzy matching.
7565
7566      {str} is treated as a literal string and regular expression
7567      matching is NOT supported.  Only the first 1024 characters of
7568      {str} and of each item in {list} are used for matching;
7569      characters beyond that are ignored.
7570
7571      When {str} has multiple words each separated by white space,
7572      then the list of strings that have all the words is returned.
7573
7574      If there are no matching strings or there is an error, then an
7575      empty list is returned.
7576
7577      When {limit} is given, matchfuzzy() will find up to this
7578      number of matches in {list} and return them in sorted order.
7579
7580      Refer to |fuzzy-matching| for more information about fuzzy
7581      matching strings.
7582
7583      Example: >vim
7584         echo matchfuzzy(["clay", "crow"], "cay")
7585      <results in ["clay"]. >vim
7586         echo getbufinfo()->map({_, v -> v.name})->matchfuzzy("ndl")
7587      <results in a list of buffer names fuzzy matching "ndl". >vim
7588         echo getbufinfo()->matchfuzzy("ndl", {'key' : 'name'})
7589      <results in a list of buffer information dicts with buffer
7590      names fuzzy matching "ndl". >vim
7591         echo getbufinfo()->matchfuzzy("spl",
7592      				\ {'text_cb' : {v -> v.name}})
7593      <results in a list of buffer information dicts with buffer
7594      names fuzzy matching "spl". >vim
7595         echo v:oldfiles->matchfuzzy("test")
7596      <results in a list of file names fuzzy matching "test". >vim
7597         let l = readfile("buffer.c")->matchfuzzy("str")
7598      <results in a list of lines in "buffer.c" fuzzy matching "str". >vim
7599         echo ['one two', 'two one']->matchfuzzy('two one')
7600      <results in `['two one', 'one two']` . >vim
7601         echo ['one two', 'two one']->matchfuzzy('two one',
7602      				\ {'matchseq': 1})
7603      <results in `['two one']`.
7604    ]=],
7605    name = 'matchfuzzy',
7606    params = { { 'list', 'any[]' }, { 'str', 'string' }, { 'dict', 'table' } },
7607    signature = 'matchfuzzy({list}, {str} [, {dict}])',
7608    returns = 'table',
7609  },
7610  matchfuzzypos = {
7611    args = { 2, 3 },
7612    base = 1,
7613    desc = [=[
7614      Same as |matchfuzzy()|, but returns the list of matched
7615      strings, the list of character positions where characters
7616      in {str} matches and a list of matching scores.  You can
7617      use |byteidx()| to convert a character position to a byte
7618      position.
7619
7620      If {str} matches multiple times in a string, then only the
7621      positions for the best match is returned.
7622
7623      If there are no matching strings or there is an error, then a
7624      list with three empty list items is returned.
7625
7626      Example: >vim
7627      	echo matchfuzzypos(['testing'], 'tsg')
7628      <results in [["testing"], [[0, 2, 6]], [99]] >vim
7629      	echo matchfuzzypos(['clay', 'lacy'], 'la')
7630      <results in [["lacy", "clay"], [[0, 1], [1, 2]], [153, 133]] >vim
7631      	echo [{'text': 'hello', 'id' : 10}]
7632      		\ ->matchfuzzypos('ll', {'key' : 'text'})
7633      <results in `[[{"id": 10, "text": "hello"}], [[2, 3]], [127]]`
7634    ]=],
7635    name = 'matchfuzzypos',
7636    params = { { 'list', 'any[]' }, { 'str', 'string' }, { 'dict', 'table' } },
7637    signature = 'matchfuzzypos({list}, {str} [, {dict}])',
7638    returns = 'table',
7639  },
7640  matchlist = {
7641    args = { 2, 4 },
7642    base = 1,
7643    desc = [=[
7644      Same as |match()|, but return a |List|.  The first item in the
7645      list is the matched string, same as what |matchstr()| would
7646      return.  Following items are submatches, like "\1", "\2", etc.
7647      in |:substitute|.  When an optional submatch didn't match an
7648      empty string is used.  Example: >vim
7649      	echo matchlist('acd', '\(a\)\?\(b\)\?\(c\)\?\(.*\)')
7650      <Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', '']
7651      When there is no match an empty list is returned.
7652
7653      You can pass in a List, but that is not very useful.
7654
7655    ]=],
7656    name = 'matchlist',
7657    params = {
7658      { 'expr', 'any' },
7659      { 'pat', 'string' },
7660      { 'start', 'integer' },
7661      { 'count', 'integer' },
7662    },
7663    signature = 'matchlist({expr}, {pat} [, {start} [, {count}]])',
7664    returns = 'string[]',
7665  },
7666  matchstr = {
7667    args = { 2, 4 },
7668    base = 1,
7669    desc = [=[
7670      Same as |match()|, but return the matched string.  Example: >vim
7671      	echo matchstr("testing", "ing")
7672      <results in "ing".
7673      When there is no match "" is returned.
7674      The {start}, if given, has the same meaning as for |match()|. >vim
7675      	echo matchstr("testing", "ing", 2)
7676      <results in "ing". >vim
7677      	echo matchstr("testing", "ing", 5)
7678      <result is "".
7679      When {expr} is a |List| then the matching item is returned.
7680      The type isn't changed, it's not necessarily a String.
7681
7682    ]=],
7683    name = 'matchstr',
7684    params = {
7685      { 'expr', 'any' },
7686      { 'pat', 'string' },
7687      { 'start', 'integer' },
7688      { 'count', 'integer' },
7689    },
7690    signature = 'matchstr({expr}, {pat} [, {start} [, {count}]])',
7691    returns = 'string',
7692  },
7693  matchstrlist = {
7694    args = { 2, 3 },
7695    base = 1,
7696    desc = [=[
7697      Returns the |List| of matches in {list} where {pat} matches.
7698      {list} is a |List| of strings.  {pat} is matched against each
7699      string in {list}.
7700
7701      The {dict} argument supports following items:
7702          submatches	include submatch information (|/\(|)
7703
7704      For each match, a |Dict| with the following items is returned:
7705          byteidx	starting byte index of the match.
7706          idx		index in {list} of the match.
7707          text	matched string
7708          submatches	a List of submatches.  Present only if
7709      		"submatches" is set to v:true in {dict}.
7710
7711      See |match-pattern| for information about the effect of some
7712      option settings on the pattern.
7713
7714      Example: >vim
7715          echo matchstrlist(['tik tok'], '\<\k\+\>')
7716      <    `[{'idx': 0, 'byteidx': 0, 'text': 'tik'}, {'idx': 0, 'byteidx': 4, 'text': 'tok'}]` >vim
7717          echo matchstrlist(['a', 'b'], '\<\k\+\>')
7718      <    `[{'idx': 0, 'byteidx': 0, 'text': 'a'}, {'idx': 1, 'byteidx': 0, 'text': 'b'}]`
7719
7720      If "submatches" is present and is v:true, then submatches like
7721      "\1", "\2", etc. are also returned.  Example: >vim
7722          echo matchstrlist(['acd'], '\(a\)\?\(b\)\?\(c\)\?\(.*\)',
7723      				\ #{submatches: v:true})
7724      <    `[{'idx': 0, 'byteidx': 0, 'text': 'acd', 'submatches': ['a', '', 'c', 'd', '', '', '', '', '']}]`
7725      The "submatches" List always contains 9 items.  If a submatch
7726      is not found, then an empty string is returned for that
7727      submatch.
7728    ]=],
7729    name = 'matchstrlist',
7730    params = { { 'list', 'string[]' }, { 'pat', 'string' }, { 'dict', 'table' } },
7731    signature = 'matchstrlist({list}, {pat} [, {dict}])',
7732    returns = 'string[]',
7733  },
7734  matchstrpos = {
7735    args = { 2, 4 },
7736    base = 1,
7737    desc = [=[
7738      Same as |matchstr()|, but return the matched string, the start
7739      position and the end position of the match.  Example: >vim
7740      	echo matchstrpos("testing", "ing")
7741      <results in ["ing", 4, 7].
7742      When there is no match ["", -1, -1] is returned.
7743      The {start}, if given, has the same meaning as for |match()|. >vim
7744      	echo matchstrpos("testing", "ing", 2)
7745      <results in ["ing", 4, 7]. >vim
7746      	echo matchstrpos("testing", "ing", 5)
7747      <result is ["", -1, -1].
7748      When {expr} is a |List| then the matching item, the index
7749      of first item where {pat} matches, the start position and the
7750      end position of the match are returned. >vim
7751      	echo matchstrpos([1, '__x'], '\a')
7752      <result is ["x", 1, 2, 3].
7753      The type isn't changed, it's not necessarily a String.
7754
7755    ]=],
7756    name = 'matchstrpos',
7757    params = {
7758      { 'expr', 'any' },
7759      { 'pat', 'string' },
7760      { 'start', 'integer' },
7761      { 'count', 'integer' },
7762    },
7763    signature = 'matchstrpos({expr}, {pat} [, {start} [, {count}]])',
7764    returns = 'table',
7765  },
7766  max = {
7767    args = 1,
7768    base = 1,
7769    desc = [=[
7770      Return the maximum value of all items in {expr}.  Example: >vim
7771      	echo max([apples, pears, oranges])
7772
7773      <{expr} can be a |List| or a |Dictionary|.  For a Dictionary,
7774      it returns the maximum of all values in the Dictionary.
7775      If {expr} is neither a List nor a Dictionary, or one of the
7776      items in {expr} cannot be used as a Number this results in
7777      an error.  An empty |List| or |Dictionary| results in zero.
7778
7779    ]=],
7780    name = 'max',
7781    params = { { 'expr', 'any' } },
7782    returns = 'number',
7783    signature = 'max({expr})',
7784    see_lua = {
7785      '|math.max()| with `unpack(expr)` for lists; dict values and empty inputs need custom handling',
7786    },
7787  },
7788  menu_get = {
7789    args = { 1, 2 },
7790    desc = [=[
7791      Returns a |List| of |Dictionaries| describing |menus| (defined
7792      by |:menu|, |:amenu|, …), including |hidden-menus|.
7793
7794      {path} matches a menu by name, or all menus if {path} is an
7795      empty string.  Example: >vim
7796      	echo menu_get('File','')
7797      	echo menu_get('')
7798      <
7799      {modes} is a string of zero or more modes (see |maparg()| or
7800      |creating-menus| for the list of modes). "a" means "all".
7801
7802      Example: >vim
7803      	nnoremenu &Test.Test inormal
7804      	inoremenu Test.Test insert
7805      	vnoremenu Test.Test x
7806      	echo menu_get("")
7807
7808      <returns something like this: >
7809
7810      	[ {
7811      	  "hidden": 0,
7812      	  "name": "Test",
7813      	  "priority": 500,
7814      	  "shortcut": 84,
7815      	  "submenus": [ {
7816      	    "hidden": 0,
7817      	    "mappings": {
7818      	      i": {
7819      		"enabled": 1,
7820      		"noremap": 1,
7821      		"rhs": "insert",
7822      		"sid": 1,
7823      		"silent": 0
7824      	      },
7825      	      n": { ... },
7826      	      s": { ... },
7827      	      v": { ... }
7828      	    },
7829      	    "name": "Test",
7830      	    "priority": 500,
7831      	    "shortcut": 0
7832      	  } ]
7833      	} ]
7834      <
7835    ]=],
7836    name = 'menu_get',
7837    params = { { 'path', 'string' }, { 'modes', 'string' } },
7838    signature = 'menu_get({path} [, {modes}])',
7839  },
7840  menu_info = {
7841    args = { 1, 2 },
7842    base = 1,
7843    desc = [=[
7844      Return information about the specified menu {name} in
7845      mode {mode}.  The menu name should be specified without the
7846      shortcut character ('&').  If {name} is "", then the top-level
7847      menu names are returned.
7848
7849      {mode} can be one of these strings:
7850      	"n"	Normal
7851      	"v"	Visual (including Select)
7852      	"o"	Operator-pending
7853      	"i"	Insert
7854      	"c"	Cmd-line
7855      	"s"	Select
7856      	"x"	Visual
7857      	"t"	Terminal-Job
7858      	""	Normal, Visual and Operator-pending
7859      	"!"	Insert and Cmd-line
7860      When {mode} is omitted, the modes for "" are used.
7861
7862      Returns a |Dictionary| containing the following items:
7863        accel		menu item accelerator text |menu-text|
7864        display	display name (name without '&')
7865        enabled	v:true if this menu item is enabled
7866      		Refer to |:menu-enable|
7867        icon		name of the icon file (for toolbar)
7868      		|toolbar-icon|
7869        iconidx	index of a built-in icon
7870        modes		modes for which the menu is defined.  In
7871      		addition to the modes mentioned above, these
7872      		characters will be used:
7873      		" "	Normal, Visual and Operator-pending
7874        name		menu item name.
7875        noremenu	v:true if the {rhs} of the menu item is not
7876      		remappable else v:false.
7877        priority	menu order priority |menu-priority|
7878        rhs		right-hand-side of the menu item.  The
7879      		returned string has special characters
7880      		translated like in the output of the ":menu"
7881      		command listing.  When the {rhs} of a menu
7882      		item is empty, then "<Nop>" is returned.
7883        script	v:true if script-local remapping of {rhs} is
7884      		allowed else v:false.  See |:menu-script|.
7885        shortcut	shortcut key (character after '&' in
7886      		the menu name) |menu-shortcut|
7887        silent	v:true if the menu item is created
7888      		with <silent> argument |:menu-silent|
7889        submenus	|List| containing the names of
7890      		all the submenus.  Present only if the menu
7891      		item has submenus.
7892
7893      Returns an empty dictionary if the menu item is not found.
7894
7895      Examples: >vim
7896      	echo menu_info('Edit.Cut')
7897      	echo menu_info('File.Save', 'n')
7898
7899      	" Display the entire menu hierarchy in a buffer
7900      	func ShowMenu(name, pfx)
7901      	  let m = menu_info(a:name)
7902      	  call append(line('$'), a:pfx .. m.display)
7903      	  for child in m->get('submenus', [])
7904      	    call ShowMenu(a:name .. '.' .. escape(child, '.'),
7905      					\ a:pfx .. '    ')
7906      	  endfor
7907      	endfunc
7908      	new
7909      	for topmenu in menu_info('').submenus
7910      	  call ShowMenu(topmenu, '')
7911      	endfor
7912      <
7913    ]=],
7914    name = 'menu_info',
7915    params = { { 'name', 'string' }, { 'mode', 'string' } },
7916    signature = 'menu_info({name} [, {mode}])',
7917  },
7918  min = {
7919    args = 1,
7920    base = 1,
7921    desc = [=[
7922      Return the minimum value of all items in {expr}. Example: >vim
7923      	echo min([apples, pears, oranges])
7924
7925      <{expr} can be a |List| or a |Dictionary|.  For a Dictionary,
7926      it returns the minimum of all values in the Dictionary.
7927      If {expr} is neither a List nor a Dictionary, or one of the
7928      items in {expr} cannot be used as a Number this results in
7929      an error.  An empty |List| or |Dictionary| results in zero.
7930
7931    ]=],
7932    name = 'min',
7933    params = { { 'expr', 'any' } },
7934    returns = 'number',
7935    signature = 'min({expr})',
7936    see_lua = {
7937      '|math.min()| with `unpack(expr)` for lists; dict values and empty inputs need custom handling',
7938    },
7939  },
7940  mkdir = {
7941    args = { 1, 3 },
7942    base = 1,
7943    desc = [=[
7944      Create directory {name}.
7945
7946      When {flags} is present it must be a string.  An empty string
7947      has no effect.
7948
7949      {flags} can contain these character flags:
7950       "p"	intermediate directories will be created as necessary
7951       "D"	{name} will be deleted at the end of the current
7952      	function, but not recursively |:defer|
7953       "R"	{name} will be deleted recursively at the end of the
7954      	current function |:defer|
7955
7956      Note that when {name} has more than one part and "p" is used
7957      some directories may already exist.  Only the first one that
7958      is created and what it contains is scheduled to be deleted.
7959      E.g. when using: >vim
7960      	call mkdir('subdir/tmp/autoload', 'pR')
7961      <and "subdir" already exists then "subdir/tmp" will be
7962      scheduled for deletion, like with: >vim
7963      	defer delete('subdir/tmp', 'rf')
7964      <
7965      If {prot} is given it is used to set the protection bits of
7966      the new directory.  The default is 0o755 (rwxr-xr-x: r/w for
7967      the user, readable for others).  Use 0o700 to make it
7968      unreadable for others.  This is used for the newly created
7969      directories.  Note: umask is applied to {prot} (on Unix).
7970      Example: >vim
7971      	call mkdir($HOME .. "/tmp/foo/bar", "p", 0o700)
7972
7973      <This function is not available in the |sandbox|.
7974
7975      If you try to create an existing directory with {flags} set to
7976      "p" mkdir() will silently exit.
7977
7978      The function result is a Number, which is TRUE if the call was
7979      successful or FALSE if the directory creation failed or partly
7980      failed.
7981
7982    ]=],
7983    name = 'mkdir',
7984    params = { { 'name', 'string' }, { 'flags', 'string' }, { 'prot', 'string' } },
7985    returns = 'integer',
7986    signature = 'mkdir({name} [, {flags} [, {prot}]])',
7987    tags = { 'E739' },
7988    see_lua = {
7989      '|vim.fs.mkdir()|; `"D"`, `"R"`, and return semantics differ',
7990    },
7991  },
7992  mode = {
7993    args = { 0, 1 },
7994    base = 1,
7995    desc = [=[
7996      Return a string that indicates the current mode.
7997      If {expr} is supplied and it evaluates to a non-zero Number or
7998      a non-empty String (|non-zero-arg|), then the full mode is
7999      returned, otherwise only the first letter is returned.
8000      Also see |state()|.
8001
8002         n	    Normal
8003         no	    Operator-pending
8004         nov	    Operator-pending (forced charwise |o_v|)
8005         noV	    Operator-pending (forced linewise |o_V|)
8006         noCTRL-V Operator-pending (forced blockwise |o_CTRL-V|)
8007      		CTRL-V is one character
8008         niI	    Normal using |i_CTRL-O| in |Insert-mode|
8009         niR	    Normal using |i_CTRL-O| in |Replace-mode|
8010         niV	    Normal using |i_CTRL-O| in |Virtual-Replace-mode|
8011         nt	    Normal in |terminal-emulator| (insert goes to
8012      		Terminal mode)
8013         ntT	    Normal using |t_CTRL-\_CTRL-O| in |Terminal-mode|
8014         v	    Visual by character
8015         vs	    Visual by character using |v_CTRL-O| in Select mode
8016         V	    Visual by line
8017         Vs	    Visual by line using |v_CTRL-O| in Select mode
8018         CTRL-V   Visual blockwise
8019         CTRL-Vs  Visual blockwise using |v_CTRL-O| in Select mode
8020         s	    Select by character
8021         S	    Select by line
8022         CTRL-S   Select blockwise
8023         i	    Insert
8024         ic	    Insert mode completion |compl-generic|
8025         ix	    Insert mode |i_CTRL-X| completion
8026         R	    Replace |R|
8027         Rc	    Replace mode completion |compl-generic|
8028         Rx	    Replace mode |i_CTRL-X| completion
8029         Rv	    Virtual Replace |gR|
8030         Rvc	    Virtual Replace mode completion |compl-generic|
8031         Rvx	    Virtual Replace mode |i_CTRL-X| completion
8032         c	    Command-line editing
8033         cr	    Command-line editing overstrike mode |c_<Insert>|
8034         cv	    Non-interactive Ex mode |-es|
8035         r	    Hit-enter prompt
8036         rm	    The -- more -- prompt
8037         r?	    A |:confirm| query of some sort
8038         !	    Shell or external command is executing
8039         t	    Terminal mode: keys go to the job
8040
8041      This is useful in the 'statusline' option or RPC calls. In
8042      most other places it always returns "c" or "n".
8043      Note that in the future more modes and more specific modes may
8044      be added.  It's better not to compare the whole string but
8045      only the leading character(s).
8046      Also see |visualmode()|.
8047
8048    ]=],
8049    name = 'mode',
8050    params = { { 'expr', 'any' } },
8051    signature = 'mode([{expr}])',
8052    see_lua = {
8053      '|nvim_get_mode()|; use the `.mode` field. It always returns the full mode string, unlike |mode()| without a non-zero {expr}',
8054    },
8055  },
8056  msgpackdump = {
8057    args = { 1, 2 },
8058    desc = [=[
8059      Convert a list of Vimscript objects to msgpack. Returned value is a
8060      |readfile()|-style list. When {type} contains "B", a |Blob| is
8061      returned instead. Example: >vim
8062      	call writefile(msgpackdump([{}]), 'fname.mpack', 'b')
8063      <or, using a |Blob|: >vim
8064      	call writefile(msgpackdump([{}], 'B'), 'fname.mpack')
8065      <
8066      This will write the single 0x80 byte to a `fname.mpack` file
8067      (dictionary with zero items is represented by 0x80 byte in
8068      messagepack).
8069
8070      Limitations:				*E5004* *E5005*
8071      1. |Funcref|s cannot be dumped.
8072      2. Containers that reference themselves cannot be dumped.
8073      3. Dictionary keys are always dumped as STR strings.
8074      4. Other strings and |Blob|s are always dumped as BIN strings.
8075      5. Points 3. and 4. do not apply to |msgpack-special-dict|s.
8076    ]=],
8077    name = 'msgpackdump',
8078    params = { { 'list', 'any' }, { 'type', 'any' } },
8079    signature = 'msgpackdump({list} [, {type}])',
8080    see_lua = {
8081      '|vim.mpack.encode()|; list wrapping, return shape, and special-dict semantics differ',
8082    },
8083  },
8084  msgpackparse = {
8085    args = 1,
8086    desc = [=[
8087      Convert a |readfile()|-style list or a |Blob| to a list of
8088      Vimscript objects.
8089      Example: >vim
8090      	let fname = expand('~/.config/nvim/shada/main.shada')
8091      	let mpack = readfile(fname, 'b')
8092      	let shada_objects = msgpackparse(mpack)
8093      <This will read ~/.config/nvim/shada/main.shada file to
8094      `shada_objects` list.
8095
8096      Limitations:
8097      1. Mapping ordering is not preserved unless messagepack
8098         mapping is dumped using generic mapping
8099         (|msgpack-special-map|).
8100      2. Since the parser aims to preserve all data untouched
8101         (except for 1.) some strings are parsed to
8102         |msgpack-special-dict| format which is not convenient to
8103         use.
8104      					*msgpack-special-dict*
8105      Some messagepack strings may be parsed to special
8106      dictionaries. Special dictionaries are dictionaries which
8107
8108      1. Contain exactly two keys: `_TYPE` and `_VAL`.
8109      2. `_TYPE` key is one of the types found in |v:msgpack_types|
8110         variable.
8111      3. Value for `_VAL` has the following format (Key column
8112         contains name of the key from |v:msgpack_types|):
8113
8114      Key	Value ~
8115      nil	Zero, ignored when dumping.  Not returned by
8116      	|msgpackparse()| since |v:null| was introduced.
8117      boolean	One or zero.  When dumping it is only checked that
8118      	value is a |Number|.  Not returned by |msgpackparse()|
8119      	since |v:true| and |v:false| were introduced.
8120      integer	|List| with four numbers: sign (-1 or 1), highest two
8121      	bits, number with bits from 62nd to 31st, lowest 31
8122      	bits. I.e. to get actual number one will need to use
8123      	code like >
8124      		_VAL[0] * ((_VAL[1] << 62)
8125      		           & (_VAL[2] << 31)
8126      		           & _VAL[3])
8127      <	Special dictionary with this type will appear in
8128      	|msgpackparse()| output under one of the following
8129      	circumstances:
8130      	1. |Number| is 32-bit and value is either above
8131      	   INT32_MAX or below INT32_MIN.
8132      	2. |Number| is 64-bit and value is above INT64_MAX. It
8133      	   cannot possibly be below INT64_MIN because msgpack
8134      	   C parser does not support such values.
8135      float	|Float|. This value cannot possibly appear in
8136      	|msgpackparse()| output.
8137      string	|String|, or |Blob| if binary string contains zero
8138      	byte. This value cannot appear in |msgpackparse()|
8139      	output since blobs were introduced.
8140      array	|List|. This value cannot appear in |msgpackparse()|
8141      	output.
8142      					*msgpack-special-map*
8143      map	|List| of |List|s with two items (key and value) each.
8144      	This value will appear in |msgpackparse()| output if
8145      	parsed mapping contains one of the following keys:
8146      	1. Any key that is not a string (including keys which
8147      	   are binary strings).
8148      	2. String with NUL byte inside.
8149      	3. Duplicate key.
8150      ext	|List| with two values: first is a signed integer
8151      	representing extension type. Second is
8152      	|readfile()|-style list of strings.
8153    ]=],
8154    name = 'msgpackparse',
8155    params = { { 'data', 'any' } },
8156    signature = 'msgpackparse({data})',
8157    see_lua = { '|vim.mpack.decode()|; input and special-dict semantics differ' },
8158  },
8159  nextnonblank = {
8160    args = 1,
8161    base = 1,
8162    desc = [=[
8163      Return the line number of the first line at or below {lnum}
8164      that is not blank.  Example: >vim
8165      	if getline(nextnonblank(1)) =~ "Java" | endif
8166      <When {lnum} is invalid or there is no non-blank line at or
8167      below it, zero is returned.
8168      {lnum} is used like with |getline()|.
8169      See also |prevnonblank()|.
8170
8171    ]=],
8172    name = 'nextnonblank',
8173    params = { { 'lnum', 'integer|string' } },
8174    returns = 'integer',
8175    signature = 'nextnonblank({lnum})',
8176  },
8177  nr2char = {
8178    args = { 1, 2 },
8179    base = 1,
8180    desc = [=[
8181      Gets a UTF-8 string for a single codepoint {expr}.
8182      Examples: >vim
8183      	echo nr2char(64)		" returns '@'
8184      	echo nr2char(32)		" returns ' '
8185      	echo nr2char(300)		" returns I with bow character
8186      <
8187      UTF-8 encoding is always used, {utf8} option has no effect,
8188      and exists only for backwards-compatibility.
8189      Note that a NUL character in the file is specified with
8190      nr2char(10), because NULs are represented with newline
8191      characters.  nr2char(0) is a real NUL and terminates the
8192      string, thus results in an empty string.
8193
8194    ]=],
8195    fast = true,
8196    name = 'nr2char',
8197    params = { { 'expr', 'integer' }, { 'utf8', 'boolean' } },
8198    returns = 'string',
8199    signature = 'nr2char({expr} [, {utf8}])',
8200    see_lua = { '|string.char()|: only works with ASCII' },
8201  },
8202  nvim_api__ = {
8203    args = 1,
8204    base = 1,
8205    desc = [=[
8206      Call nvim |api| functions. The type checking of arguments will
8207      be stricter than for most other builtins. For instance,
8208      if Integer is expected, a |Number| must be passed in, a
8209      |String| will not be autoconverted.
8210      Buffer numbers, as returned by |bufnr()| could be used as
8211      first argument to nvim_buf_... functions.  All functions
8212      expecting an object (buffer, window or tabpage) can
8213      also take the numerical value 0 to indicate the current
8214      (focused) object.
8215    ]=],
8216    lua = false,
8217    name = 'nvim_...',
8218    params = VARARGS,
8219    signature = 'nvim_...({...})',
8220    tags = { 'E5555', 'eval-api' },
8221    see_lua = { '|vim.api|' },
8222  },
8223  ['or'] = {
8224    args = 2,
8225    base = 1,
8226    desc = [=[
8227      Bitwise OR on the two arguments.  The arguments are converted
8228      to a number.  A List, Dict or Float argument causes an error.
8229      Also see `and()` and `xor()`.
8230      Example: >vim
8231      	let bits = or(bits, 0x80)
8232
8233      <Rationale: The reason this is a function and not using the "|"
8234      character like many languages, is that Vi has always used "|"
8235      to separate commands.  In many places it would not be clear if
8236      "|" is an operator or a command separator.
8237    ]=],
8238    name = 'or',
8239    params = { { 'expr', 'number' }, { 'expr', 'number' } },
8240    signature = 'or({expr}, {expr})',
8241    see_lua = { '|bit.bor()|' },
8242  },
8243  pathshorten = {
8244    args = { 1, 2 },
8245    base = 1,
8246    desc = [=[
8247      Shorten directory names in the path {path} and return the
8248      result.  The tail, the file name, is kept as-is.  The other
8249      components in the path are reduced to {len} letters in length.
8250      If {len} is omitted or smaller than 1 then 1 is used (single
8251      letters).  Leading '~' and '.' characters are kept.  Examples: >vim
8252      	echo pathshorten('~/.config/nvim/autoload/file1.vim')
8253      <	~/.c/n/a/file1.vim ~
8254      >vim
8255      	echo pathshorten('~/.config/nvim/autoload/file2.vim', 2)
8256      <	~/.co/nv/au/file2.vim ~
8257      It doesn't matter if the path exists or not.
8258      Returns an empty string on error.
8259
8260    ]=],
8261    name = 'pathshorten',
8262    params = { { 'path', 'string' }, { 'len', 'integer' } },
8263    returns = 'string',
8264    signature = 'pathshorten({path} [, {len}])',
8265  },
8266  perleval = {
8267    args = 1,
8268    base = 1,
8269    desc = [=[
8270      Evaluate |perl| expression {expr} and return its result
8271      converted to Vim data structures.
8272      Numbers and strings are returned as they are (strings are
8273      copied though).
8274      Lists are represented as Vim |List| type.
8275      Dictionaries are represented as Vim |Dictionary| type,
8276      non-string keys result in error.
8277
8278      Note: If you want an array or hash, {expr} must return a
8279      reference to it.
8280      Example: >vim
8281      	echo perleval('[1 .. 4]')
8282      <	[1, 2, 3, 4]
8283
8284    ]=],
8285    name = 'perleval',
8286    params = { { 'expr', 'any' } },
8287    signature = 'perleval({expr})',
8288  },
8289  pow = {
8290    args = 2,
8291    base = 1,
8292    desc = [=[
8293      Return the power of {x} to the exponent {y} as a |Float|.
8294      {x} and {y} must evaluate to a |Float| or a |Number|.
8295      Returns 0.0 if {x} or {y} is not a |Float| or a |Number|.
8296      Examples: >vim
8297      	echo pow(3, 3)
8298      <	27.0 >vim
8299      	echo pow(2, 16)
8300      <	65536.0 >vim
8301      	echo pow(32, 0.20)
8302      <	2.0
8303
8304    ]=],
8305    name = 'pow',
8306    params = { { 'x', 'number' }, { 'y', 'number' } },
8307    returns = 'number',
8308    signature = 'pow({x}, {y})',
8309    see_lua = { '|math.pow()|' },
8310  },
8311  preinserted = {
8312    desc = [=[
8313      Returns non-zero if text has been inserted after the cursor
8314      because "preinsert" is present in 'completeopt', or because
8315      "longest" is present in 'completeopt' while 'autocomplete'
8316      is active.  Otherwise returns zero.
8317    ]=],
8318    name = 'preinserted',
8319    params = {},
8320    returns = 'number',
8321    signature = 'preinserted()',
8322  },
8323  prevnonblank = {
8324    args = 1,
8325    base = 1,
8326    desc = [=[
8327      Return the line number of the first line at or above {lnum}
8328      that is not blank.  Example: >vim
8329      	let ind = indent(prevnonblank(v:lnum - 1))
8330      <When {lnum} is invalid or there is no non-blank line at or
8331      above it, zero is returned.
8332      {lnum} is used like with |getline()|.
8333      Also see |nextnonblank()|.
8334
8335    ]=],
8336    name = 'prevnonblank',
8337    params = { { 'lnum', 'integer|string' } },
8338    returns = 'integer',
8339    signature = 'prevnonblank({lnum})',
8340  },
8341  printf = {
8342    args = { 1 },
8343    base = 2,
8344    desc = [=[
8345      Return a String with {fmt}, where "%" items are replaced by
8346      the formatted form of their respective arguments.  Example: >vim
8347      	echo printf("%4d: E%d %.30s", lnum, errno, msg)
8348      <May result in:
8349      	"  99: E42 asdfasdfasdfasdfasdfasdfasdfas" ~
8350
8351      When used as a |method| the base is passed as the second
8352      argument: >vim
8353      	Compute()->printf("result: %d")
8354      <
8355      You can use `call()` to pass the items as a list.
8356
8357      Often used items are:
8358        %s	string
8359        %6S	string right-aligned in 6 display cells
8360        %6s	string right-aligned in 6 bytes
8361        %.9s	string truncated to 9 bytes
8362        %c	single byte
8363        %d	decimal number
8364        %5d	decimal number padded with spaces to 5 characters
8365        %b	binary number
8366        %08b	binary number padded with zeros to at least 8 characters
8367        %B	binary number using upper case letters
8368        %x	hex number
8369        %04x	hex number padded with zeros to at least 4 characters
8370        %X	hex number using upper case letters
8371        %o	octal number
8372        %f	floating point number as 12.23, inf, -inf or nan
8373        %F	floating point number as 12.23, INF, -INF or NAN
8374        %e	floating point number as 1.23e3, inf, -inf or nan
8375        %E	floating point number as 1.23E3, INF, -INF or NAN
8376        %g	floating point number, as %f or %e depending on value
8377        %G	floating point number, as %F or %E depending on value
8378        %%	the % character itself
8379        %p	representation of the pointer to the container
8380
8381      Conversion specifications start with '%' and end with the
8382      conversion type.  All other characters are copied unchanged to
8383      the result.
8384
8385      The "%" starts a conversion specification.  The following
8386      arguments appear in sequence:
8387
8388      	% [pos-argument] [flags] [field-width] [.precision] type
8389
8390      pos-argument
8391      	At most one positional argument specifier.  These take
8392      	the form {n$}, where n is >= 1.
8393
8394      flags
8395      	Zero or more of the following flags:
8396
8397          #	      The value should be converted to an "alternate
8398      	      form".  For c, d, and s conversions, this option
8399      	      has no effect.  For o conversions, the precision
8400      	      of the number is increased to force the first
8401      	      character of the output string to a zero (except
8402      	      if a zero value is printed with an explicit
8403      	      precision of zero).
8404      	      For x and X conversions, a non-zero result has
8405      	      the string "0x" (or "0X" for X conversions)
8406      	      prepended to it.
8407
8408          0 (zero)  Zero padding.  For all conversions the converted
8409      	      value is padded on the left with zeros rather
8410      	      than blanks.  If a precision is given with a
8411      	      numeric conversion (d, o, x, and X), the 0 flag
8412      	      is ignored.
8413
8414          -	      A negative field width flag; the converted value
8415      	      is to be left adjusted on the field boundary.
8416      	      The converted value is padded on the right with
8417      	      blanks, rather than on the left with blanks or
8418      	      zeros.  A - overrides a 0 if both are given.
8419
8420          ' ' (space)  A blank should be left before a positive
8421      	      number produced by a signed conversion (d).
8422
8423          +	      A sign must always be placed before a number
8424      	      produced by a signed conversion.  A + overrides
8425      	      a space if both are used.
8426
8427      field-width
8428      	An optional decimal digit string specifying a minimum
8429      	field width.  If the converted value has fewer bytes
8430      	than the field width, it will be padded with spaces on
8431      	the left (or right, if the left-adjustment flag has
8432      	been given) to fill out the field width.  For the S
8433      	conversion the count is in cells.
8434
8435      .precision
8436      	An optional precision, in the form of a period '.'
8437      	followed by an optional digit string.  If the digit
8438      	string is omitted, the precision is taken as zero.
8439      	This gives the minimum number of digits to appear for
8440      	d, o, x, and X conversions, the maximum number of
8441      	bytes to be printed from a string for s conversions,
8442      	or the maximum number of cells to be printed from a
8443      	string for S conversions.
8444      	For floating point it is the number of digits after
8445      	the decimal point.
8446
8447      type
8448      	A character that specifies the type of conversion to
8449      	be applied, see below.
8450
8451      A field width or precision, or both, may be indicated by an
8452      asterisk "*" instead of a digit string.  In this case, a
8453      Number argument supplies the field width or precision.  A
8454      negative field width is treated as a left adjustment flag
8455      followed by a positive field width; a negative precision is
8456      treated as though it were missing.  Example: >vim
8457      	echo printf("%d: %.*s", nr, width, line)
8458      <This limits the length of the text used from "line" to
8459      "width" bytes.
8460
8461      If the argument to be formatted is specified using a
8462      positional argument specifier, and a '*' is used to indicate
8463      that a number argument is to be used to specify the width or
8464      precision, the argument(s) to be used must also be specified
8465      using a {n$} positional argument specifier.  See |printf-$|.
8466
8467      The conversion specifiers and their meanings are:
8468
8469      		*printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X*
8470      dbBoxX	The Number argument is converted to signed decimal (d),
8471      	unsigned binary (b and B), unsigned octal (o), or
8472      	unsigned hexadecimal (x and X) notation.  The letters
8473      	"abcdef" are used for x conversions; the letters
8474      	"ABCDEF" are used for X conversions.  The precision, if
8475      	any, gives the minimum number of digits that must
8476      	appear; if the converted value requires fewer digits, it
8477      	is padded on the left with zeros.  In no case does a
8478      	non-existent or small field width cause truncation of a
8479      	numeric field; if the result of a conversion is wider
8480      	than the field width, the field is expanded to contain
8481      	the conversion result.
8482      	The 'h' modifier indicates the argument is 16 bits.
8483      	The 'l' modifier indicates the argument is a long
8484      	integer.  The size will be 32 bits or 64 bits
8485      	depending on your platform.
8486      	The "ll" modifier indicates the argument is 64 bits.
8487      	The b and B conversion specifiers never take a width
8488      	modifier and always assume their argument is a 64 bit
8489      	integer.
8490      	Generally, these modifiers are not useful.  They are
8491      	ignored when type is known from the argument.
8492
8493      i	alias for d
8494      D	alias for ld
8495      U	alias for lu
8496      O	alias for lo
8497
8498      					*printf-c*
8499      c	The Number argument is converted to a byte, and the
8500      	resulting character is written.
8501
8502      					*printf-s*
8503      s	The text of the String argument is used.  If a
8504      	precision is specified, no more bytes than the number
8505      	specified are used.
8506      	If the argument is not a String type, it is
8507      	automatically converted to text with the same format
8508      	as ":echo".
8509      					*printf-S*
8510      S	The text of the String argument is used.  If a
8511      	precision is specified, no more display cells than the
8512      	number specified are used.
8513
8514      					*printf-f* *E807*
8515      f F	The Float argument is converted into a string of the
8516      	form 123.456.  The precision specifies the number of
8517      	digits after the decimal point.  When the precision is
8518      	zero the decimal point is omitted.  When the precision
8519      	is not specified 6 is used.  A really big number
8520      	(out of range or dividing by zero) results in "inf"
8521      	 or "-inf" with %f (INF or -INF with %F).
8522      	 "0.0 / 0.0" results in "nan" with %f (NAN with %F).
8523      	Example: >vim
8524      		echo printf("%.2f", 12.115)
8525      <		12.12
8526      	Note that roundoff depends on the system libraries.
8527      	Use |round()| when in doubt.
8528
8529      					*printf-e* *printf-E*
8530      e E	The Float argument is converted into a string of the
8531      	form 1.234e+03 or 1.234E+03 when using 'E'.  The
8532      	precision specifies the number of digits after the
8533      	decimal point, like with 'f'.
8534
8535      					*printf-g* *printf-G*
8536      g G	The Float argument is converted like with 'f' if the
8537      	value is between 0.001 (inclusive) and 10000000.0
8538      	(exclusive).  Otherwise 'e' is used for 'g' and 'E'
8539      	for 'G'.  When no precision is specified superfluous
8540      	zeroes and '+' signs are removed, except for the zero
8541      	immediately after the decimal point.  Thus 10000000.0
8542      	results in 1.0e7.
8543
8544      					*printf-%*
8545      %	A '%' is written.  No argument is converted.  The
8546      	complete conversion specification is "%%".
8547
8548      When a Number argument is expected a String argument is also
8549      accepted and automatically converted.
8550      When a Float or String argument is expected a Number argument
8551      is also accepted and automatically converted.
8552      Any other argument type results in an error message.
8553
8554      					*E766* *E767*
8555      The number of {exprN} arguments must exactly match the number
8556      of "%" items.  If there are not sufficient or too many
8557      arguments an error is given.  Up to 18 arguments can be used.
8558
8559      					*printf-$*
8560      In certain languages, error and informative messages are
8561      more readable when the order of words is different from the
8562      corresponding message in English.  To accommodate translations
8563      having a different word order, positional arguments may be
8564      used to indicate this.  For instance: >vim
8565
8566          #, c-format
8567          msgid "%s returning %s"
8568          msgstr "waarde %2$s komt terug van %1$s"
8569      <
8570      In this example, the sentence has its 2 string arguments
8571      reversed in the output. >vim
8572
8573          echo printf(
8574      	"In The Netherlands, vim's creator's name is: %1$s %2$s",
8575      	"Bram", "Moolenaar")
8576      <    In The Netherlands, vim's creator's name is: Bram Moolenaar >vim
8577
8578          echo printf(
8579      	"In Belgium, vim's creator's name is: %2$s %1$s",
8580      	"Bram", "Moolenaar")
8581      <    In Belgium, vim's creator's name is: Moolenaar Bram
8582
8583      Width (and precision) can be specified using the '*'
8584      specifier.  In this case, you must specify the field width
8585      position in the argument list. >vim
8586
8587          echo printf("%1$*2$.*3$d", 1, 2, 3)
8588      <    001 >vim
8589          echo printf("%2$*3$.*1$d", 1, 2, 3)
8590      <      2 >vim
8591          echo printf("%3$*1$.*2$d", 1, 2, 3)
8592      <    03 >vim
8593          echo printf("%1$*2$.*3$g", 1.4142, 2, 3)
8594      <    1.414
8595
8596      You can mix specifying the width and/or precision directly
8597      and via positional arguments: >vim
8598
8599          echo printf("%1$4.*2$f", 1.4142135, 6)
8600      <    1.414214 >vim
8601          echo printf("%1$*2$.4f", 1.4142135, 6)
8602      <    1.4142 >vim
8603          echo printf("%1$*2$.*3$f", 1.4142135, 6, 2)
8604      <      1.41
8605
8606      You will get an overflow error |E1510|, when the field-width
8607      or precision will result in a string longer than 1 MiB
8608      (1024*1024 = 1048576) chars.
8609
8610      					*E1500*
8611      You cannot mix positional and non-positional arguments: >vim
8612          echo printf("%s%1$s", "One", "Two")
8613          " E1500: Cannot mix positional and non-positional arguments:
8614          " %s%1$s
8615      <
8616      					*E1501*
8617      You cannot skip a positional argument in a format string: >vim
8618          echo printf("%3$s%1$s", "One", "Two", "Three")
8619          " E1501: format argument 2 unused in $-style format:
8620          " %3$s%1$s
8621      <
8622      					*E1502*
8623      You can re-use a [field-width] (or [precision]) argument: >vim
8624          echo printf("%1$d at width %2$d is: %1$0*2$d", 1, 2)
8625          " 1 at width 2 is: 01
8626      <
8627      However, you can't use it as a different type: >vim
8628          echo printf("%1$d at width %2$ld is: %1$0*2$d", 1, 2)
8629          " E1502: Positional argument 2 used as field width reused as
8630          " different type: long int/int
8631      <
8632      					*E1503*
8633      When a positional argument is used, but not the correct number
8634      or arguments is given, an error is raised: >vim
8635          echo printf("%1$d at width %2$d is: %1$0*2$.*3$d", 1, 2)
8636          " E1503: Positional argument 3 out of bounds: %1$d at width
8637          " %2$d is: %1$0*2$.*3$d
8638      <
8639      Only the first error is reported: >vim
8640          echo printf("%1$0*2$.*3$d %4$d", 1, 2)
8641          " E1503: Positional argument 3 out of bounds: %1$0*2$.*3$d
8642          " %4$d
8643      <
8644      					*E1504*
8645      A positional argument can be used more than once: >vim
8646          echo printf("%1$s %2$s %1$s", "One", "Two")
8647          " One Two One
8648      <
8649      However, you can't use a different type the second time: >vim
8650          echo printf("%1$s %2$s %1$d", "One", "Two")
8651          " E1504: Positional argument 1 type used inconsistently:
8652          " int/string
8653      <
8654      					*E1505*
8655      Various other errors that lead to a format string being
8656      wrongly formatted lead to: >vim
8657          echo printf("%1$d at width %2$d is: %01$*2$.3$d", 1, 2)
8658          " E1505: Invalid format specifier: %1$d at width %2$d is:
8659          " %01$*2$.3$d
8660      <
8661      					*E1507*
8662      This internal error indicates that the logic to parse a
8663      positional format argument ran into a problem that couldn't be
8664      otherwise reported.  Please file a bug against Vim if you run
8665      into this, copying the exact format string and parameters that
8666      were used.
8667
8668    ]=],
8669    name = 'printf',
8670    params = { { 'fmt', 'string' }, { 'expr1', 'any' } },
8671    signature = 'printf({fmt}, {expr1} ...)',
8672    returns = 'string',
8673    see_lua = { '|string.format()|' },
8674  },
8675  prompt_appendbuf = {
8676    args = 2,
8677    base = 2,
8678    desc = [=[
8679      Appends text to prompt buffer before current prompt. When {text} is
8680      a |List|: Append each item of the |List| as a text line above
8681      prompt-line in the buffer. Any type of item is accepted and converted
8682      to a String. Returns 1 for failure ({buf} not a prmopt buffer),
8683      0 for success.  When {text} is an empty list zero is returned.
8684
8685      Example: >vim
8686        func TextEntered(text)
8687          call prompt_appendbuf(bufnr(''), split('Entered: "' . a:text . '"', '\n'))
8688        endfunc
8689
8690        set buftype=prompt
8691        call prompt_setcallback(bufnr(''), function("TextEntered"))
8692        eval bufnr("")->prompt_setprompt("cmd: ")
8693        startinsert
8694      <
8695    ]=],
8696    name = 'prompt_appendbuf',
8697    params = { { 'buf', 'integer|string' }, { 'text', 'string|string[]' } },
8698    returns = '0|1',
8699    signature = 'prompt_appendbuf({buf}, {text})',
8700  },
8701  prompt_getinput = {
8702    args = 1,
8703    base = 1,
8704    desc = [=[
8705      Gets the current user-input in |prompt-buffer| {buf} without invoking
8706      prompt_callback. {buf} can be a buffer name or number.
8707
8708      If the buffer doesn't exist or isn't a prompt buffer, an empty
8709      string is returned.
8710
8711    ]=],
8712    name = 'prompt_getinput',
8713    params = { { 'buf', 'integer|string' } },
8714    signature = 'prompt_getinput({buf})',
8715  },
8716  prompt_getprompt = {
8717    args = 1,
8718    base = 1,
8719    desc = [=[
8720      Returns the effective prompt text for buffer {buf}.  {buf} can
8721      be a buffer name or number.  See |prompt-buffer|.
8722
8723      If the buffer doesn't exist or isn't a prompt buffer, an empty
8724      string is returned.
8725
8726    ]=],
8727    name = 'prompt_getprompt',
8728    params = { { 'buf', 'integer|string' } },
8729    signature = 'prompt_getprompt({buf})',
8730  },
8731  prompt_setcallback = {
8732    args = { 2, 2 },
8733    base = 1,
8734    desc = [=[
8735      Set prompt callback for buffer {buf} to {expr}.  When {expr}
8736      is an empty string the callback is removed.  This has only
8737      effect if {buf} has 'buftype' set to "prompt".
8738
8739      The callback is invoked when pressing Enter.  The current
8740      buffer will always be the prompt buffer.  A new line for a
8741      prompt is added before invoking the callback, thus the prompt
8742      for which the callback was invoked will be in the last but one
8743      line.
8744      If the callback wants to add text to the buffer, it must
8745      insert it above the last line, since that is where the current
8746      prompt is.  This can also be done asynchronously.
8747      The callback is invoked with one argument, which is the text
8748      that was entered at the prompt.  This can be an empty string
8749      if the user only typed Enter.
8750      Example: >vim
8751         func s:TextEntered(text)
8752           if a:text == 'exit' || a:text == 'quit'
8753             stopinsert
8754             " Reset 'modified' to allow the buffer to be closed.
8755             " We assume there is nothing useful to be saved.
8756             set nomodified
8757             close
8758           else
8759             " Do something useful with "a:text".  In this example
8760             " we just repeat it.
8761             call append(line('$') - 1, 'Entered: "' .. a:text .. '"')
8762           endif
8763         endfunc
8764         call prompt_setcallback(bufnr(), function('s:TextEntered'))
8765      <
8766    ]=],
8767    name = 'prompt_setcallback',
8768    params = { { 'buf', 'integer|string' }, { 'expr', 'string|function' } },
8769    signature = 'prompt_setcallback({buf}, {expr})',
8770  },
8771  prompt_setinterrupt = {
8772    args = { 2, 2 },
8773    base = 1,
8774    desc = [=[
8775      Set a callback for buffer {buf} to {expr}.  When {expr} is an
8776      empty string the callback is removed.  This has only effect if
8777      {buf} has 'buftype' set to "prompt".
8778
8779      This callback will be invoked when pressing CTRL-C in Insert
8780      mode.  Without setting a callback Vim will exit Insert mode,
8781      as in any buffer.
8782
8783    ]=],
8784    name = 'prompt_setinterrupt',
8785    params = { { 'buf', 'integer|string' }, { 'expr', 'string|function' } },
8786    signature = 'prompt_setinterrupt({buf}, {expr})',
8787  },
8788  prompt_setprompt = {
8789    args = { 2, 2 },
8790    base = 1,
8791    desc = [=[
8792      Set prompt for buffer {buf} to {text}.  You most likely want
8793      {text} to end in a space.
8794      The result is only visible if {buf} has 'buftype' set to
8795      "prompt".  Example: >vim
8796      	call prompt_setprompt(bufnr(''), 'command: ')
8797      <
8798    ]=],
8799    name = 'prompt_setprompt',
8800    params = { { 'buf', 'integer|string' }, { 'text', 'string' } },
8801    signature = 'prompt_setprompt({buf}, {text})',
8802  },
8803  pum_getpos = {
8804    desc = [=[
8805      If the popup menu (see |ins-completion-menu|) is not visible,
8806      returns an empty |Dictionary|, otherwise, returns a
8807      |Dictionary| with the following keys:
8808      	height		nr of items visible
8809      	width		screen cells
8810      	row		top screen row (0 first row)
8811      	col		leftmost screen column (0 first col)
8812      	size		total nr of items
8813      	scrollbar	|TRUE| if scrollbar is visible
8814
8815      The values are the same as in |v:event| during |CompleteChanged|.
8816    ]=],
8817    name = 'pum_getpos',
8818    params = {},
8819    signature = 'pum_getpos()',
8820  },
8821  pumvisible = {
8822    desc = [=[
8823      Returns non-zero when the popup menu is visible, zero
8824      otherwise.  See |ins-completion-menu|.
8825      This can be used to avoid some things that would remove the
8826      popup menu.
8827    ]=],
8828    name = 'pumvisible',
8829    params = {},
8830    signature = 'pumvisible()',
8831  },
8832  py3eval = {
8833    args = 1,
8834    base = 1,
8835    desc = [=[
8836      Evaluate Python expression {expr} and return its result
8837      converted to Vim data structures.
8838      Numbers and strings are returned as they are (strings are
8839      copied though, Unicode strings are additionally converted to
8840      UTF-8).
8841      Lists are represented as Vim |List| type.
8842      Dictionaries are represented as Vim |Dictionary| type with
8843      keys converted to strings.
8844
8845    ]=],
8846    name = 'py3eval',
8847    params = { { 'expr', 'any' } },
8848    signature = 'py3eval({expr})',
8849  },
8850  pyeval = {
8851    args = 1,
8852    base = 1,
8853    desc = [=[
8854      Evaluate Python expression {expr} and return its result
8855      converted to Vim data structures.
8856      Numbers and strings are returned as they are (strings are
8857      copied though).
8858      Lists are represented as Vim |List| type.
8859      Dictionaries are represented as Vim |Dictionary| type,
8860      non-string keys result in error.
8861
8862    ]=],
8863    func = 'f_py3eval',
8864    name = 'pyeval',
8865    params = { { 'expr', 'any' } },
8866    signature = 'pyeval({expr})',
8867    tags = { 'E858', 'E859' },
8868  },
8869  pyxeval = {
8870    args = 1,
8871    base = 1,
8872    desc = [=[
8873      Evaluate Python expression {expr} and return its result
8874      converted to Vim data structures.
8875      Uses Python 2 or 3, see |python_x| and 'pyxversion'.
8876      See also: |pyeval()|, |py3eval()|
8877
8878    ]=],
8879    func = 'f_py3eval',
8880    name = 'pyxeval',
8881    params = { { 'expr', 'any' } },
8882    signature = 'pyxeval({expr})',
8883  },
8884  rand = {
8885    args = { 0, 1 },
8886    base = 1,
8887    desc = [=[
8888      Return a pseudo-random Number generated with an xoshiro128**
8889      algorithm using seed {expr}.  The returned number is 32 bits,
8890      also on 64 bits systems, for consistency.
8891      {expr} can be initialized by |srand()| and will be updated by
8892      rand().  If {expr} is omitted, an internal seed value is used
8893      and updated.
8894      Returns -1 if {expr} is invalid.
8895
8896      Examples: >vim
8897      	echo rand()
8898      	let seed = srand()
8899      	echo rand(seed)
8900      	echo rand(seed) % 16  " random number 0 - 15
8901      <
8902    ]=],
8903    name = 'rand',
8904    params = { { 'expr', 'number' } },
8905    signature = 'rand([{expr}])',
8906    see_lua = { '|math.random()|' },
8907  },
8908  range = {
8909    args = { 1, 3 },
8910    base = 1,
8911    desc = [=[
8912      Returns a |List| with Numbers:
8913      - If only {expr} is specified: [0, 1, ..., {expr} - 1]
8914      - If {max} is specified: [{expr}, {expr} + 1, ..., {max}]
8915      - If {stride} is specified: [{expr}, {expr} + {stride}, ...,
8916        {max}] (increasing {expr} with {stride} each time, not
8917        producing a value past {max}).
8918      When the maximum is one before the start the result is an
8919      empty list.  When the maximum is more than one before the
8920      start this is an error.
8921      Examples: >vim
8922      	echo range(4)		" [0, 1, 2, 3]
8923      	echo range(2, 4)	" [2, 3, 4]
8924      	echo range(2, 9, 3)	" [2, 5, 8]
8925      	echo range(2, -2, -1)	" [2, 1, 0, -1, -2]
8926      	echo range(0)		" []
8927      	echo range(2, 0)	" error!
8928      <
8929    ]=],
8930    name = 'range',
8931    params = { { 'expr', 'any' }, { 'max', 'integer' }, { 'stride', 'integer' } },
8932    signature = 'range({expr} [, {max} [, {stride}]])',
8933    tags = { 'E726', 'E727' },
8934  },
8935  readblob = {
8936    args = { 1, 3 },
8937    base = 1,
8938    desc = [=[
8939      Read file {fname} in binary mode and return a |Blob|.
8940      If {offset} is specified, read the file from the specified
8941      offset.  If it is a negative value, it is used as an offset
8942      from the end of the file.  E.g., to read the last 12 bytes: >vim
8943      	echo readblob('file.bin', -12)
8944      <If {size} is specified, only the specified size will be read.
8945      E.g. to read the first 100 bytes of a file: >vim
8946      	echo readblob('file.bin', 0, 100)
8947      <If {size} is -1 or omitted, the whole data starting from
8948      {offset} will be read.
8949      This can be also used to read the data from a character device
8950      on Unix when {size} is explicitly set.  Only if the device
8951      supports seeking {offset} can be used.  Otherwise it should be
8952      zero.  E.g. to read 10 bytes from a serial console: >vim
8953      	echo readblob('/dev/ttyS0', 0, 10)
8954      <When the file can't be opened an error message is given and
8955      the result is an empty |Blob|.
8956      When the offset is beyond the end of the file the result is an
8957      empty blob.
8958      When trying to read more bytes than are available the result
8959      is truncated.
8960      Also see |readfile()| and |writefile()|.
8961    ]=],
8962    name = 'readblob',
8963    params = { { 'fname', 'string' }, { 'offset', 'integer' }, { 'size', 'integer' } },
8964    signature = 'readblob({fname} [, {offset} [, {size}]])',
8965    see_lua = {
8966      '|io.open()| with `:read("*a")` in binary mode for whole-file reads; offset, size, and Blob return differ',
8967    },
8968  },
8969  readdir = {
8970    args = { 1, 2 },
8971    base = 1,
8972    desc = [=[
8973      Return a list with file and directory names in {directory}.
8974      You can also use |glob()| if you don't need to do complicated
8975      things, such as limiting the number of matches.
8976
8977      When {expr} is omitted all entries are included.
8978      When {expr} is given, it is evaluated to check what to do:
8979      	If {expr} results in -1 then no further entries will
8980      	be handled.
8981      	If {expr} results in 0 then this entry will not be
8982      	added to the list.
8983      	If {expr} results in 1 then this entry will be added
8984      	to the list.
8985      Each time {expr} is evaluated |v:val| is set to the entry name.
8986      When {expr} is a function the name is passed as the argument.
8987      For example, to get a list of files ending in ".txt": >vim
8988        echo readdir(dirname, {n -> n =~ '\.txt$'})
8989      <To skip hidden and backup files: >vim
8990        echo readdir(dirname, {n -> n !~ '^\.\|\~$'})
8991
8992      <If you want to get a directory tree: >vim
8993        function! s:tree(dir)
8994            return {a:dir : map(readdir(a:dir),
8995            \ {_, x -> isdirectory(x) ?
8996            \          {x : s:tree(a:dir .. '/' .. x)} : x})}
8997        endfunction
8998        echo s:tree(".")
8999      <
9000      Returns an empty List on error.
9001
9002    ]=],
9003    name = 'readdir',
9004    params = { { 'directory', 'string' }, { 'expr', 'integer|string|fun(name: string): integer' } },
9005    signature = 'readdir({directory} [, {expr}])',
9006    see_lua = { '|vim.fs.dir()| as an iterator, then collect and filter results as needed' },
9007  },
9008  readfile = {
9009    args = { 1, 3 },
9010    base = 1,
9011    desc = [=[
9012      Read file {fname} and return a |List|, each line of the file
9013      as an item.  Lines are broken at NL characters.  Macintosh
9014      files separated with CR will result in a single long line
9015      (unless a NL appears somewhere).
9016      All NUL characters are replaced with a NL character.
9017      When {type} contains "b" binary mode is used:
9018      - When the last line ends in a NL an extra empty list item is
9019        added.
9020      - No CR characters are removed.
9021      Otherwise:
9022      - CR characters that appear before a NL are removed.
9023      - Whether the last line ends in a NL or not does not matter.
9024      - Any UTF-8 byte order mark is removed from the text.
9025      When {max} is given this specifies the maximum number of lines
9026      to be read.  Useful if you only want to check the first ten
9027      lines of a file: >vim
9028      	for line in readfile(fname, '', 10)
9029      	  if line =~ 'Date' | echo line | endif
9030      	endfor
9031      <When {max} is negative -{max} lines from the end of the file
9032      are returned, or as many as there are.
9033      When {max} is zero the result is an empty list.
9034      Note that without {max} the whole file is read into memory.
9035      Also note that there is no recognition of encoding.  Read a
9036      file into a buffer if you need to.
9037      Deprecated (use |readblob()| instead): When {type} contains
9038      "B" a |Blob| is returned with the binary data of the file
9039      unmodified.
9040      When the file can't be opened an error message is given and
9041      the result is an empty list.
9042      Also see |writefile()|.
9043
9044    ]=],
9045    name = 'readfile',
9046    params = { { 'fname', 'string' }, { 'type', 'string' }, { 'max', 'integer' } },
9047    returns = 'string[]',
9048    signature = 'readfile({fname} [, {type} [, {max}]])',
9049    see_lua = {
9050      '|io.open()| with `:read("*a")`, then split lines as needed; `{type}`, `{max}`, and Blob return differ',
9051    },
9052  },
9053  reduce = {
9054    args = { 2, 3 },
9055    base = 1,
9056    tags = { 'E998' },
9057    desc = [=[
9058      {func} is called for every item in {object}, which can be a
9059      |String|, |List| or a |Blob|.  {func} is called with two
9060      arguments: the result so far and current item.  After
9061      processing all items the result is returned. *E1132*
9062
9063      {initial} is the initial result.  When omitted, the first item
9064      in {object} is used and {func} is first called for the second
9065      item.  If {initial} is not given and {object} is empty no
9066      result can be computed, an E998 error is given.
9067
9068      Examples: >vim
9069      	echo reduce([1, 3, 5], { acc, val -> acc + val })
9070      	echo reduce(['x', 'y'], { acc, val -> acc .. val }, 'a')
9071      	echo reduce(0z1122, { acc, val -> 2 * acc + val })
9072      	echo reduce('xyz', { acc, val -> acc .. ',' .. val })
9073      <
9074    ]=],
9075    name = 'reduce',
9076    generics = { 'T' },
9077    params = {
9078      { 'object', 'any' },
9079      { 'func', 'fun(accumulator: T, current: any): any' },
9080      { 'initial', 'any' },
9081    },
9082    returns = 'T',
9083    signature = 'reduce({object}, {func} [, {initial}])',
9084    see_lua = { '|Iter:fold()|' },
9085  },
9086  reg_executing = {
9087    desc = [=[
9088      Returns the single letter name of the register being executed.
9089      Returns an empty string when no register is being executed.
9090      See |@|.
9091    ]=],
9092    name = 'reg_executing',
9093    params = {},
9094    signature = 'reg_executing()',
9095  },
9096  reg_recorded = {
9097    desc = [=[
9098      Returns the single letter name of the last recorded register.
9099      Returns an empty string when nothing was recorded yet.
9100      See |q| and |Q|.
9101    ]=],
9102    name = 'reg_recorded',
9103    params = {},
9104    signature = 'reg_recorded()',
9105  },
9106  reg_recording = {
9107    desc = [=[
9108      Returns the single letter name of the register being recorded.
9109      Returns an empty string when not recording.  See |q|.
9110    ]=],
9111    name = 'reg_recording',
9112    params = {},
9113    signature = 'reg_recording()',
9114  },
9115  reltime = {
9116    args = { 0, 2 },
9117    base = 1,
9118    fast = true,
9119    name = 'reltime',
9120    params = {},
9121    signature = 'reltime()',
9122  },
9123  reltime__1 = {
9124    args = { 0, 2 },
9125    base = 1,
9126    fast = true,
9127    name = 'reltime',
9128    params = { { 'start', 'any' } },
9129    signature = 'reltime({start})',
9130  },
9131  reltime__2 = {
9132    args = { 0, 2 },
9133    base = 1,
9134    desc = [=[
9135      Return an item that represents a time value.  The item is a
9136      list with items that depend on the system.
9137      The item can be passed to |reltimestr()| to convert it to a
9138      string or |reltimefloat()| to convert to a Float.
9139
9140      Without an argument it returns the current "relative time", an
9141      implementation-defined value meaningful only when used as an
9142      argument to |reltime()|, |reltimestr()| and |reltimefloat()|.
9143
9144      With one argument it returns the time passed since the time
9145      specified in the argument.
9146      With two arguments it returns the time passed between {start}
9147      and {end}.
9148
9149      The {start} and {end} arguments must be values returned by
9150      reltime().  Returns zero on error.
9151
9152      Note: |localtime()| returns the current (non-relative) time.
9153    ]=],
9154    fast = true,
9155    name = 'reltime',
9156    params = { { 'start', 'any' }, { 'end', 'any' } },
9157    signature = 'reltime({start}, {end})',
9158    see_lua = { '|uv.hrtime()|' },
9159  },
9160  reltimefloat = {
9161    args = 1,
9162    base = 1,
9163    desc = [=[
9164      Return a Float that represents the time value of {time}.
9165      Unit of time is seconds.
9166      Example:
9167      	let start = reltime()
9168      	call MyFunction()
9169      	let seconds = reltimefloat(reltime(start))
9170      See the note of |reltimestr()| about overhead.
9171      Also see |profiling|.
9172      If there is an error an empty string is returned
9173
9174    ]=],
9175    fast = true,
9176    name = 'reltimefloat',
9177    params = { { 'time', 'any' } },
9178    signature = 'reltimefloat({time})',
9179    see_lua = { '|uv.hrtime()| with `(finish - start) / 1e9` for elapsed seconds' },
9180  },
9181  reltimestr = {
9182    args = 1,
9183    base = 1,
9184    desc = [=[
9185      Return a String that represents the time value of {time}.
9186      This is the number of seconds, a dot and the number of
9187      microseconds.  Example: >vim
9188      	let start = reltime()
9189      	call MyFunction()
9190      	echo reltimestr(reltime(start))
9191      <Note that overhead for the commands will be added to the time.
9192      Leading spaces are used to make the string align nicely.  You
9193      can use |split()| to remove it. >vim
9194      	echo split(reltimestr(reltime(start)))[0]
9195      <Also see |profiling|.
9196      If there is an error an empty string is returned
9197
9198    ]=],
9199    fast = true,
9200    name = 'reltimestr',
9201    params = { { 'time', 'any' } },
9202    signature = 'reltimestr({time})',
9203  },
9204  remove = {
9205    args = { 2, 3 },
9206    base = 1,
9207    name = 'remove',
9208    params = { { 'list', 'any' }, { 'idx', 'integer' } },
9209    signature = 'remove({list}, {idx})',
9210    see_lua = { '|table.remove()|' },
9211  },
9212  remove__1 = {
9213    args = { 2, 3 },
9214    base = 1,
9215    desc = [=[
9216      Without {end}: Remove the item at {idx} from |List| {list} and
9217      return the item.
9218      With {end}: Remove items from {idx} to {end} (inclusive) and
9219      return a |List| with these items.  When {idx} points to the same
9220      item as {end} a list with one item is returned.  When {end}
9221      points to an item before {idx} this is an error.
9222      See |list-index| for possible values of {idx} and {end}.
9223      Returns zero on error.
9224      Example: >vim
9225      	echo "last item: " .. remove(mylist, -1)
9226      	call remove(mylist, 0, 9)
9227      <
9228      Use |delete()| to remove a file.
9229
9230    ]=],
9231    name = 'remove',
9232    params = { { 'list', 'any[]' }, { 'idx', 'integer' }, { 'end', 'integer' } },
9233    signature = 'remove({list}, {idx}, {end})',
9234  },
9235  remove__2 = {
9236    args = { 2, 3 },
9237    base = 1,
9238    name = 'remove',
9239    params = { { 'blob', 'any' }, { 'idx', 'integer' } },
9240    signature = 'remove({blob}, {idx})',
9241  },
9242  remove__3 = {
9243    args = { 2, 3 },
9244    base = 1,
9245    desc = [=[
9246      Without {end}: Remove the byte at {idx} from |Blob| {blob} and
9247      return the byte.
9248      With {end}: Remove bytes from {idx} to {end} (inclusive) and
9249      return a |Blob| with these bytes.  When {idx} points to the same
9250      byte as {end} a |Blob| with one byte is returned.  When {end}
9251      points to a byte before {idx} this is an error.
9252      Returns zero on error.
9253      Example: >vim
9254      	echo "last byte: " .. remove(myblob, -1)
9255      	call remove(mylist, 0, 9)
9256      <
9257    ]=],
9258    name = 'remove',
9259    params = { { 'blob', 'any' }, { 'idx', 'integer' }, { 'end', 'integer' } },
9260    signature = 'remove({blob}, {idx}, {end})',
9261  },
9262  remove__4 = {
9263    args = { 2, 3 },
9264    base = 1,
9265    desc = [=[
9266      Remove the entry from {dict} with key {key} and return it.
9267      Example: >vim
9268      	echo "removed " .. remove(dict, "one")
9269      <If there is no {key} in {dict} this is an error.
9270      Returns zero on error.
9271    ]=],
9272    name = 'remove',
9273    params = { { 'dict', 'any' }, { 'key', 'string' } },
9274    signature = 'remove({dict}, {key})',
9275    see_lua = {
9276      '`local value = dict[key]; dict[key] = nil` for dicts; missing-key behavior differs',
9277    },
9278  },
9279  rename = {
9280    args = 2,
9281    base = 1,
9282    desc = [=[
9283      Rename the file by the name {from} to the name {to}.  This
9284      should also work to move files across file systems.  The
9285      result is a Number, which is 0 if the file was renamed
9286      successfully, and non-zero when the renaming failed.
9287      NOTE: If {to} exists it is overwritten without warning.
9288      This function is not available in the |sandbox|.
9289
9290    ]=],
9291    name = 'rename',
9292    params = { { 'from', 'string' }, { 'to', 'string' } },
9293    returns = 'integer',
9294    signature = 'rename({from}, {to})',
9295    see_lua = { '|uv.fs_rename()|', '|os.rename()|' },
9296  },
9297  ['repeat'] = {
9298    args = 2,
9299    base = 1,
9300    desc = [=[
9301      Repeat {expr} {count} times and return the concatenated
9302      result.  Example: >vim
9303      	let separator = repeat('-', 80)
9304      <When {count} is zero or negative the result is empty.
9305      When {expr} is a |List| or a |Blob| the result is {expr}
9306      concatenated {count} times.  Example: >vim
9307      	let longlist = repeat(['a', 'b'], 3)
9308      <Results in ['a', 'b', 'a', 'b', 'a', 'b'].
9309
9310    ]=],
9311    fast = true,
9312    name = 'repeat',
9313    params = { { 'expr', 'any' }, { 'count', 'integer' } },
9314    signature = 'repeat({expr}, {count})',
9315    see_lua = { '|string.rep()| for strings; lists need manual repetition' },
9316  },
9317  resolve = {
9318    args = 1,
9319    base = 1,
9320    tags = { 'E655' },
9321    desc = [=[
9322      On MS-Windows, when {filename} is a shortcut (a .lnk file),
9323      returns the path the shortcut points to in a simplified form.
9324      On Unix, repeat resolving symbolic links in all path
9325      components of {filename} and return the simplified result.
9326      To cope with link cycles, resolving of symbolic links is
9327      stopped after 100 iterations.
9328      On other systems, return the simplified {filename}.
9329      The simplification step is done as by |simplify()|.
9330      resolve() keeps a leading path component specifying the
9331      current directory (provided the result is still a relative
9332      path name) and also keeps a trailing path separator.
9333
9334    ]=],
9335    fast = true,
9336    name = 'resolve',
9337    params = { { 'filename', 'string' } },
9338    returns = 'string',
9339    signature = 'resolve({filename})',
9340  },
9341  reverse = {
9342    args = 1,
9343    base = 1,
9344    desc = [=[
9345      Reverse the order of items in {object}.  {object} can be a
9346      |List|, a |Blob| or a |String|.  For a List and a Blob the
9347      items are reversed in-place and {object} is returned.
9348      For a String a new String is returned.
9349      Returns zero if {object} is not a List, Blob or a String.
9350      If you want a List or Blob to remain unmodified make a copy
9351      first: >vim
9352      	let revlist = reverse(copy(mylist))
9353      <
9354    ]=],
9355    name = 'reverse',
9356    generics = { 'T' },
9357    params = { { 'object', 'T[]' } },
9358    returns = 'T[]',
9359    signature = 'reverse({object})',
9360    see_lua = {
9361      '`vim.iter(list):rev():totable()` for lists; strings, blobs, and in-place behavior differ',
9362    },
9363  },
9364  round = {
9365    args = 1,
9366    base = 1,
9367    desc = [=[
9368      Round off {expr} to the nearest integral value and return it
9369      as a |Float|.  If {expr} lies halfway between two integral
9370      values, then use the larger one (away from zero).
9371      {expr} must evaluate to a |Float| or a |Number|.
9372      Returns 0.0 if {expr} is not a |Float| or a |Number|.
9373      Examples: >vim
9374      	echo round(0.456)
9375      <	0.0  >vim
9376      	echo round(4.5)
9377      <	5.0 >vim
9378      	echo round(-4.5)
9379      <	-5.0
9380
9381    ]=],
9382    func_float = 'round',
9383    name = 'round',
9384    params = { { 'expr', 'number' } },
9385    returns = 'number',
9386    signature = 'round({expr})',
9387    see_lua = {
9388      '`expr >= 0 and math.floor(expr + 0.5) or math.ceil(expr - 0.5)` for half-away-from-zero rounding',
9389    },
9390  },
9391  rpcnotify = {
9392    args = { 2 },
9393    desc = [=[
9394      Sends {event} to {channel} via |RPC| and returns immediately.
9395      If {channel} is 0, the event is broadcast to all channels.
9396      Example: >vim
9397      	au VimLeave call rpcnotify(0, "leaving")
9398      <
9399    ]=],
9400    name = 'rpcnotify',
9401    params = { { 'channel', 'integer' }, { 'event', 'string' }, { '...', 'any' } },
9402    returns = 'integer',
9403    signature = 'rpcnotify({channel}, {event} [, {args}...])',
9404    see_lua = { '|vim.rpcnotify()|' },
9405  },
9406  rpcrequest = {
9407    args = { 2 },
9408    desc = [=[
9409      Sends a request to {channel} to invoke {method} via
9410      |RPC| and blocks until a response is received.
9411      Example: >vim
9412      	let result = rpcrequest(rpc_chan, "func", 1, 2, 3)
9413      <
9414    ]=],
9415    name = 'rpcrequest',
9416    params = { { 'channel', 'integer' }, { 'method', 'string' }, { '...', 'any' } },
9417    signature = 'rpcrequest({channel}, {method} [, {args}...])',
9418    see_lua = { '|vim.rpcrequest()|' },
9419  },
9420  rpcstart = {
9421    deprecated = true,
9422    args = { 1, 2 },
9423    desc = [=[
9424      Deprecated. Replace  >vim
9425      	let id = rpcstart('prog', ['arg1', 'arg2'])
9426      <with >vim
9427      	let id = jobstart(['prog', 'arg1', 'arg2'], {'rpc': v:true})
9428      <
9429    ]=],
9430    name = 'rpcstart',
9431    params = { { 'prog', 'string' }, { 'argv', 'any' } },
9432    signature = 'rpcstart({prog} [, {argv}])',
9433  },
9434  rpcstop = {
9435    args = 1,
9436    deprecated = true,
9437    desc = [=[
9438      Use |jobstop()| instead to stop any job, or
9439      `chanclose(id, "rpc")` to close RPC communication
9440      without stopping the job. Use chanclose(id) to close
9441      any socket.
9442    ]=],
9443    params = VARARGS,
9444    signature = 'rpcstop(...)',
9445  },
9446  rubyeval = {
9447    args = 1,
9448    base = 1,
9449    desc = [=[
9450      Evaluate Ruby expression {expr} and return its result
9451      converted to Vim data structures.
9452      Numbers, floats and strings are returned as they are (strings
9453      are copied though).
9454      Arrays are represented as Vim |List| type.
9455      Hashes are represented as Vim |Dictionary| type.
9456      Other objects are represented as strings resulted from their
9457      "Object#to_s" method.
9458
9459    ]=],
9460    name = 'rubyeval',
9461    params = { { 'expr', 'any' } },
9462    signature = 'rubyeval({expr})',
9463  },
9464  screenattr = {
9465    args = 2,
9466    base = 1,
9467    desc = [=[
9468      Like |screenchar()|, but return the attribute.  This is a rather
9469      arbitrary number that can only be used to compare to the
9470      attribute at other positions.
9471      Returns -1 when row or col is out of range.
9472
9473    ]=],
9474    name = 'screenattr',
9475    params = { { 'row', 'integer' }, { 'col', 'integer' } },
9476    returns = 'integer',
9477    signature = 'screenattr({row}, {col})',
9478  },
9479  screenchar = {
9480    args = 2,
9481    base = 1,
9482    desc = [=[
9483      Returns the character at screen position [row, col] as a
9484      Number.  This works for every possible screen position, also
9485      status lines, window separators and the command line.  The
9486      top left position is row one, column one.  The character
9487      excludes composing characters.  For double-byte
9488      encodings it may only be the first byte.
9489      This is mainly to be used for testing.
9490      Returns -1 when row or col is out of range.
9491
9492    ]=],
9493    name = 'screenchar',
9494    params = { { 'row', 'integer' }, { 'col', 'integer' } },
9495    returns = 'integer',
9496    signature = 'screenchar({row}, {col})',
9497  },
9498  screenchars = {
9499    args = 2,
9500    base = 1,
9501    desc = [=[
9502      Returns the character and any composing characters at screen
9503      position [row, col] as a |List| of Numbers.  The first number
9504      is the same as what |screenchar()| returns; further numbers
9505      are composing characters on top of the base character.
9506      This is mainly to be used for testing.
9507      Returns an empty List when row or col is out of range.
9508
9509    ]=],
9510    name = 'screenchars',
9511    params = { { 'row', 'integer' }, { 'col', 'integer' } },
9512    returns = 'integer[]',
9513    signature = 'screenchars({row}, {col})',
9514  },
9515  screencol = {
9516    desc = [=[
9517      Returns the current screen column of the cursor.  The
9518      leftmost column has number 1.
9519      This function is mainly used for testing.
9520
9521      Note: Always returns the current screen column, thus if used
9522      in a command (e.g. ":echo screencol()") it will return the
9523      column inside the command line, which is 1 when the command is
9524      executed.  To get the cursor position in the file use one of
9525      the following mappings: >vim
9526      	nnoremap <expr> GG ":echom " .. screencol() .. "\n"
9527      	nnoremap <silent> GG :echom screencol()<CR>
9528      	noremap GG <Cmd>echom screencol()<CR>
9529      <
9530    ]=],
9531    name = 'screencol',
9532    params = {},
9533    returns = 'integer',
9534    signature = 'screencol()',
9535  },
9536  screenpos = {
9537    args = 3,
9538    base = 1,
9539    desc = [=[
9540      Returns the screen position of the text character in window
9541      {winid} at buffer line {lnum} and column {col} as a Dict.
9542      {col} is a one-based byte index.
9543      The Dict has these members:
9544      	row	screen row
9545      	col	first screen column
9546      	endcol	last screen column
9547      	curscol	cursor screen column
9548      If the specified position is not visible, all values are zero.
9549      The "endcol" value differs from "col" when the character
9550      occupies more than one screen cell.  E.g. for a Tab "col" can
9551      be 1 and "endcol" can be 8.
9552      The "curscol" value is where the cursor would be placed.  For
9553      a Tab it would be the same as "endcol", while for a double
9554      width character it would be the same as "col".
9555      The |conceal| feature is ignored here, the column numbers are
9556      as if 'conceallevel' is zero.  You can set the cursor to the
9557      right position and use |screencol()| to get the value with
9558      |conceal| taken into account.
9559      If the position is in a closed fold the screen position of the
9560      first character is returned, {col} is not used.
9561      Returns an empty Dict if {winid} is invalid.
9562
9563    ]=],
9564    name = 'screenpos',
9565    params = { { 'winid', 'integer' }, { 'lnum', 'integer' }, { 'col', 'integer' } },
9566    returns = '{ col: integer, curscol: integer, endcol: integer, row: integer }',
9567    signature = 'screenpos({winid}, {lnum}, {col})',
9568  },
9569  screenrow = {
9570    desc = [=[
9571      Returns the current screen row of the cursor.  The top line
9572      has number one.
9573      This function is mainly used for testing.
9574      Alternatively you can use |winline()|.
9575
9576      Note: Same restrictions as with |screencol()|.
9577    ]=],
9578    name = 'screenrow',
9579    params = {},
9580    returns = 'integer',
9581    signature = 'screenrow()',
9582  },
9583  screenstring = {
9584    args = 2,
9585    base = 1,
9586    desc = [=[
9587      Returns the base character and any composing characters at
9588      screen position [row, col] as a String.  This is like
9589      |screenchars()| but returning a String with the characters.
9590      This is mainly to be used for testing.
9591      Returns an empty String when row or col is out of range.
9592
9593    ]=],
9594    name = 'screenstring',
9595    params = { { 'row', 'integer' }, { 'col', 'integer' } },
9596    returns = 'string',
9597    signature = 'screenstring({row}, {col})',
9598  },
9599  search = {
9600    args = { 1, 5 },
9601    base = 1,
9602    desc = [=[
9603      Search for regexp pattern {pattern}.  The search starts at the
9604      cursor position (you can use |cursor()| to set it).
9605
9606      When a match has been found its line number is returned.
9607      If there is no match a 0 is returned and the cursor doesn't
9608      move.  No error message is given.
9609      To get the matched string, use |matchbufline()|.
9610
9611      {flags} is a String, which can contain these character flags:
9612      'b'	search Backward instead of forward
9613      'c'	accept a match at the Cursor position
9614      'e'	move to the End of the match
9615      'n'	do Not move the cursor
9616      'p'	return number of matching sub-Pattern (see below)
9617      's'	Set the ' mark at the previous location of the cursor
9618      'w'	Wrap around the end of the file
9619      'W'	don't Wrap around the end of the file
9620      'z'	start searching at the cursor column instead of Zero
9621      If neither 'w' or 'W' is given, the 'wrapscan' option applies.
9622
9623      If the 's' flag is supplied, the ' mark is set, only if the
9624      cursor is moved.  The 's' flag cannot be combined with the 'n'
9625      flag.
9626
9627      'ignorecase', 'smartcase' and 'magic' are used.
9628
9629      When the 'z' flag is not given, forward searching always
9630      starts in column zero and then matches before the cursor are
9631      skipped.  When the 'c' flag is present in 'cpo' the next
9632      search starts after the match.  Without the 'c' flag the next
9633      search starts one column after the start of the match.  This
9634      matters for overlapping matches.  See |cpo-c|.  You can also
9635      insert "\ze" to change where the match ends, see  |/\ze|.
9636
9637      When searching backwards and the 'z' flag is given then the
9638      search starts in column zero, thus no match in the current
9639      line will be found (unless wrapping around the end of the
9640      file).
9641
9642      When the {stopline} argument is given then the search stops
9643      after searching this line.  This is useful to restrict the
9644      search to a range of lines.  Examples: >vim
9645      	let match = search('(', 'b', line("w0"))
9646      	let end = search('END', '', line("w$"))
9647      <When {stopline} is used and it is not zero this also implies
9648      that the search does not wrap around the end of the file.
9649      A zero value is equal to not giving the argument.
9650
9651      When the {timeout} argument is given the search stops when
9652      more than this many milliseconds have passed.  Thus when
9653      {timeout} is 500 the search stops after half a second.
9654      The value must not be negative.  A zero value is like not
9655      giving the argument.
9656
9657      Note: the timeout is only considered when searching, not
9658      while evaluating the {skip} expression.
9659
9660      If the {skip} expression is given it is evaluated with the
9661      cursor positioned on the start of a match.  If it evaluates to
9662      non-zero this match is skipped.  This can be used, for
9663      example, to skip a match in a comment or a string.
9664      {skip} can be a string, which is evaluated as an expression, a
9665      function reference or a lambda.
9666      When {skip} is omitted or empty, every match is accepted.
9667      When evaluating {skip} causes an error the search is aborted
9668      and -1 returned.
9669      					*search()-sub-match*
9670      With the 'p' flag the returned value is one more than the
9671      first sub-match in \(\).  One if none of them matched but the
9672      whole pattern did match.
9673      To get the column number too use |searchpos()|.
9674
9675      The cursor will be positioned at the match, unless the 'n'
9676      flag is used.
9677
9678      Example (goes over all files in the argument list): >vim
9679          let n = 1
9680          while n <= argc()	    " loop over all files in arglist
9681            exe "argument " .. n
9682            " start at the last char in the file and wrap for the
9683            " first search to find match at start of file
9684            normal G$
9685            let flags = "w"
9686            while search("foo", flags) > 0
9687              s/foo/bar/g
9688              let flags = "W"
9689            endwhile
9690            update		    " write the file if modified
9691            let n = n + 1
9692          endwhile
9693      <
9694      Example for using some flags: >vim
9695          echo search('\<if\|\(else\)\|\(endif\)', 'ncpe')
9696      <This will search for the keywords "if", "else", and "endif"
9697      under or after the cursor.  Because of the 'p' flag, it
9698      returns 1, 2, or 3 depending on which keyword is found, or 0
9699      if the search fails.  With the cursor on the first word of the
9700      line:
9701          if (foo == 0) | let foo = foo + 1 | endif ~
9702      the function returns 1.  Without the 'c' flag, the function
9703      finds the "endif" and returns 3.  The same thing happens
9704      without the 'e' flag if the cursor is on the "f" of "if".
9705      The 'n' flag tells the function not to move the cursor.
9706
9707    ]=],
9708    name = 'search',
9709    params = {
9710      { 'pattern', 'string' },
9711      { 'flags', 'string' },
9712      { 'stopline', 'integer' },
9713      { 'timeout', 'integer' },
9714      { 'skip', 'string|function' },
9715    },
9716    returns = 'integer',
9717    signature = 'search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])',
9718  },
9719  searchcount = {
9720    args = { 0, 1 },
9721    base = 1,
9722    desc = [=[
9723      Get or update the last search count, like what is displayed
9724      without the "S" flag in 'shortmess'.  This works even if
9725      'shortmess' does contain the "S" flag.
9726
9727      This returns a |Dictionary|.  The dictionary is empty if the
9728      previous pattern was not set and "pattern" was not specified.
9729
9730        key		type		meaning ~
9731        current	|Number|	current position of match;
9732      				0 if the cursor position is
9733      				before the first match
9734        exact_match	|Boolean|	1 if "current" is matched on
9735      				"pos", otherwise 0
9736        total		|Number|	total count of matches found
9737        incomplete	|Number|	0: search was fully completed
9738      				1: recomputing was timed out
9739      				2: max count exceeded
9740
9741      For {options} see further down.
9742
9743      To get the last search count when |n| or |N| was pressed, call
9744      this function with `recompute: 0` .  This sometimes returns
9745      wrong information because of 'maxsearchcount'.
9746      If the count exceeded 'maxsearchcount', the result must be
9747      'maxsearchcount' + 1.  If you want to get correct information,
9748      specify `recompute: 1`: >vim
9749
9750      	" result == 'maxsearchcount' + 1 when many matches
9751      	let result = searchcount(#{recompute: 0})
9752
9753      	" Below returns correct result (recompute defaults
9754      	" to 1)
9755      	let result = searchcount()
9756      <
9757      The function is useful to add the count to 'statusline': >vim
9758      	function! LastSearchCount() abort
9759      	  let result = searchcount(#{recompute: 0})
9760      	  if empty(result)
9761      	    return ''
9762      	  endif
9763      	  if result.incomplete ==# 1     " timed out
9764      	    return printf(' /%s [?/??]', @/)
9765      	  elseif result.incomplete ==# 2 " max count exceeded
9766      	    if result.total > result.maxcount &&
9767      	    \  result.current > result.maxcount
9768      	      return printf(' /%s [>%d/>%d]', @/,
9769      	      \             result.current, result.total)
9770      	    elseif result.total > result.maxcount
9771      	      return printf(' /%s [%d/>%d]', @/,
9772      	      \             result.current, result.total)
9773      	    endif
9774      	  endif
9775      	  return printf(' /%s [%d/%d]', @/,
9776      	  \             result.current, result.total)
9777      	endfunction
9778      	let &statusline ..= '%{LastSearchCount()}'
9779
9780      	" Or if you want to show the count only when
9781      	" 'hlsearch' was on
9782      	" let &statusline ..=
9783      	" \   '%{v:hlsearch ? LastSearchCount() : ""}'
9784      <
9785      You can also update the search count, which can be useful in a
9786      |CursorMoved| or |CursorMovedI| autocommand: >vim
9787
9788      	autocmd CursorMoved,CursorMovedI *
9789      	  \ let s:searchcount_timer = timer_start(
9790      	  \   200, function('s:update_searchcount'))
9791      	function! s:update_searchcount(timer) abort
9792      	  if a:timer ==# s:searchcount_timer
9793      	    call searchcount(#{
9794      	    \ recompute: 1, maxcount: 0, timeout: 100})
9795      	    redrawstatus
9796      	  endif
9797      	endfunction
9798      <
9799      This can also be used to count matched texts with specified
9800      pattern in the current buffer using "pattern":  >vim
9801
9802      	" Count '\<foo\>' in this buffer
9803      	" (Note that it also updates search count)
9804      	let result = searchcount(#{pattern: '\<foo\>'})
9805
9806      	" To restore old search count by old pattern,
9807      	" search again
9808      	call searchcount()
9809      <
9810      {options} must be a |Dictionary|.  It can contain:
9811        key		type		meaning ~
9812        recompute	|Boolean|	if |TRUE|, recompute the count
9813      				like |n| or |N| was executed.
9814      				otherwise returns the last
9815      				computed result (when |n| or
9816      				|N| was used when "S" is not
9817      				in 'shortmess', or this
9818      				function was called).
9819      				(default: |TRUE|)
9820        pattern	|String|	recompute if this was given
9821      				and different with |@/|.
9822      				this works as same as the
9823      				below command is executed
9824      				before calling this function >vim
9825      				  let @/ = pattern
9826      <				(default: |@/|)
9827        timeout	|Number|	0 or negative number is no
9828      				timeout. timeout milliseconds
9829      				for recomputing the result
9830      				(default: 0)
9831        maxcount	|Number|	0 or negative number is no
9832      				limit. max count of matched
9833      				text while recomputing the
9834      				result.  if search exceeded
9835      				total count, "total" value
9836      				becomes `maxcount + 1`
9837      				(default: 'maxsearchcount')
9838        pos		|List|		`[lnum, col, off]` value
9839      				when recomputing the result.
9840      				this changes "current" result
9841      				value. see |cursor()|, |getpos()|
9842      				(default: cursor's position)
9843
9844    ]=],
9845    name = 'searchcount',
9846    params = { { 'options', 'table' } },
9847    signature = 'searchcount([{options}])',
9848  },
9849  searchdecl = {
9850    args = { 1, 3 },
9851    base = 1,
9852    desc = [=[
9853      Search for the declaration of {name}.
9854
9855      With a non-zero {global} argument it works like |gD|, find
9856      first match in the file.  Otherwise it works like |gd|, find
9857      first match in the function.
9858
9859      With a non-zero {thisblock} argument matches in a {} block
9860      that ends before the cursor position are ignored.  Avoids
9861      finding variable declarations only valid in another scope.
9862
9863      Moves the cursor to the found match.
9864      Returns zero for success, non-zero for failure.
9865      Example: >vim
9866      	if searchdecl('myvar') == 0
9867      	   echo getline('.')
9868      	endif
9869      <
9870    ]=],
9871    name = 'searchdecl',
9872    params = { { 'name', 'string' }, { 'global', 'boolean' }, { 'thisblock', 'boolean' } },
9873    signature = 'searchdecl({name} [, {global} [, {thisblock}]])',
9874  },
9875  searchpair = {
9876    args = { 3, 7 },
9877    desc = [=[
9878      Search for the match of a nested start-end pair.  This can be
9879      used to find the "endif" that matches an "if", while other
9880      if/endif pairs in between are ignored.
9881      The search starts at the cursor.  The default is to search
9882      forward, include 'b' in {flags} to search backward.
9883      If a match is found, the cursor is positioned at it and the
9884      line number is returned.  If no match is found 0 or -1 is
9885      returned and the cursor doesn't move.  No error message is
9886      given.
9887
9888      {start}, {middle} and {end} are patterns, see |pattern|.  They
9889      must not contain \( \) pairs.  Use of \%( \) is allowed.  When
9890      {middle} is not empty, it is found when searching from either
9891      direction, but only when not in a nested start-end pair.  A
9892      typical use is: >vim
9893      	echo searchpair('\<if\>', '\<else\>', '\<endif\>')
9894      <By leaving {middle} empty the "else" is skipped.
9895
9896      {flags} 'b', 'c', 'n', 's', 'w' and 'W' are used like with
9897      |search()|.  Additionally:
9898      'r'	Repeat until no more matches found; will find the
9899      	outer pair.  Implies the 'W' flag.
9900      'm'	Return number of matches instead of line number with
9901      	the match; will be > 1 when 'r' is used.
9902      Note: it's nearly always a good idea to use the 'W' flag, to
9903      avoid wrapping around the end of the file.
9904
9905      When a match for {start}, {middle} or {end} is found, the
9906      {skip} expression is evaluated with the cursor positioned on
9907      the start of the match.  It should return non-zero if this
9908      match is to be skipped.  E.g., because it is inside a comment
9909      or a string.
9910      When {skip} is omitted or empty, every match is accepted.
9911      When evaluating {skip} causes an error the search is aborted
9912      and -1 returned.
9913      {skip} can be a string, a lambda, a funcref or a partial.
9914      Anything else makes the function fail.
9915
9916      For {stopline} and {timeout} see |search()|.
9917
9918      The value of 'ignorecase' is used.  'magic' is ignored, the
9919      patterns are used like it's on.
9920
9921      The search starts exactly at the cursor.  A match with
9922      {start}, {middle} or {end} at the next character, in the
9923      direction of searching, is the first one found.  Example: >vim
9924      	if 1
9925      	  if 2
9926      	  endif 2
9927      	endif 1
9928      <When starting at the "if 2", with the cursor on the "i", and
9929      searching forwards, the "endif 2" is found.  When starting on
9930      the character just before the "if 2", the "endif 1" will be
9931      found.  That's because the "if 2" will be found first, and
9932      then this is considered to be a nested if/endif from "if 2" to
9933      "endif 2".
9934      When searching backwards and {end} is more than one character,
9935      it may be useful to put "\zs" at the end of the pattern, so
9936      that when the cursor is inside a match with the end it finds
9937      the matching start.
9938
9939      Example, to find the "endif" command in a Vim script: >vim
9940
9941      	echo searchpair('\<if\>', '\<el\%[seif]\>', '\<en\%[dif]\>', 'W',
9942      	\ 'getline(".") =~ "^\\s*\""')
9943
9944      <The cursor must be at or after the "if" for which a match is
9945      to be found.  Note that single-quote strings are used to avoid
9946      having to double the backslashes.  The skip expression only
9947      catches comments at the start of a line, not after a command.
9948      Also, a word "en" or "if" halfway through a line is considered
9949      a match.
9950      Another example, to search for the matching "{" of a "}": >vim
9951
9952      	echo searchpair('{', '', '}', 'bW')
9953
9954      <This works when the cursor is at or before the "}" for which a
9955      match is to be found.  To reject matches that syntax
9956      highlighting recognized as strings: >vim
9957
9958      	echo searchpair('{', '', '}', 'bW',
9959      	     \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"')
9960      <
9961    ]=],
9962    name = 'searchpair',
9963    params = {
9964      { 'start', 'string' },
9965      { 'middle', 'string' },
9966      { 'end', 'string' },
9967      { 'flags', 'string' },
9968      { 'skip', 'string|function' },
9969      { 'stopline', 'integer' },
9970      { 'timeout', 'integer' },
9971    },
9972    returns = 'integer',
9973    signature = 'searchpair({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline} [, {timeout}]]]])',
9974  },
9975  searchpairpos = {
9976    args = { 3, 7 },
9977    desc = [=[
9978      Same as |searchpair()|, but returns a |List| with the line and
9979      column position of the match.  The first element of the |List|
9980      is the line number and the second element is the byte index of
9981      the column position of the match.  If no match is found,
9982      returns [0, 0]. >vim
9983
9984      	let [lnum,col] = searchpairpos('{', '', '}', 'n')
9985      <
9986      See |match-parens| for a bigger and more useful example.
9987    ]=],
9988    name = 'searchpairpos',
9989    params = {
9990      { 'start', 'string' },
9991      { 'middle', 'string' },
9992      { 'end', 'string' },
9993      { 'flags', 'string' },
9994      { 'skip', 'string|function' },
9995      { 'stopline', 'integer' },
9996      { 'timeout', 'integer' },
9997    },
9998    returns = '[integer, integer]',
9999    signature = 'searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline} [, {timeout}]]]])',
10000  },
10001  searchpos = {
10002    args = { 1, 5 },
10003    base = 1,
10004    desc = [=[
10005      Same as |search()|, but returns a |List| with the line and
10006      column position of the match.  The first element of the |List|
10007      is the line number and the second element is the byte index of
10008      the column position of the match.  If no match is found,
10009      returns [0, 0].
10010      Example: >vim
10011      	let [lnum, col] = searchpos('mypattern', 'n')
10012
10013      <When the 'p' flag is given then there is an extra item with
10014      the sub-pattern match number |search()-sub-match|.  Example: >vim
10015      	let [lnum, col, submatch] = searchpos('\(\l\)\|\(\u\)', 'np')
10016      <In this example "submatch" is 2 when a lowercase letter is
10017      found |/\l|, 3 when an uppercase letter is found |/\u|.
10018
10019    ]=],
10020    name = 'searchpos',
10021    params = {
10022      { 'pattern', 'string' },
10023      { 'flags', 'string' },
10024      { 'stopline', 'integer' },
10025      { 'timeout', 'integer' },
10026      { 'skip', 'string|function' },
10027    },
10028    returns = '{ [1]: integer, [2]: integer, [3]: integer? }',
10029    signature = 'searchpos({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])',
10030  },
10031  serverlist = {
10032    args = { 0, 1 },
10033    desc = [=[
10034      Returns a list of server addresses, or empty if all servers
10035      were stopped. |serverstart()| |serverstop()|
10036
10037      The optional argument {opts} is a Dict and supports the following items:
10038
10039        peer  : If |TRUE|, servers not started by |serverstart()|
10040                will also be returned. (default: |FALSE|)
10041                Not supported on Windows yet.
10042
10043        info  : If |TRUE|, return a list of Dicts with detailed info
10044                instead of addresses. Implies `peer=true`. Each Dict
10045                has the following items:
10046                  addr          (string)  Server address.
10047                  pid           (number)  PID of the Nvim process.
10048                  own           (bool)    Whether this server belongs to
10049                                          the current Nvim instance.
10050                  active        (number)  |v:useractive| of the server.
10051                (default: |FALSE|)
10052
10053      Example: >vim
10054      	echo serverlist()
10055      	echo serverlist(#{info: v:true})
10056      <
10057    ]=],
10058    name = 'serverlist',
10059    params = { { 'opts', 'table' } },
10060    returns = 'string[]|vim.ServerInfo[]',
10061    signature = 'serverlist([{opts}])',
10062  },
10063  serverstart = {
10064    args = { 0, 1 },
10065    desc = [=[
10066      Opens a socket or named pipe at {address} and listens for
10067      |RPC| messages. Clients can send |API| commands to the
10068      returned address to control Nvim.
10069
10070      Returns the address string (which may differ from the
10071      {address} argument, see below).
10072
10073      - If {address} has a colon (":") it is a TCP/IPv4/IPv6 address
10074        where the last ":" separates host and port (empty or zero
10075        assigns a random port).
10076      - Else {address} is the path to a named pipe (except on Windows).
10077        - If {address} has no slashes ("/") it is treated as the
10078          "name" part of a generated path in this format: >vim
10079      	stdpath("run").."/{name}.{pid}.{counter}"
10080      <  - If {address} is omitted the name is "nvim". >vim
10081      	echo serverstart()
10082      < >
10083      	=> /tmp/nvim.bram/oknANW/nvim.15430.5
10084      <
10085      Example bash command to list all Nvim servers: >bash
10086      	ls ${XDG_RUNTIME_DIR:-${TMPDIR}nvim.${USER}}/*/nvim.*.0
10087
10088      <Example named pipe: >vim
10089      	if has('win32')
10090      	  echo serverstart('//./pipe/nvim-pipe-1234')
10091      	else
10092      	  echo serverstart('nvim.sock')
10093      	endif
10094      <
10095      Example TCP/IP address: >vim
10096      	echo serverstart('::1:12345')
10097      <
10098    ]=],
10099    name = 'serverstart',
10100    params = { { 'address', 'string' } },
10101    returns = 'string',
10102    signature = 'serverstart([{address}])',
10103  },
10104  serverstop = {
10105    args = 1,
10106    desc = [=[
10107      Closes the pipe or socket at {address}.
10108      Returns TRUE if {address} is valid, else FALSE.
10109      If |v:servername| is stopped it is set to the next available
10110      address in |serverlist()|.
10111    ]=],
10112    name = 'serverstop',
10113    params = { { 'address', 'string' } },
10114    returns = 'integer',
10115    signature = 'serverstop({address})',
10116  },
10117  setbufline = {
10118    args = 3,
10119    base = 3,
10120    desc = [=[
10121      Set line {lnum} to {text} in buffer {buf}.  This works like
10122      |setline()| for the specified buffer.
10123
10124      This function works only for loaded buffers.  First call
10125      |bufload()| if needed.
10126
10127      To insert lines use |appendbufline()|.
10128
10129      {text} can be a string to set one line, or a List of strings
10130      to set multiple lines.  If the List extends below the last
10131      line then those lines are added.  If the List is empty then
10132      nothing is changed and zero is returned.
10133
10134      For the use of {buf}, see |bufname()| above.
10135
10136      {lnum} is used like with |setline()|.
10137      Use "$" to refer to the last line in buffer {buf}.
10138      When {lnum} is just below the last line the {text} will be
10139      added below the last line.
10140      On success 0 is returned, on failure 1 is returned.
10141
10142      If {buf} is not a valid buffer or {lnum} is not valid, an
10143      error message is given.
10144
10145    ]=],
10146    name = 'setbufline',
10147    params = { { 'buf', 'integer|string' }, { 'lnum', 'integer' }, { 'text', 'string|string[]' } },
10148    returns = 'integer',
10149    signature = 'setbufline({buf}, {lnum}, {text})',
10150    see_lua = { '|nvim_buf_set_lines()|' },
10151  },
10152  setbufvar = {
10153    args = 3,
10154    base = 3,
10155    desc = [=[
10156      Set option or local variable {varname} (string, without "b:")
10157      in buffer {buf} to {val}. Also works for a global or
10158      window-local option (not variable). A window-local option is
10159      set in a window of the current tabpage that displays {buf},
10160      and the global value is unchanged. When no window in the
10161      current tabpage displays {buf} the option is not set and no
10162      error is given; use |setwinvar()| or |win_execute()| for that.
10163
10164      For the use of {buf}, see |bufname()| above.
10165
10166      Examples: >vim
10167      	call setbufvar(1, "&mod", 1)
10168      	call setbufvar("todo", "myvar", "foobar")
10169      <This function is not available in the |sandbox|.
10170
10171    ]=],
10172    name = 'setbufvar',
10173    params = { { 'buf', 'integer|string' }, { 'varname', 'string' }, { 'val', 'any' } },
10174    signature = 'setbufvar({buf}, {varname}, {val})',
10175    see_lua = {
10176      '|nvim_buf_set_var()| or |vim.b| after resolving {buf} to a bufnr; option names use |nvim_set_option_value()|',
10177    },
10178  },
10179  setcellwidths = {
10180    args = 1,
10181    base = 1,
10182    desc = [=[
10183      Specify overrides for cell widths of character ranges.  This
10184      tells Vim how wide characters are when displayed in the
10185      terminal, counted in screen cells.  The values override
10186      'ambiwidth'.  Example: >vim
10187         call setcellwidths([
10188      		\ [0x111, 0x111, 1],
10189      		\ [0x2194, 0x2199, 2],
10190      		\ ])
10191
10192      <The {list} argument is a List of Lists with each three
10193      numbers: [{low}, {high}, {width}].	*E1109* *E1110*
10194      {low} and {high} can be the same, in which case this refers to
10195      one character.  Otherwise it is the range of characters from
10196      {low} to {high} (inclusive).		*E1111* *E1114*
10197      Only characters with value 0x80 and higher can be used.
10198
10199      {width} must be either 1 or 2, indicating the character width
10200      in screen cells.			*E1112*
10201      An error is given if the argument is invalid, also when a
10202      range overlaps with another.		*E1113*
10203
10204      If the new value causes 'fillchars' or 'listchars' to become
10205      invalid it is rejected and an error is given.
10206
10207      To clear the overrides pass an empty {list}: >vim
10208         call setcellwidths([])
10209
10210      <You can use the script $VIMRUNTIME/scripts/emoji_list.lua to see
10211      the effect for known emoji characters.  Move the cursor
10212      through the text to check if the cell widths of your terminal
10213      match with what Vim knows about each emoji.  If it doesn't
10214      look right you need to adjust the {list} argument.
10215
10216      |getcellwidths()| can be used to get the overrides later.
10217    ]=],
10218    name = 'setcellwidths',
10219    params = { { 'list', 'any[]' } },
10220    signature = 'setcellwidths({list})',
10221  },
10222  setcharpos = {
10223    args = 2,
10224    base = 2,
10225    desc = [=[
10226      Same as |setpos()| but uses the specified column number as the
10227      character index instead of the byte index in the line.
10228
10229      Example:
10230      With the text "여보세요" in line 8: >vim
10231      	call setcharpos('.', [0, 8, 4, 0])
10232      <positions the cursor on the fourth character '요'. >vim
10233      	call setpos('.', [0, 8, 4, 0])
10234      <positions the cursor on the second character '보'.
10235
10236    ]=],
10237    name = 'setcharpos',
10238    params = { { 'expr', 'string' }, { 'list', 'integer[]' } },
10239    signature = 'setcharpos({expr}, {list})',
10240    see_lua = {
10241      '|nvim_win_set_cursor()| or |nvim_buf_set_mark()| with |vim.str_byteindex()|; special positions, `off`, and `curswant` differ',
10242    },
10243  },
10244  setcharsearch = {
10245    args = 1,
10246    base = 1,
10247    desc = [=[
10248      Set the current character search information to {dict},
10249      which contains one or more of the following entries:
10250
10251          char	character which will be used for a subsequent
10252      		|,| or |;| command; an empty string clears the
10253      		character search
10254          forward	direction of character search; 1 for forward,
10255      		0 for backward
10256          until	type of character search; 1 for a |t| or |T|
10257      		character search, 0 for an |f| or |F|
10258      		character search
10259
10260      This can be useful to save/restore a user's character search
10261      from a script: >vim
10262      	let prevsearch = getcharsearch()
10263      	" Perform a command which clobbers user's search
10264      	call setcharsearch(prevsearch)
10265      <Also see |getcharsearch()|.
10266
10267    ]=],
10268    name = 'setcharsearch',
10269    params = { { 'dict', '{ char?: string, forward?: 1|0, until?: 1|0 }' } },
10270    signature = 'setcharsearch({dict})',
10271  },
10272  setcmdline = {
10273    args = { 1, 2 },
10274    base = 1,
10275    desc = [=[
10276      Set the command line to {str} and set the cursor position to
10277      {pos}.
10278      If {pos} is omitted, the cursor is positioned after the text.
10279      Returns 0 when successful, 1 when not editing the command
10280      line.
10281
10282    ]=],
10283    name = 'setcmdline',
10284    params = { { 'str', 'string' }, { 'pos', 'integer' } },
10285    returns = 'integer',
10286    signature = 'setcmdline({str} [, {pos}])',
10287  },
10288  setcmdpos = {
10289    args = 1,
10290    base = 1,
10291    desc = [=[
10292      Set the cursor position in the command line to byte position
10293      {pos}.  The first position is 1.
10294      Use |getcmdpos()| to obtain the current position.
10295      Only works while editing the command line, thus you must use
10296      |c_CTRL-\_e|, |c_CTRL-R_=| or |c_CTRL-R_CTRL-R| with '='.  For
10297      |c_CTRL-\_e| and |c_CTRL-R_CTRL-R| with '=' the position is
10298      set after the command line is set to the expression.  For
10299      |c_CTRL-R_=| it is set after evaluating the expression but
10300      before inserting the resulting text.
10301      When the number is too big the cursor is put at the end of the
10302      line.  A number smaller than one has undefined results.
10303      Returns 0 when successful, 1 when not editing the command
10304      line.
10305
10306    ]=],
10307    name = 'setcmdpos',
10308    params = { { 'pos', 'integer' } },
10309    signature = 'setcmdpos({pos})',
10310  },
10311  setcursorcharpos = {
10312    args = { 1, 3 },
10313    base = 1,
10314    name = 'setcursorcharpos',
10315    params = { { 'lnum', 'integer|string' }, { 'col', 'integer' }, { 'off', 'integer' } },
10316    signature = 'setcursorcharpos({lnum}, {col} [, {off}])',
10317    see_lua = {
10318      '|nvim_win_set_cursor()| with |vim.str_byteindex()|; `off`, return values, and special line forms differ',
10319    },
10320  },
10321  setcursorcharpos__1 = {
10322    args = { 1, 3 },
10323    base = 1,
10324    desc = [=[
10325      Same as |cursor()| but uses the specified column number as the
10326      character index instead of the byte index in the line.
10327
10328      Example:
10329      With the text "여보세요" in line 4: >vim
10330      	call setcursorcharpos(4, 3)
10331      <positions the cursor on the third character '세'. >vim
10332      	call cursor(4, 3)
10333      <positions the cursor on the first character '여'.
10334
10335      Returns 0 when the position could be set, -1 otherwise.
10336    ]=],
10337    name = 'setcursorcharpos',
10338    params = { { 'list', 'integer[]' } },
10339    signature = 'setcursorcharpos({list})',
10340    see_lua = {
10341      '|nvim_win_set_cursor()| with |vim.str_byteindex()|; list shape, `off`, and return values differ',
10342    },
10343  },
10344  setenv = {
10345    args = 2,
10346    base = 2,
10347    desc = [=[
10348      Set environment variable {name} to {val}.  Example: >vim
10349      	call setenv('HOME', '/home/myhome')
10350
10351      <When {val} is |v:null| the environment variable is deleted.
10352      See also |expr-env|.
10353
10354    ]=],
10355    name = 'setenv',
10356    params = { { 'name', 'string' }, { 'val', 'string' } },
10357    signature = 'setenv({name}, {val})',
10358    see_lua = { '|vim.env|' },
10359  },
10360  setfperm = {
10361    args = 2,
10362    base = 1,
10363    tags = { 'chmod' },
10364    desc = [=[
10365      Set the file permissions for {fname} to {mode}.
10366      {mode} must be a string with 9 characters.  It is of the form
10367      "rwxrwxrwx", where each group of "rwx" flags represent, in
10368      turn, the permissions of the owner of the file, the group the
10369      file belongs to, and other users.  A '-' character means the
10370      permission is off, any other character means on.  Multi-byte
10371      characters are not supported.
10372
10373      For example "rw-r-----" means read-write for the user,
10374      readable by the group, not accessible by others.  "xx-x-----"
10375      would do the same thing.
10376
10377      Returns non-zero for success, zero for failure.
10378
10379      To read permissions see |getfperm()|.
10380    ]=],
10381    name = 'setfperm',
10382    params = { { 'fname', 'string' }, { 'mode', 'string' } },
10383    signature = 'setfperm({fname}, {mode})',
10384    see_lua = { '|uv.fs_chmod()|' },
10385  },
10386  setline = {
10387    args = 2,
10388    base = 2,
10389    desc = [=[
10390      Set line {lnum} of the current buffer to {text}.  To insert
10391      lines use |append()|.  To set lines in another buffer use
10392      |setbufline()|.
10393
10394      {lnum} is used like with |getline()|.
10395      When {lnum} is just below the last line the {text} will be
10396      added below the last line.
10397      {text} can be any type or a List of any type, each item is
10398      converted to a String.  When {text} is an empty List then
10399      nothing is changed and FALSE is returned.
10400
10401      If this succeeds, FALSE is returned.  If this fails (most
10402      likely because {lnum} is invalid) TRUE is returned.
10403
10404      Example: >vim
10405      	call setline(5, strftime("%c"))
10406
10407      <When {text} is a |List| then line {lnum} and following lines
10408      will be set to the items in the list.  Example: >vim
10409      	call setline(5, ['aaa', 'bbb', 'ccc'])
10410      <This is equivalent to: >vim
10411      	for [n, l] in [[5, 'aaa'], [6, 'bbb'], [7, 'ccc']]
10412      	  call setline(n, l)
10413      	endfor
10414
10415      <Note: The '[ and '] marks are not set.
10416
10417    ]=],
10418    name = 'setline',
10419    params = { { 'lnum', 'integer|string' }, { 'text', 'any' } },
10420    signature = 'setline({lnum}, {text})',
10421    see_lua = { '|nvim_set_current_line()|', '|nvim_buf_set_lines()|' },
10422  },
10423  setloclist = {
10424    args = { 2, 4 },
10425    base = 2,
10426    desc = [=[
10427      Create or replace or add to the location list for window {nr}
10428      (|window-number| or |window-ID|).
10429      When {nr} is zero the current window is used.
10430
10431      For a location list window, the displayed location list is
10432      modified.  For an invalid {nr}, -1 is returned.
10433      Otherwise, same as |setqflist()|.
10434      Also see |location-list|.
10435
10436      For {action} see |setqflist-action|.
10437
10438      If the optional {what} dictionary argument is supplied, then
10439      only the items listed in {what} are set.  Refer to |setqflist()|
10440      for the list of supported keys in {what}.
10441
10442    ]=],
10443    name = 'setloclist',
10444    params = {
10445      { 'nr', 'integer' },
10446      { 'list', 'vim.quickfix.entry[]' },
10447      { 'action', 'string' },
10448      { 'what', 'vim.fn.setqflist.what' },
10449    },
10450    signature = 'setloclist({nr}, {list} [, {action} [, {what}]])',
10451  },
10452  setmatches = {
10453    args = { 1, 2 },
10454    base = 1,
10455    desc = [=[
10456      Restores a list of matches saved by |getmatches()| for the
10457      current window.  Returns 0 if successful, otherwise -1.  All
10458      current matches are cleared before the list is restored.  See
10459      example for |getmatches()|.
10460      {win} (if given) is a |window-number| or |window-ID|.
10461
10462    ]=],
10463    name = 'setmatches',
10464    params = { { 'list', 'vim.fn.getmatches.ret.item[]' }, { 'win', 'integer' } },
10465    signature = 'setmatches({list} [, {win}])',
10466  },
10467  setpos = {
10468    args = 2,
10469    base = 2,
10470    desc = [=[
10471      Set the position for String {expr}.  Possible values:
10472      	.	the cursor
10473      	'x	mark x
10474
10475      {list} must be a |List| with four or five numbers:
10476          [bufnum, lnum, col, off]
10477          [bufnum, lnum, col, off, curswant]
10478
10479      "bufnum" is the buffer number.	Zero can be used for the
10480      current buffer.  When setting an uppercase mark "bufnum" is
10481      used for the mark position.  For other marks it specifies the
10482      buffer to set the mark in.  You can use the |bufnr()| function
10483      to turn a file name into a buffer number.
10484      For setting the cursor and the ' mark "bufnum" is ignored,
10485      since these are associated with a window, not a buffer.
10486      Does not change the jumplist.
10487
10488      "lnum" and "col" are the position in the buffer.  The first
10489      column is 1.  Use a zero "lnum" to delete a mark.  If "col" is
10490      smaller than 1 then 1 is used.  To use the character count
10491      instead of the byte count, use |setcharpos()|.
10492
10493      The "off" number is only used when 'virtualedit' is set.  Then
10494      it is the offset in screen columns from the start of the
10495      character.  E.g., a position within a <Tab> or after the last
10496      character.
10497
10498      The "curswant" number is only used when setting the cursor
10499      position.  It sets the preferred column for when moving the
10500      cursor vertically.  When the "curswant" number is missing the
10501      preferred column is not set.  When it is present and setting a
10502      mark position it is not used.
10503
10504      Note that for |'<| and |'>| changing the line number may
10505      result in the marks to be effectively swapped, so that |'<| is
10506      always before |'>|.
10507
10508      The visual marks |'<| and |'>| refer to the beginning and end
10509      of the visual selection relative to the cursor position.
10510      Note that this differs from |getpos()|, where they are
10511      relative to the buffer.
10512
10513      Returns 0 when the position could be set, -1 otherwise.
10514      An error message is given if {expr} is invalid.
10515
10516      Also see |setcharpos()|, |getpos()| and |getcurpos()|.
10517
10518      This does not restore the preferred column for moving
10519      vertically; if you set the cursor position with this, |j| and
10520      |k| motions will jump to previous columns!  Use |cursor()| to
10521      also set the preferred column.  Also see the "curswant" key in
10522      |winrestview()|.
10523
10524    ]=],
10525    name = 'setpos',
10526    params = { { 'expr', 'string' }, { 'list', 'integer[]' } },
10527    signature = 'setpos({expr}, {list})',
10528    see_lua = {
10529      '|nvim_win_set_cursor()| for "." or |nvim_buf_set_mark()| for marks; special positions, `off`, and `curswant` differ',
10530    },
10531  },
10532  setqflist = {
10533    args = { 1, 3 },
10534    base = 1,
10535    desc = [=[
10536      Create or replace or add to the quickfix list.
10537
10538      If the optional {what} dictionary argument is supplied, then
10539      only the items listed in {what} are set.  The first {list}
10540      argument is ignored.  See below for the supported items in
10541      {what}.
10542      					*setqflist-what*
10543      When {what} is not present, the items in {list} are used.
10544      Each item must be a dictionary.  Non-dictionary items in
10545      {list} are ignored.  Each dictionary item can contain the
10546      following entries:
10547
10548          bufnr	buffer number; must be the number of a valid
10549      		buffer
10550          filename	name of a file; only used when "bufnr" is not
10551      		present or it is invalid.
10552          module	name of a module; if given it will be used in
10553      		quickfix error window instead of the filename.
10554          lnum	line number in the file
10555          end_lnum	end of lines, if the item spans multiple lines
10556          pattern	search pattern used to locate the error
10557          col		column number
10558          vcol	when non-zero: "col" is visual column
10559      		when zero: "col" is byte index
10560          end_col	end column, if the item spans multiple columns
10561          nr		error number
10562          text	description of the error
10563          type	single-character error type, 'E', 'W', etc.
10564          valid	recognized error message
10565          user_data
10566      		custom data associated with the item, can be
10567      		any type.
10568
10569      The "col", "vcol", "nr", "type" and "text" entries are
10570      optional.  Either "lnum" or "pattern" entry can be used to
10571      locate a matching error line.
10572      If the "filename" and "bufnr" entries are not present or
10573      neither the "lnum" or "pattern" entries are present, then the
10574      item will not be handled as an error line.
10575      If both "pattern" and "lnum" are present then "pattern" will
10576      be used.
10577      If the "valid" entry is not supplied, then the valid flag is
10578      set when "bufnr" is a valid buffer or "filename" exists.
10579      If you supply an empty {list}, the quickfix list will be
10580      cleared.
10581      Note that the list is not exactly the same as what
10582      |getqflist()| returns.
10583
10584      {action} values:		*setqflist-action* *E927*
10585      'a'	The items from {list} are added to the existing
10586      	quickfix list.  If there is no existing list, then a
10587      	new list is created.
10588
10589      'r'	The items from the current quickfix list are replaced
10590      	with the items from {list}.  This can also be used to
10591      	clear the list: >vim
10592      		call setqflist([], 'r')
10593      <
10594      'u'	Like 'r', but tries to preserve the current selection
10595      	in the quickfix list.  The entry nearest to the
10596      	previously selected one becomes the current entry.
10597      	Proximity is determined by comparing the file, then
10598      	the line number and then the column number.
10599      'f'	All the quickfix lists in the quickfix stack are
10600      	freed.
10601
10602      If {action} is not present or is set to ' ', then a new list
10603      is created.  The new quickfix list is added after the current
10604      quickfix list in the stack and all the following lists are
10605      freed.  To add a new quickfix list at the end of the stack,
10606      set "nr" in {what} to "$".
10607
10608      The following items can be specified in dictionary {what}:
10609          context	quickfix list context.  See |quickfix-context|
10610          efm		errorformat to use when parsing text from
10611      		"lines".  If this is not present, then the
10612      		'errorformat' option value is used.
10613      		See |quickfix-parse|
10614          id		quickfix list identifier |quickfix-ID|
10615          idx		index of the current entry in the quickfix
10616      		list specified by "id" or "nr".  If set to
10617      		'$', then the last entry in the list is set as
10618      		the current entry.  See |quickfix-index|
10619          items	list of quickfix entries.  Same as the {list}
10620      		argument.
10621          lines	use 'errorformat' to parse a list of lines and
10622      		add the resulting entries to the quickfix list
10623      		{nr} or {id}.  Only a |List| value is supported.
10624      		See |quickfix-parse|
10625          nr		list number in the quickfix stack; zero
10626      		means the current quickfix list and "$" means
10627      		the last quickfix list.
10628          quickfixtextfunc
10629      		function to get the text to display in the
10630      		quickfix window.  The value can be the name of
10631      		a function or a funcref or a lambda.  Refer to
10632      		|quickfix-window-function| for an explanation
10633      		of how to write the function and an example.
10634          title	quickfix list title text.  See |quickfix-title|
10635      Unsupported keys in {what} are ignored.
10636      If the "nr" item is not present, then the current quickfix
10637      list is modified.  When creating a new quickfix list, "nr" can
10638      be set to a value one greater than the quickfix stack size.
10639      When modifying a quickfix list, to guarantee that the correct
10640      list is modified, "id" should be used instead of "nr" to
10641      specify the list.
10642
10643      Examples (See also |setqflist-examples|): >vim
10644         call setqflist([], 'r', {'title': 'My search'})
10645         call setqflist([], 'r', {'nr': 2, 'title': 'Errors'})
10646         call setqflist([], 'a', {'id':qfid, 'lines':["F1:10:L10"]})
10647      <
10648      Returns zero for success, -1 for failure.
10649
10650      This function can be used to create a quickfix list
10651      independent of the 'errorformat' setting.  Use a command like
10652      `:cc 1` to jump to the first position.
10653
10654    ]=],
10655    name = 'setqflist',
10656    params = {
10657      { 'list', 'vim.quickfix.entry[]' },
10658      { 'action', 'string' },
10659      { 'what', 'vim.fn.setqflist.what' },
10660    },
10661    returns = 'integer',
10662    signature = 'setqflist({list} [, {action} [, {what}]])',
10663  },
10664  setreg = {
10665    args = { 2, 3 },
10666    base = 2,
10667    desc = [=[
10668      Set the register {regname} to {value}.
10669      If {regname} is "" or "@", the unnamed register '"' is used.
10670      The {regname} argument is a string.
10671
10672      {value} may be any value returned by |getreg()| or
10673      |getreginfo()|, including a |List| or |Dict|.
10674      If {options} contains "a" or {regname} is upper case,
10675      then the value is appended.
10676
10677      {options} can also contain a register type specification:
10678          "c" or "v"	      |charwise| mode
10679          "l" or "V"	      |linewise| mode
10680          "b" or "<CTRL-V>" |blockwise-visual| mode
10681      If a number immediately follows "b" or "<CTRL-V>" then this is
10682      used as the width of the selection - if it is not specified
10683      then the width of the block is set to the number of characters
10684      in the longest line (counting a <Tab> as 1 character).
10685      If {options} contains "u" or '"', then the unnamed register is
10686      set to point to register {regname}.
10687
10688      If {options} contains no register settings, then the default
10689      is to use character mode unless {value} ends in a <NL> for
10690      string {value} and linewise mode for list {value}.  Blockwise
10691      mode is never selected automatically.
10692      Returns zero for success, non-zero for failure.
10693
10694      					*E883*
10695      Note: you may not use |List| containing more than one item to
10696            set search and expression registers.  Lists containing
10697            no items act like empty strings.
10698
10699      Examples: >vim
10700      	call setreg(v:register, @*)
10701      	call setreg('*', @%, 'ac')
10702      	call setreg('a', "1\n2\n3", 'b5')
10703      	call setreg('"', { 'points_to': 'a'})
10704
10705      <This example shows using the functions to save and restore a
10706      register: >vim
10707      	let var_a = getreginfo()
10708      	call setreg('a', var_a)
10709      <or: >vim
10710      	let var_a = getreg('a', 1, 1)
10711      	let var_amode = getregtype('a')
10712      	" ....
10713      	call setreg('a', var_a, var_amode)
10714      <Note: you may not reliably restore register value
10715      without using the third argument to |getreg()| as without it
10716      newlines are represented as newlines AND Nul bytes are
10717      represented as newlines as well, see |NL-used-for-Nul|.
10718
10719      You can also change the type of a register by appending
10720      nothing: >vim
10721      	call setreg('a', '', 'al')
10722      <
10723    ]=],
10724    name = 'setreg',
10725    params = { { 'regname', 'string' }, { 'value', 'any' }, { 'options', 'string' } },
10726    signature = 'setreg({regname}, {value} [, {options}])',
10727  },
10728  settabvar = {
10729    args = 3,
10730    base = 3,
10731    desc = [=[
10732      Set tab-local variable {varname} to {val} in tabpage {tabnr}.
10733      |t:var|
10734      The {varname} argument is a string.
10735      Note that the variable name without "t:" must be used.
10736      Tabs are numbered starting with one.
10737      This function is not available in the |sandbox|.
10738
10739    ]=],
10740    name = 'settabvar',
10741    params = { { 'tabnr', 'integer' }, { 'varname', 'string' }, { 'val', 'any' } },
10742    signature = 'settabvar({tabnr}, {varname}, {val})',
10743    see_lua = { '|nvim_tabpage_set_var()|', '|vim.t|' },
10744  },
10745  settabwinvar = {
10746    args = 4,
10747    base = 4,
10748    desc = [=[
10749      Set option or local variable {varname} in window {winnr} to
10750      {val}.
10751      Tabs are numbered starting with one.  For the current tabpage
10752      use |setwinvar()|.
10753      {winnr} is a |window-number| or |window-ID|.
10754      When {winnr} is zero the current window is used.
10755      This also works for a global or local buffer option, but it
10756      doesn't work for a global or local buffer variable.
10757      For a local buffer option the global value is unchanged.
10758      Note that the variable name without "w:" must be used.
10759      Examples: >vim
10760      	call settabwinvar(1, 1, "&list", 0)
10761      	call settabwinvar(3, 2, "myvar", "foobar")
10762      <This function is not available in the |sandbox|.
10763
10764    ]=],
10765    name = 'settabwinvar',
10766    params = {
10767      { 'tabnr', 'integer' },
10768      { 'winnr', 'integer' },
10769      { 'varname', 'string' },
10770      { 'val', 'any' },
10771    },
10772    signature = 'settabwinvar({tabnr}, {winnr}, {varname}, {val})',
10773    see_lua = {
10774      '|nvim_win_set_var()| or |vim.w| after resolving {tabnr} and {winnr} to a winid; option names use |nvim_set_option_value()|',
10775    },
10776  },
10777  settagstack = {
10778    args = { 2, 3 },
10779    base = 2,
10780    desc = [=[
10781      Modify the tag stack of the window {nr} (|window-number| or
10782      |window-ID|) using {dict}.
10783
10784      For a list of supported items in {dict}, refer to
10785      |gettagstack()|.  "curidx" takes effect before changing the tag
10786      stack.
10787      					*E962*
10788      How the tag stack is modified depends on the {action}
10789      argument:
10790      - If {action} is not present or is set to 'r', then the tag
10791        stack is replaced.
10792      - If {action} is set to 'a', then new entries from {dict} are
10793        pushed (added) onto the tag stack.
10794      - If {action} is set to 't', then all the entries from the
10795        current entry in the tag stack or "curidx" in {dict} are
10796        removed and then new entries are pushed to the stack.
10797
10798      The current index is set to one after the length of the tag
10799      stack after the modification.
10800
10801      Returns zero for success, -1 for failure.
10802
10803      Examples (for more examples see |tagstack-examples|):
10804          Empty the tag stack of window 3: >vim
10805      	call settagstack(3, {'items' : []})
10806
10807      <    Save and restore the tag stack: >vim
10808      	let stack = gettagstack(1003)
10809      	" do something else
10810      	call settagstack(1003, stack)
10811      	unlet stack
10812      <
10813    ]=],
10814    name = 'settagstack',
10815    params = { { 'nr', 'integer' }, { 'dict', 'any' }, { 'action', 'string' } },
10816    signature = 'settagstack({nr}, {dict} [, {action}])',
10817  },
10818  setwinvar = {
10819    args = 3,
10820    base = 3,
10821    desc = [=[
10822      Like |settabwinvar()| for the current tabpage.
10823      Examples: >vim
10824      	call setwinvar(1, "&list", 0)
10825      	call setwinvar(2, "myvar", "foobar")
10826      <
10827    ]=],
10828    name = 'setwinvar',
10829    params = { { 'nr', 'integer' }, { 'varname', 'string' }, { 'val', 'any' } },
10830    signature = 'setwinvar({nr}, {varname}, {val})',
10831    see_lua = {
10832      '|nvim_win_set_var()| or |vim.w| after resolving {nr} to a winid; option names use |nvim_set_option_value()|',
10833    },
10834  },
10835  sha256 = {
10836    args = 1,
10837    base = 1,
10838    desc = [=[
10839      Returns a String with 64 hex characters, which is the SHA256
10840      checksum of {expr}.
10841      {expr} is a String or a Blob.
10842
10843    ]=],
10844    name = 'sha256',
10845    params = { { 'expr', 'string' } },
10846    returns = 'string',
10847    signature = 'sha256({expr})',
10848  },
10849  shellescape = {
10850    args = { 1, 2 },
10851    base = 1,
10852    desc = [=[
10853      Escape {string} for use as a shell command argument.
10854
10855      On Windows when 'shellslash' is not set, encloses {string} in
10856      double-quotes and doubles all double-quotes within {string}.
10857      Otherwise encloses {string} in single-quotes and replaces all
10858      "'" with "'\''".
10859
10860      The {special} argument adds additional escaping of keywords
10861      used in Vim commands. If it is a |non-zero-arg|:
10862      - Special items such as "!", "%", "#" and "<cword>" (as listed
10863        in |expand()|) will be preceded by a backslash.
10864        The backslash will be removed again by the |:!| command.
10865      - The <NL> character is escaped.
10866
10867      If 'shell' contains "csh" in the tail:
10868      - The "!" character will be escaped. This is because csh and
10869        tcsh use "!" for history replacement even in single-quotes.
10870      - The <NL> character is escaped (twice if {special} is
10871        a |non-zero-arg|).
10872
10873      If 'shell' contains "fish" in the tail, the "\" character will
10874      be escaped because in fish it is used as an escape character
10875      inside single quotes.
10876
10877      Example of use with a |:!| command: >vim
10878          exe '!dir ' .. shellescape(expand('<cfile>'), 1)
10879      <This results in a directory listing for the file under the
10880      cursor.  Example of use with |system()|: >vim
10881          call system("chmod +w -- " .. shellescape(expand("%")))
10882      <See also |::S|.
10883
10884    ]=],
10885    name = 'shellescape',
10886    params = { { 'string', 'string' }, { 'special', 'boolean' } },
10887    returns = 'string',
10888    signature = 'shellescape({string} [, {special}])',
10889    see_lua = {
10890      '|vim.system()| with list args to avoid shell escaping; `:!` and {special} semantics differ',
10891    },
10892  },
10893  shiftwidth = {
10894    args = { 0, 1 },
10895    base = 1,
10896    desc = [=[
10897      Returns the effective value of 'shiftwidth'.  This is the
10898      'shiftwidth' value unless it is zero, in which case it is the
10899      'tabstop' value.  To be backwards compatible in indent
10900      plugins, use this: >vim
10901      	if exists('*shiftwidth')
10902      	  func s:sw()
10903      	    return shiftwidth()
10904      	  endfunc
10905      	else
10906      	  func s:sw()
10907      	    return &sw
10908      	  endfunc
10909      	endif
10910      <And then use s:sw() instead of &sw.
10911
10912      for which to return the 'shiftwidth' value.  This matters for
10913      the 'vartabstop' feature.  If the 'vartabstop' setting is
10914      enabled and no {col} argument is given, column 1 will be
10915      assumed.
10916
10917    ]=],
10918    name = 'shiftwidth',
10919    params = { { 'col', 'integer' } },
10920    signature = 'shiftwidth([{col}])',
10921    returns = 'integer',
10922    see_lua = {
10923      "|vim.bo| for simple cases: `vim.bo.shiftwidth > 0 and vim.bo.shiftwidth or vim.bo.tabstop`; `{col}` and 'vartabstop' semantics differ",
10924    },
10925  },
10926  sign_define = {
10927    args = { 1, 2 },
10928    base = 1,
10929    name = 'sign_define',
10930    params = { { 'name', 'string' }, { 'dict', 'vim.fn.sign_define.dict' } },
10931    signature = 'sign_define({name} [, {dict}])',
10932    returns = '0|-1',
10933    see_lua = false,
10934  },
10935  sign_define__1 = {
10936    args = { 1, 2 },
10937    base = 1,
10938    desc = [=[
10939      Define a new sign named {name} or modify the attributes of an
10940      existing sign.  This is similar to the |:sign-define| command.
10941
10942      Prefix {name} with a unique text to avoid name collisions.
10943      There is no {group} like with placing signs.
10944
10945      The {name} can be a String or a Number.  The optional {dict}
10946      argument specifies the sign attributes.  The following values
10947      are supported:
10948         icon		full path to the bitmap file for the sign.
10949         linehl	highlight group used for the whole line the
10950      		sign is placed in.
10951         priority	default priority value of the sign
10952         numhl	highlight group used for the line number where
10953      		the sign is placed.
10954         text		text that is displayed when there is no icon
10955      		or the GUI is not being used.
10956         texthl	highlight group used for the text item
10957         culhl	highlight group used for the text item when
10958      		the cursor is on the same line as the sign and
10959      		'cursorline' is enabled.
10960
10961      If the sign named {name} already exists, then the attributes
10962      of the sign are updated.
10963
10964      The one argument {list} can be used to define a list of signs.
10965      Each list item is a dictionary with the above items in {dict}
10966      and a "name" item for the sign name.
10967
10968      Returns 0 on success and -1 on failure.  When the one argument
10969      {list} is used, then returns a List of values one for each
10970      defined sign.
10971
10972      Examples: >vim
10973      	call sign_define("mySign", {
10974      		\ "text" : "=>",
10975      		\ "texthl" : "Error",
10976      		\ "linehl" : "Search"})
10977      	call sign_define([
10978      		\ {'name' : 'sign1',
10979      		\  'text' : '=>'},
10980      		\ {'name' : 'sign2',
10981      		\  'text' : '!!'}
10982      		\ ])
10983      <
10984    ]=],
10985    name = 'sign_define',
10986    params = { { 'list', 'vim.fn.sign_define.dict[]' } },
10987    signature = 'sign_define({list})',
10988    returns = '(0|-1)[]',
10989    see_lua = false,
10990  },
10991  sign_getdefined = {
10992    args = { 0, 1 },
10993    base = 1,
10994    desc = [=[
10995      Get a list of defined signs and their attributes.
10996      This is similar to the |:sign-list| command.
10997
10998      If the {name} is not supplied, then a list of all the defined
10999      signs is returned.  Otherwise the attribute of the specified
11000      sign is returned.
11001
11002      Each list item in the returned value is a dictionary with the
11003      following entries:
11004         icon		full path to the bitmap file of the sign
11005         linehl	highlight group used for the whole line the
11006      		sign is placed in; not present if not set.
11007         name		name of the sign
11008         priority	default priority value of the sign
11009         numhl	highlight group used for the line number where
11010      		the sign is placed; not present if not set.
11011         text		text that is displayed when there is no icon
11012      		or the GUI is not being used.
11013         texthl	highlight group used for the text item; not
11014      		present if not set.
11015         culhl	highlight group used for the text item when
11016      		the cursor is on the same line as the sign and
11017      		'cursorline' is enabled; not present if not
11018      		set.
11019
11020      Returns an empty List if there are no signs and when {name} is
11021      not found.
11022
11023      Examples: >vim
11024      	" Get a list of all the defined signs
11025      	echo sign_getdefined()
11026
11027      	" Get the attribute of the sign named mySign
11028      	echo sign_getdefined("mySign")
11029      <
11030    ]=],
11031    name = 'sign_getdefined',
11032    params = { { 'name', 'string' } },
11033    signature = 'sign_getdefined([{name}])',
11034    returns = 'vim.fn.sign_getdefined.ret.item[]',
11035    see_lua = false,
11036  },
11037  sign_getplaced = {
11038    args = { 0, 2 },
11039    base = 1,
11040    desc = [=[
11041      Return a list of signs placed in a buffer or all the buffers.
11042      This is similar to the |:sign-place-list| command.
11043
11044      If the optional buffer name {buf} is specified, then only the
11045      list of signs placed in that buffer is returned.  For the use
11046      of {buf}, see |bufname()|.  The optional {dict} can contain
11047      the following entries:
11048         group	select only signs in this group
11049         id		select sign with this identifier
11050         lnum		select signs placed in this line.  For the use
11051      		of {lnum}, see |line()|.
11052      If {group} is "*", then signs in all the groups including the
11053      global group are returned.  If {group} is not supplied or is
11054      an empty string, then only signs in the global group are
11055      returned.  If no arguments are supplied, then signs in the
11056      global group placed in all the buffers are returned.
11057      See |sign-group|.
11058
11059      Each list item in the returned value is a dictionary with the
11060      following entries:
11061      	bufnr	number of the buffer with the sign
11062      	signs	list of signs placed in {bufnr}.  Each list
11063      		item is a dictionary with the below listed
11064      		entries
11065
11066      The dictionary for each sign contains the following entries:
11067      	group	 sign group.  Set to '' for the global group.
11068      	id	 identifier of the sign
11069      	lnum	 line number where the sign is placed
11070      	name	 name of the defined sign
11071      	priority sign priority
11072
11073      The returned signs in a buffer are ordered by their line
11074      number and priority.
11075
11076      Returns an empty list on failure or if there are no placed
11077      signs.
11078
11079      Examples: >vim
11080      	" Get a List of signs placed in eval.c in the
11081      	" global group
11082      	echo sign_getplaced("eval.c")
11083
11084      	" Get a List of signs in group 'g1' placed in eval.c
11085      	echo sign_getplaced("eval.c", {'group' : 'g1'})
11086
11087      	" Get a List of signs placed at line 10 in eval.c
11088      	echo sign_getplaced("eval.c", {'lnum' : 10})
11089
11090      	" Get sign with identifier 10 placed in a.py
11091      	echo sign_getplaced("a.py", {'id' : 10})
11092
11093      	" Get sign with id 20 in group 'g1' placed in a.py
11094      	echo sign_getplaced("a.py", {'group' : 'g1',
11095      					\  'id' : 20})
11096
11097      	" Get a List of all the placed signs
11098      	echo sign_getplaced()
11099      <
11100    ]=],
11101    name = 'sign_getplaced',
11102    params = { { 'buf', 'integer|string' }, { 'dict', 'vim.fn.sign_getplaced.dict' } },
11103    signature = 'sign_getplaced([{buf} [, {dict}]])',
11104    returns = 'vim.fn.sign_getplaced.ret.item[]',
11105    see_lua = false,
11106  },
11107  sign_jump = {
11108    args = 3,
11109    base = 1,
11110    desc = [=[
11111      Open the buffer {buf} or jump to the window that contains
11112      {buf} and position the cursor at sign {id} in group {group}.
11113      This is similar to the |:sign-jump| command.
11114
11115      If {group} is an empty string, then the global group is used.
11116      For the use of {buf}, see |bufname()|.
11117
11118      Returns the line number of the sign.  Returns -1 if the
11119      arguments are invalid.
11120
11121      Example: >vim
11122      	" Jump to sign 10 in the current buffer
11123      	call sign_jump(10, '', '')
11124      <
11125    ]=],
11126    name = 'sign_jump',
11127    params = { { 'id', 'integer' }, { 'group', 'string' }, { 'buf', 'integer|string' } },
11128    signature = 'sign_jump({id}, {group}, {buf})',
11129    returns = 'integer',
11130    see_lua = false,
11131  },
11132  sign_place = {
11133    args = { 4, 5 },
11134    base = 1,
11135    desc = [=[
11136      Place the sign defined as {name} at line {lnum} in file or
11137      buffer {buf} and assign {id} and {group} to sign.  This is
11138      similar to the |:sign-place| command.
11139
11140      If the sign identifier {id} is zero, then a new identifier is
11141      allocated.  Otherwise the specified number is used.  {group}
11142      is the sign group name.  To use the global sign group, use an
11143      empty string.  {group} functions as a namespace for {id}, thus
11144      two groups can use the same IDs.  Refer to |sign-identifier|
11145      and |sign-group| for more information.
11146
11147      {name} refers to a defined sign.
11148      {buf} refers to a buffer name or number.  For the accepted
11149      values, see |bufname()|.
11150
11151      The optional {dict} argument supports the following entries:
11152      	lnum		line number in the file or buffer
11153      			{buf} where the sign is to be placed.
11154      			For the accepted values, see |line()|.
11155      	priority	priority of the sign.  See
11156      			|sign-priority| for more information.
11157
11158      If the optional {dict} is not specified, then it modifies the
11159      placed sign {id} in group {group} to use the defined sign
11160      {name}.
11161
11162      Returns the sign identifier on success and -1 on failure.
11163
11164      Examples: >vim
11165      	" Place a sign named sign1 with id 5 at line 20 in
11166      	" buffer json.c
11167      	call sign_place(5, '', 'sign1', 'json.c',
11168      					\ {'lnum' : 20})
11169
11170      	" Updates sign 5 in buffer json.c to use sign2
11171      	call sign_place(5, '', 'sign2', 'json.c')
11172
11173      	" Place a sign named sign3 at line 30 in
11174      	" buffer json.c with a new identifier
11175      	let id = sign_place(0, '', 'sign3', 'json.c',
11176      					\ {'lnum' : 30})
11177
11178      	" Place a sign named sign4 with id 10 in group 'g3'
11179      	" at line 40 in buffer json.c with priority 90
11180      	call sign_place(10, 'g3', 'sign4', 'json.c',
11181      			\ {'lnum' : 40, 'priority' : 90})
11182      <
11183    ]=],
11184    name = 'sign_place',
11185    params = {
11186      { 'id', 'integer' },
11187      { 'group', 'string' },
11188      { 'name', 'string' },
11189      { 'buf', 'integer|string' },
11190      { 'dict', 'vim.fn.sign_place.dict' },
11191    },
11192    signature = 'sign_place({id}, {group}, {name}, {buf} [, {dict}])',
11193    returns = 'integer',
11194    see_lua = false,
11195  },
11196  sign_placelist = {
11197    args = 1,
11198    base = 1,
11199    desc = [=[
11200      Place one or more signs.  This is similar to the
11201      |sign_place()| function.  The {list} argument specifies the
11202      List of signs to place.  Each list item is a dict with the
11203      following sign attributes:
11204          buffer	Buffer name or number.  For the accepted
11205      		values, see |bufname()|.
11206          group	Sign group.  {group} functions as a namespace
11207      		for {id}, thus two groups can use the same
11208      		IDs.  If not specified or set to an empty
11209      		string, then the global group is used.   See
11210      		|sign-group| for more information.
11211          id		Sign identifier.  If not specified or zero,
11212      		then a new unique identifier is allocated.
11213      		Otherwise the specified number is used.  See
11214      		|sign-identifier| for more information.
11215          lnum	Line number in the buffer where the sign is to
11216      		be placed.  For the accepted values, see
11217      		|line()|.
11218          name	Name of the sign to place.  See |sign_define()|
11219      		for more information.
11220          priority	Priority of the sign.  When multiple signs are
11221      		placed on a line, the sign with the highest
11222      		priority is used.  If not specified, the
11223      		default value of 10 is used, unless specified
11224      		otherwise by the sign definition.  See
11225      		|sign-priority| for more information.
11226
11227      If {id} refers to an existing sign, then the existing sign is
11228      modified to use the specified {name} and/or {priority}.
11229
11230      Returns a List of sign identifiers.  If failed to place a
11231      sign, the corresponding list item is set to -1.
11232
11233      Examples: >vim
11234      	" Place sign s1 with id 5 at line 20 and id 10 at line
11235      	" 30 in buffer a.c
11236      	let [n1, n2] = sign_placelist([
11237      		\ {'id' : 5,
11238      		\  'name' : 's1',
11239      		\  'buffer' : 'a.c',
11240      		\  'lnum' : 20},
11241      		\ {'id' : 10,
11242      		\  'name' : 's1',
11243      		\  'buffer' : 'a.c',
11244      		\  'lnum' : 30}
11245      		\ ])
11246
11247      	" Place sign s1 in buffer a.c at line 40 and 50
11248      	" with auto-generated identifiers
11249      	let [n1, n2] = sign_placelist([
11250      		\ {'name' : 's1',
11251      		\  'buffer' : 'a.c',
11252      		\  'lnum' : 40},
11253      		\ {'name' : 's1',
11254      		\  'buffer' : 'a.c',
11255      		\  'lnum' : 50}
11256      		\ ])
11257      <
11258    ]=],
11259    name = 'sign_placelist',
11260    params = { { 'list', 'vim.fn.sign_placelist.list.item[]' } },
11261    signature = 'sign_placelist({list})',
11262    returns = 'integer[]',
11263    see_lua = false,
11264  },
11265  sign_undefine = {
11266    args = { 0, 1 },
11267    base = 1,
11268    name = 'sign_undefine',
11269    params = { { 'name', 'string' } },
11270    signature = 'sign_undefine([{name}])',
11271    returns = '0|-1',
11272    see_lua = false,
11273  },
11274  sign_undefine__1 = {
11275    args = { 0, 1 },
11276    base = 1,
11277    desc = [=[
11278      Deletes a previously defined sign {name}.  This is similar to
11279      the |:sign-undefine| command.  If {name} is not supplied, then
11280      deletes all the defined signs.
11281
11282      The one argument {list} can be used to undefine a list of
11283      signs.  Each list item is the name of a sign.
11284
11285      Returns 0 on success and -1 on failure.  For the one argument
11286      {list} call, returns a list of values one for each undefined
11287      sign.
11288
11289      Examples: >vim
11290      	" Delete a sign named mySign
11291      	call sign_undefine("mySign")
11292
11293      	" Delete signs 'sign1' and 'sign2'
11294      	call sign_undefine(["sign1", "sign2"])
11295
11296      	" Delete all the signs
11297      	call sign_undefine()
11298      <
11299    ]=],
11300    name = 'sign_undefine',
11301    params = { { 'list', 'string[]' } },
11302    signature = 'sign_undefine({list})',
11303    returns = 'integer[]',
11304    see_lua = false,
11305  },
11306  sign_unplace = {
11307    args = { 1, 2 },
11308    base = 1,
11309    desc = [=[
11310      Remove a previously placed sign in one or more buffers.  This
11311      is similar to the |:sign-unplace| command.
11312
11313      {group} is the sign group name.  To use the global sign group,
11314      use an empty string.  If {group} is set to "*", then all the
11315      groups including the global group are used.
11316      The signs in {group} are selected based on the entries in
11317      {dict}.  The following optional entries in {dict} are
11318      supported:
11319      	buffer	buffer name or number.  See |bufname()|.
11320      	id	sign identifier
11321      If {dict} is not supplied, then all the signs in {group} are
11322      removed.
11323
11324      Returns 0 on success and -1 on failure.
11325
11326      Examples: >vim
11327      	" Remove sign 10 from buffer a.vim
11328      	call sign_unplace('', {'buffer' : "a.vim", 'id' : 10})
11329
11330      	" Remove sign 20 in group 'g1' from buffer 3
11331      	call sign_unplace('g1', {'buffer' : 3, 'id' : 20})
11332
11333      	" Remove all the signs in group 'g2' from buffer 10
11334      	call sign_unplace('g2', {'buffer' : 10})
11335
11336      	" Remove sign 30 in group 'g3' from all the buffers
11337      	call sign_unplace('g3', {'id' : 30})
11338
11339      	" Remove all the signs placed in buffer 5
11340      	call sign_unplace('*', {'buffer' : 5})
11341
11342      	" Remove the signs in group 'g4' from all the buffers
11343      	call sign_unplace('g4')
11344
11345      	" Remove sign 40 from all the buffers
11346      	call sign_unplace('*', {'id' : 40})
11347
11348      	" Remove all the placed signs from all the buffers
11349      	call sign_unplace('*')
11350      <
11351    ]=],
11352    name = 'sign_unplace',
11353    params = { { 'group', 'string' }, { 'dict', 'vim.fn.sign_unplace.dict' } },
11354    signature = 'sign_unplace({group} [, {dict}])',
11355    returns = '0|-1',
11356    see_lua = false,
11357  },
11358  sign_unplacelist = {
11359    args = 1,
11360    base = 1,
11361    desc = [=[
11362      Remove previously placed signs from one or more buffers.  This
11363      is similar to the |sign_unplace()| function.
11364
11365      The {list} argument specifies the List of signs to remove.
11366      Each list item is a dict with the following sign attributes:
11367          buffer	buffer name or number.  For the accepted
11368      		values, see |bufname()|.  If not specified,
11369      		then the specified sign is removed from all
11370      		the buffers.
11371          group	sign group name.  If not specified or set to an
11372      		empty string, then the global sign group is
11373      		used.  If set to "*", then all the groups
11374      		including the global group are used.
11375          id		sign identifier.  If not specified, then all
11376      		the signs in the specified group are removed.
11377
11378      Returns a List where an entry is set to 0 if the corresponding
11379      sign was successfully removed or -1 on failure.
11380
11381      Example: >vim
11382      	" Remove sign with id 10 from buffer a.vim and sign
11383      	" with id 20 from buffer b.vim
11384      	call sign_unplacelist([
11385      		\ {'id' : 10, 'buffer' : "a.vim"},
11386      		\ {'id' : 20, 'buffer' : 'b.vim'},
11387      		\ ])
11388      <
11389    ]=],
11390    name = 'sign_unplacelist',
11391    params = { { 'list', 'vim.fn.sign_unplacelist.list.item' } },
11392    signature = 'sign_unplacelist({list})',
11393    returns = '(0|-1)[]',
11394    see_lua = false,
11395  },
11396  simplify = {
11397    args = 1,
11398    base = 1,
11399    desc = [=[
11400      Simplify the file name as much as possible without changing
11401      the meaning.  Shortcuts (on MS-Windows) or symbolic links (on
11402      Unix) are not resolved.  If the first path component in
11403      {filename} designates the current directory, this will be
11404      valid for the result as well.  A trailing path separator is
11405      not removed either.  On Unix "//path" is unchanged, but
11406      "///path" is simplified to "/path" (this follows the Posix
11407      standard).
11408      Example: >vim
11409      	simplify("./dir/.././/file/") == "./file/"
11410      <Note: The combination "dir/.." is only removed if "dir" is
11411      a searchable directory or does not exist.  On Unix, it is also
11412      removed when "dir" is a symbolic link within the same
11413      directory.  In order to resolve all the involved symbolic
11414      links before simplifying the path name, use |resolve()|.
11415
11416    ]=],
11417    name = 'simplify',
11418    params = { { 'filename', 'string' } },
11419    returns = 'string',
11420    signature = 'simplify({filename})',
11421    see_lua = {
11422      '|vim.fs.normalize()|; `~`/$VAR expansion and leading `./` or trailing `/` handling differ',
11423    },
11424  },
11425  sin = {
11426    args = 1,
11427    base = 1,
11428    desc = [=[
11429      Return the sine of {expr}, measured in radians, as a |Float|.
11430      {expr} must evaluate to a |Float| or a |Number|.
11431      Returns 0.0 if {expr} is not a |Float| or a |Number|.
11432      Examples: >vim
11433      	echo sin(100)
11434      <	-0.506366 >vim
11435      	echo sin(-4.01)
11436      <	0.763301
11437
11438    ]=],
11439    func_float = 'sin',
11440    name = 'sin',
11441    params = { { 'expr', 'number' } },
11442    returns = 'number',
11443    signature = 'sin({expr})',
11444    see_lua = { '|math.sin()|' },
11445  },
11446  sinh = {
11447    args = 1,
11448    base = 1,
11449    desc = [=[
11450      Return the hyperbolic sine of {expr} as a |Float| in the range
11451      [-inf, inf].
11452      {expr} must evaluate to a |Float| or a |Number|.
11453      Returns 0.0 if {expr} is not a |Float| or a |Number|.
11454      Examples: >vim
11455      	echo sinh(0.5)
11456      <	0.521095 >vim
11457      	echo sinh(-0.9)
11458      <	-1.026517
11459
11460    ]=],
11461    func_float = 'sinh',
11462    name = 'sinh',
11463    params = { { 'expr', 'number' } },
11464    signature = 'sinh({expr})',
11465    see_lua = { '|math.sinh()|' },
11466  },
11467  slice = {
11468    args = { 2, 3 },
11469    base = 1,
11470    desc = [=[
11471      Similar to using a |slice| "expr[start : end]", but "end" is
11472      used exclusive.  And for a string the indexes are used as
11473      character indexes instead of byte indexes.
11474      Also, composing characters are treated as a part of the
11475      preceding base character.
11476      When {end} is omitted the slice continues to the last item.
11477      When {end} is -1 the last item is omitted.
11478      Returns an empty value if {start} or {end} are invalid.
11479
11480    ]=],
11481    name = 'slice',
11482    params = { { 'expr', 'any' }, { 'start', 'integer' }, { 'end', 'integer' } },
11483    signature = 'slice({expr}, {start} [, {end}])',
11484  },
11485  sockconnect = {
11486    args = { 2, 3 },
11487    desc = [=[
11488      Connect a socket to an address. If {mode} is "pipe" then
11489      {address} should be the path of a local domain socket (on
11490      unix) or named pipe (on Windows). If {mode} is "tcp" then
11491      {address} should be of the form "host:port" where the host
11492      should be an ip address or host name, and port the port
11493      number.
11494
11495      For "pipe" mode, see |luv-pipe-handle|. For "tcp" mode, see
11496      |luv-tcp-handle|.
11497
11498      Returns a |channel| ID. Close the socket with |chanclose()|.
11499      Use |chansend()| to send data over a bytes socket, and
11500      |rpcrequest()| and |rpcnotify()| to communicate with a RPC
11501      socket.
11502
11503      {opts} is an optional dictionary with these keys:
11504        |on_data| : callback invoked when data was read from socket
11505        data_buffered : read socket data in |channel-buffered| mode.
11506        rpc     : If set, |msgpack-rpc| will be used to communicate
11507      	    over the socket.
11508      Returns:
11509        - The channel ID on success (greater than zero)
11510        - 0 on invalid arguments or connection failure.
11511    ]=],
11512    name = 'sockconnect',
11513    params = { { 'mode', 'string' }, { 'address', 'string' }, { 'opts', 'table' } },
11514    signature = 'sockconnect({mode}, {address} [, {opts}])',
11515  },
11516  sort = {
11517    args = { 1, 3 },
11518    base = 1,
11519    tags = { 'E702' },
11520    desc = [=[
11521      Sort the items in {list} in-place.  Returns {list}.
11522
11523      If you want a list to remain unmodified make a copy first: >vim
11524      	let sortedlist = sort(copy(mylist))
11525
11526      <When {how} is omitted or is a string, then sort() uses the
11527      string representation of each item to sort on.  Numbers sort
11528      after Strings, |Lists| after Numbers.  For sorting text in the
11529      current buffer use |:sort|.
11530
11531      When {how} is given and it is 'i' then case is ignored.
11532      For backwards compatibility, the value one can be used to
11533      ignore case.  Zero means to not ignore case.
11534
11535      When {how} is given and it is 'l' then the current collation
11536      locale is used for ordering.  Implementation details:
11537      strcoll() is used to compare strings.  See |:language| to check
11538      or set the collation locale.  |v:collate| can also be used to
11539      check the current locale.  Sorting using the locale typically
11540      ignores case.  Example: >vim
11541      	" ö is sorted similarly to o with English locale.
11542      	language collate en_US.UTF8
11543      	echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l')
11544      <	['n', 'o', 'O', 'ö', 'p', 'z'] ~
11545      >vim
11546      	" ö is sorted after z with Swedish locale.
11547      	language collate sv_SE.UTF8
11548      	echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l')
11549      <	['n', 'o', 'O', 'p', 'z', 'ö'] ~
11550      This does not work properly on Mac.
11551
11552      When {how} is given and it is 'n' then all items will be
11553      sorted numerical (Implementation detail: this uses the
11554      strtod() function to parse numbers, Strings, Lists, Dicts and
11555      Funcrefs will be considered as being 0).
11556
11557      When {how} is given and it is 'N' then all items will be
11558      sorted numerical.  This is like 'n' but a string containing
11559      digits will be used as the number they represent.
11560
11561      When {how} is given and it is 'f' then all items will be
11562      sorted numerical.  All values must be a Number or a Float.
11563
11564      When {how} is a |Funcref| or a function name, this function
11565      is called to compare items.  The function is invoked with two
11566      items as argument and must return zero if they are equal, 1 or
11567      bigger if the first one sorts after the second one, -1 or
11568      smaller if the first one sorts before the second one.
11569
11570      {dict} is for functions with the "dict" attribute.  It will be
11571      used to set the local variable "self". |Dictionary-function|
11572
11573      The sort is stable, items which compare equal (as number or as
11574      string) will keep their relative position.  E.g., when sorting
11575      on numbers, text strings will sort next to each other, in the
11576      same order as they were originally.
11577
11578
11579      Example: >vim
11580      	func MyCompare(i1, i2)
11581      	   return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1
11582      	endfunc
11583      	eval mylist->sort("MyCompare")
11584      <A shorter compare version for this specific simple case, which
11585      ignores overflow: >vim
11586      	func MyCompare(i1, i2)
11587      	   return a:i1 - a:i2
11588      	endfunc
11589      <For a simple expression you can use a lambda: >vim
11590      	eval mylist->sort({i1, i2 -> i1 - i2})
11591      <
11592    ]=],
11593    name = 'sort',
11594    generics = { 'T' },
11595    params = { { 'list', 'T[]' }, { 'how', 'string|function' }, { 'dict', 'any' } },
11596    returns = 'T[]',
11597    signature = 'sort({list} [, {how} [, {dict}]])',
11598    see_lua = {
11599      "|table.sort()| with a custom comparator; it is not stable and Vim's `i`/`l`/`n`/`N`/`f` modes differ",
11600    },
11601  },
11602  soundfold = {
11603    args = 1,
11604    base = 1,
11605    desc = [=[
11606      Return the sound-folded equivalent of {word}.  Uses the first
11607      language in 'spelllang' for the current window that supports
11608      soundfolding.  'spell' must be set.  When no sound folding is
11609      possible the {word} is returned unmodified.
11610      This can be used for making spelling suggestions.  Note that
11611      the method can be quite slow.
11612
11613    ]=],
11614    name = 'soundfold',
11615    params = { { 'word', 'string' } },
11616    returns = 'string',
11617    signature = 'soundfold({word})',
11618  },
11619  spellbadword = {
11620    args = { 0, 1 },
11621    base = 1,
11622    desc = [=[
11623      Without argument: The result is the badly spelled word under
11624      or after the cursor.  The cursor is moved to the start of the
11625      bad word.  When no bad word is found in the cursor line the
11626      result is an empty string and the cursor doesn't move.
11627
11628      With argument: The result is the first word in {sentence} that
11629      is badly spelled.  If there are no spelling mistakes the
11630      result is an empty string.
11631
11632      The return value is a list with two items:
11633      - The badly spelled word or an empty string.
11634      - The type of the spelling error:
11635      	"bad"		spelling mistake
11636      	"rare"		rare word
11637      	"local"		word only valid in another region
11638      	"caps"		word should start with Capital
11639      Example: >vim
11640      	echo spellbadword("the quik brown fox")
11641      <	['quik', 'bad'] ~
11642
11643      The spelling information for the current window and the value
11644      of 'spelllang' are used.
11645
11646    ]=],
11647    name = 'spellbadword',
11648    params = { { 'sentence', 'string' } },
11649    signature = 'spellbadword([{sentence}])',
11650    see_lua = {
11651      '|vim.spell.check()| for string input; it returns all matches with positions, not just the first one or cursor-moving behavior',
11652    },
11653  },
11654  spellsuggest = {
11655    args = { 1, 3 },
11656    base = 1,
11657    desc = [=[
11658      Return a |List| with spelling suggestions to replace {word}.
11659      When {max} is given up to this number of suggestions are
11660      returned.  Otherwise up to 25 suggestions are returned.
11661
11662      When the {capital} argument is given and it's non-zero only
11663      suggestions with a leading capital will be given.  Use this
11664      after a match with 'spellcapcheck'.
11665
11666      {word} can be a badly spelled word followed by other text.
11667      This allows for joining two words that were split.  The
11668      suggestions also include the following text, thus you can
11669      replace a line.
11670
11671      {word} may also be a good word.  Similar words will then be
11672      returned.  {word} itself is not included in the suggestions,
11673      although it may appear capitalized.
11674
11675      The spelling information for the current window is used.  The
11676      values of 'spelllang' and 'spellsuggest' are used.
11677
11678    ]=],
11679    name = 'spellsuggest',
11680    params = { { 'word', 'string' }, { 'max', 'integer' }, { 'capital', 'boolean' } },
11681    returns = 'string[]',
11682    signature = 'spellsuggest({word} [, {max} [, {capital}]])',
11683  },
11684  split = {
11685    args = { 1, 3 },
11686    base = 1,
11687    desc = [=[
11688      Make a |List| out of {string}.  When {pattern} is omitted or
11689      empty each white space separated sequence of characters
11690      becomes an item.
11691      Otherwise the string is split where {pattern} matches,
11692      removing the matched characters.  'ignorecase' is not used
11693      here, add \c to ignore case. |/\c|
11694      When the first or last item is empty it is omitted, unless the
11695      {keepempty} argument is given and it's non-zero.
11696      Other empty items are kept when {pattern} matches at least one
11697      character or when {keepempty} is non-zero.
11698      Example: >vim
11699      	let words = split(getline('.'), '\W\+')
11700      <To split a string in individual characters: >vim
11701      	for c in split(mystring, '\zs') | endfor
11702      <If you want to keep the separator you can also use '\zs' at
11703      the end of the pattern: >vim
11704      	echo split('abc:def:ghi', ':\zs')
11705      < >
11706      	['abc:', 'def:', 'ghi']
11707      <
11708      Splitting a table where the first element can be empty: >vim
11709      	let items = split(line, ':', 1)
11710      <The opposite function is |join()|.
11711
11712    ]=],
11713    name = 'split',
11714    params = { { 'string', 'string' }, { 'pattern', 'string' }, { 'keepempty', 'boolean' } },
11715    returns = 'string[]',
11716    signature = 'split({string} [, {pattern} [, {keepempty}]])',
11717    see_lua = { '|vim.split()|' },
11718  },
11719  sqrt = {
11720    args = 1,
11721    base = 1,
11722    desc = [=[
11723      Return the non-negative square root of Float {expr} as a
11724      |Float|.
11725      {expr} must evaluate to a |Float| or a |Number|.  When {expr}
11726      is negative the result is NaN (Not a Number).  Returns 0.0 if
11727      {expr} is not a |Float| or a |Number|.
11728      Examples: >vim
11729      	echo sqrt(100)
11730      <	10.0 >vim
11731      	echo sqrt(-4.01)
11732      <	str2float("nan")
11733      NaN may be different, it depends on system libraries.
11734
11735    ]=],
11736    func_float = 'sqrt',
11737    name = 'sqrt',
11738    params = { { 'expr', 'number' } },
11739    signature = 'sqrt({expr})',
11740    see_lua = { '|math.sqrt()|' },
11741  },
11742  srand = {
11743    args = { 0, 1 },
11744    base = 1,
11745    desc = [=[
11746      Initialize seed used by |rand()|:
11747      - If {expr} is not given, seed values are initialized by
11748        reading from /dev/urandom, if possible, or using time(NULL)
11749        a.k.a. epoch time otherwise; this only has second accuracy.
11750      - If {expr} is given it must be a Number.  It is used to
11751        initialize the seed values.  This is useful for testing or
11752        when a predictable sequence is intended.
11753
11754      Examples: >vim
11755      	let seed = srand()
11756      	let seed = srand(userinput)
11757      	echo rand(seed)
11758      <
11759    ]=],
11760    name = 'srand',
11761    params = { { 'expr', 'number' } },
11762    signature = 'srand([{expr}])',
11763    see_lua = { '|math.randomseed()|' },
11764  },
11765  state = {
11766    args = { 0, 1 },
11767    base = 1,
11768    desc = [=[
11769      Return a string which contains characters indicating the
11770      current state.  Mostly useful in callbacks that want to do
11771      work that may not always be safe.  Roughly this works like:
11772      - callback uses state() to check if work is safe to do.
11773        Yes: then do it right away.
11774        No:  add to work queue and add a |SafeState| autocommand.
11775      - When SafeState is triggered and executes your autocommand,
11776        check with `state()` if the work can be done now, and if yes
11777        remove it from the queue and execute.
11778        Remove the autocommand if the queue is now empty.
11779      Also see |mode()|.
11780
11781      When {what} is given only characters in this string will be
11782      added.  E.g, this checks if the screen has scrolled: >vim
11783      	if state('s') == ''
11784      	   " screen has not scrolled
11785      <
11786      These characters indicate the state, generally indicating that
11787      something is busy:
11788          m	halfway a mapping, :normal command, |feedkeys()| or
11789      	stuffed command
11790          o	operator pending, e.g. after |d|
11791          a	Insert mode autocomplete active
11792          x	executing an autocommand
11793          S	not triggering SafeState, e.g. after |f| or a count
11794          c	callback invoked, including timer (repeats for
11795      	recursiveness up to "ccc")
11796          s	screen has scrolled for messages
11797    ]=],
11798    fast = true,
11799    name = 'state',
11800    params = { { 'what', 'string' } },
11801    signature = 'state([{what}])',
11802  },
11803  stdioopen = {
11804    args = 1,
11805    desc = [=[
11806      With |--headless| this opens stdin and stdout as a |channel|.
11807      May be called only once. See |channel-stdio|. stderr is not
11808      handled by this function, see |v:stderr|.
11809
11810      Close the stdio handles with |chanclose()|. Use |chansend()|
11811      to send data to stdout, and |rpcrequest()| and |rpcnotify()|
11812      to communicate over RPC.
11813
11814      {opts} is a dictionary with these keys:
11815        |on_stdin| : callback invoked when stdin is written to.
11816        on_print : callback invoked when Nvim needs to print a
11817      	     message, with the message (whose type is string)
11818      	     as sole argument.
11819        stdin_buffered : read stdin in |channel-buffered| mode.
11820        rpc      : If set, |msgpack-rpc| will be used to communicate
11821      	     over stdio
11822      Returns:
11823        - |channel-id| on success (value is always 1)
11824        - 0 on invalid arguments
11825    ]=],
11826    name = 'stdioopen',
11827    params = { { 'opts', 'table' } },
11828    signature = 'stdioopen({opts})',
11829  },
11830  stdpath = {
11831    args = 1,
11832    tags = { 'E6100' },
11833    desc = [=[
11834      Returns |standard-path| locations of various default files and
11835      directories. The locations are driven by |base-directories|
11836      which you can configure via |$NVIM_APPNAME| or the `$XDG_…`
11837      environment variables.
11838
11839      {what}       Type    Description ~
11840      cache        String  Cache directory: arbitrary temporary
11841                           storage for plugins, etc.
11842      config       String  User configuration directory. |init.vim|
11843                           is stored here.
11844      config_dirs  List    Other configuration directories.
11845      data         String  User data directory.
11846      data_dirs    List    Other data directories.
11847      log          String  Logs directory (for use by plugins too).
11848      run          String  Run directory: temporary, local storage
11849      		     for sockets, named pipes, etc.
11850      state        String  Session state: storage for backupdir,
11851      		     file drafts, |shada|, swap, undo, 'viewdir'.
11852
11853      Example: >vim
11854      	echo stdpath("config")
11855      <
11856    ]=],
11857    fast = true,
11858    name = 'stdpath',
11859    params = { { 'what', "'cache'|'config'|'config_dirs'|'data'|'data_dirs'|'log'|'run'|'state'" } },
11860    returns = 'string|string[]',
11861    signature = 'stdpath({what})',
11862  },
11863  stdpath__1 = {
11864    args = 1,
11865    fast = true,
11866    name = 'stdpath',
11867    params = { { 'what', "'cache'|'config'|'data'|'log'|'run'|'state'" } },
11868    returns = 'string',
11869  },
11870  stdpath__2 = {
11871    args = 1,
11872    fast = true,
11873    name = 'stdpath',
11874    params = { { 'what', "'config_dirs'|'data_dirs'" } },
11875    returns = 'string[]',
11876  },
11877  str2float = {
11878    args = 1,
11879    base = 1,
11880    desc = [=[
11881      Convert String {string} to a Float.  This mostly works the
11882      same as when using a floating point number in an expression,
11883      see |floating-point-format|.  But it's a bit more permissive.
11884      E.g., "1e40" is accepted, while in an expression you need to
11885      write "1.0e40".  The hexadecimal form "0x123" is also
11886      accepted, but not others, like binary or octal.
11887      When {quoted} is present and non-zero then embedded single
11888      quotes before the dot are ignored, thus "1'000.0" is a
11889      thousand.
11890      Text after the number is silently ignored.
11891      The decimal point is always '.', no matter what the locale is
11892      set to.  A comma ends the number: "12,345.67" is converted to
11893      12.0.  You can strip out thousands separators with
11894      |substitute()|: >vim
11895      	let f = str2float(substitute(text, ',', '', 'g'))
11896      <
11897      Returns 0.0 if the conversion fails.
11898
11899    ]=],
11900    name = 'str2float',
11901    params = { { 'string', 'string' }, { 'quoted', 'boolean' } },
11902    signature = 'str2float({string} [, {quoted}])',
11903    see_lua = {
11904      '|tonumber()| for simple numbers; quoted digits, hex forms, and trailing text differ',
11905    },
11906  },
11907  str2list = {
11908    args = { 1, 2 },
11909    base = 1,
11910    desc = [=[
11911      Return a list containing the number values which represent
11912      each character in String {string}.  Examples: >vim
11913      	echo str2list(" ")		" returns [32]
11914      	echo str2list("ABC")		" returns [65, 66, 67]
11915      <|list2str()| does the opposite.
11916
11917      UTF-8 encoding is always used, {utf8} option has no effect,
11918      and exists only for backwards-compatibility.
11919      With UTF-8 composing characters are handled properly: >vim
11920      	echo str2list("á")		" returns [97, 769]
11921      <
11922    ]=],
11923    fast = true,
11924    name = 'str2list',
11925    params = { { 'string', 'string' }, { 'utf8', 'boolean' } },
11926    signature = 'str2list({string} [, {utf8}])',
11927  },
11928  str2nr = {
11929    args = { 1, 3 },
11930    base = 1,
11931    desc = [=[
11932      Convert string {string} to a number.
11933      {base} is the conversion base, it can be 2, 8, 10 or 16.
11934      When {quoted} is present and non-zero then embedded single
11935      quotes are ignored, thus "1'000'000" is a million.
11936
11937      When {base} is omitted base 10 is used.  This also means that
11938      a leading zero doesn't cause octal conversion to be used, as
11939      with the default String to Number conversion.  Example: >vim
11940      	let nr = str2nr('0123')
11941      <
11942      When {base} is 16 a leading "0x" or "0X" is ignored.  With a
11943      different base the result will be zero. Similarly, when
11944      {base} is 8 a leading "0", "0o" or "0O" is ignored, and when
11945      {base} is 2 a leading "0b" or "0B" is ignored.
11946      Text after the number is silently ignored.
11947
11948      Returns 0 if {string} is empty or on error.
11949
11950    ]=],
11951    name = 'str2nr',
11952    params = { { 'string', 'string' }, { 'base', 'integer' } },
11953    signature = 'str2nr({string} [, {base}])',
11954    see_lua = {
11955      '|tonumber()| for simple numbers; quoted digits, base prefixes, and trailing text differ',
11956    },
11957  },
11958  strcharlen = {
11959    args = 1,
11960    base = 1,
11961    desc = [=[
11962      Returns the number of characters in String {string}, ignoring
11963      composing characters. Returns 0 on error or empty {string}.
11964
11965      |strchars()| can count the number of characters, counting
11966      composing characters separately.
11967
11968      Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
11969
11970    ]=],
11971    fast = true,
11972    name = 'strcharlen',
11973    params = { { 'string', 'string' } },
11974    returns = 'integer',
11975    signature = 'strcharlen({string})',
11976  },
11977  strcharpart = {
11978    args = { 2, 4 },
11979    base = 1,
11980    desc = [=[
11981      Like |strpart()| but using character index and length instead
11982      of byte index and length.
11983      When {skipcc} is omitted or zero, composing characters are
11984      counted separately.
11985      When {skipcc} set to 1, composing characters are treated as a
11986      part of the preceding base character, similar to |slice()|.
11987      When a character index is used where a character does not
11988      exist it is omitted and counted as one character.  For
11989      example: >vim
11990      	echo strcharpart('abc', -1, 2)
11991      <results in 'a'.
11992
11993      Returns an empty string on error.
11994
11995    ]=],
11996    fast = true,
11997    name = 'strcharpart',
11998    params = {
11999      { 'src', 'string' },
12000      { 'start', 'integer' },
12001      { 'len', 'integer' },
12002      { 'skipcc', '0|1|boolean' },
12003    },
12004    returns = 'string',
12005    signature = 'strcharpart({src}, {start} [, {len} [, {skipcc}]])',
12006  },
12007  strchars = {
12008    args = { 1, 2 },
12009    base = 1,
12010    desc = [=[
12011      Returns the number of characters in String {string}.
12012      When {skipcc} is omitted or zero, composing characters are
12013      counted separately.
12014      When {skipcc} set to 1, composing characters are ignored.
12015      |strcharlen()| always does this.
12016
12017      Returns zero on error.
12018
12019      Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
12020
12021      {skipcc} is only available after 7.4.755.  For backward
12022      compatibility, you can define a wrapper function: >vim
12023          if has("patch-7.4.755")
12024            function s:strchars(str, skipcc)
12025      	return strchars(a:str, a:skipcc)
12026            endfunction
12027          else
12028            function s:strchars(str, skipcc)
12029      	if a:skipcc
12030      	  return strlen(substitute(a:str, ".", "x", "g"))
12031      	else
12032      	  return strchars(a:str)
12033      	endif
12034            endfunction
12035          endif
12036      <
12037    ]=],
12038    fast = true,
12039    name = 'strchars',
12040    params = { { 'string', 'string' }, { 'skipcc', '0|1|boolean' } },
12041    returns = 'integer',
12042    signature = 'strchars({string} [, {skipcc}])',
12043    see_lua = { '|vim.str_utfindex()| for codepoint counts; `skipcc` handling differs' },
12044  },
12045  strdisplaywidth = {
12046    args = { 1, 2 },
12047    base = 1,
12048    desc = [=[
12049      Returns the number of display cells String {string} occupies
12050      on the screen when it starts at {col} (first column is zero).
12051      Returns zero on error.
12052
12053      When {col} is omitted zero is used. Otherwise it is the screen
12054      column where to start.  This matters for Tab characters.
12055      The option settings of the current window are used.  This
12056      matters for anything that's displayed differently, such as
12057      'tabstop' and 'display'.
12058
12059      When {string} contains characters with East Asian Width Class
12060      Ambiguous, this function's return value depends on
12061      'ambiwidth'.
12062
12063      Also see |strlen()|, |strwidth()| and |strchars()|.
12064
12065    ]=],
12066    fast = true,
12067    name = 'strdisplaywidth',
12068    params = { { 'string', 'string' }, { 'col', 'integer' } },
12069    returns = 'integer',
12070    signature = 'strdisplaywidth({string} [, {col}])',
12071    see_lua = {
12072      '|nvim_strwidth()| when `{col}` is 0; Tab expansion and window-option semantics differ',
12073    },
12074  },
12075  strftime = {
12076    args = { 1, 2 },
12077    base = 1,
12078    desc = [=[
12079      Formats a date and time String specified by {format}.  The
12080      given {time} is used, or the current time if no time is given.
12081      The {format} depends on your system, this is not portable!
12082      See the manual page of the C function strftime() for the
12083      format.  The maximum length of the result is 80 characters.
12084      See also |localtime()|, |getftime()| and |strptime()|.
12085      The language can be changed with the |:language| command.
12086      Examples: >vim
12087        echo strftime("%c")		   " Sun Apr 27 11:49:23 1997
12088        echo strftime("%Y %b %d %X")	   " 1997 Apr 27 11:53:25
12089        echo strftime("%y%m%d %T")	   " 970427 11:53:55
12090        echo strftime("%H:%M")		   " 11:55
12091        echo strftime("%c", getftime("file.c"))
12092      				   " Show mod time of file.c.
12093      <
12094    ]=],
12095    name = 'strftime',
12096    params = { { 'format', 'string' }, { 'time', 'number' } },
12097    returns = 'string',
12098    signature = 'strftime({format} [, {time}])',
12099    see_lua = { '|os.date()|' },
12100  },
12101  strgetchar = {
12102    args = 2,
12103    base = 1,
12104    desc = [=[
12105      Get a Number corresponding to the character at {index} in
12106      {str}.  This uses a zero-based character index, not a byte
12107      index.  Composing characters are considered separate
12108      characters here.  Use |nr2char()| to convert the Number to a
12109      String.
12110      Returns -1 if {index} is invalid.
12111      Also see |strcharpart()| and |strchars()|.
12112
12113    ]=],
12114    fast = true,
12115    name = 'strgetchar',
12116    params = { { 'str', 'string' }, { 'index', 'integer' } },
12117    returns = 'integer',
12118    signature = 'strgetchar({str}, {index})',
12119  },
12120  stridx = {
12121    args = { 2, 3 },
12122    base = 1,
12123    desc = [=[
12124      Returns the byte index of the first occurrence of {needle}
12125      in {haystack}.
12126      If {start} is specified, the search starts at index {start}.
12127      This can be used to find a second match: >vim
12128      	let colon1 = stridx(line, ":")
12129      	let colon2 = stridx(line, ":", colon1 + 1)
12130      <The search is done case-sensitive.
12131      For pattern searches use |match()|.
12132      -1 is returned if the {needle} does not occur in {haystack}.
12133      See also |strridx()|.
12134      Examples: >vim
12135        echo stridx("An Example", "Example")     " 3
12136        echo stridx("Starting point", "Start")   " 0
12137        echo stridx("Starting point", "start")   " -1
12138      <					*strstr()* *strchr()*
12139      stridx() works similar to the C function strstr().  When used
12140      with a single character it works similar to strchr().
12141
12142    ]=],
12143    fast = true,
12144    name = 'stridx',
12145    params = { { 'haystack', 'string' }, { 'needle', 'string' }, { 'start', 'integer' } },
12146    returns = 'integer',
12147    signature = 'stridx({haystack}, {needle} [, {start}])',
12148    see_lua = {
12149      '|string.find()| with `plain = true` and `start + 1`, then subtract 1; missing matches return nil instead of -1',
12150    },
12151  },
12152  string = {
12153    args = 1,
12154    base = 1,
12155    desc = [=[
12156      Converts {expr} to a String.  If {expr} is a Number, Float,
12157      String, Blob or a composition of them, the result can be
12158      parsed back with |eval()|.
12159
12160      	{expr} type	result ~
12161      	String		`'string'`
12162      	Number		123
12163      	Float		123.123456 or 1.123456e8 or
12164      			`str2float('inf')`
12165      	Funcref		`function('name')`
12166      	Blob		0z00112233.44556677.8899
12167      	List		[item, item]
12168      	Dictionary	`{key: value, key: value}`
12169
12170      Note: in String values the ' character is doubled.
12171      Also see |strtrans()|.
12172
12173      Note: Output format is mostly compatible with YAML, except for
12174      infinite and NaN floating-point values representations which
12175      use |str2float()|.  Strings are also dumped literally, only
12176      single quote is escaped, which does not allow using YAML for
12177      parsing back binary strings.  |eval()| should always work for
12178      strings and floats though, and this is the only official
12179      method.  Use |msgpackdump()| or |json_encode()| if you need to
12180      share data with other applications.
12181
12182    ]=],
12183    name = 'string',
12184    params = { { 'expr', 'any' } },
12185    returns = 'string',
12186    signature = 'string({expr})',
12187    see_lua = { '|vim.inspect()| for tables, or |tostring()| for scalars' },
12188  },
12189  strlen = {
12190    args = 1,
12191    base = 1,
12192    desc = [=[
12193      Returns the length of String {string} in bytes.
12194      If the argument is a Number it is first converted to a String.
12195      For other types an error is given and zero is returned.
12196      If you want to count the number of multibyte characters use
12197      |strchars()|.
12198      Also see |len()|, |strdisplaywidth()| and |strwidth()|.
12199
12200    ]=],
12201    fast = true,
12202    name = 'strlen',
12203    params = { { 'string', 'string' } },
12204    returns = 'integer',
12205    signature = 'strlen({string})',
12206    see_lua = { '|string.len()|' },
12207  },
12208  strpart = {
12209    args = { 2, 4 },
12210    base = 1,
12211    desc = [=[
12212      Gets a substring from {src}, starting from byte {start}, with
12213      byte length {len}. Returns empty string on error.
12214
12215      When {chars} is present and TRUE then {len} is the number of
12216      characters positions (composing characters are not counted
12217      separately, thus "1" means one base character and any
12218      following composing characters).
12219
12220      To count {start} as characters instead of bytes use
12221      |strcharpart()|.
12222
12223      When bytes are selected which do not exist, this doesn't
12224      result in an error, the bytes are simply omitted.
12225      If {len} is missing, the copy continues from {start} till the
12226      end of the {src}. >vim
12227      	echo strpart("abcdefg", 3, 2)    " returns 'de'
12228      	echo strpart("abcdefg", -2, 4)   " returns 'ab'
12229      	echo strpart("abcdefg", 5, 4)    " returns 'fg'
12230      	echo strpart("abcdefg", 3)	 " returns 'defg'
12231
12232      <Note: To get the first character, {start} must be 0.  For
12233      example, to get the character under the cursor: >vim
12234      	strpart(getline("."), col(".") - 1, 1, v:true)
12235      <
12236
12237    ]=],
12238    fast = true,
12239    name = 'strpart',
12240    params = {
12241      { 'src', 'string' },
12242      { 'start', 'integer' },
12243      { 'len', 'integer' },
12244      { 'chars', '0|1' },
12245    },
12246    returns = 'string',
12247    signature = 'strpart({src}, {start} [, {len} [, {chars}]])',
12248    see_lua = { '|string.sub()| for byte slices; negative `start` and the `chars` flag differ' },
12249  },
12250  strptime = {
12251    args = 2,
12252    base = 1,
12253    desc = [=[
12254      Parses a date/time string and returns a unix timestamp.
12255      {timestring} must match the format specified in {format}.
12256
12257      The {format} depends on your system, this is not portable!
12258      See the strptime() manpage for the format.  Especially avoid
12259      "%c".  The value of $TZ also matters.
12260
12261      If the {timestring} cannot be parsed with {format} zero is
12262      returned.  If you do not know the format of {timestring} you
12263      can try different {format} values until you get a non-zero
12264      result.
12265
12266      See also |strftime()|.
12267      Examples: >vim
12268        echo strptime("%Y %b %d %X", "1997 Apr 27 11:49:23")
12269      <  862156163 >vim
12270        echo strftime("%c", strptime("%y%m%d %T", "970427 11:53:55"))
12271      <  Sun Apr 27 11:53:55 1997 >vim
12272        echo strftime("%c", strptime("%Y%m%d%H%M%S", "19970427115355") + 3600)
12273      <  Sun Apr 27 12:53:55 1997
12274
12275    ]=],
12276    name = 'strptime',
12277    params = { { 'format', 'string' }, { 'timestring', 'string' } },
12278    returns = 'integer',
12279    signature = 'strptime({format}, {timestring})',
12280  },
12281  strridx = {
12282    args = { 2, 3 },
12283    base = 1,
12284    desc = [=[
12285      Returns the byte index of the last occurrence of {needle}
12286      in {haystack}.
12287      When {start} is specified, matches beyond this index are
12288      ignored.  This can be used to find a match before a previous
12289      match: >vim
12290      	let lastcomma = strridx(line, ",")
12291      	let comma2 = strridx(line, ",", lastcomma - 1)
12292      <The search is done case-sensitive.
12293      For pattern searches use |match()|.
12294      -1 is returned if the {needle} does not occur in {haystack}.
12295      If the {needle} is empty the length of {haystack} is returned.
12296      See also |stridx()|.  Examples: >vim
12297        echo strridx("an angry armadillo", "an")	     3
12298      <					*strrchr()*
12299      When used with a single character it works similar to the C
12300      function strrchr().
12301
12302    ]=],
12303    name = 'strridx',
12304    params = {
12305      { 'haystack', 'string' },
12306      { 'needle', 'string' },
12307      { 'start', 'integer' },
12308    },
12309    returns = 'integer',
12310    signature = 'strridx({haystack}, {needle} [, {start}])',
12311    see_lua = {
12312      '|string.find()| in a loop with `plain = true`, then subtract 1; empty-needle and missing-match semantics differ',
12313    },
12314  },
12315  strtrans = {
12316    args = 1,
12317    base = 1,
12318    desc = [=[
12319      Translates all unprintable characters in {string} into
12320      printable characters, like they are shown in a
12321      window.  Example: >vim
12322      	echo strtrans(@a)
12323      <This displays a newline in register a as "^@" instead of
12324      starting a new line.
12325
12326      Returns an empty string on error.
12327
12328    ]=],
12329    fast = true,
12330    name = 'strtrans',
12331    params = { { 'string', 'string' } },
12332    returns = 'string',
12333    signature = 'strtrans({string})',
12334  },
12335  strutf16len = {
12336    args = { 1, 2 },
12337    base = 1,
12338    desc = [=[
12339      Returns the number of UTF-16 code units in String {string}
12340      (after converting it to UTF-16).
12341
12342      When {countcc} is TRUE, composing characters are counted
12343      separately.
12344      When {countcc} is omitted or FALSE, composing characters are
12345      ignored.
12346
12347      Returns zero on error.
12348
12349      Also see |strlen()| and |strcharlen()|.
12350      Examples: >vim
12351          echo strutf16len('a')		" returns 1
12352          echo strutf16len('©')		" returns 1
12353          echo strutf16len('😊')		" returns 2
12354          echo strutf16len('ą́')		" returns 1
12355          echo strutf16len('ą́', v:true)	" returns 3
12356      <
12357    ]=],
12358    name = 'strutf16len',
12359    params = { { 'string', 'string' }, { 'countcc', '0|1' } },
12360    returns = 'integer',
12361    signature = 'strutf16len({string} [, {countcc}])',
12362    see_lua = { '|vim.str_utfindex()| with `"utf-16"`; `countcc = false` semantics differ' },
12363  },
12364  strwidth = {
12365    args = 1,
12366    base = 1,
12367    desc = [=[
12368      Returns the number of display cells String {string} occupies.
12369      A Tab character is counted as one cell, alternatively use
12370      |strdisplaywidth()|.
12371      When {string} contains characters with East Asian Width Class
12372      Ambiguous, this function's return value depends on
12373      'ambiwidth'.
12374      Returns zero on error.
12375      Also see |strlen()|, |strdisplaywidth()| and |strchars()|.
12376
12377    ]=],
12378    fast = true,
12379    name = 'strwidth',
12380    params = { { 'string', 'string' } },
12381    returns = 'integer',
12382    signature = 'strwidth({string})',
12383    see_lua = { '|nvim_strwidth()|' },
12384  },
12385  submatch = {
12386    args = { 1, 2 },
12387    base = 1,
12388    tags = { 'E935' },
12389    desc = [=[
12390      Only for an expression in a |:substitute| command or
12391      |substitute()| function.
12392      Returns the {nr}th submatch of the matched text.  When {nr}
12393      is 0 the whole matched text is returned.
12394      Note that a NL in the string can stand for a line break of a
12395      multi-line match or a NUL character in the text.
12396      Also see |sub-replace-expression|.
12397
12398      If {list} is present and non-zero then submatch() returns
12399      a list of strings, similar to |getline()| with two arguments.
12400      NL characters in the text represent NUL characters in the
12401      text.
12402      Only returns more than one item for |:substitute|, inside
12403      |substitute()| this list will always contain one or zero
12404      items, since there are no real line breaks.
12405
12406      When |substitute()| is used recursively only the submatches in
12407      the current (deepest) call can be obtained.
12408
12409      Returns an empty string or list on error.
12410
12411      Examples: >vim
12412      	s/\d\+/\=submatch(0) + 1/
12413      	echo substitute(text, '\d\+', '\=submatch(0) + 1', '')
12414      <This finds the first number in the line and adds one to it.
12415      A line break is included as a newline character.
12416
12417    ]=],
12418    name = 'submatch',
12419    params = { { 'nr', 'integer' }, { 'list', 'nil' } },
12420    signature = 'submatch({nr} [, {list}])',
12421    returns = 'string',
12422  },
12423  submatch__1 = {
12424    args = { 2 },
12425    base = 1,
12426    name = 'submatch',
12427    params = { { 'nr', 'integer' }, { 'list', 'integer' } },
12428    returns = 'string|string[]',
12429  },
12430  substitute = {
12431    args = 4,
12432    base = 1,
12433    desc = [=[
12434      Performs string substitution.  Returns a copy of {string}
12435      in which the first match of {pat} is replaced with {sub}.
12436      When {flags} is "g", all matches of {pat} in {string} are
12437      replaced.  Otherwise {flags} should be "".
12438
12439      This works like the ":substitute" command (without any flags).
12440      But the matching with {pat} is always done like the 'magic'
12441      option is set and 'cpoptions' is empty (to make scripts
12442      portable).  'ignorecase' is still relevant, use |/\c| or |/\C|
12443      if you want to ignore or match case and ignore 'ignorecase'.
12444      'smartcase' is not used.  See |string-match| for how {pat} is
12445      used.
12446
12447      A "~" in {sub} is not replaced with the previous {sub}.
12448      Note that some codes in {sub} have a special meaning
12449      |sub-replace-special|.  For example, to replace something with
12450      "\n" (two characters), use "\\\\n" or '\\n'.
12451
12452      When {pat} does not match in {string}, {string} is returned
12453      unmodified.
12454
12455      Example: >vim
12456      	let &path = substitute(&path, ",\\=[^,]*$", "", "")
12457      <This removes the last component of the 'path' option. >vim
12458      	echo substitute("testing", ".*", "\\U\\0", "")
12459      <results in "TESTING".
12460
12461      When {sub} starts with "\=", the remainder is interpreted as
12462      an expression.  See |sub-replace-expression|.  Example: >vim
12463      	echo substitute(s, '%\(\x\x\)',
12464      	   \ '\=nr2char("0x" .. submatch(1))', 'g')
12465
12466      <When {sub} is a Funcref that function is called, with one
12467      optional argument.  Example: >vim
12468         echo substitute(s, '%\(\x\x\)', SubNr, 'g')
12469      <The optional argument is a list which contains the whole
12470      matched string and up to nine submatches, like what
12471      |submatch()| returns.  Example: >vim
12472         echo substitute(s, '%\(\x\x\)', {m -> '0x' .. m[1]}, 'g')
12473
12474      <Returns an empty string on error.
12475
12476    ]=],
12477    name = 'substitute',
12478    params = {
12479      { 'string', 'string' },
12480      { 'pat', 'string' },
12481      { 'sub', 'string' },
12482      { 'flags', 'string' },
12483    },
12484    returns = 'string',
12485    signature = 'substitute({string}, {pat}, {sub}, {flags})',
12486    see_lua = {
12487      '|string.gsub()| for common substitutions; Vim patterns, flags, and replacement semantics differ',
12488    },
12489  },
12490  swapfilelist = {
12491    desc = [=[
12492      Returns a list of swap file names, like what "vim -r" shows.
12493      See the |-r| command argument.  The 'directory' option is used
12494      for the directories to inspect.  If you only want to get a
12495      list of swap files in the current directory then temporarily
12496      set 'directory' to a dot: >vim
12497      	let save_dir = &directory
12498      	let &directory = '.'
12499      	let swapfiles = swapfilelist()
12500      	let &directory = save_dir
12501      <
12502    ]=],
12503    name = 'swapfilelist',
12504    params = {},
12505    returns = 'string[]',
12506    signature = 'swapfilelist()',
12507  },
12508  swapinfo = {
12509    args = 1,
12510    base = 1,
12511    desc = [=[
12512      Returns information about the swapfile {fname} as a
12513      dictionary.  The available fields are:
12514      	version Vim version
12515      	user	user name
12516      	host	host name
12517      	fname	original file name
12518      	pid	PID of the Nvim process that created the swap
12519      		file, or zero if not running.
12520      	mtime	last modification time in seconds
12521      	inode	Optional: INODE number of the file
12522      	dirty	1 if file was modified, 0 if not
12523      In case of failure an "error" item is added with the reason:
12524      	Cannot open file: file not found or in accessible
12525      	Cannot read file: cannot read first block
12526      	Not a swap file: does not contain correct block ID
12527      	Magic number mismatch: Info in first block is invalid
12528
12529    ]=],
12530    name = 'swapinfo',
12531    params = { { 'fname', 'string' } },
12532    signature = 'swapinfo({fname})',
12533  },
12534  swapname = {
12535    args = 1,
12536    base = 1,
12537    desc = [=[
12538      The result is the swap file path of the buffer {buf}.
12539      For the use of {buf}, see |bufname()| above.
12540      If buffer {buf} is the current buffer, the result is equal to
12541      |:swapname| (unless there is no swap file).
12542      If buffer {buf} has no swap file, returns an empty string.
12543
12544    ]=],
12545    name = 'swapname',
12546    params = { { 'buf', 'integer|string' } },
12547    returns = 'string',
12548    signature = 'swapname({buf})',
12549  },
12550  synID = {
12551    args = 3,
12552    desc = [=[
12553      Returns the syntax ID at position {lnum} and {col} in the
12554      current window.  The syntax ID can be used with |synIDattr()|
12555      and |synIDtrans()| to obtain syntax information about text.
12556
12557      {col} is 1 for the leftmost column, {lnum} is 1 for the first
12558      line.  'synmaxcol' applies, in a longer line zero is returned.
12559      Note that when the position is after the last character,
12560      that's where the cursor can be in Insert mode, synID() returns
12561      zero.  {lnum} is used like with |getline()|.
12562
12563      When {trans} is |TRUE|, transparent items are reduced to the
12564      item that they reveal.  This is useful when wanting to know
12565      the effective color.  When {trans} is |FALSE|, the transparent
12566      item is returned.  This is useful when wanting to know which
12567      syntax item is effective (e.g. inside parens).
12568      Warning: This function can be very slow.  Best speed is
12569      obtained by going through the file in forward direction.
12570
12571      Returns zero on error.
12572
12573      Example (echoes the name of the syntax item under the cursor): >vim
12574      	echo synIDattr(synID(line("."), col("."), 1), "name")
12575      <
12576    ]=],
12577    name = 'synID',
12578    params = { { 'lnum', 'integer|string' }, { 'col', 'integer' }, { 'trans', '0|1' } },
12579    returns = 'integer',
12580    signature = 'synID({lnum}, {col}, {trans})',
12581  },
12582  synIDattr = {
12583    args = { 2, 3 },
12584    base = 1,
12585    desc = [=[
12586      Returns the {what} attribute of syntax ID {synID} as a
12587      String.  This can be used to obtain information about a
12588      syntax item.
12589      {mode} can be "gui" or "cterm", to get the attributes
12590      for that mode.  When {mode} is omitted, or an invalid value is
12591      used, the attributes for the currently active highlighting are
12592      used (GUI or cterm).
12593      Use |synIDtrans()| to follow linked highlight groups.
12594      {what}		result
12595      "name"		the name of the syntax item
12596      "fg"		foreground color (GUI: color name used to set
12597      		the color, cterm: color number as a string,
12598      		term: empty string)
12599      "bg"		background color (as with "fg")
12600      "font"		font name (only available in the GUI)
12601      		|highlight-font|
12602      "sp"		special color (as with "fg") |guisp|
12603      "fg#"		like "fg", but for the GUI and the GUI is
12604      		running the name in "#RRGGBB" form
12605      "bg#"		like "fg#" for "bg"
12606      "sp#"		like "fg#" for "sp"
12607      "bold"		"1" if bold
12608      "italic"	"1" if italic
12609      "reverse"	"1" if reverse
12610      "inverse"	"1" if inverse (= reverse)
12611      "standout"	"1" if standout
12612      "underline"	"1" if underlined
12613      "undercurl"	"1" if undercurled
12614      "underdouble"	"1" if double underlined
12615      "underdotted"	"1" if dotted underlined
12616      "underdashed"	"1" if dashed underlined
12617      "strikethrough"	"1" if struckthrough
12618      "altfont"	"1" if alternative font
12619      "nocombine"	"1" if nocombine
12620      "dim"	"1" if half-bright/dimmed
12621      "blink"	"1" if blinking
12622      "conceal"	"1" if concealed
12623      "overline"	"1" if overlined
12624
12625      Returns an empty string on error.
12626
12627      Example (echoes the color of the syntax item under the
12628      cursor): >vim
12629      	echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg")
12630      <
12631      Can also be used as a |method|: >vim
12632      	echo synID(line("."), col("."), 1)->synIDtrans()->synIDattr("fg")
12633      <
12634    ]=],
12635    name = 'synIDattr',
12636    params = { { 'synID', 'integer' }, { 'what', 'string' }, { 'mode', 'string' } },
12637    returns = 'string',
12638    signature = 'synIDattr({synID}, {what} [, {mode}])',
12639  },
12640  synIDtrans = {
12641    args = 1,
12642    base = 1,
12643    desc = [=[
12644      Returns the translated syntax ID of {synID}, following
12645      highlight links.  This is the syntax group ID of what is
12646      being used to highlight the character.  Highlight links given with
12647      ":highlight link" are followed.
12648
12649      Returns zero on error.
12650
12651    ]=],
12652    name = 'synIDtrans',
12653    params = { { 'synID', 'integer' } },
12654    returns = 'integer',
12655    signature = 'synIDtrans({synID})',
12656  },
12657  synconcealed = {
12658    args = 2,
12659    desc = [=[
12660      Returns conceal information for the character at position
12661      {lnum} and {col} as a |List| with three items:
12662      1. The first item in the list is 0 if the character is not
12663         part of a concealable region, 1 if it is.  {lnum} is used
12664         like with |getline()|.
12665      2. The second item in the list is a string.  If the first item
12666         is 1, the second item contains the text which will be
12667         displayed in place of the concealed text, depending on the
12668         current setting of 'conceallevel' and 'listchars'.
12669      3. The third and final item in the list is a number
12670         representing the specific syntax region matched in the
12671         line.  When the character is not concealed the value is
12672         zero.  This allows detection of the beginning of a new
12673         concealable region if there are two consecutive regions
12674         with the same replacement character.  For an example, if
12675         the text is "123456" and both "23" and "45" are concealed
12676         and replaced by the character "X", then:
12677      	call			returns ~
12678      	synconcealed(lnum, 1)   [0, '', 0]
12679      	synconcealed(lnum, 2)   [1, 'X', 1]
12680      	synconcealed(lnum, 3)   [1, 'X', 1]
12681      	synconcealed(lnum, 4)   [1, 'X', 2]
12682      	synconcealed(lnum, 5)   [1, 'X', 2]
12683      	synconcealed(lnum, 6)   [0, '', 0]
12684
12685      Note: Doesn't consider |matchadd()| highlighting items,
12686      since syntax and matching highlighting are two different
12687      mechanisms |syntax-vs-match|.
12688    ]=],
12689    name = 'synconcealed',
12690    params = { { 'lnum', 'integer|string' }, { 'col', 'integer' } },
12691    returns = '[integer, string, integer]',
12692    signature = 'synconcealed({lnum}, {col})',
12693  },
12694  synstack = {
12695    args = 2,
12696    desc = [=[
12697      Return a |List|, which is the stack of syntax items at the
12698      position {lnum} and {col} in the current window.  {lnum} is
12699      used like with |getline()|.  Each item in the List is an ID
12700      like what |synID()| returns.
12701      The first item in the List is the outer region, following are
12702      items contained in that one.  The last one is what |synID()|
12703      returns, unless not the whole item is highlighted or it is a
12704      transparent item.
12705      This function is useful for debugging a syntax file.
12706      Example that shows the syntax stack under the cursor: >vim
12707      	for id in synstack(line("."), col("."))
12708      	   echo synIDattr(id, "name")
12709      	endfor
12710      <When the position specified with {lnum} and {col} is invalid
12711      an empty list is returned.  The position just after the last
12712      character in a line and the first column in an empty line are
12713      valid positions.
12714    ]=],
12715    name = 'synstack',
12716    params = { { 'lnum', 'integer|string' }, { 'col', 'integer' } },
12717    returns = 'integer[]',
12718    signature = 'synstack({lnum}, {col})',
12719  },
12720  system = {
12721    args = { 1, 2 },
12722    base = 1,
12723    tags = { 'E677' },
12724    desc = [=[
12725      Gets the output of {cmd} as a |string| (|systemlist()| returns
12726      a |List|) and sets |v:shell_error| to the error code.
12727      {cmd} is treated as in |jobstart()|:
12728      If {cmd} is a List it runs directly (no 'shell').
12729      If {cmd} is a String it runs in the 'shell', like this: >vim
12730        call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}'])
12731
12732      <Not to be used for interactive commands.
12733
12734      Result is a String, filtered to avoid platform-specific quirks:
12735      - <CR><NL> is replaced with <NL>
12736      - NUL characters are replaced with SOH (0x01)
12737
12738      Example: >vim
12739          echo system(['ls', expand('%:h')])
12740
12741      <If {input} is a string it is written to a pipe and passed as
12742      stdin to the command.  The string is written as-is, line
12743      separators are not changed.
12744      If {input} is a |List| it is written to the pipe as
12745      |writefile()| does with {binary} set to "b" (i.e. with
12746      a newline between each list item, and newlines inside list
12747      items converted to NULs).
12748      When {input} is given and is a valid buffer id, the content of
12749      the buffer is written to the file line by line, each line
12750      terminated by NL (and NUL where the text has NL).
12751      						*E5677*
12752      Note: system() cannot write to or read from backgrounded ("&")
12753      shell commands, e.g.: >vim
12754          echo system("cat - &", "foo")
12755      <which is equivalent to: >
12756          $ echo foo | bash -c 'cat - &'
12757      <The pipes are disconnected (unless overridden by shell
12758      redirection syntax) before input can reach it. Use
12759      |jobstart()| instead.
12760
12761      Note: Use |shellescape()| or |::S| with |expand()| or
12762      |fnamemodify()| to escape special characters in a command
12763      argument. 'shellquote' and 'shellxquote' must be properly
12764      configured. Example: >vim
12765          echo system('ls '..shellescape(expand('%:h')))
12766          echo system('ls '..expand('%:h:S'))
12767
12768      <Unlike ":!cmd" there is no automatic check for changed files.
12769      Use |:checktime| to force a check.
12770
12771    ]=],
12772    name = 'system',
12773    params = {
12774      { 'cmd', 'string|string[]' },
12775      { 'input', 'string|string[]|integer' },
12776    },
12777    returns = 'string',
12778    signature = 'system({cmd} [, {input}])',
12779    see_lua = {
12780      '`vim.system(...):wait().stdout` for string output; string commands use the shell in Vimscript, not by default in Lua',
12781    },
12782  },
12783  systemlist = {
12784    args = { 1, 3 },
12785    base = 1,
12786    desc = [=[
12787      Same as |system()|, but returns a |List| with lines (parts of
12788      output separated by NL) with NULs transformed into NLs.
12789      Output is the same as |readfile()| will output with {binary}
12790      argument set to "b", except that a final newline is not
12791      preserved, unless {keepempty} is non-zero.
12792      Note that on MS-Windows you may get trailing CR characters.
12793
12794      To see the difference between "echo hello" and "echo -n hello"
12795      use |system()| and |split()|: >vim
12796      	echo split(system('echo hello'), '\n', 1)
12797      <
12798      Returns an empty string on error.
12799
12800    ]=],
12801    name = 'systemlist',
12802    params = {
12803      { 'cmd', 'string|string[]' },
12804      { 'input', 'string|string[]|integer' },
12805      { 'keepempty', 'integer' },
12806    },
12807    -- TODO(lewis6991): Not sure the '' return case is possible via vim.fn
12808    -- returns = "string[]|''",
12809    returns = 'string[]',
12810    signature = 'systemlist({cmd} [, {input} [, {keepempty}]])',
12811    see_lua = {
12812      '`vim.system(...):wait().stdout` split into lines; string commands use the shell in Vimscript, not by default in Lua',
12813    },
12814  },
12815  tabpagebuflist = {
12816    args = { 0, 1 },
12817    base = 1,
12818    desc = [=[
12819      Returns a |List| of buffer numbers, one for each window in
12820      the specified tabpage.
12821      {arg} specifies the number of the tabpage to be used.  When
12822      omitted the current tabpage is used.
12823      When {arg} is invalid the number zero is returned.
12824      To get a list of all buffers in all tabs use this: >vim
12825      	let buflist = []
12826      	for i in range(tabpagenr('$'))
12827      	   call extend(buflist, tabpagebuflist(i + 1))
12828      	endfor
12829      <Note that a buffer may appear in more than one window.
12830
12831    ]=],
12832    name = 'tabpagebuflist',
12833    params = { { 'arg', 'integer' } },
12834    signature = 'tabpagebuflist([{arg}])',
12835    see_lua = {
12836      '|nvim_tabpage_list_wins()| with |nvim_win_get_buf()|; invalid tabpages error instead of returning 0',
12837    },
12838  },
12839  tabpagenr = {
12840    args = { 0, 1 },
12841    desc = [=[
12842      Returns the current |tabpage-number|.
12843
12844      The optional argument {arg} supports the following values:
12845        $	the last |tabpage-number| (the tabpage count).
12846        #	the last-accessed |tabpage-number| (where |g<Tab>|
12847      		goes to), or 0 if there is no previous tabpage.
12848      The number can be used with the |:tab| command.
12849
12850      Returns zero on error.
12851    ]=],
12852    name = 'tabpagenr',
12853    params = { { 'arg', "'$'|'#'" } },
12854    returns = 'integer',
12855    signature = 'tabpagenr([{arg}])',
12856    see_lua = {
12857      '|nvim_tabpage_get_number()| with |nvim_get_current_tabpage()| for the current tab, or `#vim.api.nvim_list_tabpages()` for "$"; "#" differs',
12858    },
12859  },
12860  tabpagewinnr = {
12861    args = { 1, 2 },
12862    base = 1,
12863    desc = [=[
12864      Like |winnr()| but for tabpage {tabarg}.
12865      {tabarg} specifies the |tabpage-number| to be used.
12866      {arg} is used like with |winnr()|:
12867      - When omitted the current window number is returned.  This is
12868        the window which will be used when going to this tabpage.
12869      - When "$" the number of windows is returned.
12870      - When "#" the previous window nr is returned.
12871      Useful examples: >vim
12872          tabpagewinnr(1)	    " current window of tabpage 1
12873          tabpagewinnr(4, '$')    " number of windows in tabpage 4
12874      <When {tabarg} is invalid zero is returned.
12875
12876    ]=],
12877    name = 'tabpagewinnr',
12878    params = { { 'tabarg', 'integer' }, { 'arg', "'$'|'#'" } },
12879    returns = 'integer',
12880    signature = 'tabpagewinnr({tabarg} [, {arg}])',
12881    see_lua = {
12882      '|nvim_win_get_number()| with |nvim_tabpage_get_win()| for the current window, or the length of |nvim_tabpage_list_wins()| for "$"; "#" and invalid-tab behavior differ',
12883    },
12884  },
12885  tagfiles = {
12886    desc = [=[
12887      Returns a |List| with the file names used to search for tags
12888      for the current buffer.  This is the 'tags' option expanded.
12889    ]=],
12890    name = 'tagfiles',
12891    params = {},
12892    returns = 'string[]',
12893    signature = 'tagfiles()',
12894  },
12895  taglist = {
12896    args = { 1, 2 },
12897    base = 1,
12898    desc = [=[
12899      Returns a |List| of tags matching the regular expression {expr}.
12900
12901      If {filename} is passed it is used to prioritize the results
12902      in the same way that |:tselect| does.  See |tag-priority|.
12903      {filename} should be the full path of the file.
12904
12905      Each list item is a dictionary with at least the following
12906      entries:
12907      	name		Name of the tag.
12908      	filename	Name of the file where the tag is
12909      			defined.  It is either relative to the
12910      			current directory or a full path.
12911      	cmd		Ex command used to locate the tag in
12912      			the file.
12913      	kind		Type of the tag.  The value for this
12914      			entry depends on the language specific
12915      			kind values.  Only available when
12916      			using a tags file generated by
12917      			Universal/Exuberant ctags or hdrtag.
12918      	static		A file specific tag.  Refer to
12919      			|static-tag| for more information.
12920      More entries may be present, depending on the content of the
12921      tags file: access, implementation, inherits and signature.
12922      Refer to the ctags documentation for information about these
12923      fields.  For C code the fields "struct", "class" and "enum"
12924      may appear, they give the name of the entity the tag is
12925      contained in.
12926
12927      The ex-command "cmd" can be either an ex search pattern, a
12928      line number or a line number followed by a byte number.
12929
12930      If there are no matching tags, then an empty list is returned.
12931
12932      To get an exact tag match, the anchors '^' and '$' should be
12933      used in {expr}.  This also make the function work faster.
12934      Refer to |tag-regexp| for more information about the tag
12935      search regular expression pattern.
12936
12937      Refer to 'tags' for information about how the tags file is
12938      located by Vim.  Refer to |tags-file-format| for the format of
12939      the tags file generated by the different ctags tools.
12940
12941    ]=],
12942    name = 'taglist',
12943    params = { { 'expr', 'any' }, { 'filename', 'string' } },
12944    signature = 'taglist({expr} [, {filename}])',
12945  },
12946  tan = {
12947    args = 1,
12948    base = 1,
12949    desc = [=[
12950      Return the tangent of {expr}, measured in radians, as a |Float|
12951      in the range [-inf, inf].
12952      {expr} must evaluate to a |Float| or a |Number|.
12953      Returns 0.0 if {expr} is not a |Float| or a |Number|.
12954      Examples: >vim
12955      	echo tan(10)
12956      <	0.648361 >vim
12957      	echo tan(-4.01)
12958      <	-1.181502
12959
12960    ]=],
12961    func_float = 'tan',
12962    name = 'tan',
12963    params = { { 'expr', 'number' } },
12964    returns = 'number',
12965    signature = 'tan({expr})',
12966    see_lua = { '|math.tan()|' },
12967  },
12968  tanh = {
12969    args = 1,
12970    base = 1,
12971    desc = [=[
12972      Return the hyperbolic tangent of {expr} as a |Float| in the
12973      range [-1, 1].
12974      {expr} must evaluate to a |Float| or a |Number|.
12975      Returns 0.0 if {expr} is not a |Float| or a |Number|.
12976      Examples: >vim
12977      	echo tanh(0.5)
12978      <	0.462117 >vim
12979      	echo tanh(-1)
12980      <	-0.761594
12981
12982    ]=],
12983    func_float = 'tanh',
12984    name = 'tanh',
12985    params = { { 'expr', 'number' } },
12986    returns = 'number',
12987    signature = 'tanh({expr})',
12988    see_lua = { '|math.tanh()|' },
12989  },
12990  tempname = {
12991    desc = [=[
12992      Generates a (non-existent) filename located in the Nvim root
12993      |tempdir|. Scripts can use the filename as a temporary file.
12994      Example: >vim
12995      	let tmpfile = tempname()
12996      	exe "redir > " .. tmpfile
12997      <
12998    ]=],
12999    name = 'tempname',
13000    params = {},
13001    returns = 'string',
13002    signature = 'tempname()',
13003    see_lua = {
13004      "|os.tmpname()| for a temporary name; Nvim's |tempdir| and nonexistence are not guaranteed",
13005    },
13006  },
13007  termopen = {
13008    deprecated = true,
13009    args = { 1, 2 },
13010    desc = [=[
13011      Use |jobstart()| with `{term: v:true}` instead.
13012    ]=],
13013    name = 'termopen',
13014    params = { { 'cmd', 'string|string[]' }, { 'opts', 'table' } },
13015    returns = 'integer',
13016    signature = 'termopen({cmd} [, {opts}])',
13017  },
13018  test_garbagecollect_now = {
13019    args = 0,
13020    desc = [=[
13021      Like |garbagecollect()|, but executed right away.  This must
13022      only be called directly to avoid any structure to exist
13023      internally, and |v:testing| must have been set before calling
13024      any function.   *E1142*
13025    ]=],
13026    params = {},
13027    signature = 'test_garbagecollect_now()',
13028    lua = false,
13029  },
13030  test_write_list_log = {
13031    args = 1,
13032    params = { { 'fname', 'string' } },
13033    lua = false,
13034  },
13035  timer_info = {
13036    args = { 0, 1 },
13037    base = 1,
13038    desc = [=[
13039      Return a list with information about timers.
13040      When {id} is given only information about this timer is
13041      returned.  When timer {id} does not exist an empty list is
13042      returned.
13043      When {id} is omitted information about all timers is returned.
13044
13045      For each timer the information is stored in a |Dictionary| with
13046      these items:
13047          "id"	    the timer ID
13048          "time"	    time the timer was started with
13049          "repeat"	    number of times the timer will still fire;
13050      		    -1 means forever
13051          "callback"	    the callback
13052
13053    ]=],
13054    name = 'timer_info',
13055    params = { { 'id', 'integer' } },
13056    signature = 'timer_info([{id}])',
13057  },
13058  timer_pause = {
13059    args = 2,
13060    base = 1,
13061    desc = [=[
13062      Pause or unpause a timer.  A paused timer does not invoke its
13063      callback when its time expires.  Unpausing a timer may cause
13064      the callback to be invoked almost immediately if enough time
13065      has passed.
13066
13067      Pausing a timer is useful to avoid the callback to be called
13068      for a short time.
13069
13070      If {paused} evaluates to a non-zero Number or a non-empty
13071      String, then the timer is paused, otherwise it is unpaused.
13072      See |non-zero-arg|.
13073
13074    ]=],
13075    name = 'timer_pause',
13076    params = { { 'timer', 'integer' }, { 'paused', 'boolean' } },
13077    signature = 'timer_pause({timer}, {paused})',
13078  },
13079  timer_start = {
13080    args = { 2, 3 },
13081    base = 1,
13082    tags = { 'timer' },
13083    desc = [=[
13084      Create a timer and return the timer ID.
13085
13086      {time} is the waiting time in milliseconds.  This is the
13087      minimum time before invoking the callback.  When the system is
13088      busy or Vim is not waiting for input the time will be longer.
13089      Zero can be used to execute the callback when Vim is back in
13090      the main loop.
13091
13092      {callback} is the function to call.  It can be the name of a
13093      function or a |Funcref|.  It is called with one argument, which
13094      is the timer ID.  The callback is only invoked when Vim is
13095      waiting for input.
13096
13097      {options} is a dictionary.  Supported entries:
13098         "repeat"	Number of times to repeat the callback.
13099      		-1 means forever.  Default is 1.
13100      		If the timer causes an error three times in a
13101      		row the repeat is cancelled.
13102
13103      Returns -1 on error.
13104
13105      Example: >vim
13106      	func MyHandler(timer)
13107      	  echo 'Handler called'
13108      	endfunc
13109      	let timer = timer_start(500, 'MyHandler',
13110      		\ {'repeat': 3})
13111      <This invokes MyHandler() three times at 500 msec intervals.
13112
13113    ]=],
13114    name = 'timer_start',
13115    params = { { 'time', 'number' }, { 'callback', 'string|function' }, { 'options', 'table' } },
13116    signature = 'timer_start({time}, {callback} [, {options}])',
13117    see_lua = {
13118      '|vim.defer_fn()| for one-shot timers, or |uv.new_timer()| for repeating timers; callback and handle semantics differ',
13119    },
13120  },
13121  timer_stop = {
13122    args = 1,
13123    base = 1,
13124    desc = [=[
13125      Stop a timer.  The timer callback will no longer be invoked.
13126      {timer} is an ID returned by |timer_start()|, thus it must be a
13127      Number.  If {timer} does not exist there is no error.
13128
13129    ]=],
13130    name = 'timer_stop',
13131    params = { { 'timer', 'integer' } },
13132    signature = 'timer_stop({timer})',
13133    see_lua = {
13134      '|uv.timer_stop()| and |uv.close()| on a stored |uv.new_timer()| handle; timer IDs differ',
13135    },
13136  },
13137  timer_stopall = {
13138    args = 0,
13139    desc = [=[
13140      Stop all timers.  The timer callbacks will no longer be
13141      invoked.  Useful if some timers is misbehaving.  If there are
13142      no timers there is no error.
13143    ]=],
13144    name = 'timer_stopall',
13145    params = {},
13146    signature = 'timer_stopall()',
13147  },
13148  tolower = {
13149    args = 1,
13150    base = 1,
13151    desc = [=[
13152      Converts a String to lowercase (like applying |gu|).
13153      Returns empty string on error.
13154
13155    ]=],
13156    fast = true,
13157    name = 'tolower',
13158    params = { { 'expr', 'string' } },
13159    returns = 'string',
13160    signature = 'tolower({expr})',
13161    see_lua = { '|string.lower()|' },
13162  },
13163  toupper = {
13164    args = 1,
13165    base = 1,
13166    desc = [=[
13167      Converts a String to uppercase (like applying |gU|).
13168      Returns empty string on error.
13169
13170    ]=],
13171    fast = true,
13172    name = 'toupper',
13173    params = { { 'expr', 'string' } },
13174    returns = 'string',
13175    signature = 'toupper({expr})',
13176    see_lua = { '|string.upper()|' },
13177  },
13178  tr = {
13179    args = 3,
13180    base = 1,
13181    desc = [=[
13182      Translates characters in {src}, replacing each character that
13183      appears in {fromstr} with the corresponding character in
13184      {tostr}.  Exactly like the unix "tr" command.
13185      This code also deals with multibyte characters properly.
13186
13187      Returns an empty string on error.
13188
13189      Examples: >vim
13190      	echo tr("hello there", "ht", "HT")
13191      <returns "Hello THere" >vim
13192      	echo tr("<blob>", "<>", "{}")
13193      <returns "{blob}"
13194
13195    ]=],
13196    fast = true,
13197    name = 'tr',
13198    params = { { 'src', 'string' }, { 'fromstr', 'string' }, { 'tostr', 'string' } },
13199    returns = 'string',
13200    signature = 'tr({src}, {fromstr}, {tostr})',
13201  },
13202  trim = {
13203    args = { 1, 3 },
13204    base = 1,
13205    desc = [=[
13206      Return {text} as a String where any character in {mask} is
13207      removed from the beginning and/or end of {text}.
13208
13209      If {mask} is not given, or is an empty string, {mask} is all
13210      characters up to 0x20, which includes Tab, space, NL and CR,
13211      plus the non-breaking space character 0xa0.
13212
13213      The optional {dir} argument specifies where to remove the
13214      characters:
13215      	0	remove from the beginning and end of {text}
13216      	1	remove only at the beginning of {text}
13217      	2	remove only at the end of {text}
13218      When omitted both ends are trimmed.
13219
13220      This function deals with multibyte characters properly.
13221      Returns an empty string on error.
13222
13223      Examples: >vim
13224      	echo trim("   some text ")
13225      <returns "some text" >vim
13226      	echo trim("  \r\t\t\r RESERVE \t\n\x0B\xA0") .. "_TAIL"
13227      <returns "RESERVE_TAIL" >vim
13228      	echo trim("rm<Xrm<>X>rrm", "rm<>")
13229      <returns "Xrm<>X" (characters in the middle are not removed) >vim
13230      	echo trim("  vim  ", " ", 2)
13231      <returns "  vim"
13232
13233    ]=],
13234    fast = true,
13235    name = 'trim',
13236    params = { { 'text', 'string' }, { 'mask', 'string' }, { 'dir', '0|1|2' } },
13237    returns = 'string',
13238    signature = 'trim({text} [, {mask} [, {dir}]])',
13239    see_lua = { '|vim.trim()|' },
13240  },
13241  trunc = {
13242    args = 1,
13243    base = 1,
13244    desc = [=[
13245      Return the largest integral value with magnitude less than or
13246      equal to {expr} as a |Float| (truncate towards zero).
13247      {expr} must evaluate to a |Float| or a |Number|.
13248      Returns 0.0 if {expr} is not a |Float| or a |Number|.
13249      Examples: >vim
13250      	echo trunc(1.456)
13251      <	1.0  >vim
13252      	echo trunc(-5.456)
13253      <	-5.0  >vim
13254      	echo trunc(4.0)
13255      <	4.0
13256
13257    ]=],
13258    func_float = 'trunc',
13259    name = 'trunc',
13260    params = { { 'expr', 'number' } },
13261    returns = 'integer',
13262    signature = 'trunc({expr})',
13263    see_lua = { '|math.modf()| (first return value)' },
13264  },
13265  type = {
13266    args = 1,
13267    base = 1,
13268    desc = [=[
13269      Returns the type of {expr} as a Number.
13270      Instead of using the number directly, it is better to use the
13271      v:t_ variable that has the value:
13272      	Number:	    0  |v:t_number|
13273      	String:	    1  |v:t_string|
13274      	Funcref:    2  |v:t_func|
13275      	List:	    3  |v:t_list|
13276      	Dictionary: 4  |v:t_dict|
13277      	Float:	    5  |v:t_float|
13278      	Boolean:    6  |v:t_bool| (|v:false| and |v:true|)
13279      	Null:	    7  (|v:null|)
13280      	Blob:	   10  |v:t_blob|
13281      For backward compatibility, this method can be used: >vim
13282      	if type(myvar) == type(0) | endif
13283      	if type(myvar) == type("") | endif
13284      	if type(myvar) == type(function("tr")) | endif
13285      	if type(myvar) == type([]) | endif
13286      	if type(myvar) == type({}) | endif
13287      	if type(myvar) == type(0.0) | endif
13288      	if type(myvar) == type(v:true) | endif
13289      <In place of checking for |v:null| type it is better to check
13290      for |v:null| directly as it is the only value of this type: >vim
13291      	if myvar is v:null | endif
13292      <To check if the v:t_ variables exist use this: >vim
13293      	if exists('v:t_number') | endif
13294      <
13295
13296    ]=],
13297    fast = true,
13298    name = 'type',
13299    params = { { 'expr', 'any' } },
13300    returns = 'integer',
13301    signature = 'type({expr})',
13302    see_lua = { '|lua-type()| for most Lua type checks; Vim type IDs differ' },
13303  },
13304  undofile = {
13305    args = 1,
13306    base = 1,
13307    desc = [=[
13308      Return the name of the undo file that would be used for a file
13309      with name {name} when writing.  This uses the 'undodir'
13310      option, finding directories that exist.  It does not check if
13311      the undo file exists.
13312      {name} is always expanded to the full path, since that is what
13313      is used internally.
13314      If {name} is empty undofile() returns an empty string, since a
13315      buffer without a file name will not write an undo file.
13316      Useful in combination with |:wundo| and |:rundo|.
13317
13318    ]=],
13319    name = 'undofile',
13320    params = { { 'name', 'string' } },
13321    returns = 'string',
13322    signature = 'undofile({name})',
13323  },
13324  undotree = {
13325    args = { 0, 1 },
13326    base = 1,
13327    desc = [=[
13328      Return the current state of the undo tree for the current
13329      buffer, or for a specific buffer if {buf} is given.  The
13330      result is a dictionary with the following items:
13331        "seq_last"	The highest undo sequence number used.
13332        "seq_cur"	The sequence number of the current position in
13333      		the undo tree.  This differs from "seq_last"
13334      		when some changes were undone.
13335        "time_cur"	Time last used for |:earlier| and related
13336      		commands.  Use |strftime()| to convert to
13337      		something readable.
13338        "save_last"	Number of the last file write.  Zero when no
13339      		write yet.
13340        "save_cur"	Number of the current position in the undo
13341      		tree.
13342        "synced"	Non-zero when the last undo block was synced.
13343      		This happens when waiting from input from the
13344      		user.  See |undo-blocks|.
13345        "entries"	A list of dictionaries with information about
13346      		undo blocks.
13347
13348      The first item in the "entries" list is the oldest undo item.
13349      Each List item is a |Dictionary| with these items:
13350        "seq"		Undo sequence number.  Same as what appears in
13351      		|:undolist|.
13352        "time"	Timestamp when the change happened.  Use
13353      		|strftime()| to convert to something readable.
13354        "newhead"	Only appears in the item that is the last one
13355      		that was added.  This marks the last change
13356      		and where further changes will be added.
13357        "curhead"	Only appears in the item that is the last one
13358      		that was undone.  This marks the current
13359      		position in the undo tree, the block that will
13360      		be used by a redo command.  When nothing was
13361      		undone after the last change this item will
13362      		not appear anywhere.
13363        "save"	Only appears on the last block before a file
13364      		write.  The number is the write count.  The
13365      		first write has number 1, the last one the
13366      		"save_last" mentioned above.
13367        "alt"		Alternate entry.  This is again a List of undo
13368      		blocks.  Each item may again have an "alt"
13369      		item.
13370    ]=],
13371    name = 'undotree',
13372    params = { { 'buf', 'integer|string' } },
13373    returns = 'vim.fn.undotree.ret',
13374    signature = 'undotree([{buf}])',
13375  },
13376  uniq = {
13377    args = { 1, 3 },
13378    base = 1,
13379    tags = { 'E882' },
13380    desc = [=[
13381      Remove second and succeeding copies of repeated adjacent
13382      {list} items in-place.  Returns {list}.  If you want a list
13383      to remain unmodified make a copy first: >vim
13384      	let newlist = uniq(copy(mylist))
13385      <The default compare function uses the string representation of
13386      each item.  For the use of {func} and {dict} see |sort()|.
13387      For deduplicating text in the current buffer see |:uniq|.
13388
13389      Returns zero if {list} is not a |List|.
13390
13391    ]=],
13392    name = 'uniq',
13393    params = { { 'list', 'any' }, { 'func', 'any' }, { 'dict', 'any' } },
13394    returns = 'any[]|0',
13395    signature = 'uniq({list} [, {func} [, {dict}]])',
13396    see_lua = { '|vim.list.unique()|' },
13397  },
13398  utf16idx = {
13399    args = { 2, 4 },
13400    base = 1,
13401    desc = [=[
13402      Same as |charidx()| but returns the UTF-16 code unit index of
13403      the byte at {idx} in {string} (after converting it to UTF-16).
13404
13405      When {charidx} is present and TRUE, {idx} is used as the
13406      character index in the String {string} instead of as the byte
13407      index.
13408      An {idx} in the middle of a UTF-8 sequence is rounded
13409      downwards to the beginning of that sequence.
13410
13411      Returns -1 if the arguments are invalid or if there are less
13412      than {idx} bytes in {string}.  If there are exactly {idx}
13413      bytes, the length of the string in UTF-16 code units is
13414      returned.
13415
13416      See |byteidx()| and |byteidxcomp()| for getting the byte index
13417      from the UTF-16 index and |charidx()| for getting the
13418      character index from the UTF-16 index.
13419      Refer to |string-offset-encoding| for more information.
13420      Examples: >vim
13421      	echo utf16idx('a😊😊', 3)	" returns 2
13422      	echo utf16idx('a😊😊', 7)	" returns 4
13423      	echo utf16idx('a😊😊', 1, 0, 1)	" returns 2
13424      	echo utf16idx('a😊😊', 2, 0, 1)	" returns 4
13425      	echo utf16idx('aą́c', 6)		" returns 2
13426      	echo utf16idx('aą́c', 6, 1)	" returns 4
13427      	echo utf16idx('a😊😊', 9)	" returns -1
13428      <
13429    ]=],
13430    fast = true,
13431    name = 'utf16idx',
13432    params = {
13433      { 'string', 'string' },
13434      { 'idx', 'integer' },
13435      { 'countcc', 'boolean' },
13436      { 'charidx', 'boolean' },
13437    },
13438    returns = 'integer',
13439    signature = 'utf16idx({string}, {idx} [, {countcc} [, {charidx}]])',
13440    see_lua = {
13441      '|vim.str_utfindex()| with `"utf-16"` and `strict_indexing = false`; `countcc` and `charidx` semantics differ',
13442    },
13443  },
13444  values = {
13445    args = 1,
13446    base = 1,
13447    desc = [=[
13448      Return a |List| with all the values of {dict}.  The |List| is
13449      in arbitrary order.  Also see |items()| and |keys()|.
13450      Returns zero if {dict} is not a |Dict|.
13451
13452    ]=],
13453    name = 'values',
13454    params = { { 'dict', 'any' } },
13455    signature = 'values({dict})',
13456    see_lua = { '|vim.tbl_values()|' },
13457  },
13458  virtcol = {
13459    args = { 1, 3 },
13460    base = 1,
13461    desc = [=[
13462      Returns the virtual (screen) column of the file position
13463      given with {expr}.  That is, the total number of screen cells
13464      occupied by the part of the line until the end of the
13465      character at that position.  When there is a <Tab> at the
13466      position, the returned Number will be the column at the end of
13467      the <Tab>.  For example, for a <Tab> in column 1, with 'ts'
13468      set to 8, it returns 8.  |conceal| is ignored.
13469      For the byte position use |col()|.
13470
13471      For the use of {expr} see |getpos()| and |col()|.
13472      When {expr} is "$", it means the end of the cursor line, so
13473      the result is the number of cells in the cursor line plus one.
13474
13475      When 'virtualedit' is used {expr} can be [lnum, col, off],
13476      where "off" is the offset in screen columns from the start of
13477      the character.  E.g., a position within a <Tab> or after the
13478      last character.  When "off" is omitted zero is used.  When
13479      Virtual editing is active in the current mode, a position
13480      beyond the end of the line can be returned.  Also see
13481      'virtualedit'
13482
13483      If {list} is present and non-zero then virtcol() returns a
13484      List with the first and last screen position occupied by the
13485      character.
13486
13487      With the optional {winid} argument the values are obtained for
13488      that window instead of the current window.
13489
13490      Note that only marks in the current file can be used.
13491      Examples: >vim
13492      	" With text "foo^Lbar" and cursor on the "^L":
13493
13494      	echo virtcol(".")	" returns 5
13495      	echo virtcol(".", 1)	" returns [4, 5]
13496      	echo virtcol("$")	" returns 9
13497
13498      	" With text "	  there", with 't at 'h':
13499
13500      	echo virtcol("'t")	" returns 6
13501      <
13502      The first column is 1.  0 or [0, 0] is returned for an error.
13503
13504      A more advanced example that echoes the maximum length of
13505      all lines: >vim
13506          echo max(map(range(1, line('$')), "virtcol([v:val, '$'])"))
13507      <
13508
13509    ]=],
13510    name = 'virtcol',
13511    params = { { 'expr', 'string|any[]' }, { 'list', 'boolean' }, { 'winid', 'integer' } },
13512    returns = 'integer|[integer, integer]',
13513    signature = 'virtcol({expr} [, {list} [, {winid}]])',
13514  },
13515  virtcol2col = {
13516    args = 3,
13517    base = 1,
13518    desc = [=[
13519      Converts a virtual column to a byte index.  Returns the byte
13520      index of the character in window {winid} at buffer line
13521      {lnum} and virtual column {col}.
13522
13523      If buffer line {lnum} is an empty line, 0 is returned.
13524
13525      If {col} is greater than the last virtual column in line
13526      {lnum}, then the byte index of the character at the last
13527      virtual column is returned.
13528
13529      For a multi-byte character, the column number of the first
13530      byte in the character is returned.
13531
13532      {winid} is a |window-number| or |window-ID|.  If zero, the
13533      current window is used.
13534
13535      Returns -1 if the window {winid} doesn't exist or the buffer
13536      line {lnum} or virtual column {col} is invalid.
13537
13538      See also |screenpos()|, |virtcol()| and |col()|.
13539
13540    ]=],
13541    name = 'virtcol2col',
13542    params = { { 'winid', 'integer' }, { 'lnum', 'integer' }, { 'col', 'integer' } },
13543    returns = 'integer',
13544    signature = 'virtcol2col({winid}, {lnum}, {col})',
13545  },
13546  visualmode = {
13547    args = { 0, 1 },
13548    desc = [=[
13549      Returns a String describing the last Visual mode used in the
13550      current buffer.  Initially it returns an empty string, but
13551      once Visual mode has been used, it returns "v",
13552      "V", or "<CTRL-V>" (a single CTRL-V character) for
13553      character-wise, line-wise, or block-wise Visual mode
13554      respectively.
13555      Example: >vim
13556      	exe "normal " .. visualmode()
13557      <This enters the same Visual mode as before.  It is also useful
13558      in scripts if you wish to act differently depending on the
13559      Visual mode that was used.
13560      If Visual mode is active, use |mode()| to get the Visual mode
13561      (e.g., in a |:vmap|).
13562      If {expr} is supplied and it evaluates to a non-zero Number or
13563      a non-empty String, then the Visual mode will be cleared and
13564      the old value is returned.  See |non-zero-arg|.
13565    ]=],
13566    name = 'visualmode',
13567    params = { { 'expr', 'boolean' } },
13568    returns = 'string',
13569    signature = 'visualmode([{expr}])',
13570  },
13571  wait = {
13572    args = { 2, 3 },
13573    desc = [=[
13574      Waits until {condition} evaluates to |TRUE|, where {condition}
13575      is a |Funcref| or |string| containing an expression.
13576
13577      {timeout} is the maximum waiting time in milliseconds, -1
13578      means forever.
13579
13580      Condition is evaluated on user events, internal events, and
13581      every {interval} milliseconds (default: 200).
13582
13583      Returns a status integer:
13584      	0 if the condition was satisfied before timeout
13585      	-1 if the timeout was exceeded
13586      	-2 if the function was interrupted (by |CTRL-C|)
13587      	-3 if an error occurred
13588    ]=],
13589    name = 'wait',
13590    params = { { 'timeout', 'integer' }, { 'condition', 'any' }, { 'interval', 'number' } },
13591    signature = 'wait({timeout}, {condition} [, {interval}])',
13592    see_lua = { '|vim.wait()|' },
13593  },
13594  wildmenumode = {
13595    desc = [=[
13596      Returns |TRUE| when the wildmenu is active and |FALSE|
13597      otherwise.  See 'wildmenu' and 'wildmode'.
13598      This can be used in mappings to handle the 'wildcharm' option
13599      gracefully.  (Makes only sense with |mapmode-c| mappings).
13600
13601      For example to make <c-j> work like <down> in wildmode, use: >vim
13602          cnoremap <expr> <C-j> wildmenumode() ? "\<Down>\<Tab>" : "\<c-j>"
13603      <
13604      (Note: this needs the 'wildcharm' option set appropriately).
13605    ]=],
13606    name = 'wildmenumode',
13607    params = {},
13608    signature = 'wildmenumode()',
13609  },
13610  wildtrigger = {
13611    desc = [==[
13612      Start wildcard expansion in the command-line, using the
13613      behavior defined by the 'wildmode' and 'wildoptions' settings.
13614
13615      This function also enables completion in search patterns such
13616      as |/|, |?|, |:s|, |:g|, |:v| and |:vimgrep|.
13617
13618      Unlike pressing 'wildchar' manually, this function does not
13619      produce a beep when no matches are found and generally
13620      operates more quietly.  This makes it suitable for triggering
13621      completion automatically.
13622
13623      Note: After navigating command-line history, the first call to
13624      wildtrigger() is a no-op; a second call is needed to start
13625      expansion.  This is to support history navigation in
13626      command-line autocompletion.
13627
13628      See |cmdline-autocompletion|.
13629
13630      Return value is always 0.
13631    ]==],
13632    name = 'wildtrigger',
13633    params = {},
13634    returns = 'number',
13635    signature = 'wildtrigger()',
13636  },
13637  win_execute = {
13638    args = { 2, 3 },
13639    base = 2,
13640    desc = [=[
13641      Like `execute()` but in the context of window {id}.
13642      The window will temporarily be made the current window,
13643      without triggering autocommands or changing directory.  When
13644      executing {command} autocommands will be triggered, this may
13645      have unexpected side effects.  Use `:noautocmd` if needed.
13646      Example: >vim
13647      	call win_execute(winid, 'syntax enable')
13648      <Doing the same with `setwinvar()` would not trigger
13649      autocommands and not actually show syntax highlighting.
13650
13651      When window {id} does not exist then no error is given and
13652      an empty string is returned.
13653
13654    ]=],
13655    name = 'win_execute',
13656    params = { { 'id', 'integer' }, { 'command', 'string' }, { 'silent', 'boolean' } },
13657    signature = 'win_execute({id}, {command} [, {silent}])',
13658    see_lua = { '|nvim_win_call()|' },
13659  },
13660  win_findbuf = {
13661    args = 1,
13662    base = 1,
13663    desc = [=[
13664      Returns a |List| with |window-ID|s for windows that contain
13665      buffer {bufnr}.  When there is none the list is empty.
13666
13667    ]=],
13668    name = 'win_findbuf',
13669    params = { { 'bufnr', 'integer' } },
13670    returns = 'integer[]',
13671    signature = 'win_findbuf({bufnr})',
13672    see_lua = { '|nvim_list_wins()| with |nvim_win_get_buf()|' },
13673  },
13674  win_getid = {
13675    args = { 0, 2 },
13676    base = 1,
13677    desc = [=[
13678      Get the |window-ID| for the specified window.
13679      When {win} is missing use the current window.
13680      With {win} this is the |window-number|.
13681      Without {tab} use the current tab, otherwise the
13682      |tabpage-number| given by {tab}.
13683      Return zero if the window cannot be found.
13684
13685    ]=],
13686    name = 'win_getid',
13687    params = { { 'win', 'integer' }, { 'tab', 'integer' } },
13688    returns = 'integer',
13689    signature = 'win_getid([{win} [, {tab}]])',
13690    see_lua = {
13691      '|nvim_get_current_win()| when omitted, or |nvim_tabpage_list_wins()| with |nvim_win_get_number()| after resolving {tab}; invalid windows return 0 in Vimscript',
13692    },
13693  },
13694  win_gettype = {
13695    args = { 0, 1 },
13696    base = 1,
13697    desc = [=[
13698      Gets the type of the given window, or current window if {nr}
13699      is omitted:
13700      - (empty)     Normal window
13701      - "autocmd"   Internal "context-switch" window.
13702      - "command"   Command-line window |cmdwin|
13703      - "loclist"   |location-list-window|
13704      - "popup"     Floating window |api-floatwin|
13705      - "preview"   Preview window |preview-window|
13706      - "quickfix"  |quickfix-window|
13707      - "unknown"   Window {nr} not found
13708
13709      See also the 'buftype' option.
13710
13711    ]=],
13712    name = 'win_gettype',
13713    params = { { 'nr', 'integer' } },
13714    returns = "'autocmd'|'command'|''|'loclist'|'popup'|'preview'|'quickfix'|'unknown'",
13715    signature = 'win_gettype([{nr}])',
13716  },
13717  win_gotoid = {
13718    args = 1,
13719    base = 1,
13720    desc = [=[
13721      Go to |window-ID| {expr}.  May change the current tabpage.
13722      Return TRUE if successful, FALSE if the window cannot be
13723      found.
13724
13725    ]=],
13726    name = 'win_gotoid',
13727    params = { { 'expr', 'integer' } },
13728    returns = '0|1',
13729    signature = 'win_gotoid({expr})',
13730    see_lua = { '|nvim_set_current_win()|; invalid IDs error instead of returning FALSE' },
13731  },
13732  win_id2tabwin = {
13733    args = 1,
13734    base = 1,
13735    desc = [=[
13736      Return [tabnr, winnr] for window with |window-ID| {expr}, where
13737      tabnr is the |tabpage-number| and winnr is the |window-number|.
13738      Return [0, 0] if the window cannot be found.
13739
13740    ]=],
13741    name = 'win_id2tabwin',
13742    params = { { 'expr', 'integer' } },
13743    signature = 'win_id2tabwin({expr})',
13744    see_lua = {
13745      '|nvim_win_get_tabpage()| and |nvim_win_get_number()| for valid windows; invalid IDs error instead of returning `[0, 0]`',
13746    },
13747  },
13748  win_id2win = {
13749    args = 1,
13750    base = 1,
13751    desc = [=[
13752      Return the |window-number| of for the given |window-ID| {expr}.
13753      Return 0 if the window cannot be found in the current tabpage.
13754
13755    ]=],
13756    name = 'win_id2win',
13757    params = { { 'expr', 'integer' } },
13758    returns = 'integer',
13759    signature = 'win_id2win({expr})',
13760    see_lua = {
13761      '|nvim_win_get_number()| for valid windows; windows outside the current tabpage and invalid IDs differ',
13762    },
13763  },
13764  win_move_separator = {
13765    args = 2,
13766    base = 1,
13767    desc = [=[
13768      Move window {nr}'s vertical separator (i.e., the right border)
13769      by {offset} columns, as if being dragged by the mouse.  {nr}
13770      is a |window-number| or |window-ID|.  A positive {offset}
13771      moves right and a negative {offset} moves left.  Moving a
13772      window's vertical separator will change the width of the
13773      window and the width of other windows adjacent to the vertical
13774      separator.  The magnitude of movement may be smaller than
13775      specified (e.g., as a consequence of maintaining
13776      'winminwidth').  Returns TRUE if the window can be found and
13777      FALSE otherwise.
13778      This will fail for the rightmost window and a full-width
13779      window, since it has no separator on the right.
13780      Only works for the current tabpage. *E1308*
13781
13782    ]=],
13783    name = 'win_move_separator',
13784    params = { { 'nr', 'integer' }, { 'offset', 'integer' } },
13785    signature = 'win_move_separator({nr}, {offset})',
13786  },
13787  win_move_statusline = {
13788    args = 2,
13789    base = 1,
13790    desc = [=[
13791      Move window {nr}'s status line (i.e., the bottom border) by
13792      {offset} rows, as if being dragged by the mouse.  {nr} is a
13793      |window-number| or |window-ID|.  A positive {offset} moves
13794      down and a negative {offset} moves up.  Moving a window's
13795      status line will change the height of the window and the
13796      height of other windows adjacent to the status line. The
13797      magnitude of movement may be smaller than specified (e.g., as
13798      a consequence of maintaining 'winminheight'). Returns TRUE if
13799      the window can be found and FALSE otherwise.
13800      Only works for the current tabpage.
13801
13802    ]=],
13803    name = 'win_move_statusline',
13804    params = { { 'nr', 'integer' }, { 'offset', 'integer' } },
13805    signature = 'win_move_statusline({nr}, {offset})',
13806  },
13807  win_screenpos = {
13808    args = 1,
13809    base = 1,
13810    desc = [=[
13811      Return the screen position of window {nr} as a list with two
13812      numbers: [row, col].  The first window always has position
13813      [1, 1], unless there is a tabline, then it is [2, 1].
13814      {nr} is a |window-number| or |window-ID|.  Use zero for the
13815      current window.
13816      Returns [0, 0] if the window cannot be found.
13817    ]=],
13818    name = 'win_screenpos',
13819    params = { { 'nr', 'integer' } },
13820    signature = 'win_screenpos({nr})',
13821    see_lua = {
13822      '|nvim_win_get_position()| and add 1 to row and col; invalid-window semantics differ',
13823    },
13824  },
13825  win_splitmove = {
13826    args = { 2, 3 },
13827    base = 1,
13828    desc = [=[
13829      Temporarily switch to window {target}, then move window {nr}
13830      to a new split adjacent to {target}.
13831      Unlike commands such as |:split|, no new windows are created
13832      (the |window-ID| of window {nr} is unchanged after the move).
13833
13834      Both {nr} and {target} are a |window-number| or |window-ID|.
13835      Both must be in the current tabpage.
13836
13837      Returns zero for success, non-zero for failure.
13838
13839      {options} is a |Dictionary| with the following optional entries:
13840        "vertical"	When TRUE, the split is created vertically,
13841      		like with |:vsplit|.
13842        "rightbelow"	When TRUE, the split is made below or to the
13843      		right (if vertical).  When FALSE, it is done
13844      		above or to the left (if vertical).  When not
13845      		present, the values of 'splitbelow' and
13846      		'splitright' are used.
13847
13848    ]=],
13849    name = 'win_splitmove',
13850    params = { { 'nr', 'integer' }, { 'target', 'integer' }, { 'options', 'table' } },
13851    signature = 'win_splitmove({nr}, {target} [, {options}])',
13852  },
13853  winbufnr = {
13854    args = 1,
13855    base = 1,
13856    desc = [=[
13857      Returns the buffer number associated with window {nr}
13858      (|window-number| or |window-ID|).
13859      When {nr} is zero, the number of the buffer in the current
13860      window is returned.
13861      When window {nr} doesn't exist, -1 is returned.
13862      Example: >vim
13863        echo "The file in the current window is " .. bufname(winbufnr(0))
13864      <
13865    ]=],
13866    name = 'winbufnr',
13867    params = { { 'nr', 'integer' } },
13868    returns = 'integer',
13869    signature = 'winbufnr({nr})',
13870    see_lua = { '|nvim_win_get_buf()|' },
13871  },
13872  wincol = {
13873    desc = [=[
13874      Returns the virtual column of the cursor in the window.
13875      This is counting screen cells from the left side of the
13876      window.  The leftmost column is one.
13877    ]=],
13878    name = 'wincol',
13879    params = {},
13880    returns = 'integer',
13881    signature = 'wincol()',
13882  },
13883  windowsversion = {
13884    desc = [=[
13885      Returns the Windows OS version as a String.  E.g, Windows 10
13886      is "10.0", Windows 8 is "6.2", Windows XP is "5.1".  For
13887      non-MS-Windows systems the result is an empty string.
13888
13889      Lua: see |uv.os_uname()|.
13890    ]=],
13891    fast = true,
13892    name = 'windowsversion',
13893    params = {},
13894    returns = 'string',
13895    signature = 'windowsversion()',
13896  },
13897  winheight = {
13898    args = 1,
13899    base = 1,
13900    desc = [=[
13901      Gets the height of |window-ID| {nr} (zero for "current
13902      window"), excluding any 'winbar' and 'statusline'. Returns -1
13903      if window {nr} doesn't exist. An existing window always has
13904      a height of zero or more.
13905
13906      Examples: >vim
13907        echo "Current window has " .. winheight(0) .. " lines."
13908      <
13909    ]=],
13910    name = 'winheight',
13911    params = { { 'nr', 'integer' } },
13912    returns = 'integer',
13913    signature = 'winheight({nr})',
13914    see_lua = false,
13915  },
13916  winlayout = {
13917    args = { 0, 1 },
13918    base = 1,
13919    desc = [=[
13920      Returns the layout of windows in a tabpage as a nested List.
13921
13922      Without {tabnr} use the current tabpage, otherwise the tabpage
13923      with number {tabnr}.  If the tabpage {tabnr} is not found,
13924      returns an empty list.
13925
13926      For a leaf window, it returns: >
13927      	["leaf", {winid}]
13928      <
13929      For horizontally split windows, which form a column, it
13930      returns: >
13931      	["col", [{nested list of windows}]]
13932      <For vertically split windows, which form a row, it returns: >
13933      	["row", [{nested list of windows}]]
13934      <
13935      Example: >vim
13936      	" Only one window in the tabpage
13937      	echo winlayout()
13938      < >
13939      	['leaf', 1000]
13940      < >vim
13941      	" Two horizontally split windows
13942      	echo winlayout()
13943      < >
13944      	['col', [['leaf', 1000], ['leaf', 1001]]]
13945      < >vim
13946      	" The second tabpage, with three horizontally split
13947      	" windows, with two vertically split windows in the
13948      	" middle window
13949      	echo winlayout(2)
13950      < >
13951      	['col', [['leaf', 1002], ['row', [['leaf', 1003],
13952      			    ['leaf', 1001]]], ['leaf', 1000]]]
13953      <
13954    ]=],
13955    name = 'winlayout',
13956    params = { { 'tabnr', 'integer' } },
13957    returns = 'vim.fn.winlayout.ret',
13958    signature = 'winlayout([{tabnr}])',
13959  },
13960  winline = {
13961    desc = [=[
13962      Returns the screen line of the cursor in the window.  This is
13963      counting screen lines from the top of the window.  The first
13964      line is one.
13965      If the cursor was moved the view on the file will be updated
13966      first, this may cause a scroll.
13967    ]=],
13968    name = 'winline',
13969    params = {},
13970    returns = 'integer',
13971    signature = 'winline()',
13972  },
13973  winnr = {
13974    args = { 0, 1 },
13975    base = 1,
13976    desc = [=[
13977      Returns the number of the current window.  The top window has
13978      number 1.  Returns zero for a hidden or non |focusable|
13979      window, unless it is the current window.
13980
13981      The optional argument {arg} supports the following values:
13982      	$	the number of the last window (the window
13983      		count).
13984      	#	the number of the last accessed window (where
13985      		|CTRL-W_p| goes to).  If there is no previous
13986      		window or it is in another tabpage, 0 is
13987      		returned.  May refer to the current window in
13988      		some cases (e.g. when evaluating 'statusline'
13989      		expressions).
13990      	{N}j	the number of the Nth window below the
13991      		current window (where |CTRL-W_j| goes to).
13992      	{N}k	the number of the Nth window above the current
13993      		window (where |CTRL-W_k| goes to).
13994      	{N}h	the number of the Nth window left of the
13995      		current window (where |CTRL-W_h| goes to).
13996      	{N}l	the number of the Nth window right of the
13997      		current window (where |CTRL-W_l| goes to).
13998      The number can be used with |CTRL-W_w| and ":wincmd w"
13999      |:wincmd|.
14000      When {arg} is invalid an error is given and zero is returned.
14001      Also see |tabpagewinnr()| and |win_getid()|.
14002      Examples: >vim
14003      	let window_count = winnr('$')
14004      	let prev_window = winnr('#')
14005      	let wnum = winnr('3k')
14006      <
14007    ]=],
14008    name = 'winnr',
14009    params = { { 'arg', 'string|integer' } },
14010    returns = 'integer',
14011    signature = 'winnr([{arg}])',
14012    see_lua = {
14013      '|nvim_win_get_number()| with |nvim_get_current_win()| for the current window, or |nvim_tabpage_list_wins()| with |nvim_get_current_tabpage()| for "$"; "#", motion args, and hidden windows differ',
14014    },
14015  },
14016  winrestcmd = {
14017    desc = [=[
14018      Returns a sequence of |:resize| commands that should restore
14019      the current window sizes.  Only works properly when no windows
14020      are opened or closed and the current window and tabpage is
14021      unchanged.
14022      Example: >vim
14023      	let cmd = winrestcmd()
14024      	call MessWithWindowSizes()
14025      	exe cmd
14026      <
14027    ]=],
14028    name = 'winrestcmd',
14029    params = {},
14030    returns = 'string',
14031    signature = 'winrestcmd()',
14032  },
14033  winrestview = {
14034    args = 1,
14035    base = 1,
14036    desc = [=[
14037      Uses the |Dictionary| returned by |winsaveview()| to restore
14038      the view of the current window.
14039      Note: The {dict} does not have to contain all values, that are
14040      returned by |winsaveview()|.  If values are missing, those
14041      settings won't be restored.  So you can use: >vim
14042          call winrestview({'curswant': 4})
14043      <
14044      This will only set the curswant value (the column the cursor
14045      wants to move on vertical movements) of the cursor to column 5
14046      (yes, that is 5), while all other settings will remain the
14047      same.  This is useful, if you set the cursor position
14048      manually.
14049
14050      If you have changed the values the result is unpredictable.
14051      If the window size changed the result won't be the same.
14052
14053    ]=],
14054    name = 'winrestview',
14055    params = { { 'dict', 'vim.fn.winrestview.dict' } },
14056    signature = 'winrestview({dict})',
14057  },
14058  winsaveview = {
14059    desc = [=[
14060      Returns a |Dictionary| that contains information to restore
14061      the view of the current window.  Use |winrestview()| to
14062      restore the view.
14063      This is useful if you have a mapping that jumps around in the
14064      buffer and you want to go back to the original view.
14065      This does not save fold information.  Use the 'foldenable'
14066      option to temporarily switch off folding, so that folds are
14067      not opened when moving around.  This may have side effects.
14068      The return value includes:
14069      	lnum		cursor line number
14070      	col		cursor column (Note: the first column
14071      			zero, as opposed to what |getcurpos()|
14072      			returns)
14073      	coladd		cursor column offset for 'virtualedit'
14074      	curswant	column for vertical movement (Note:
14075      			the first column is zero, as opposed
14076      			to what |getcurpos()| returns).  After
14077      			|$| command it will be a very large
14078      			number equal to |v:maxcol|.
14079      	topline		first line in the window
14080      	topfill		filler lines, only in diff mode
14081      	leftcol		first column displayed; only used when
14082      			'wrap' is off
14083      	skipcol		columns skipped
14084      Note that no option values are saved.
14085    ]=],
14086    name = 'winsaveview',
14087    params = {},
14088    signature = 'winsaveview()',
14089    returns = 'vim.fn.winsaveview.ret',
14090  },
14091  winwidth = {
14092    args = 1,
14093    base = 1,
14094    desc = [=[
14095      Gets the width of |window-ID| {nr} (zero for "current
14096      window"), including columns (|sign-column|, 'statuscolumn',
14097      etc.). Returns -1 if window {nr} doesn't exist. An existing
14098      window always has a width of zero or more.
14099
14100      Example: >vim
14101        echo "Current window has " .. winwidth(0) .. " columns."
14102        if winwidth(0) <= 50
14103          50 wincmd |
14104        endif
14105      <
14106      To get the buffer "viewport", use |getwininfo()|: >vim
14107          :echo getwininfo(win_getid())[0].width - getwininfo(win_getid())[0].textoff
14108      <
14109      To get the Nvim screen size, see the 'columns' option.
14110    ]=],
14111    name = 'winwidth',
14112    params = { { 'nr', 'integer' } },
14113    returns = 'integer',
14114    signature = 'winwidth({nr})',
14115    see_lua = false,
14116  },
14117  wordcount = {
14118    desc = [=[
14119      Returns a dictionary of byte/chars/word statistics for the
14120      current buffer.  This is the same info provided by |g_CTRL-G|.
14121      The return value includes:
14122      	bytes		Number of bytes in the buffer
14123      	chars		Number of chars in the buffer
14124      	words		Number of words in the buffer
14125      	cursor_bytes    Number of bytes before cursor position
14126      			(not in Visual mode)
14127      	cursor_chars    Number of chars before cursor position
14128      			(not in Visual mode)
14129      	cursor_words    Number of words before cursor position
14130      			(not in Visual mode)
14131      	visual_bytes    Number of bytes visually selected
14132      			(only in Visual mode)
14133      	visual_chars    Number of chars visually selected
14134      			(only in Visual mode)
14135      	visual_words    Number of words visually selected
14136      			(only in Visual mode)
14137    ]=],
14138    name = 'wordcount',
14139    params = {},
14140    signature = 'wordcount()',
14141  },
14142  writefile = {
14143    args = { 2, 3 },
14144    base = 1,
14145    desc = [=[
14146      Writes {data} to file {fname}.
14147
14148      - When {data} is a |Blob| its bytes are written unmodified
14149        (even if binary mode "b" is not specified).
14150      - When {data} is a Lua string, it is treated as a blob.
14151      - When {data} is a |List|, each list item is treated as a text
14152        line (terminated with a newline). Each list item must be
14153        a String or Number.
14154        - Any NL (newline) chars in the line are treated as a NUL
14155          character. (This is a workaround to allow Vimscript to
14156          write binary data, and is irrelevant for Lua, which should
14157          just pass a string instead.)
14158
14159      {flags} must be a String.  These characters are recognized:
14160
14161      'b'  Binary mode is used: There will not be a NL after the
14162           last list item.  An empty item at the end does cause the
14163           last line in the file to end in a NL.
14164
14165      'a'  Append mode is used, lines are appended to the file: >vim
14166      	call writefile(["foo"], "event.log", "a")
14167      	call writefile(["bar"], "event.log", "a")
14168      <
14169      'D'  Delete the file when the current function ends.  This
14170           works like: >vim
14171      	defer delete({fname})
14172      <     Fails when not in a function.  Also see |:defer|.
14173
14174      's'  fsync() is called after writing the file.  This flushes
14175           the file to disk, if possible.  This takes more time but
14176           avoids losing the file if the system crashes.
14177
14178      'S'  fsync() is not called, even when 'fsync' is set.
14179
14180           When {flags} does not contain "S" or "s" then fsync() is
14181           called if the 'fsync' option is set.
14182
14183      An existing file is overwritten, if possible.
14184
14185      When the write fails -1 is returned, otherwise 0.  There is an
14186      error message if the file can't be created or when writing
14187      fails.
14188
14189      Also see |readfile()|.
14190      To copy a file byte for byte: >vim
14191      	let fl = readfile("foo", "b")
14192      	call writefile(fl, "foocopy", "b")
14193      <
14194
14195    ]=],
14196    name = 'writefile',
14197    params = { { 'data', 'any' }, { 'fname', 'string' }, { 'flags', 'string' } },
14198    signature = 'writefile({data}, {fname} [, {flags}])',
14199  },
14200  xor = {
14201    args = 2,
14202    base = 1,
14203    desc = [=[
14204      Bitwise XOR on the two arguments.  The arguments are converted
14205      to a number.  A List, Dict or Float argument causes an error.
14206      Also see `and()` and `or()`.
14207      Example: >vim
14208      	let bits = xor(bits, 0x80)
14209      <
14210    ]=],
14211    name = 'xor',
14212    params = { { 'expr', 'integer' }, { 'expr', 'integer' } },
14213    returns = 'integer',
14214    signature = 'xor({expr}, {expr})',
14215    see_lua = { '|bit.bxor()|' },
14216  },
14217}
14218
14219return M