From 0903702634d8e5714749ea599a2f1042b3377525 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 31 Aug 2022 08:08:51 +0200 Subject: vim-patch:9b03d3e75b42 (#20013) Update runtime files https://github.com/vim/vim/commit/9b03d3e75b4274493bbe76772d7b92238791964c --- runtime/doc/eval.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 376adfec7f..3fbf1ee136 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3167,6 +3167,9 @@ text... iterate over. Unlike with |List|, modifying the |Blob| does not affect the iteration. + When {object} is a |String| each item is a string with + one character, plus any combining characters. + :for [{var1}, {var2}, ...] in {listlist} :endfo[r] Like `:for` above, but each item in {listlist} must be -- cgit From f31db30975479cb6b57247f124a65f4362f80bfe Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 30 Jun 2022 13:26:31 +0600 Subject: feat(lua): vim.ui_attach to get ui events from lua Co-authored-by: Famiu Haque --- runtime/doc/lua.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 499b3f9a6f..a634cc1e93 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -967,6 +967,37 @@ vim.wait({time} [, {callback}, {interval}, {fast_only}]) *vim.wait()* end < +vim.ui_attach({ns}, {options}, {callback}) *vim.ui_attach()* + Attach to ui events, similar to |nvim_ui_attach()| but receive events + as lua callback. Can be used to implement screen elements like + popupmenu or message handling in lua. + + {options} should be a dictionary-like table, where `ext_...` options should + be set to true to receive events for the respective external element. + + {callback} receives event name plus additional parameters. See |ui-popupmenu| + and the sections below for event format for respective events. + + Example (stub for a |ui-popupmenu| implementation): > + + ns = vim.api.nvim_create_namespace('my_fancy_pum') + + vim.ui_attach(ns, {ext_popupmenu=true}, function(event, ...) + if event == "popupmenu_show" then + local items, selected, row, col, grid = ... + print("display pum ", #items) + elseif event == "popupmenu_select" then + local selected = ... + print("selected", selected) + elseif event == "popupmenu_hide" then + print("FIN") + end + end) + +vim.ui_detach({ns}) *vim.ui_detach()* + Detach a callback previously attached with |vim.ui_attach()| for the + given namespace {ns}. + vim.type_idx *vim.type_idx* Type index for use in |lua-special-tbl|. Specifying one of the values from |vim.types| allows typing the empty table (it is unclear whether empty Lua -- cgit From c65b1f3e15662cd14c443e34862237d3dee30977 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 1 Sep 2022 20:18:17 +0800 Subject: vim-patch:9.0.0342: ":wincmd =" equalizes in two directions Problem: ":wincmd =" equalizes in two directions. Solution: Make ":vertical wincmd =" equalize vertically only and ":horizontal wincmd =" equalize horizontally only. https://github.com/vim/vim/commit/21c3a80a7fd6b7fc250ce5dc287963511f54b86f --- runtime/doc/windows.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 2627068a14..ddf4d09e92 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -235,9 +235,16 @@ and 'winminwidth' are relevant. *:vert* *:vertical* :vert[ical] {cmd} Execute {cmd}. If it contains a command that splits a window, - it will be split vertically. + it will be split vertically. For `vertical wincmd =` windows + will be equialized only vertically. Doesn't work for |:execute| and |:normal|. + *:hor* *:horizontal* +:hor[izontal] {cmd} + Execute {cmd}. Currently only makes a difference for + `horizontal wincmd =`, which will equal windows only + horizontally. + :lefta[bove] {cmd} *:lefta* *:leftabove* :abo[veleft] {cmd} *:abo* *:aboveleft* Execute {cmd}. If it contains a command that splits a window, @@ -530,6 +537,10 @@ CTRL-W = Make all windows (almost) equally high and wide, but use 'winheight' and 'winwidth' for the current window. Windows with 'winfixheight' set keep their height and windows with 'winfixwidth' set keep their width. + To equalize only vertically (make window equally high) use + `vertical wincmd =` + To equalize only horizontally (make window equally wide) use + `horizontal wincmd =` :res[ize] -N *:res* *:resize* *CTRL-W_-* CTRL-W - Decrease current window height by N (default 1). -- cgit From 56bf026deac8eddb1abc8e1d46fde992cfc67ac2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 1 Sep 2022 20:25:34 +0800 Subject: vim-patch:9.0.0346: :horizontal modifier not fully supported Problem: :horizontal modifier not fully supported. Solution: Also use :horizontal for completion and user commands. (closes vim/vim#11025) https://github.com/vim/vim/commit/d3de178e5352fedf0f30b979f46a2fcbca24ea40 --- runtime/doc/map.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index ca1ddaabd4..da6a305e89 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1623,11 +1623,11 @@ The valid escape sequences are ** ** *:command-modifiers* The command modifiers, if specified. Otherwise, expands to nothing. Supported modifiers are |:aboveleft|, |:belowright|, - |:botright|, |:browse|, |:confirm|, |:hide|, |:keepalt|, - |:keepjumps|, |:keepmarks|, |:keeppatterns|, |:leftabove|, - |:lockmarks|, |:noautocmd|, |:noswapfile| |:rightbelow|, - |:sandbox|, |:silent|, |:tab|, |:topleft|, |:unsilent|, - |:verbose|, and |:vertical|. + |:botright|, |:browse|, |:confirm|, |:hide|, |:horizontal|, + |:keepalt|, |:keepjumps|, |:keepmarks|, |:keeppatterns|, + |:leftabove|, |:lockmarks|, |:noautocmd|, |:noswapfile| + |:rightbelow|, |:sandbox|, |:silent|, |:tab|, |:topleft|, + |:unsilent|, |:verbose|, and |:vertical|. Note that |:filter| is not supported. Examples: > command! -nargs=+ -complete=file MyEdit -- cgit From 689f5d604e59eba1ddab6f91b458a8163dc6629d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 1 Sep 2022 20:32:59 +0800 Subject: feat(api): add support for :horizontal modifier --- runtime/doc/api.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 89baf84c86..82978d0b3c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1839,6 +1839,7 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* • browse: (boolean) |:browse|. • confirm: (boolean) |:confirm|. • hide: (boolean) |:hide|. + • horizontal: (boolean) |:horizontal|. • keepalt: (boolean) |:keepalt|. • keepjumps: (boolean) |:keepjumps|. • keepmarks: (boolean) |:keepmarks|. -- cgit From 2afcdbd63a5b0cbeaad9d83b096a3af5201c67a9 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 2 Sep 2022 15:20:29 +0100 Subject: feat(Man): port to Lua (#19912) Co-authored-by: zeertzjq --- runtime/doc/filetype.txt | 4 ++-- runtime/doc/vim_diff.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 7fff74a963..9f8ef248f8 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -586,12 +586,12 @@ Local mappings: to the end of the file in Normal mode. This means "> " is inserted in each line. -MAN *ft-man-plugin* *:Man* *man.vim* +MAN *ft-man-plugin* *:Man* *man.lua* View manpages in Nvim. Supports highlighting, completion, locales, and navigation. Also see |find-manpage|. -man.vim will always attempt to reuse the closest man window (above/left) but +man.lua will always attempt to reuse the closest man window (above/left) but otherwise create a split. The case sensitivity of completion is controlled by 'fileignorecase'. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 0011cd9821..b013e00fe8 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -73,7 +73,7 @@ centralized reference of the differences. - 'wildmenu' is enabled - 'wildoptions' defaults to "pum,tagfile" -- |man.vim| plugin is enabled, so |:Man| is available by default. +- |man.lua| plugin is enabled, so |:Man| is available by default. - |matchit| plugin is enabled. To disable it in your config: > :let loaded_matchit = 1 -- cgit From 1ef7720567b08caec0c077605fb2a01a9d6eafbc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 1 Sep 2022 18:46:34 +0800 Subject: fix(api)!: correctly deal with number before :tab Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which is the same as the number passed before :tab modifier instead of the number plus 1, and "tab" value is -1 if :tab modifier is not used. --- runtime/doc/api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 82978d0b3c..a4fe71bc86 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1846,7 +1846,7 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* • keeppatterns: (boolean) |:keeppatterns|. • lockmarks: (boolean) |:lockmarks|. • noswapfile: (boolean) |:noswapfile|. - • tab: (integer) |:tab|. + • tab: (integer) |:tab|. -1 when omitted. • verbose: (integer) |:verbose|. -1 when omitted. • vertical: (boolean) |:vertical|. • split: (string) Split modifier string, is an empty string when -- cgit From 6f7d55d3d987560d65220522e3705704abca5325 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 4 Sep 2022 06:40:19 +0800 Subject: vim-patch:7.4.{1578,1624} https://github.com/vim/vim/commit/975b5271eed4fa0500c24a8f37be0b1797cb9db7 https://github.com/vim/vim/commit/03602ec28ed25739e88b2c835adb0662d3720bb2 --- runtime/doc/builtin.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index a2e15142e7..50087db4ea 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2510,7 +2510,8 @@ funcref({name} [, {arglist}] [, {dict}]) *function()* *E700* *E922* *E923* function({name} [, {arglist}] [, {dict}]) Return a |Funcref| variable that refers to function {name}. - {name} can be a user defined function or an internal function. + {name} can be the name of a user defined function or an + internal function. {name} can also be a Funcref or a partial. When it is a partial the dict stored in it will be used and the {dict} @@ -2536,6 +2537,18 @@ function({name} [, {arglist}] [, {dict}]) < Invokes the function as with: > call Callback('one', 'two', 'name') +< The function() call can be nested to add more arguments to the + Funcref. The extra arguments are appended to the list of + arguments. Example: > + func Callback(arg1, arg2, name) + ... + let Func = function('Callback', ['one']) + let Func2 = function(Func, ['two']) + ... + call Func2('name') +< Invokes the function as with: > + call Callback('one', 'two', 'name') + < The Dictionary is only useful when calling a "dict" function. In that case the {dict} is passed in as "self". Example: > function Callback() dict @@ -2546,6 +2559,10 @@ function({name} [, {arglist}] [, {dict}]) let Func = function('Callback', context) ... call Func() " will echo: called for example +< The use of function() is not needed when there are no extra + arguments, these two are equivalent: > + let Func = function('Callback', context) + let Func = context.Callback < The argument list and the Dictionary can be combined: > function Callback(arg1, count) dict -- cgit From 21dad0dcf34330cfd7c765485b19d0ac46ce8565 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 4 Sep 2022 06:20:23 +0800 Subject: vim-patch:088e8e344352 Update runtime files. https://github.com/vim/vim/commit/088e8e3443520dec91a384081e66445a104810bb Also cherry-pick "partial" tag from a later runtime update. --- runtime/doc/builtin.txt | 11 ++++++++++- runtime/doc/eval.txt | 5 +++++ runtime/doc/quickref.txt | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 50087db4ea..3ca6f04389 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2507,7 +2507,7 @@ funcref({name} [, {arglist}] [, {dict}]) Can also be used as a |method|: > GetFuncname()->funcref([arg]) < - *function()* *E700* *E922* *E923* + *function()* *partial* *E700* *E922* *E923* function({name} [, {arglist}] [, {dict}]) Return a |Funcref| variable that refers to function {name}. {name} can be the name of a user defined function or an @@ -2537,6 +2537,15 @@ function({name} [, {arglist}] [, {dict}]) < Invokes the function as with: > call Callback('one', 'two', 'name') +< With a |method|: > + func Callback(one, two, three) + ... + let Partial = function('Callback', ['two']) + ... + eval 'one'->Partial('three') +< Invokes the function as with: > + call Callback('one', 'two', 'three') + < The function() call can be nested to add more arguments to the Funcref. The extra arguments are appended to the list of arguments. Example: > diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 3fbf1ee136..bce0189cfb 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2622,6 +2622,11 @@ It is also possible to use `:eval`. It does not support a range, but does allow for method chaining, e.g.: > eval GetList()->Filter()->append('$') +A function can also be called as part of evaluating an expression or when it +is used as a method: > + let x = GetList() + let y = GetList()->Filter() + AUTOMATICALLY LOADING FUNCTIONS ~ *autoload-functions* diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 6f16db5cc2..9f3993506a 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -649,6 +649,7 @@ Short explanation of each option: *option-list* 'complete' 'cpt' specify how Insert mode completion works 'completefunc' 'cfu' function to be used for Insert mode completion 'completeopt' 'cot' options for Insert mode completion +'completeslash' 'csl' like 'shellslash' for completion 'concealcursor' 'cocu' whether concealable text is hidden in cursor line 'conceallevel' 'cole' whether concealable text is shown or hidden 'confirm' 'cf' ask what to do about unsaved/read-only files -- cgit From 00b49dd8dd638c5fe1b664273aea5c843d69f36d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 24 Jul 2022 11:20:23 +0800 Subject: vim-patch:8.2.4674: cannot force getting MouseMove events Problem: Cannot force getting MouseMove events. Solution: Add the 'mousemoveevent' option with implementaiton for the GUI. (Ernie Rael, closes vim/vim#10044) https://github.com/vim/vim/commit/c4cb544cd5beaa864b3893e4b8d0085393c7dbce This only ports the docs and the option variable. The following commits will actually implement it as a UI option. --- runtime/doc/options.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9e396dd3e8..208633f93f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4231,6 +4231,18 @@ A jump table for the options with a short description can be found at |Q_op|. The 'mousemodel' option is set by the |:behave| command. + *'mousemoveevent'* *'mousemev'* +'mousemoveevent' 'mousemev' boolean (default off) + global + {only works in the GUI} + When on, mouse move events are delivered to the input queue and are + available for mapping. The default, off, avoids the mouse movement + overhead except when needed. + Warning: Setting this option can make pending mappings to be aborted + when the mouse is moved. + Currently only works in the GUI, may be made to work in a terminal + later. + *'mousescroll'* 'mousescroll' string (default "ver:3,hor:6") global -- cgit From a5fe7940c8b9436b78ae408eae8345266423f2c8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 24 Jul 2022 11:32:56 +0800 Subject: feat(ui-ext): make 'mousemoveevent' a ui_option --- runtime/doc/ui.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/doc') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 3fb9ed1125..955af84679 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -207,6 +207,7 @@ the editor. 'guifontwide' 'linespace' 'mousefocus' + 'mousemoveevent' 'pumblend' 'showtabline' 'termguicolors' -- cgit From 04bd700ac3bc2bdea0e0d8747de95dab2034aa11 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 24 Jul 2022 11:26:54 +0800 Subject: feat(tui): support 'mousemoveevent' --- runtime/doc/options.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 208633f93f..316b7ae3f1 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4234,14 +4234,11 @@ A jump table for the options with a short description can be found at |Q_op|. *'mousemoveevent'* *'mousemev'* 'mousemoveevent' 'mousemev' boolean (default off) global - {only works in the GUI} When on, mouse move events are delivered to the input queue and are available for mapping. The default, off, avoids the mouse movement overhead except when needed. Warning: Setting this option can make pending mappings to be aborted when the mouse is moved. - Currently only works in the GUI, may be made to work in a terminal - later. *'mousescroll'* 'mousescroll' string (default "ver:3,hor:6") -- cgit From ceb09701f29dcabcf219f458fffbb64f5adced9b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 24 Jul 2022 13:58:29 +0800 Subject: feat(api): add "move" to nvim_input_mouse --- runtime/doc/api.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 82978d0b3c..063e17ded9 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1067,9 +1067,11 @@ nvim_input_mouse({button}, {action}, {modifier}, {grid}, {row}, {col}) |api-fast| Parameters: ~ - {button} Mouse button: one of "left", "right", "middle", "wheel". + {button} Mouse button: one of "left", "right", "middle", "wheel", + "move". {action} For ordinary buttons, one of "press", "drag", "release". For the wheel, one of "up", "down", "left", "right". + Ignored for "move". {modifier} String of modifiers each represented by a single char. The same specifiers are used as for a key press, except that the "-" separator is optional, so "C-A-", "c-a" and "CA" -- cgit From 0822896efcf0da7002e323369fdc1e4a15ad1d57 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 5 Sep 2022 15:52:27 +0200 Subject: feat(treesitter): add vim.treesitter.start(), enable for Lua * Add vim.treesitter.start() for starting treesitter highlighting via ftplugin or autocommand (can be extended later for fold, indent, matchpairs, ...) * Add vim.treesitter.stop() for manually stopping treesitter highlighting * Enable treesitter highlighting for Lua if `vim.g.ts_highlight_lua = true` is set in `init.lua` --- runtime/doc/treesitter.txt | 67 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 14 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 2c6c9e4ed8..8d5e494601 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -375,9 +375,9 @@ get_captures_at_position({bufnr}, {row}, {col}) Gets a list of captures for a given cursor position Parameters: ~ - {bufnr} (number) The buffer number - {row} (number) The position row - {col} (number) The position column + {bufnr} (number) Buffer number (0 for current buffer) + {row} (number) Position row + {col} (number) Position column Return: ~ (table) A table of captures @@ -398,12 +398,14 @@ get_parser({bufnr}, {lang}, {opts}) *get_parser()* callback Parameters: ~ - {bufnr} The buffer the parser should be tied to - {lang} The filetype of this parser - {opts} Options object to pass to the created language tree + {bufnr} (number|nil) Buffer the parser should be tied to: (default + current buffer) + {lang} (string) |nil Filetype of this parser (default: buffer + filetype) + {opts} (table|nil) Options to pass to the created language tree Return: ~ - The parser + (table) Parser object get_string_parser({str}, {lang}, {opts}) *get_string_parser()* Gets a string parser @@ -417,8 +419,8 @@ is_ancestor({dest}, {source}) *is_ancestor()* Determines whether a node is the ancestor of another Parameters: ~ - {dest} (table) the possible ancestor - {source} (table) the possible descendant node + {dest} (table) Possible ancestor + {source} (table) Possible descendant node Return: ~ (boolean) True if dest is an ancestor of source @@ -427,20 +429,57 @@ is_in_node_range({node}, {line}, {col}) *is_in_node_range()* Determines whether (line, col) position is in node range Parameters: ~ - {node} Node defining the range - {line} A line (0-based) - {col} A column (0-based) + {node} (table) Node defining the range + {line} (number) Line (0-based) + {col} (number) Column (0-based) + + Return: ~ + (boolean) True if the position is in node range node_contains({node}, {range}) *node_contains()* Determines if a node contains a range Parameters: ~ - {node} (table) The node - {range} (table) The range + {node} (table) + {range} (table) Return: ~ (boolean) True if the node contains the range +start({bufnr}, {lang}, {opts}) *start()* + Start treesitter highlighting for a buffer + + Can be used in an ftplugin or FileType autocommand + + Note: By default, disables regex syntax highlighting, which may be + required for some plugins. In this case, add `{ syntax = true }`. + + Example: +> + + vim.api.nvim_create_autocmd( 'FileType', { pattern = 'tex', + callback = function(args) + vim.treesitter.start(args.buf, 'latex', { syntax = true }) + end + }) +< + + Parameters: ~ + {bufnr} (number|nil) Buffer to be highlighted (default: current + buffer) + {lang} (string|nil) Language of the parser (default: buffer + filetype) + {opts} (table|nil) Optional keyword arguments: + • `syntax` boolean Run regex syntax highlighting (default + false) + +stop({bufnr}) *stop()* + Stop treesitter highlighting for a buffer + + Parameters: ~ + {bufnr} (number|nil) Buffer to stop highlighting (default: current + buffer) + ============================================================================== Lua module: vim.treesitter.language *treesitter-language* -- cgit From 4bf005e9fdfb57397475b2663a3651faa83886ff Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 6 Sep 2022 08:57:53 +0200 Subject: vim-patch:partial 0daafaa7d99e (#20083) Update runtime files https://github.com/vim/vim/commit/0daafaa7d99ef500f76b1b12f5fe8153e2fcaea0 skip vim9script ftplugin create userfunc.txt from Neovim content (skip section 3, needs 9.0.0379) --- runtime/doc/autocmd.txt | 2 + runtime/doc/builtin.txt | 29 ++-- runtime/doc/eval.txt | 398 +------------------------------------------ runtime/doc/help.txt | 1 + runtime/doc/userfunc.txt | 429 +++++++++++++++++++++++++++++++++++++++++++++++ runtime/doc/windows.txt | 4 +- 6 files changed, 451 insertions(+), 412 deletions(-) create mode 100644 runtime/doc/userfunc.txt (limited to 'runtime/doc') diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 63226fe701..7a2c540ea2 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -412,6 +412,8 @@ CmdwinLeave Before leaving the command-line window. |cmdwin-char| *ColorScheme* ColorScheme After loading a color scheme. |:colorscheme| + Not triggered if the color scheme is not + found. The pattern is matched against the colorscheme name. can be used for the name of the actual file where this option was diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 3ca6f04389..57b41c664b 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -6,9 +6,7 @@ Builtin functions *builtin-functions* -1. Overview |builtin-function-list| -2. Details |builtin-function-details| -3. Matching a pattern in a String |string-match| + Type |gO| to see the table of contents. ============================================================================== 1. Overview *builtin-function-list* @@ -1276,7 +1274,7 @@ complete_info([{what}]) *complete_info()* typed text only, or the last completion after no item is selected when using the or keys) - inserted Inserted string. [NOT IMPLEMENT YET] + inserted Inserted string. [NOT IMPLEMENTED YET] *complete_info_mode* mode values are: @@ -2530,18 +2528,18 @@ function({name} [, {arglist}] [, {dict}]) The arguments are passed to the function in front of other arguments, but after any argument from |method|. Example: > func Callback(arg1, arg2, name) - ... + "... let Partial = function('Callback', ['one', 'two']) - ... + "... call Partial('name') < Invokes the function as with: > call Callback('one', 'two', 'name') < With a |method|: > func Callback(one, two, three) - ... + "... let Partial = function('Callback', ['two']) - ... + "... eval 'one'->Partial('three') < Invokes the function as with: > call Callback('one', 'two', 'three') @@ -2550,10 +2548,10 @@ function({name} [, {arglist}] [, {dict}]) Funcref. The extra arguments are appended to the list of arguments. Example: > func Callback(arg1, arg2, name) - ... + "... let Func = function('Callback', ['one']) let Func2 = function(Func, ['two']) - ... + "... call Func2('name') < Invokes the function as with: > call Callback('one', 'two', 'name') @@ -2563,22 +2561,23 @@ function({name} [, {arglist}] [, {dict}]) function Callback() dict echo "called for " .. self.name endfunction - ... + "... let context = {"name": "example"} let Func = function('Callback', context) - ... + "... call Func() " will echo: called for example < The use of function() is not needed when there are no extra - arguments, these two are equivalent: > + arguments, these two are equivalent, if Callback() is defined + as context.Callback(): > let Func = function('Callback', context) let Func = context.Callback < The argument list and the Dictionary can be combined: > function Callback(arg1, count) dict - ... + "... let context = {"name": "example"} let Func = function('Callback', ['one'], context) - ... + "... call Func(500) < Invokes the function as with: > call context.Callback('one', 500) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index bce0189cfb..3e068e3b4e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2309,402 +2309,10 @@ help file: |builtin-functions|. 5. Defining functions *user-function* New functions can be defined. These can be called just like builtin -functions. The function executes a sequence of Ex commands. Normal mode -commands can be executed with the |:normal| command. - -The function name must start with an uppercase letter, to avoid confusion with -builtin functions. To prevent from using the same name in different scripts -avoid obvious, short names. A good habit is to start the function name with -the name of the script, e.g., "HTMLcolor()". - -It's also possible to use curly braces, see |curly-braces-names|. And the -|autoload| facility is useful to define a function only when it's called. - - *local-function* -A function local to a script must start with "s:". A local script function -can only be called from within the script and from functions, user commands -and autocommands defined in the script. It is also possible to call the -function from a mapping defined in the script, but then || must be used -instead of "s:" when the mapping is expanded outside of the script. -There are only script-local functions, no buffer-local or window-local -functions. - - *:fu* *:function* *E128* *E129* *E123* -:fu[nction] List all functions and their arguments. - -:fu[nction][!] {name} List function {name}, annotated with line numbers - unless "!" is given. - {name} may be a |Dictionary| |Funcref| entry: > - :function dict.init - -:fu[nction] /{pattern} List functions with a name matching {pattern}. - Example that lists all functions ending with "File": > - :function /File$ -< - *:function-verbose* -When 'verbose' is non-zero, listing a function will also display where it was -last defined. Example: > - - :verbose function SetFileTypeSH - function SetFileTypeSH(name) - Last set from /usr/share/vim/vim-7.0/filetype.vim -< -See |:verbose-cmd| for more information. - - *E124* *E125* *E853* *E884* -:fu[nction][!] {name}([arguments]) [range] [abort] [dict] [closure] - Define a new function by the name {name}. The body of - the function follows in the next lines, until the - matching |:endfunction|. - - The name must be made of alphanumeric characters and - '_', and must start with a capital or "s:" (see - above). Note that using "b:" or "g:" is not allowed. - (since patch 7.4.260 E884 is given if the function - name has a colon in the name, e.g. for "foo:bar()". - Before that patch no error was given). - - {name} can also be a |Dictionary| entry that is a - |Funcref|: > - :function dict.init(arg) -< "dict" must be an existing dictionary. The entry - "init" is added if it didn't exist yet. Otherwise [!] - is required to overwrite an existing function. The - result is a |Funcref| to a numbered function. The - function can only be used with a |Funcref| and will be - deleted if there are no more references to it. - *E127* *E122* - When a function by this name already exists and [!] is - not used an error message is given. There is one - exception: When sourcing a script again, a function - that was previously defined in that script will be - silently replaced. - When [!] is used, an existing function is silently - replaced. Unless it is currently being executed, that - is an error. - NOTE: Use ! wisely. If used without care it can cause - an existing function to be replaced unexpectedly, - which is hard to debug. - - For the {arguments} see |function-argument|. - - *:func-range* *a:firstline* *a:lastline* - When the [range] argument is added, the function is - expected to take care of a range itself. The range is - passed as "a:firstline" and "a:lastline". If [range] - is excluded, ":{range}call" will call the function for - each line in the range, with the cursor on the start - of each line. See |function-range-example|. - The cursor is still moved to the first line of the - range, as is the case with all Ex commands. - *:func-abort* - When the [abort] argument is added, the function will - abort as soon as an error is detected. - *:func-dict* - When the [dict] argument is added, the function must - be invoked through an entry in a |Dictionary|. The - local variable "self" will then be set to the - dictionary. See |Dictionary-function|. - *:func-closure* *E932* - When the [closure] argument is added, the function - can access variables and arguments from the outer - scope. This is usually called a closure. In this - example Bar() uses "x" from the scope of Foo(). It - remains referenced even after Foo() returns: > - :function! Foo() - : let x = 0 - : function! Bar() closure - : let x += 1 - : return x - : endfunction - : return funcref('Bar') - :endfunction - - :let F = Foo() - :echo F() -< 1 > - :echo F() -< 2 > - :echo F() -< 3 - - *function-search-undo* - The last used search pattern and the redo command "." - will not be changed by the function. This also - implies that the effect of |:nohlsearch| is undone - when the function returns. - - *:endf* *:endfunction* *E126* *E193* *W22* -:endf[unction] [argument] - The end of a function definition. Best is to put it - on a line by its own, without [argument]. - - [argument] can be: - | command command to execute next - \n command command to execute next - " comment always ignored - anything else ignored, warning given when - 'verbose' is non-zero - The support for a following command was added in Vim - 8.0.0654, before that any argument was silently - ignored. - - To be able to define a function inside an `:execute` - command, use line breaks instead of |:bar|: > - :exe "func Foo()\necho 'foo'\nendfunc" -< - *:delf* *:delfunction* *E131* *E933* -:delf[unction][!] {name} - Delete function {name}. - {name} can also be a |Dictionary| entry that is a - |Funcref|: > - :delfunc dict.init -< This will remove the "init" entry from "dict". The - function is deleted if there are no more references to - it. - With the ! there is no error if the function does not - exist. - *:retu* *:return* *E133* -:retu[rn] [expr] Return from a function. When "[expr]" is given, it is - evaluated and returned as the result of the function. - If "[expr]" is not given, the number 0 is returned. - When a function ends without an explicit ":return", - the number 0 is returned. - Note that there is no check for unreachable lines, - thus there is no warning if commands follow ":return". - - If the ":return" is used after a |:try| but before the - matching |:finally| (if present), the commands - following the ":finally" up to the matching |:endtry| - are executed first. This process applies to all - nested ":try"s inside the function. The function - returns at the outermost ":endtry". - - *function-argument* *a:var* -An argument can be defined by giving its name. In the function this can then -be used as "a:name" ("a:" for argument). - *a:0* *a:1* *a:000* *E740* *...* -Up to 20 arguments can be given, separated by commas. After the named -arguments an argument "..." can be specified, which means that more arguments -may optionally be following. In the function the extra arguments can be used -as "a:1", "a:2", etc. "a:0" is set to the number of extra arguments (which -can be 0). "a:000" is set to a |List| that contains these arguments. Note -that "a:1" is the same as "a:000[0]". - *E742* -The a: scope and the variables in it cannot be changed, they are fixed. -However, if a composite type is used, such as |List| or |Dictionary| , you can -change their contents. Thus you can pass a |List| to a function and have the -function add an item to it. If you want to make sure the function cannot -change a |List| or |Dictionary| use |:lockvar|. - -It is also possible to define a function without any arguments. You must -still supply the () then. - -It is allowed to define another function inside a function body. - - *optional-function-argument* -You can provide default values for positional named arguments. This makes -them optional for function calls. When a positional argument is not -specified at a call, the default expression is used to initialize it. -This only works for functions declared with |function|, not for -lambda expressions |expr-lambda|. - -Example: > - function Something(key, value = 10) - echo a:key .. ": " .. a:value - endfunction - call Something('empty') "empty: 10" - call Something('key', 20) "key: 20" - -The argument default expressions are evaluated at the time of the function -call, not definition. Thus it is possible to use an expression which is -invalid the moment the function is defined. The expressions are also only -evaluated when arguments are not specified during a call. - - *E989* -Optional arguments with default expressions must occur after any mandatory -arguments. You can use "..." after all optional named arguments. - -It is possible for later argument defaults to refer to prior arguments, -but not the other way around. They must be prefixed with "a:", as with all -arguments. - -Example that works: > - :function Okay(mandatory, optional = a:mandatory) - :endfunction -Example that does NOT work: > - :function NoGood(first = a:second, second = 10) - :endfunction -< -When not using "...", the number of arguments in a function call must be at -least equal to the number of mandatory named arguments. When using "...", the -number of arguments may be larger than the total of mandatory and optional -arguments. - - *local-variables* -Inside a function local variables can be used. These will disappear when the -function returns. Global variables need to be accessed with "g:". - -Example: > - :function Table(title, ...) - : echohl Title - : echo a:title - : echohl None - : echo a:0 .. " items:" - : for s in a:000 - : echon ' ' .. s - : endfor - :endfunction - -This function can then be called with: > - call Table("Table", "line1", "line2") - call Table("Empty Table") - -To return more than one value, return a |List|: > - :function Compute(n1, n2) - : if a:n2 == 0 - : return ["fail", 0] - : endif - : return ["ok", a:n1 / a:n2] - :endfunction - -This function can then be called with: > - :let [success, div] = Compute(102, 6) - :if success == "ok" - : echo div - :endif -< - *:cal* *:call* *E107* *E117* -:[range]cal[l] {name}([arguments]) - Call a function. The name of the function and its arguments - are as specified with `:function`. Up to 20 arguments can be - used. The returned value is discarded. - Without a range and for functions that accept a range, the - function is called once. When a range is given the cursor is - positioned at the start of the first line before executing the - function. - When a range is given and the function doesn't handle it - itself, the function is executed for each line in the range, - with the cursor in the first column of that line. The cursor - is left at the last line (possibly moved by the last function - call). The arguments are re-evaluated for each line. Thus - this works: - *function-range-example* > - :function Mynumber(arg) - : echo line(".") .. " " .. a:arg - :endfunction - :1,5call Mynumber(getline(".")) -< - The "a:firstline" and "a:lastline" are defined anyway, they - can be used to do something different at the start or end of - the range. - - Example of a function that handles the range itself: > - - :function Cont() range - : execute (a:firstline + 1) .. "," .. a:lastline .. 's/^/\t\\ ' - :endfunction - :4,8call Cont() -< - This function inserts the continuation character "\" in front - of all the lines in the range, except the first one. - - When the function returns a composite value it can be further - dereferenced, but the range will not be used then. Example: > - :4,8call GetDict().method() -< Here GetDict() gets the range but method() does not. - - *E132* -The recursiveness of user functions is restricted with the |'maxfuncdepth'| -option. - -It is also possible to use `:eval`. It does not support a range, but does -allow for method chaining, e.g.: > - eval GetList()->Filter()->append('$') - -A function can also be called as part of evaluating an expression or when it -is used as a method: > - let x = GetList() - let y = GetList()->Filter() - - -AUTOMATICALLY LOADING FUNCTIONS ~ - *autoload-functions* -When using many or large functions, it's possible to automatically define them -only when they are used. There are two methods: with an autocommand and with -the "autoload" directory in 'runtimepath'. - - -Using an autocommand ~ - -This is introduced in the user manual, section |41.14|. - -The autocommand is useful if you have a plugin that is a long Vim script file. -You can define the autocommand and quickly quit the script with `:finish`. -That makes Vim startup faster. The autocommand should then load the same file -again, setting a variable to skip the `:finish` command. - -Use the FuncUndefined autocommand event with a pattern that matches the -function(s) to be defined. Example: > - - :au FuncUndefined BufNet* source ~/vim/bufnetfuncs.vim - -The file "~/vim/bufnetfuncs.vim" should then define functions that start with -"BufNet". Also see |FuncUndefined|. - - -Using an autoload script ~ - *autoload* *E746* -This is introduced in the user manual, section |41.15|. - -Using a script in the "autoload" directory is simpler, but requires using -exactly the right file name. A function that can be autoloaded has a name -like this: > - - :call filename#funcname() - -When such a function is called, and it is not defined yet, Vim will search the -"autoload" directories in 'runtimepath' for a script file called -"filename.vim". For example "~/.config/nvim/autoload/filename.vim". That -file should then define the function like this: > - - function filename#funcname() - echo "Done!" - endfunction - -The file name and the name used before the # in the function must match -exactly, and the defined function must have the name exactly as it will be -called. - -It is possible to use subdirectories. Every # in the function name works like -a path separator. Thus when calling a function: > - - :call foo#bar#func() - -Vim will look for the file "autoload/foo/bar.vim" in 'runtimepath'. - -This also works when reading a variable that has not been set yet: > - - :let l = foo#bar#lvar - -However, when the autoload script was already loaded it won't be loaded again -for an unknown variable. - -When assigning a value to such a variable nothing special happens. This can -be used to pass settings to the autoload script before it's loaded: > - - :let foo#bar#toggle = 1 - :call foo#bar#func() - -Note that when you make a mistake and call a function that is supposed to be -defined in an autoload script, but the script doesn't actually define the -function, you will get an error message for the missing function. If you fix -the autoload script it won't be automatically loaded again. Either restart -Vim or manually source the script. +functions. The function takes arguments, executes a sequence of Ex commands +and can return a value. -Also note that if you have two script files, and one calls a function in the -other and vice versa, before the used function is defined, it won't work. -Avoid using the autoload functionality at the toplevel. +You can find most information about defining functions in |userfunc.txt|. ============================================================================== 6. Curly braces names *curly-braces-names* diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 04e31e0680..34213f7512 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -131,6 +131,7 @@ Advanced editing ~ |autocmd.txt| automatically executing commands on an event |eval.txt| expression evaluation, conditional commands |builtin.txt| builtin functions +|userfunc.txt| defining user functions |fold.txt| hide (fold) ranges of lines |lua.txt| Lua API |api.txt| Nvim API via RPC, Lua and VimL diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt new file mode 100644 index 0000000000..39c246e21d --- /dev/null +++ b/runtime/doc/userfunc.txt @@ -0,0 +1,429 @@ +*userfunc.txt* Nvim + + + VIM REFERENCE MANUAL by Bram Moolenaar + + +Defining and using functions. + +This is introduced in section |41.7| of the user manual. + + Type |gO| to see the table of contents. + +============================================================================== + +1. Defining a fuction ~ + *define-function* +New functions can be defined. These can be called just like builtin +functions. The function executes a sequence of Ex commands. Normal mode +commands can be executed with the |:normal| command. + +The function name must start with an uppercase letter, to avoid confusion with +builtin functions. To prevent from using the same name in different scripts +make them script-local. If you do use a global function the avoid obvious, +short names. A good habit is to start the function name with the name of the +script, e.g., "HTMLcolor()". + +It is also possible to use curly braces, see |curly-braces-names|. + +The |autoload| facility is useful to define a function only when it's called. + + *local-function* +A function local to a script must start with "s:". A local script function +can only be called from within the script and from functions, user commands +and autocommands defined in the script. It is also possible to call the +function from a mapping defined in the script, but then || must be used +instead of "s:" when the mapping is expanded outside of the script. +There are only script-local functions, no buffer-local or window-local +functions. + + *:fu* *:function* *E128* *E129* *E123* +:fu[nction] List all functions and their arguments. + +:fu[nction][!] {name} List function {name}, annotated with line numbers + unless "!" is given. + {name} may be a |Dictionary| |Funcref| entry: > + :function dict.init + +:fu[nction] /{pattern} List functions with a name matching {pattern}. + Example that lists all functions ending with "File": > + :function /File$ +< + *:function-verbose* +When 'verbose' is non-zero, listing a function will also display where it was +last defined. Example: > + + :verbose function SetFileTypeSH + function SetFileTypeSH(name) + Last set from /usr/share/vim/vim-7.0/filetype.vim +< +See |:verbose-cmd| for more information. + + *E124* *E125* *E853* *E884* +:fu[nction][!] {name}([arguments]) [range] [abort] [dict] [closure] + Define a new function by the name {name}. The body of + the function follows in the next lines, until the + matching |:endfunction|. + + The name must be made of alphanumeric characters and + '_', and must start with a capital or "s:" (see + above). Note that using "b:" or "g:" is not allowed. + (since patch 7.4.260 E884 is given if the function + name has a colon in the name, e.g. for "foo:bar()". + Before that patch no error was given). + + {name} can also be a |Dictionary| entry that is a + |Funcref|: > + :function dict.init(arg) +< "dict" must be an existing dictionary. The entry + "init" is added if it didn't exist yet. Otherwise [!] + is required to overwrite an existing function. The + result is a |Funcref| to a numbered function. The + function can only be used with a |Funcref| and will be + deleted if there are no more references to it. + *E127* *E122* + When a function by this name already exists and [!] is + not used an error message is given. There is one + exception: When sourcing a script again, a function + that was previously defined in that script will be + silently replaced. + When [!] is used, an existing function is silently + replaced. Unless it is currently being executed, that + is an error. + NOTE: Use ! wisely. If used without care it can cause + an existing function to be replaced unexpectedly, + which is hard to debug. + + For the {arguments} see |function-argument|. + + *:func-range* *a:firstline* *a:lastline* + When the [range] argument is added, the function is + expected to take care of a range itself. The range is + passed as "a:firstline" and "a:lastline". If [range] + is excluded, ":{range}call" will call the function for + each line in the range, with the cursor on the start + of each line. See |function-range-example|. + The cursor is still moved to the first line of the + range, as is the case with all Ex commands. + *:func-abort* + When the [abort] argument is added, the function will + abort as soon as an error is detected. + *:func-dict* + When the [dict] argument is added, the function must + be invoked through an entry in a |Dictionary|. The + local variable "self" will then be set to the + dictionary. See |Dictionary-function|. + *:func-closure* *E932* + When the [closure] argument is added, the function + can access variables and arguments from the outer + scope. This is usually called a closure. In this + example Bar() uses "x" from the scope of Foo(). It + remains referenced even after Foo() returns: > + :function! Foo() + : let x = 0 + : function! Bar() closure + : let x += 1 + : return x + : endfunction + : return funcref('Bar') + :endfunction + + :let F = Foo() + :echo F() +< 1 > + :echo F() +< 2 > + :echo F() +< 3 + + *function-search-undo* + The last used search pattern and the redo command "." + will not be changed by the function. This also + implies that the effect of |:nohlsearch| is undone + when the function returns. + + *:endf* *:endfunction* *E126* *E193* *W22* +:endf[unction] [argument] + The end of a function definition. Best is to put it + on a line by its own, without [argument]. + + [argument] can be: + | command command to execute next + \n command command to execute next + " comment always ignored + anything else ignored, warning given when + 'verbose' is non-zero + The support for a following command was added in Vim + 8.0.0654, before that any argument was silently + ignored. + + To be able to define a function inside an `:execute` + command, use line breaks instead of |:bar|: > + :exe "func Foo()\necho 'foo'\nendfunc" +< + *:delf* *:delfunction* *E131* *E933* +:delf[unction][!] {name} + Delete function {name}. + {name} can also be a |Dictionary| entry that is a + |Funcref|: > + :delfunc dict.init +< This will remove the "init" entry from "dict". The + function is deleted if there are no more references to + it. + With the ! there is no error if the function does not + exist. + *:retu* *:return* *E133* +:retu[rn] [expr] Return from a function. When "[expr]" is given, it is + evaluated and returned as the result of the function. + If "[expr]" is not given, the number 0 is returned. + When a function ends without an explicit ":return", + the number 0 is returned. + Note that there is no check for unreachable lines, + thus there is no warning if commands follow ":return". + + If the ":return" is used after a |:try| but before the + matching |:finally| (if present), the commands + following the ":finally" up to the matching |:endtry| + are executed first. This process applies to all + nested ":try"s inside the function. The function + returns at the outermost ":endtry". + + *function-argument* *a:var* +An argument can be defined by giving its name. In the function this can then +be used as "a:name" ("a:" for argument). + *a:0* *a:1* *a:000* *E740* *...* +Up to 20 arguments can be given, separated by commas. After the named +arguments an argument "..." can be specified, which means that more arguments +may optionally be following. In the function the extra arguments can be used +as "a:1", "a:2", etc. "a:0" is set to the number of extra arguments (which +can be 0). "a:000" is set to a |List| that contains these arguments. Note +that "a:1" is the same as "a:000[0]". + *E742* +The a: scope and the variables in it cannot be changed, they are fixed. +However, if a composite type is used, such as |List| or |Dictionary| , you can +change their contents. Thus you can pass a |List| to a function and have the +function add an item to it. If you want to make sure the function cannot +change a |List| or |Dictionary| use |:lockvar|. + +It is also possible to define a function without any arguments. You must +still supply the () then. + +It is allowed to define another function inside a function body. + + *optional-function-argument* +You can provide default values for positional named arguments. This makes +them optional for function calls. When a positional argument is not +specified at a call, the default expression is used to initialize it. +This only works for functions declared with |function|, not for +lambda expressions |expr-lambda|. + +Example: > + function Something(key, value = 10) + echo a:key .. ": " .. a:value + endfunction + call Something('empty') "empty: 10" + call Something('key', 20) "key: 20" + +The argument default expressions are evaluated at the time of the function +call, not definition. Thus it is possible to use an expression which is +invalid the moment the function is defined. The expressions are also only +evaluated when arguments are not specified during a call. + + *E989* +Optional arguments with default expressions must occur after any mandatory +arguments. You can use "..." after all optional named arguments. + +It is possible for later argument defaults to refer to prior arguments, +but not the other way around. They must be prefixed with "a:", as with all +arguments. + +Example that works: > + :function Okay(mandatory, optional = a:mandatory) + :endfunction +Example that does NOT work: > + :function NoGood(first = a:second, second = 10) + :endfunction +< +When not using "...", the number of arguments in a function call must be at +least equal to the number of mandatory named arguments. When using "...", the +number of arguments may be larger than the total of mandatory and optional +arguments. + + *local-variables* +Inside a function local variables can be used. These will disappear when the +function returns. Global variables need to be accessed with "g:". Inside +functions local variables are accessed without prepending anything. But you +can also prepend "l:" if you like. This is required for some reserved names, +such as "version". + +Example: > + :function Table(title, ...) + : echohl Title + : echo a:title + : echohl None + : echo a:0 .. " items:" + : for s in a:000 + : echon ' ' .. s + : endfor + :endfunction + +This function can then be called with: > + call Table("Table", "line1", "line2") + call Table("Empty Table") + +To return more than one value, return a |List|: > + :function Compute(n1, n2) + : if a:n2 == 0 + : return ["fail", 0] + : endif + : return ["ok", a:n1 / a:n2] + :endfunction + +This function can then be called with: > + :let [success, div] = Compute(102, 6) + :if success == "ok" + : echo div + :endif +< +============================================================================== + +2. Calling a fuction ~ + *:cal* *:call* *E107* *E117* +:[range]cal[l] {name}([arguments]) + Call a function. The name of the function and its arguments + are as specified with `:function`. Up to 20 arguments can be + used. The returned value is discarded. + Without a range and for functions that accept a range, the + function is called once. When a range is given the cursor is + positioned at the start of the first line before executing the + function. + When a range is given and the function doesn't handle it + itself, the function is executed for each line in the range, + with the cursor in the first column of that line. The cursor + is left at the last line (possibly moved by the last function + call). The arguments are re-evaluated for each line. Thus + this works: + *function-range-example* > + :function Mynumber(arg) + : echo line(".") .. " " .. a:arg + :endfunction + :1,5call Mynumber(getline(".")) +< + The "a:firstline" and "a:lastline" are defined anyway, they + can be used to do something different at the start or end of + the range. + + Example of a function that handles the range itself: > + + :function Cont() range + : execute (a:firstline + 1) .. "," .. a:lastline .. 's/^/\t\\ ' + :endfunction + :4,8call Cont() +< + This function inserts the continuation character "\" in front + of all the lines in the range, except the first one. + + When the function returns a composite value it can be further + dereferenced, but the range will not be used then. Example: > + :4,8call GetDict().method() +< Here GetDict() gets the range but method() does not. + + *E132* +The recursiveness of user functions is restricted with the |'maxfuncdepth'| +option. + +It is also possible to use `:eval`. It does not support a range, but does +allow for method chaining, e.g.: > + eval GetList()->Filter()->append('$') + +A function can also be called as part of evaluating an expression or when it +is used as a method: > + let x = GetList() + let y = GetList()->Filter() + + +============================================================================== + +3. Automatically loading functions ~ + *autoload-functions* +When using many or large functions, it's possible to automatically define them +only when they are used. There are two methods: with an autocommand and with +the "autoload" directory in 'runtimepath'. + + +Using an autocommand ~ + +This is introduced in the user manual, section |41.14|. + +The autocommand is useful if you have a plugin that is a long Vim script file. +You can define the autocommand and quickly quit the script with `:finish`. +That makes Vim startup faster. The autocommand should then load the same file +again, setting a variable to skip the `:finish` command. + +Use the FuncUndefined autocommand event with a pattern that matches the +function(s) to be defined. Example: > + + :au FuncUndefined BufNet* source ~/vim/bufnetfuncs.vim + +The file "~/vim/bufnetfuncs.vim" should then define functions that start with +"BufNet". Also see |FuncUndefined|. + + +Using an autoload script ~ + *autoload* *E746* +This is introduced in the user manual, section |41.15|. + +Using a script in the "autoload" directory is simpler, but requires using +exactly the right file name. A function that can be autoloaded has a name +like this: > + + :call filename#funcname() + +When such a function is called, and it is not defined yet, Vim will search the +"autoload" directories in 'runtimepath' for a script file called +"filename.vim". For example "~/.config/nvim/autoload/filename.vim". That +file should then define the function like this: > + + function filename#funcname() + echo "Done!" + endfunction + +The file name and the name used before the # in the function must match +exactly, and the defined function must have the name exactly as it will be +called. + +It is possible to use subdirectories. Every # in the function name works like +a path separator. Thus when calling a function: > + + :call foo#bar#func() + +Vim will look for the file "autoload/foo/bar.vim" in 'runtimepath'. + +This also works when reading a variable that has not been set yet: > + + :let l = foo#bar#lvar + +However, when the autoload script was already loaded it won't be loaded again +for an unknown variable. + +When assigning a value to such a variable nothing special happens. This can +be used to pass settings to the autoload script before it's loaded: > + + :let foo#bar#toggle = 1 + :call foo#bar#func() + +Note that when you make a mistake and call a function that is supposed to be +defined in an autoload script, but the script doesn't actually define the +function, you will get an error message for the missing function. If you fix +the autoload script it won't be automatically loaded again. Either restart +Vim or manually source the script. + +Also note that if you have two script files, and one calls a function in the +other and vice versa, before the used function is defined, it won't work. +Avoid using the autoload functionality at the toplevel. + +Hint: If you distribute a bunch of scripts you can pack them together with the +|vimball| utility. Also read the user manual |distribute-script|. + + + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index ddf4d09e92..6386e4ace1 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -236,13 +236,13 @@ and 'winminwidth' are relevant. :vert[ical] {cmd} Execute {cmd}. If it contains a command that splits a window, it will be split vertically. For `vertical wincmd =` windows - will be equialized only vertically. + will be equalized only vertically. Doesn't work for |:execute| and |:normal|. *:hor* *:horizontal* :hor[izontal] {cmd} Execute {cmd}. Currently only makes a difference for - `horizontal wincmd =`, which will equal windows only + `horizontal wincmd =`, which will equalize windows only horizontally. :lefta[bove] {cmd} *:lefta* *:leftabove* -- cgit From 95fd1ad83e24bbb14cc084fb001251939de6c0a9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 6 Sep 2022 08:50:06 +0200 Subject: refactor(treesitter): get_{nodes,captures}_at_{position,cursor} --- runtime/doc/treesitter.txt | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 8d5e494601..afbece1088 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -370,6 +370,15 @@ attribute: > ============================================================================== Lua module: vim.treesitter *lua-treesitter-core* +get_captures_at_cursor({winnr}) *get_captures_at_cursor()* + Gets a list of captures under the cursor + + Parameters: ~ + {winnr} (number|nil) Window handle or 0 for current window (default) + + Return: ~ + (table) Named node under the cursor + *get_captures_at_position()* get_captures_at_position({bufnr}, {row}, {col}) Gets a list of captures for a given cursor position @@ -380,7 +389,31 @@ get_captures_at_position({bufnr}, {row}, {col}) {col} (number) Position column Return: ~ - (table) A table of captures + (table) Table of captures + +get_node_at_cursor({winnr}) *get_node_at_cursor()* + Gets the smallest named node under the cursor + + Parameters: ~ + {winnr} (number|nil) Window handle or 0 for current window (default) + + Return: ~ + (string) Named node under the cursor + + *get_node_at_position()* +get_node_at_position({bufnr}, {row}, {col}, {opts}) + Gets the smallest named node at position + + Parameters: ~ + {bufnr} (number) Buffer number (0 for current buffer) + {row} (number) Position row + {col} (number) Position column + {opts} (table) Optional keyword arguments: + • ignore_injections boolean Ignore injected languages + (default true) + + Return: ~ + (table) Named node under the cursor get_node_range({node_or_range}) *get_node_range()* Get the node's range or unpack a range table @@ -389,7 +422,7 @@ get_node_range({node_or_range}) *get_node_range()* {node_or_range} (table) Return: ~ - start_row, start_col, end_row, end_col + (table) start_row, start_col, end_row, end_col get_parser({bufnr}, {lang}, {opts}) *get_parser()* Gets the parser for this bufnr / ft combination. @@ -398,7 +431,7 @@ get_parser({bufnr}, {lang}, {opts}) *get_parser()* callback Parameters: ~ - {bufnr} (number|nil) Buffer the parser should be tied to: (default + {bufnr} (number|nil) Buffer the parser should be tied to (default: current buffer) {lang} (string) |nil Filetype of this parser (default: buffer filetype) -- cgit From 75adfefc85bcf0d62d2c0f51a951e6003b595cea Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Mon, 18 Jul 2022 14:21:40 +0200 Subject: feat(extmarks,ts,spell): full support for spelling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added 'spell' option to extmarks: Extmarks with this set will have the region spellchecked. - Added 'noplainbuffer' option to 'spelloptions': This is used to tell Neovim not to spellcheck the buffer. The old behaviour was to spell check the whole buffer unless :syntax was set. - Added spelling support to the treesitter highlighter: @spell captures in highlights.scm are used to define regions which should be spell checked. - Added support for navigating spell errors for extmarks: Works for both ephemeral and static extmarks - Added '_on_spell_nav' callback for decoration providers: Since ephemeral callbacks are only drawn for the visible screen, providers must implement this callback to instruct Neovim which regions in the buffer need can be spell checked. The callback takes a start position and an end position. Note: this callback is subject to change hence the _ prefix. - Added spell captures for built-in support languages Co-authored-by: Lewis Russell Co-authored-by: Björn Linse --- runtime/doc/api.txt | 6 ++++-- runtime/doc/options.txt | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index ea562e60b6..00a3759936 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2646,6 +2646,8 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts}) When a character is supplied it is used as |:syn-cchar|. "hl_group" is used as highlight for the cchar if provided, otherwise it defaults to |hl-Conceal|. + • spell: boolean indicating that spell checking should be + performed within this extmark • ui_watched: boolean that indicates the mark should be drawn by a UI. When set, the UI will receive win_extmark events. Note: the mark is positioned by virt_text @@ -2677,7 +2679,7 @@ nvim_get_namespaces() *nvim_get_namespaces()* dict that maps from names to namespace ids. *nvim_set_decoration_provider()* -nvim_set_decoration_provider({ns_id}, {opts}) +nvim_set_decoration_provider({ns_id}, {*opts}) Set or change decoration provider for a namespace This is a very general purpose interface for having lua callbacks being @@ -2709,7 +2711,7 @@ nvim_set_decoration_provider({ns_id}, {opts}) Parameters: ~ {ns_id} Namespace id from |nvim_create_namespace()| - {opts} Callbacks invoked during redraw: + {opts} Table of callbacks: • on_start: called first on each screen redraw ["start", tick] • on_buf: called for each buffer being redrawn (before window diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 316b7ae3f1..b84a41eabc 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5871,10 +5871,14 @@ A jump table for the options with a short description can be found at |Q_op|. 'spelloptions' 'spo' string (default "") local to buffer A comma-separated list of options for spell checking: - camel When a word is CamelCased, assume "Cased" is a + camel When a word is CamelCased, assume "Cased" is a separate word: every upper-case character in a word that comes after a lower case character indicates the start of a new word. + noplainbuffer Only spellcheck a buffer when 'syntax' is enabled, or + or when extmarks are set within the buffer. Only + designated regions of the buffer are spellchecked in + this case. *'spellsuggest'* *'sps'* 'spellsuggest' 'sps' string (default "best") -- cgit From d01cadd82fc74baf7d292c5cbbcf223e0aa2c097 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 6 Sep 2022 17:33:44 +0200 Subject: fix(treesitter): don't support legacy syntax in start() --- runtime/doc/treesitter.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 8d5e494601..dbc81dbd96 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -446,20 +446,21 @@ node_contains({node}, {range}) *node_contains()* Return: ~ (boolean) True if the node contains the range -start({bufnr}, {lang}, {opts}) *start()* +start({bufnr}, {lang}) *start()* Start treesitter highlighting for a buffer Can be used in an ftplugin or FileType autocommand Note: By default, disables regex syntax highlighting, which may be - required for some plugins. In this case, add `{ syntax = true }`. + required for some plugins. In this case, add vim.bo.syntax = 'on `after the call to` start`. Example: > vim.api.nvim_create_autocmd( 'FileType', { pattern = 'tex', callback = function(args) - vim.treesitter.start(args.buf, 'latex', { syntax = true }) + vim.treesitter.start(args.buf, 'latex') + vim.bo[args.buf].syntax = 'on' -- only if additional legacy syntax is needed end }) < @@ -469,9 +470,6 @@ start({bufnr}, {lang}, {opts}) *start()* buffer) {lang} (string|nil) Language of the parser (default: buffer filetype) - {opts} (table|nil) Optional keyword arguments: - • `syntax` boolean Run regex syntax highlighting (default - false) stop({bufnr}) *stop()* Stop treesitter highlighting for a buffer -- cgit From fd1595514b747d8b083f78007579d869ccfbe89c Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Wed, 7 Sep 2022 08:39:56 +0200 Subject: Use weak tables in tree-sitter code (#17117) feat(treesitter): use weak tables when possible Also add the defaulttable function to create a table whose values are created when a key is missing. --- runtime/doc/lua.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index a634cc1e93..35badb13b1 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1581,6 +1581,28 @@ deepcopy({orig}) *vim.deepcopy()* Return: ~ (table) Table of copied keys and (nested) values. +defaulttable({create}) *vim.defaulttable()* + Creates a table whose members are automatically created when accessed, if + they don't already exist. + + They mimic defaultdict in python. + + If `create` is `nil`, this will create a defaulttable whose constructor + function is this function, effectively allowing to create nested tables on + the fly: +> + + local a = vim.defaulttable() + a.b.c = 1 +< + + Parameters: ~ + {create} (function|nil) The function called to create a missing + value. + + Return: ~ + (table) Empty table with metamethod + endswith({s}, {suffix}) *vim.endswith()* Tests if `s` ends with `suffix`. -- cgit From 99e6e0f221ccdb7aa983121359aedb7791e870dd Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 8 Sep 2022 12:54:41 +0800 Subject: docs(treesitter): fix doxygen --- runtime/doc/treesitter.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index dbc81dbd96..eb7ea04254 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -452,7 +452,8 @@ start({bufnr}, {lang}) *start()* Can be used in an ftplugin or FileType autocommand Note: By default, disables regex syntax highlighting, which may be - required for some plugins. In this case, add vim.bo.syntax = 'on `after the call to` start`. + required for some plugins. In this case, add `vim.bo.syntax = 'on'` after + the call to `start`. Example: > -- cgit From 4af04df84442c8d54fbe66fe7968b9bdd153aae5 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 8 Sep 2022 14:33:17 +0800 Subject: fix(docs): remove duplicate word --- runtime/doc/options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index b84a41eabc..110f7400e6 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5875,7 +5875,7 @@ A jump table for the options with a short description can be found at |Q_op|. separate word: every upper-case character in a word that comes after a lower case character indicates the start of a new word. - noplainbuffer Only spellcheck a buffer when 'syntax' is enabled, or + noplainbuffer Only spellcheck a buffer when 'syntax' is enabled, or when extmarks are set within the buffer. Only designated regions of the buffer are spellchecked in this case. -- cgit From 0405594399741babd6d935d581eac2584b289f92 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Thu, 8 Sep 2022 09:47:36 +0200 Subject: feat(treesitter)!: do not merge queries by default (#20105) Problem: Treesitter queries for a given language in runtime were merged together, leading to errors if they targeted different parser versions (e.g., bundled viml queries and those shipped by nvim-treesitter). Solution: Runtime queries now work as follows: * The last query in the rtp without `; extends` in the header will be used as the base query * All queries (without a specific order) with `; extends` are concatenated with the base query BREAKING CHANGE: queries need to be updated if they are meant to extend other queries --- runtime/doc/treesitter.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index eb7ea04254..9f688da963 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -194,6 +194,32 @@ and predicates. A `capture` allows you to associate names with a specific node in a pattern. A `predicate` adds arbitrary metadata and conditional data to a match. +Neovim supports to customize the behavior of the queries using a set of +"modelines", that is comments in the queries starting with `;`. Here are the +currently supported modeline alternatives: + + `inherits: {lang}...` + Specifies that this query should inherit the queries from {lang}. + This will recursively descend in the queries of {lang} unless wrapped + in parentheses: `({lang})`. + + `extends` + Specifies that this query should be used as an extension for the + query, i.e. that it should be merged with the others. + Note: the order of the extensions, and the query that will be used as + a base depends on your 'runtimepath' value. + +Note: these modeline comments must be at the top of the query, but can be +repeated, for example, the following modeline blocks are all valid: +> + ;; inherits: foo,bar + ;; extends + + ;; extends + ;; + ;; inherits: baz +< + Treesitter Query Predicates *lua-treesitter-predicates* When writing queries for treesitter, one might use `predicates`, that is, -- cgit From 893b659e88c61a8c3ce5b140ab475cd67e0ca6bc Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 8 Sep 2022 11:17:29 +0200 Subject: fix(treesitter): use the right loading order for base queries (#20117) Use the first, not last, query for a language on runtimepath. Typically, this implies that a user query will override a site plugin query, which will override a bundled runtime query. --- runtime/doc/treesitter.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 9f688da963..9d163aa072 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -187,6 +187,11 @@ Note: The predicates listed in the web page above differ from those Neovim supports. See |lua-treesitter-predicates| for a complete list of predicates supported by Neovim. +By default, the first query on `runtimepath` is used (which usually implies +that user config takes precedence over plugins, which take precedence over +queries bundled with Neovim). If a query should extend other queries instead +of replacing them, use the `; extends` modeline below. + A `query` consists of one or more patterns. A `pattern` is defined over node types in the syntax tree. A `match` corresponds to specific elements of the syntax tree which match a pattern. Patterns may optionally define captures -- cgit From 11167ab6d569994dd0a4f58155c84b118706380c Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Thu, 8 Sep 2022 11:33:04 +0200 Subject: feat(lsp): add range option to lsp.buf.format (#19998) --- runtime/doc/lsp.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 3393a1a1fd..a3d21cc6f7 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1136,6 +1136,11 @@ format({options}) *vim.lsp.buf.format()* ID (client.id) matching this field. • name (string|nil): Restrict formatting to the client with name (client.name) matching this field. + • range (table|nil) Range to format. Table must contain + `start` and `end` keys with {row, col} tuples using (1,0) + indexing. Defaults to current selection in visual mode + Defaults to `nil` in other modes, formatting the full + buffer formatting({options}) *vim.lsp.buf.formatting()* Formats the current buffer. -- cgit From 19a3b2c26e28382a65529a38be9ff63ca58cc023 Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Thu, 8 Sep 2022 19:25:16 +0200 Subject: docs(lsp): update rpc.start stdio limitations (#20120) --- runtime/doc/lsp.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index a3d21cc6f7..00aaf759e2 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1962,8 +1962,9 @@ rpc_response_error({code}, {message}, {data}) *vim.lsp.rpc.start()* start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params}) Starts an LSP server process and create an LSP RPC client object to - interact with it. Communication with the server is currently limited to - stdio. + interact with it. Communication with the spawned process happens via + stdio. For communication via TCP, spawn a process manually and use + |vim.lsp.rpc.connect| Parameters: ~ {cmd} (string) Command to start the LSP server. -- cgit From 91a2e7a571c8615f2ffd9046687a6b438356db2b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 10 Sep 2022 14:54:13 +0200 Subject: vim-patch:71b6d3397649 (#20144) Update runtime files https://github.com/vim/vim/commit/71b6d3397649fed68ef587aa863fcbdf5fdb057a --- runtime/doc/tagsrch.txt | 8 +++++--- runtime/doc/userfunc.txt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 2485290667..82deb0fa0c 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -870,13 +870,15 @@ like |CTRL-]|. The function used for generating the taglist is specified by setting the 'tagfunc' option. The function will be called with three arguments: - a:pattern The tag identifier or pattern used during the tag search. - a:flags String containing flags to control the function behavior. - a:info Dict containing the following entries: + pattern The tag identifier or pattern used during the tag search. + flags String containing flags to control the function behavior. + info Dict containing the following entries: buf_ffname Full filename which can be used for priority. user_data Custom data String, if stored in the tag stack previously by tagfunc. +Note that "a:" needs to be prepended to the argument name when using it. + Currently up to three flags may be passed to the tag function: 'c' The function was invoked by a normal command being processed (mnemonic: the tag function may use the context around the diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt index 39c246e21d..c701834383 100644 --- a/runtime/doc/userfunc.txt +++ b/runtime/doc/userfunc.txt @@ -20,7 +20,7 @@ commands can be executed with the |:normal| command. The function name must start with an uppercase letter, to avoid confusion with builtin functions. To prevent from using the same name in different scripts -make them script-local. If you do use a global function the avoid obvious, +make them script-local. If you do use a global function then avoid obvious, short names. A good habit is to start the function name with the name of the script, e.g., "HTMLcolor()". -- cgit From 245ac6f263b6017c050f885212ee80e5738d3b9f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 12 Sep 2022 17:10:31 +0800 Subject: vim-patch:8.2.5034: there is no way to get the byte index from a virtual column Problem: There is no way to get the byte index from a virtual column. Solution: Add virtcol2col(). (Yegappan Lakshmanan, closes vim/vim#10477, closes vim/vim#10098) https://github.com/vim/vim/commit/5a6ec10cc80ab02eeff644ab19b82312630ea855 Cherry-pick tv_check_for_number_arg() from Vim. Cherry-pick pathshorten() doc change. --- runtime/doc/builtin.txt | 32 +++++++++++++++++++++++++++++++- runtime/doc/usr_41.txt | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 57b41c664b..c70643d12c 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -526,6 +526,8 @@ uniq({list} [, {func} [, {dict}]]) List remove adjacent duplicates from a list values({dict}) List values in {dict} virtcol({expr}) Number screen column of cursor or mark +virtcol2col({winid}, {lnum}, {col}) + Number byte index of a character on screen visualmode([expr]) String last visual mode used wait({timeout}, {condition} [, {interval}]) Number Wait until {condition} is satisfied @@ -5620,12 +5622,19 @@ nvim_...({...}) *E5555* *nvim_...()* *eval-api* or({expr}, {expr}) *or()* Bitwise OR on the two arguments. The arguments are converted to a number. A List, Dict or Float argument causes an error. + Also see `and()` and `xor()`. Example: > :let bits = or(bits, 0x80) < Can also be used as a |method|: > :let bits = bits->or(0x80) -pathshorten({expr} [, {len}]) *pathshorten()* +< Rationale: The reason this is a function and not using the "|" + character like many languages, is that Vi has always used "|" + to separate commands. In many places it would not be clear if + "|" is an operator or a command separator. + + +pathshorten({path} [, {len}]) *pathshorten()* Shorten directory names in the path {path} and return the result. The tail, the file name, is kept as-is. The other components in the path are reduced to {len} letters in length. @@ -8831,6 +8840,26 @@ virtcol({expr}) *virtcol()* < Can also be used as a |method|: > GetPos()->virtcol() +virtcol2col({winid}, {lnum}, {col}) *virtcol2col()* + The result is a Number, which is the byte index of the + character in window {winid} at buffer line {lnum} and virtual + column {col}. + + If {col} is greater than the last virtual column in line + {lnum}, then the byte index of the character at the last + virtual column is returned. + + The {winid} argument can be the window number or the + |window-ID|. If this is zero, then the current window is used. + + Returns -1 if the window {winid} doesn't exist or the buffer + line {lnum} or virtual column {col} is invalid. + + See also |screenpos()|, |virtcol()| and |col()|. + + Can also be used as a |method|: > + GetWinid()->virtcol2col(lnum, col) + visualmode([{expr}]) *visualmode()* The result is a String, which describes the last Visual mode used in the current buffer. Initially it returns an empty @@ -9262,6 +9291,7 @@ writefile({object}, {fname} [, {flags}]) xor({expr}, {expr}) *xor()* Bitwise XOR on the two arguments. The arguments are converted to a number. A List, Dict or Float argument causes an error. + Also see `and()` and `or()`. Example: > :let bits = xor(bits, 0x80) < diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 76c2f8454f..ee644be366 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -745,6 +745,7 @@ Cursor and mark position: *cursor-functions* *mark-functions* screencol() get screen column of the cursor screenrow() get screen row of the cursor screenpos() screen row and col of a text character + virtcol2col() byte index of a text character on screen getcurpos() get position of the cursor getpos() get position of cursor, mark, etc. setpos() set position of cursor, mark, etc. -- cgit From a3272cf452c7df000974d39a5f4b43b4c20990a7 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Sun, 11 Sep 2022 08:23:54 +0200 Subject: docs(treesitter): suggest using `extends` to extend queries --- runtime/doc/treesitter.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 0a48b435b6..491aea793c 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -190,7 +190,7 @@ supported by Neovim. By default, the first query on `runtimepath` is used (which usually implies that user config takes precedence over plugins, which take precedence over queries bundled with Neovim). If a query should extend other queries instead -of replacing them, use the `; extends` modeline below. +of replacing them, use |ts-modeline-extends|. A `query` consists of one or more patterns. A `pattern` is defined over node types in the syntax tree. A `match` corresponds to specific elements of the @@ -199,16 +199,20 @@ and predicates. A `capture` allows you to associate names with a specific node in a pattern. A `predicate` adds arbitrary metadata and conditional data to a match. + *ts-query-modeline* Neovim supports to customize the behavior of the queries using a set of "modelines", that is comments in the queries starting with `;`. Here are the currently supported modeline alternatives: - `inherits: {lang}...` + `inherits: {lang}...` *ts-modeline-inherits* Specifies that this query should inherit the queries from {lang}. This will recursively descend in the queries of {lang} unless wrapped in parentheses: `({lang})`. + Note: this is meant to be used to include queries from another + language. If you want your query to extend the queries of the same + language, use `extends`. - `extends` + `extends` *ts-modeline-extends* Specifies that this query should be used as an extension for the query, i.e. that it should be merged with the others. Note: the order of the extensions, and the query that will be used as -- cgit From 907fc8ac373226556b84c2fdc4fe26525bbdb2c4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 13 Sep 2022 06:23:33 +0800 Subject: vim-patch:9.0.0449: there is no easy way to translate a key code into a string (#20168) Problem: There is no easy way to translate a string with a key code into a readable string. Solution: Add the keytrans() function. (closes vim/vim#11114) https://github.com/vim/vim/commit/cdc839353f68ca43db6446e1b727fc7ba657b738 vim-patch:7b2d87220c6c Add missing part of patch https://github.com/vim/vim/commit/7b2d87220c6c974d5cdae672b6f9620a6bcbd1dc --- runtime/doc/builtin.txt | 12 ++++++++++++ runtime/doc/usr_41.txt | 2 ++ 2 files changed, 14 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index c70643d12c..7b1a50c1fb 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -277,6 +277,8 @@ join({list} [, {sep}]) String join {list} items into one String json_decode({expr}) any Convert {expr} from JSON json_encode({expr}) String Convert {expr} to JSON keys({dict}) List keys in {dict} +keytrans({string}) String translate internal keycodes to a form + that can be used by |:map| len({expr}) Number the length of {expr} libcall({lib}, {func}, {arg}) String call {func} in library {lib} with {arg} libcallnr({lib}, {func}, {arg}) Number idem, but return a Number @@ -4537,6 +4539,16 @@ keys({dict}) *keys()* Can also be used as a |method|: > mydict->keys() +keytrans({string}) *keytrans()* + Turn the internal byte representation of keys into a form that + can be used for |:map|. E.g. > + :let xx = "\" + :echo keytrans(xx) +< + + Can also be used as a |method|: > + "\"->keytrans() + < *len()* *E701* len({expr}) The result is a Number, which is the length of the argument. When {expr} is a String or a Number the length in bytes is diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index ee644be366..1aa9aaa0c4 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -604,6 +604,8 @@ String manipulation: *string-functions* fnameescape() escape a file name for use with a Vim command tr() translate characters from one set to another strtrans() translate a string to make it printable + keytrans() translate internal keycodes to a form that + can be used by |:map| tolower() turn a string to lowercase toupper() turn a string to uppercase charclass() class of a character -- cgit From 1970d2ac43059639e4e2c83223d86397b38786ff Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Tue, 13 Sep 2022 08:33:39 -0600 Subject: feat(diagnostic): pass diagnostics as data to DiagnosticChanged autocmd (#20173) --- runtime/doc/diagnostic.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index e1b52746be..78254c6f2b 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -295,10 +295,18 @@ option in the "signs" table of |vim.diagnostic.config()| or 10 if unset). EVENTS *diagnostic-events* *DiagnosticChanged* -DiagnosticChanged After diagnostics have changed. +DiagnosticChanged After diagnostics have changed. When used from Lua, + the new diagnostics are passed to the autocmcd + callback in the "data" table. Example: > - autocmd DiagnosticChanged * lua vim.diagnostic.setqflist({ open = false }) + + vim.api.nvim_create_autocmd('DiagnosticChanged', { + callback = function(args) + local diagnostics = args.data.diagnostics + vim.pretty_print(diagnostics) + end, + }) < ============================================================================== Lua module: vim.diagnostic *diagnostic-api* -- cgit From a8c9e721d91efe4730db78c1115261fc128dca68 Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Tue, 13 Sep 2022 22:16:20 +0200 Subject: feat(fs): extend fs.find to accept predicate (#20193) Makes it possible to use `vim.fs.find` to find files where only a substring is known. This is useful for `vim.lsp.start` to get the `root_dir` for languages where the project-file is only known by its extension, not by the full name. For example in .NET projects there is usually a `.csproj` file in the project root. Example: vim.fs.find(function(x) return vim.endswith(x, '.csproj') end, { upward = true }) --- runtime/doc/lua.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 35badb13b1..e5bfd9e4c6 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2323,8 +2323,10 @@ find({names}, {opts}) *vim.fs.find()* specifying {type} to be "file" or "directory", respectively. Parameters: ~ - {names} (string|table) Names of the files and directories to find. - Must be base names, paths and globs are not supported. + {names} (string|table|fun(name: string): boolean) Names of the files + and directories to find. Must be base names, paths and globs + are not supported. If a function it is called per file and + dir within the traversed directories to test if they match. {opts} (table) Optional keyword arguments: • path (string): Path to begin searching from. If omitted, the current working directory is used. -- cgit From ddb762f4013ac2532ad45704466058d867e3a6ed Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 14 Sep 2022 11:08:31 +0200 Subject: docs(treesitter): clean up and update treesitter.txt (#20142) * add type annotations to code * clean up and expand static documentation * consistent use of tags for static and generated docs --- runtime/doc/lua.txt | 2 +- runtime/doc/treesitter.txt | 762 +++++++++++++++++++++++---------------------- 2 files changed, 388 insertions(+), 376 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index e5bfd9e4c6..45ee69d5e4 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1587,7 +1587,7 @@ defaulttable({create}) *vim.defaulttable()* They mimic defaultdict in python. - If `create` is `nil`, this will create a defaulttable whose constructor + If {create} is `nil`, this will create a defaulttable whose constructor function is this function, effectively allowing to create nested tables on the fly: > diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 491aea793c..dc81a31856 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -4,77 +4,75 @@ NVIM REFERENCE MANUAL -Tree-sitter integration *treesitter* +Treesitter integration *treesitter* - Type |gO| to see the table of contents. - ------------------------------------------------------------------------------- -VIM.TREESITTER *lua-treesitter* +Nvim integrates the `tree-sitter` library for incremental parsing of buffers: +https://tree-sitter.github.io/tree-sitter/ -Nvim integrates the tree-sitter library for incremental parsing of buffers. +WARNING: Treesitter support is still experimental and subject to frequent +changes. This documentation may also not fully reflect the latest changes. - *vim.treesitter.language_version* -The latest parser ABI version that is supported by the bundled tree-sitter -library. - - *vim.treesitter.minimum_language_version* -The earliest parser ABI version that is supported by the bundled tree-sitter -library. + Type |gO| to see the table of contents. -Parser files *treesitter-parsers* +============================================================================== +PARSER FILES *treesitter-parsers* Parsers are the heart of tree-sitter. They are libraries that tree-sitter will -search for in the `parser` runtime directory. Currently Nvim does not provide -the tree-sitter parsers, instead these must be built separately, for instance -using the tree-sitter utility. The only exception is a C parser being included -in official builds for testing purposes. Parsers are searched for as -`parser/{lang}.*` in any 'runtimepath' directory. +search for in the `parser` runtime directory. By default, Nvim bundles only +parsers for C, Lua, and Vimscript, but parsers can be installed manually or +via a plugin like https://github.com/nvim-treesitter/nvim-treesitter. +Parsers are searched for as `parser/{lang}.*` in any 'runtimepath' directory. +If multiple parsers for the same language are found, the first one is used. +(This typically implies the priority "user config > plugins > bundled". A parser can also be loaded manually using a full path: > vim.treesitter.require_language("python", "/path/to/python.so") +< +============================================================================== +LANGUAGE TREES *treesitter-languagetree* + *LanguageTree* - +As buffers can contain multiple languages (e.g., Vimscript commands in a Lua +file), multiple parsers may be needed to parse the full buffer. These are +combined in a |LanguageTree| object. - parser = vim.treesitter.get_parser(bufnr, lang) +To create a LanguageTree (parser object) for a buffer and a given language, +use > -<`bufnr=0` can be used for current buffer. `lang` will default to 'filetype'. + tsparser = vim.treesitter.get_parser(bufnr, lang) +< +`bufnr=0` can be used for current buffer. `lang` will default to 'filetype'. Currently, the parser will be retained for the lifetime of a buffer but this is subject to change. A plugin should keep a reference to the parser object as long as it wants incremental updates. - -Parser methods *lua-treesitter-parser* - -tsparser:parse() *tsparser:parse()* Whenever you need to access the current syntax tree, parse the buffer: > - tstree = parser:parse() - - - { - {node1, node2}, - ... - } -< - `node1` and `node2` are both considered part of the same region and will - be parsed together with the parser in the same context. +See |lua-treesitter-languagetree| for the list of available methods. + +============================================================================== +TREESITTER TREES *treesitter-tree* + *tstree* + +A "treesitter tree" represents the parsed contents of a buffer, which can be +used to perform further analysis. It is a |luaref-userdata| reference to an +object held by the tree-sitter library. -Tree methods *lua-treesitter-tree* +An instance `tstree` of a treesitter tree supports the following methods. tstree:root() *tstree:root()* Return the root node of this tree. @@ -82,8 +80,15 @@ tstree:root() *tstree:root()* tstree:copy() *tstree:copy()* Returns a copy of the `tstree`. +============================================================================== +TREESITTER NODES *treesitter-node* + *tsnode* + +A "treesitter node" represents one specific element of the parsed contents of +a buffer, which can be captured by a |Query| for, e.g., highlighting. It is a +|luaref-userdata| reference to an object held by the tree-sitter library. -Node methods *lua-treesitter-node* +An instance `tsnode` of a treesitter node supports the following methods. tsnode:parent() *tsnode:parent()* Get the node's immediate parent. @@ -160,10 +165,10 @@ tsnode:id() *tsnode:id()* Get an unique identifier for the node inside its own tree. No guarantees are made about this identifier's internal representation, - except for being a primitive lua type with value equality (so not a + except for being a primitive Lua type with value equality (so not a table). Presently it is a (non-printable) string. - Note: the id is not guaranteed to be unique for nodes from different + Note: The `id` is not guaranteed to be unique for nodes from different trees. *tsnode:descendant_for_range()* @@ -176,123 +181,91 @@ tsnode:named_descendant_for_range({start_row}, {start_col}, {end_row}, {end_col} Get the smallest named node within this node that spans the given range of (row, column) positions -Query *lua-treesitter-query* - -Tree-sitter queries are supported, they are a way to do pattern-matching over -a tree, using a simple to write lisp-like format. See -https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax for more -information on how to write queries. - -Note: The predicates listed in the web page above differ from those Neovim -supports. See |lua-treesitter-predicates| for a complete list of predicates -supported by Neovim. - +============================================================================== +TREESITTER QUERIES *treesitter-query* + +Treesitter queries are a way to extract information about a parsed |tstree|, +e.g., for the purpose of highlighting. Briefly, a `query` consists of one or +more patterns. A `pattern` is defined over node types in the syntax tree. A +`match` corresponds to specific elements of the syntax tree which match a +pattern. Patterns may optionally define captures and predicates. A `capture` +allows you to associate names with a specific node in a pattern. A `predicate` +adds arbitrary metadata and conditional data to a match. + +Queries are written in a lisp-like language documented in +https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax +Note: The predicates listed there page differ from those Nvim supports. See +|treesitter-predicates| for a complete list of predicates supported by Nvim. + +Nvim looks for queries as `*.scm` files in a `queries` directory under +`runtimepath`, where each file contains queries for a specific language and +purpose, e.g., `queries/lua/highlights.scm` for highlighting Lua files. By default, the first query on `runtimepath` is used (which usually implies that user config takes precedence over plugins, which take precedence over queries bundled with Neovim). If a query should extend other queries instead -of replacing them, use |ts-modeline-extends|. +of replacing them, use |ts-query-modeline-extends|. -A `query` consists of one or more patterns. A `pattern` is defined over node -types in the syntax tree. A `match` corresponds to specific elements of the -syntax tree which match a pattern. Patterns may optionally define captures -and predicates. A `capture` allows you to associate names with a specific -node in a pattern. A `predicate` adds arbitrary metadata and conditional data -to a match. +See |lua-treesitter-query| for the list of available methods for working with +treesitter queries from Lua. - *ts-query-modeline* -Neovim supports to customize the behavior of the queries using a set of -"modelines", that is comments in the queries starting with `;`. Here are the -currently supported modeline alternatives: - `inherits: {lang}...` *ts-modeline-inherits* - Specifies that this query should inherit the queries from {lang}. - This will recursively descend in the queries of {lang} unless wrapped - in parentheses: `({lang})`. - Note: this is meant to be used to include queries from another - language. If you want your query to extend the queries of the same - language, use `extends`. - - `extends` *ts-modeline-extends* - Specifies that this query should be used as an extension for the - query, i.e. that it should be merged with the others. - Note: the order of the extensions, and the query that will be used as - a base depends on your 'runtimepath' value. - -Note: these modeline comments must be at the top of the query, but can be -repeated, for example, the following modeline blocks are all valid: -> - ;; inherits: foo,bar - ;; extends - - ;; extends - ;; - ;; inherits: baz -< +TREESITTER QUERY PREDICATES *treesitter-predicates* -Treesitter Query Predicates *lua-treesitter-predicates* +Predicates are special scheme nodes that are evaluated to conditionally capture +nodes. For example, the |eq?| predicate can be used as follows: > -When writing queries for treesitter, one might use `predicates`, that is, -special scheme nodes that are evaluated to verify things on a captured node -for example, the |eq?| predicate : > ((identifier) @foo (#eq? @foo "foo")) +< +to only match identifier corresponding to the `"foo"` text. -This will only match identifier corresponding to the `"foo"` text. -Here is a list of built-in predicates : +The following predicates are built in: `eq?` *ts-predicate-eq?* - This predicate will check text correspondence between nodes or - strings: > + Match a string against the text corresponding to a node: > ((identifier) @foo (#eq? @foo "foo")) ((node1) @left (node2) @right (#eq? @left @right)) < `match?` *ts-predicate-match?* `vim-match?` *ts-predicate-vim-match?* - This will match if the provided vim regex matches the text - corresponding to a node: > + Match a |regexp| against the text corresponding to a node: > ((identifier) @constant (#match? @constant "^[A-Z_]+$")) -< Note: the `^` and `$` anchors will respectively match the start and - end of the node's text. +< Note: The `^` and `$` anchors will match the start and end of the + node's text. `lua-match?` *ts-predicate-lua-match?* - This will match the same way than |match?| but using lua regexes. + Match a |lua-pattern| against the text corresponding to a node, + similar to `match?` `contains?` *ts-predicate-contains?* - Will check if any of the following arguments appears in the text - corresponding to the node: > + Match a string against parts of the text corresponding to a node: > ((identifier) @foo (#contains? @foo "foo")) ((identifier) @foo-bar (#contains @foo-bar "foo" "bar")) < `any-of?` *ts-predicate-any-of?* - Will check if the text is the same as any of the following arguments: > + Match any of the given strings against the text corresponding to + a node: > ((identifier) @foo (#any-of? @foo "foo" "bar")) < This is the recommended way to check if the node matches one of many - keywords for example, as it has been optimized for this. -< + keywords, as it has been optimized for this. + *lua-treesitter-not-predicate* Each predicate has a `not-` prefixed predicate that is just the negation of the predicate. - *vim.treesitter.query.add_predicate()* -vim.treesitter.query.add_predicate({name}, {handler}) +Further predicates can be added via `vim.treesitter.query.`|add_predicate()|. +Use `vim.treesitter.query.`|list_predicates()| to list all available +predicates. -This adds a predicate with the name {name} to be used in queries. -{handler} should be a function whose signature will be : > - handler(match, pattern, bufnr, predicate) -< - *vim.treesitter.query.list_predicates()* -vim.treesitter.query.list_predicates() -This lists the currently available predicates to use in queries. +TREESITTER QUERY DIRECTIVES *treesitter-directives* -Treesitter Query Directive *lua-treesitter-directives* +Treesitter directives store metadata for a node or match and perform side +effects. For example, the |set!| predicate sets metadata on the match or node: > -Treesitter queries can also contain `directives`. Directives store metadata -for a node or match and perform side effects. For example, the |set!| -predicate sets metadata on the match or node : > ((identifier) @foo (#set! "type" "parameter")) - -Built-in directives: +< +The following directives are built in: `set!` *ts-directive-set!* Sets key/value metadata for a specific match or capture. Value is @@ -324,51 +297,74 @@ Built-in directives: ((identifier) @constant (#offset! @constant 0 1 0 -1)) < -Treesitter syntax highlighting (WIP) *lua-treesitter-highlight* +Further directives can be added via `vim.treesitter.query.`|add_directive()|. +Use `vim.treesitter.query.`|list_directives()| to list all available +directives. -NOTE: This is a partially implemented feature, and not usable as a default -solution yet. What is documented here is a temporary interface intended -for those who want to experiment with this feature and contribute to -its development. -Highlights are defined in the same query format as in the tree-sitter -highlight crate, with some limitations and additions. Set a highlight query -for a buffer with this code: > +TREESITTER QUERY MODELINES *ts-query-modeline* - local query = [[ - "for" @keyword - "if" @keyword - "return" @keyword +Neovim supports to customize the behavior of the queries using a set of +"modelines", that is comments in the queries starting with `;`. Here are the +currently supported modeline alternatives: - (string_literal) @string - (number_literal) @number - (comment) @comment + `inherits: {lang}...` *ts-query-modeline-inherits* + Specifies that this query should inherit the queries from {lang}. + This will recursively descend in the queries of {lang} unless wrapped + in parentheses: `({lang})`. + Note: This is meant to be used to include queries from another + language. If you want your query to extend the queries of the same + language, use `extends`. - (preproc_function_def name: (identifier) @function) + `extends` *ts-query-modeline-extends* + Specifies that this query should be used as an extension for the + query, i.e. that it should be merged with the others. + Note: The order of the extensions, and the query that will be used as + a base depends on your 'runtimepath' value. + +Note: These modeline comments must be at the top of the query, but can be +repeated, for example, the following two modeline blocks are both valid: > - ; ... more definitions - ]] + ;; inherits: foo,bar + ;; extends + + ;; extends + ;; + ;; inherits: baz +< +============================================================================== +TREESITTER SYNTAX HIGHLIGHTING *treesitter-highlight* - highlighter = vim.treesitter.TSHighlighter.new(query, bufnr, lang) - -- alternatively, to use the current buffer and its filetype: - -- highlighter = vim.treesitter.TSHighlighter.new(query) +Syntax highlighting is specified through queries named `highlights.scm`, +which match a |tsnode| in the parsed |tstree| to a `capture` that can be +assigned a highlight group. For example, the query > - -- Don't recreate the highlighter for the same buffer, instead - -- modify the query like this: - local query2 = [[ ... ]] - highlighter:set_query(query2) + (parameters (identifier) @parameter) +< +matches any `identifier` node inside a function `parameter` node (e.g., the +`bar` in `foo(bar)`) to the capture named `@parameter`. It is also possible to +match literal expressions (provided the parser returns them): > + "return" @keyword.return +< +Assuming a suitable parser and `highlights.scm` query is found in runtimepath, +treesitter highlighting for the current buffer can be enabled simply via +|vim.treesitter.start()|. - *lua-treesitter-highlight-groups* + *treesitter-highlight-groups* The capture names, with `@` included, are directly usable as highlight groups. +For many commonly used captures, the corresponding highlight groups are linked +to Nvim's standard |highlight-groups| by default but can be overridden in +colorschemes. + A fallback system is implemented, so that more specific groups fallback to -more generic ones. For instance, in a language that has separate doc -comments, `@comment.doc` could be used. If this group is not defined, the -highlighting for an ordinary `@comment` is used. This way, existing color -schemes already work out of the box, but it is possible to add -more specific variants for queries that make them available. +more generic ones. For instance, in a language that has separate doc comments, +`@comment.doc` could be used. If this group is not defined, the highlighting +for an ordinary `@comment` is used. This way, existing color schemes already +work out of the box, but it is possible to add more specific variants for +queries that make them available. -As an additional rule, captures highlights can always be specialized by +As an additional rule, capture highlights can always be specialized by language, by appending the language name after an additional dot. For instance, to highlight comments differently per language: > @@ -376,68 +372,91 @@ instance, to highlight comments differently per language: > hi @comment.lua @guifg=DarkBlue hi link @comment.doc.java String < -It is possible to use custom highlight groups. As an example, if we -define the `@warning` group: > + *treesitter-highlight-spell* +The special `@spell` capture can be used to indicate that a node should be +spell checked by Nvim's builtin |spell| checker. For example, the following +capture marks comments as to be checked: > + + (comment) @spell +< + *treesitter-highlight-conceal* +Treesitter highlighting supports |conceal| via the `conceal` metadata. By +convention, nodes to be concealed are captured as `@conceal`, but any capture +can be used. For example, the following query can be used to hide code block +delimiters in Markdown: > - hi link @warning WarningMsg + (fenced_code_block_delimiter) @conceal (#set! conceal "") < -the following query warns of a binary expression with two -identical identifiers, highlighting both as |hl-WarningMsg|: > +It is also possible to replace a node with a single character, which (unlike +legacy syntax) can be given a custom highlight. For example, the following +(ill-advised) query replaces the `!=` operator by a Unicode glyph, which is +still highlighted the same as other operators: > - ((binary_expression left: (identifier) @warning.left right: (identifier) @warning.right) - (eq? @warning.left @warning.right)) + "!=" @operator (#set! conceal "≠") < -Treesitter Highlighting Priority *lua-treesitter-highlight-priority* +Conceals specified in this way respect |conceallevel|. -Tree-sitter uses |nvim_buf_set_extmark()| to set highlights with a default + *treesitter-highlight-priority* +Treesitter uses |nvim_buf_set_extmark()| to set highlights with a default priority of 100. This enables plugins to set a highlighting priority lower or higher than tree-sitter. It is also possible to change the priority of an individual query pattern manually by setting its `"priority"` metadata attribute: > - ( - (super_important_node) @ImportantHighlight - ; Give the whole query highlight priority higher than the default (100) - (set! "priority" 105) - ) + (super_important_node) @ImportantHighlight (#set! "priority" 105) < +============================================================================== +VIM.TREESITTER *lua-treesitter* + +The remainder of this document is a reference manual for the `vim.treesitter` +Lua module, which is the main interface for Nvim's tree-sitter integration. +Most of the following content is automatically generated from the function +documentation. + + + *vim.treesitter.language_version* +The latest parser ABI version that is supported by the bundled tree-sitter +library. + + *vim.treesitter.minimum_language_version* +The earliest parser ABI version that is supported by the bundled tree-sitter +library. ============================================================================== Lua module: vim.treesitter *lua-treesitter-core* get_captures_at_cursor({winnr}) *get_captures_at_cursor()* - Gets a list of captures under the cursor + Returns a list of highlight capture names under the cursor Parameters: ~ {winnr} (number|nil) Window handle or 0 for current window (default) Return: ~ - (table) Named node under the cursor + string[] List of capture names *get_captures_at_position()* get_captures_at_position({bufnr}, {row}, {col}) - Gets a list of captures for a given cursor position - Parameters: ~ {bufnr} (number) Buffer number (0 for current buffer) {row} (number) Position row {col} (number) Position column Return: ~ - (table) Table of captures + table[] Captures of the form `{ capture = "capture name", priority = + capture priority }` get_node_at_cursor({winnr}) *get_node_at_cursor()* - Gets the smallest named node under the cursor + Returns the smallest named node under the cursor Parameters: ~ {winnr} (number|nil) Window handle or 0 for current window (default) Return: ~ - (string) Named node under the cursor + (string) Name of node under the cursor *get_node_at_position()* get_node_at_position({bufnr}, {row}, {col}, {opts}) - Gets the smallest named node at position + Returns the smallest named node at the given position Parameters: ~ {bufnr} (number) Buffer number (0 for current buffer) @@ -448,56 +467,59 @@ get_node_at_position({bufnr}, {row}, {col}, {opts}) (default true) Return: ~ - (table) Named node under the cursor + userdata |tsnode| under the cursor get_node_range({node_or_range}) *get_node_range()* - Get the node's range or unpack a range table + Returns the node's range or an unpacked range table Parameters: ~ - {node_or_range} (table) + {node_or_range} (userdata|table) |tsnode| or table of positions Return: ~ - (table) start_row, start_col, end_row, end_col + (table) `{ start_row, start_col, end_row, end_col }` get_parser({bufnr}, {lang}, {opts}) *get_parser()* - Gets the parser for this bufnr / ft combination. + Returns the parser for a specific buffer and filetype and attaches it to + the buffer - If needed this will create the parser. Unconditionally attach the provided - callback + If needed, this will create the parser. Parameters: ~ {bufnr} (number|nil) Buffer the parser should be tied to (default: current buffer) - {lang} (string) |nil Filetype of this parser (default: buffer + {lang} (string|nil) Filetype of this parser (default: buffer filetype) {opts} (table|nil) Options to pass to the created language tree Return: ~ - (table) Parser object + LanguageTree |LanguageTree| object to use for parsing get_string_parser({str}, {lang}, {opts}) *get_string_parser()* - Gets a string parser + Returns a string parser Parameters: ~ - {str} The string to parse - {lang} The language of this string - {opts} Options to pass to the created language tree + {str} (string) Text to parse + {lang} (string) Language of this string + {opts} (table|nil) Options to pass to the created language tree + + Return: ~ + LanguageTree |LanguageTree| object to use for parsing is_ancestor({dest}, {source}) *is_ancestor()* Determines whether a node is the ancestor of another Parameters: ~ - {dest} (table) Possible ancestor - {source} (table) Possible descendant node + {dest} userdata Possible ancestor |tsnode| + {source} userdata Possible descendant |tsnode| Return: ~ - (boolean) True if dest is an ancestor of source + (boolean) True if {dest} is an ancestor of {source} is_in_node_range({node}, {line}, {col}) *is_in_node_range()* Determines whether (line, col) position is in node range Parameters: ~ - {node} (table) Node defining the range + {node} userdata |tsnode| defining the range {line} (number) Line (0-based) {col} (number) Column (0-based) @@ -508,30 +530,29 @@ node_contains({node}, {range}) *node_contains()* Determines if a node contains a range Parameters: ~ - {node} (table) + {node} userdata |tsnode| {range} (table) Return: ~ - (boolean) True if the node contains the range + (boolean) True if the {node} contains the {range} start({bufnr}, {lang}) *start()* - Start treesitter highlighting for a buffer + Starts treesitter highlighting for a buffer - Can be used in an ftplugin or FileType autocommand + Can be used in an ftplugin or FileType autocommand. Note: By default, disables regex syntax highlighting, which may be required for some plugins. In this case, add `vim.bo.syntax = 'on'` after the call to `start`. - Example: -> + Example: > - vim.api.nvim_create_autocmd( 'FileType', { pattern = 'tex', - callback = function(args) - vim.treesitter.start(args.buf, 'latex') - vim.bo[args.buf].syntax = 'on' -- only if additional legacy syntax is needed - end - }) + vim.api.nvim_create_autocmd( 'FileType', { pattern = 'tex', + callback = function(args) + vim.treesitter.start(args.buf, 'latex') + vim.bo[args.buf].syntax = 'on' -- only if additional legacy syntax is needed + end + }) < Parameters: ~ @@ -541,7 +562,7 @@ start({bufnr}, {lang}) *start()* filetype) stop({bufnr}) *stop()* - Stop treesitter highlighting for a buffer + Stops treesitter highlighting for a buffer Parameters: ~ {bufnr} (number|nil) Buffer to stop highlighting (default: current @@ -549,7 +570,7 @@ stop({bufnr}) *stop()* ============================================================================== -Lua module: vim.treesitter.language *treesitter-language* +Lua module: vim.treesitter.language *lua-treesitter-language* inspect_language({lang}) *inspect_language()* Inspects the provided language. @@ -558,26 +579,32 @@ inspect_language({lang}) *inspect_language()* names, ... Parameters: ~ - {lang} The language. + {lang} (string) Language + + Return: ~ + (table) *require_language()* require_language({lang}, {path}, {silent}, {symbol_name}) - Asserts that the provided language is installed, and optionally provide a - path for the parser + Asserts that a parser for the language {lang} is installed. - Parsers are searched in the `parser` runtime directory. + Parsers are searched in the `parser` runtime directory, or the provided + {path} Parameters: ~ - {lang} (string) The language the parser should parse + {lang} (string) Language the parser should parse {path} (string|nil) Optional path the parser is located at {silent} (boolean|nil) Don't throw an error if language not found {symbol_name} (string|nil) Internal symbol name for the language to load + Return: ~ + (boolean) If the specified language is installed + ============================================================================== -Lua module: vim.treesitter.query *treesitter-query* +Lua module: vim.treesitter.query *lua-treesitter-query* add_directive({name}, {handler}, {force}) *add_directive()* Adds a new directive to be used in queries @@ -588,65 +615,74 @@ add_directive({name}, {handler}, {force}) *add_directive()* `metadata[capture_id].key = value` Parameters: ~ - {name} the name of the directive, without leading # - {handler} the handler function to be used signature will be (match, - pattern, bufnr, predicate, metadata) + {name} (string) Name of the directive, without leading # + {handler} function(match:string, pattern:string, bufnr:number, + predicate:function, metadata:table) add_predicate({name}, {handler}, {force}) *add_predicate()* Adds a new predicate to be used in queries Parameters: ~ - {name} the name of the predicate, without leading # - {handler} the handler function to be used signature will be (match, - pattern, bufnr, predicate) + {name} (string) Name of the predicate, without leading # + {handler} function(match:string, pattern:string, bufnr:number, + predicate:function) get_node_text({node}, {source}, {opts}) *get_node_text()* Gets the text corresponding to a given node Parameters: ~ - {node} (table) The node - {source} (table) The buffer or string from which the node is + {node} userdata |tsnode| + {source} (number|string) Buffer or string from which the {node} is extracted - {opts} (table) Optional parameters. - • concat: (boolean default true) Concatenate result in a - string + {opts} (table|nil) Optional parameters. + • concat: (boolean) Concatenate result in a string (default + true) + + Return: ~ + (string[]|string) get_query({lang}, {query_name}) *get_query()* Returns the runtime query {query_name} for {lang}. Parameters: ~ - {lang} The language to use for the query - {query_name} The name of the query (i.e. "highlights") + {lang} (string) Language to use for the query + {query_name} (string) Name of the query (e.g. 'highlights') Return: ~ - The corresponding query, parsed. + Query Parsed query *get_query_files()* get_query_files({lang}, {query_name}, {is_included}) Gets the list of files used to make up a query Parameters: ~ - {lang} The language - {query_name} The name of the query to load - {is_included} Internal parameter, most of the time left as `nil` + {lang} (string) Language to get query for + {query_name} (string) Name of the query to load (e.g., 'highlights') + {is_included} (boolean|nil) Internal parameter, most of the time left + as `nil` + + Return: ~ + string[] query_files List of files to load for given query and + language list_directives() *list_directives()* Lists the currently available directives to use in queries. Return: ~ - The list of supported directives. + string[] List of supported directives. list_predicates() *list_predicates()* + Lists the currently available predicates to use in queries. + Return: ~ - The list of supported predicates. + string[] List of supported predicates. parse_query({lang}, {query}) *parse_query()* Parse {query} as a string. (If the query is in a file, the caller should read the contents into a string before calling). - Returns a `Query` (see |lua-treesitter-query|) object which can be used to - search nodes in the syntax tree for the patterns defined in {query} using - `iter_*` methods below. + Returns a `Query` (see |lua-treesitter-query|) object which can be used to search nodes in + the syntax tree for the patterns defined in {query} using `iter_*` methods below. Exposes `info` and `captures` with additional context about {query}. • `captures` contains the list of unique capture names defined in {query}. @@ -654,106 +690,109 @@ parse_query({lang}, {query}) *parse_query()* • `info.patterns` contains information about predicates. Parameters: ~ - {lang} (string) The language - {query} (string) A string containing the query (s-expr syntax) + {lang} (string) Language to use for the query + {query} (string) Query in s-expr syntax Return: ~ - The query + Query Parsed query *Query:iter_captures()* Query:iter_captures({self}, {node}, {source}, {start}, {stop}) Iterate over all captures from all matches inside {node} - {source} is needed if the query contains predicates, then the caller must + {source} is needed if the query contains predicates; then the caller must ensure to use a freshly parsed tree consistent with the current text of the buffer (if relevant). {start_row} and {end_row} can be used to limit matches inside a row range (this is typically used with root node as the - node, i e to get syntax highlight matches in the current viewport). When - omitted the start and end row values are used from the given node. + {node}, i.e., to get syntax highlight matches in the current viewport). + When omitted, the {start} and {end} row values are used from the given + node. - The iterator returns three values, a numeric id identifying the capture, + The iterator returns three values: a numeric id identifying the capture, the captured node, and metadata from any directives processing the match. - The following example shows how to get captures by name: -> - - for id, node, metadata in query:iter_captures(tree:root(), bufnr, first, last) do - local name = query.captures[id] -- name of the capture in the query - -- typically useful info about the node: - local type = node:type() -- type of the captured node - local row1, col1, row2, col2 = node:range() -- range of the capture - ... use the info here ... - end + The following example shows how to get captures by name: > + + for id, node, metadata in query:iter_captures(tree:root(), bufnr, first, last) do + local name = query.captures[id] -- name of the capture in the query + -- typically useful info about the node: + local type = node:type() -- type of the captured node + local row1, col1, row2, col2 = node:range() -- range of the capture + ... use the info here ... + end < Parameters: ~ - {node} The node under which the search will occur - {source} The source buffer or string to extract text from - {start} The starting line of the search - {stop} The stopping line of the search (end-exclusive) + {node} userdata |tsnode| under which the search will occur + {source} (number|string) Source buffer or string to extract text from + {start} (number) Starting line for the search + {stop} (number) Stopping line for the search (end-exclusive) {self} Return: ~ - The matching capture id - The captured node + (number) capture Matching capture id + (table) capture_node Capture for {node} + (table) metadata for the {capture} *Query:iter_matches()* Query:iter_matches({self}, {node}, {source}, {start}, {stop}) Iterates the matches of self on a given range. - Iterate over all matches within a node. The arguments are the same as for - |query:iter_captures()| but the iterated values are different: an + Iterate over all matches within a {node}. The arguments are the same as + for |query:iter_captures()| but the iterated values are different: an (1-based) index of the pattern in the query, a table mapping capture indices to nodes, and metadata from any directives processing the match. - If the query has more than one pattern the capture table might be sparse, - and e.g. `pairs()` method should be used over `ipairs`. Here an example - iterating over all captures in every match: -> + If the query has more than one pattern, the capture table might be sparse + and e.g. `pairs()` method should be used over `ipairs` . Here is an example iterating over all captures in every match: > - for pattern, match, metadata in cquery:iter_matches(tree:root(), bufnr, first, last) do - for id, node in pairs(match) do - local name = query.captures[id] - -- `node` was captured by the `name` capture in the match + for pattern, match, metadata in cquery:iter_matches(tree:root(), bufnr, first, last) do + for id, node in pairs(match) do + local name = query.captures[id] + -- `node` was captured by the `name` capture in the match - local node_data = metadata[id] -- Node level metadata + local node_data = metadata[id] -- Node level metadata - ... use the info here ... - end - end + ... use the info here ... + end + end < Parameters: ~ - {node} The node under which the search will occur - {source} The source buffer or string to search - {start} The starting line of the search - {stop} The stopping line of the search (end-exclusive) + {node} userdata |tsnode| under which the search will occur + {source} (number|string) Source buffer or string to search + {start} (number) Starting line for the search + {stop} (number) Stopping line for the search (end-exclusive) {self} Return: ~ - The matching pattern id - The matching match + (number) pattern id + (table) match + (table) metadata set_query({lang}, {query_name}, {text}) *set_query()* - Sets the runtime query {query_name} for {lang} + Sets the runtime query named {query_name} for {lang} This allows users to override any runtime files and/or configuration set by plugins. Parameters: ~ - {lang} string: The language to use for the query - {query_name} string: The name of the query (i.e. "highlights") - {text} string: The query text (unparsed). + {lang} (string) Language to use for the query + {query_name} (string) Name of the query (e.g., 'highlights') + {text} (string) Query text (unparsed). ============================================================================== -Lua module: vim.treesitter.highlighter *treesitter-highlighter* +Lua module: vim.treesitter.highlighter *lua-treesitter-highlighter* new({tree}, {opts}) *highlighter.new()* Creates a new highlighter using Parameters: ~ - {tree} The language tree to use for highlighting - {opts} Table used to configure the highlighter - • queries: Table to overwrite queries used by the highlighter + {tree} LanguageTree |LanguageTree| parser object to use for highlighting + {opts} (table|nil) Configuration of the highlighter: + • queries table overwrite queries used by the highlighter + + Return: ~ + TSHighlighter Created highlighter object TSHighlighter:destroy({self}) *TSHighlighter:destroy()* Removes all internal references to the highlighter @@ -761,25 +800,9 @@ TSHighlighter:destroy({self}) *TSHighlighter:destroy()* Parameters: ~ {self} -TSHighlighter:get_query({self}, {lang}) *TSHighlighter:get_query()* - Gets the query used for - - Parameters: ~ - {lang} A language used by the highlighter. - {self} - ============================================================================== -Lua module: vim.treesitter.languagetree *treesitter-languagetree* - -LanguageTree:add_child({self}, {lang}) *LanguageTree:add_child()* - Adds a child language to this tree. - - If the language already exists as a child, it will first be removed. - - Parameters: ~ - {lang} The language to add. - {self} +Lua module: vim.treesitter.languagetree *lua-treesitter-languagetree* LanguageTree:children({self}) *LanguageTree:children()* Returns a map of language to child tree. @@ -788,15 +811,17 @@ LanguageTree:children({self}) *LanguageTree:children()* {self} LanguageTree:contains({self}, {range}) *LanguageTree:contains()* - Determines whether {range} is contained in this language tree + Determines whether {range} is contained in the |LanguageTree|. Parameters: ~ - {range} A range, that is a `{ start_line, start_col, end_line, - end_col }` table. + {range} (table) `{ start_line, start_col, end_line, end_col }` {self} + Return: ~ + (boolean) + LanguageTree:destroy({self}) *LanguageTree:destroy()* - Destroys this language tree and all its children. + Destroys this |LanguageTree| and all its children. Any cleanup logic should be performed here. @@ -807,22 +832,21 @@ LanguageTree:destroy({self}) *LanguageTree:destroy()* *LanguageTree:for_each_child()* LanguageTree:for_each_child({self}, {fn}, {include_self}) - Invokes the callback for each LanguageTree and it's children recursively + Invokes the callback for each |LanguageTree| and its children recursively Parameters: ~ - {fn} The function to invoke. This is invoked with arguments - (tree: LanguageTree, lang: string) - {include_self} Whether to include the invoking tree in the results. + {fn} function(tree: LanguageTree, lang: string) + {include_self} (boolean) Whether to include the invoking tree in the + results {self} LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()* - Invokes the callback for each treesitter trees recursively. + Invokes the callback for each |LanguageTree| recursively. - Note, this includes the invoking language tree's trees as well. + Note: This includes the invoking tree's child trees as well. Parameters: ~ - {fn} The callback to invoke. The callback is invoked with arguments - (tree: TSTree, languageTree: LanguageTree) + {fn} function(tree: TSTree, languageTree: LanguageTree) {self} LanguageTree:included_regions({self}) *LanguageTree:included_regions()* @@ -851,23 +875,29 @@ LanguageTree:lang({self}) *LanguageTree:lang()* *LanguageTree:language_for_range()* LanguageTree:language_for_range({self}, {range}) - Gets the appropriate language that contains {range} + Gets the appropriate language that contains {range}. Parameters: ~ - {range} A text range, see |LanguageTree:contains| + {range} (table) `{ start_line, start_col, end_line, end_col }` {self} + Return: ~ + LanguageTree Managing {range} + *LanguageTree:named_node_for_range()* LanguageTree:named_node_for_range({self}, {range}, {opts}) - Gets the smallest named node that contains {range} + Gets the smallest named node that contains {range}. Parameters: ~ - {range} (table) A text range - {opts} (table) Options table - {opts.ignore_injections} (boolean) (default true) Ignore injected - languages. + {range} (table) `{ start_line, start_col, end_line, end_col }` + {opts} (table|nil) Optional keyword arguments: + • ignore_injections boolean Ignore injected languages + (default true) {self} + Return: ~ + userdata|nil Found |tsnode| + LanguageTree:parse({self}) *LanguageTree:parse()* Parses all defined regions using a treesitter parser for the language this tree represents. This will run the injection query for this language to @@ -876,12 +906,16 @@ LanguageTree:parse({self}) *LanguageTree:parse()* Parameters: ~ {self} + Return: ~ + userdata[] Table of parsed |tstree| + (table) Change list + LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()* - Registers callbacks for the parser. + Registers callbacks for the |LanguageTree|. Parameters: ~ {cbs} (table) An |nvim_buf_attach()|-like table argument with the - following keys : + following handlers: • `on_bytes` : see |nvim_buf_attach()|, but this will be called after the parsers callback. • `on_changedtree` : a callback that will be called every time the tree has syntactical changes. It will only be passed one @@ -893,35 +927,6 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()* the tree. {self} -LanguageTree:remove_child({self}, {lang}) *LanguageTree:remove_child()* - Removes a child language from this tree. - - Parameters: ~ - {lang} The language to remove. - {self} - - *LanguageTree:set_included_regions()* -LanguageTree:set_included_regions({self}, {regions}) - Sets the included regions that should be parsed by this parser. A region - is a set of nodes and/or ranges that will be parsed in the same context. - - For example, `{ { node1 }, { node2} }` is two separate regions. This will - be parsed by the parser in two different contexts... thus resulting in two - separate trees. - - `{ { node1, node2 } }` is a single region consisting of two nodes. This - will be parsed by the parser in a single context... thus resulting in a - single tree. - - This allows for embedded languages to be parsed together across different - nodes, which is useful for templating languages like ERB and EJS. - - Note, this call invalidates the tree and requires it to be parsed again. - - Parameters: ~ - {regions} (table) list of regions this tree should manage and parse. - {self} - LanguageTree:source({self}) *LanguageTree:source()* Returns the source content of the language tree (bufnr or string). @@ -930,15 +935,18 @@ LanguageTree:source({self}) *LanguageTree:source()* *LanguageTree:tree_for_range()* LanguageTree:tree_for_range({self}, {range}, {opts}) - Gets the tree that contains {range} + Gets the tree that contains {range}. Parameters: ~ - {range} (table) A text range - {opts} (table) Options table - {opts.ignore_injections} (boolean) (default true) Ignore injected - languages. + {range} (table) `{ start_line, start_col, end_line, end_col }` + {opts} (table|nil) Optional keyword arguments: + • ignore_injections boolean Ignore injected languages + (default true) {self} + Return: ~ + userdata|nil Contained |tstree| + LanguageTree:trees({self}) *LanguageTree:trees()* Returns all trees this language tree contains. Does not include child languages. @@ -947,16 +955,20 @@ LanguageTree:trees({self}) *LanguageTree:trees()* {self} new({source}, {lang}, {opts}) *languagetree.new()* - Represents a single treesitter parser for a language. The language can - contain child languages with in its range, hence the tree. + A |LanguageTree| holds the treesitter parser for a given language {lang} + used to parse a buffer. As the buffer may contain injected languages, the LanguageTree needs to store parsers for these child languages as well (which in turn + may contain child languages themselves, hence the name). Parameters: ~ - {source} Can be a bufnr or a string of text to parse - {lang} The language this tree represents - {opts} Options table - {opts.injections} A table of language to injection query strings. - This is useful for overriding the built-in runtime - file searching for the injection language query per - language. + {source} (number|string) Buffer or a string of text to parse + {lang} (string) Root language this tree represents + {opts} (table|nil) Optional keyword arguments: + • injections table Mapping language to injection query + strings. This is useful for overriding the built-in + runtime file searching for the injection language query + per language. + + Return: ~ + LanguageTree |LanguageTree| parser object vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl: -- cgit From 708bd686516b420c2b65f4bc4d2c58fe43fb945e Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 13 Sep 2022 12:56:30 +0200 Subject: feat(ui): use msg_grid based implementation for cmdheight=0 --- runtime/doc/options.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 110f7400e6..14b7eb2d71 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1337,7 +1337,8 @@ A jump table for the options with a short description can be found at |Q_op|. page can have a different value. When 'cmdheight' is zero, there is no command-line unless it is being - used. Some informative messages will not be displayed, any other + used. The command-line will cover the last line of the screen when + shown. Some informative messages will not be displayed, any other messages will cause the |hit-enter| prompt. Expect some other unexpected behavior too. -- cgit From 9ec4b20be695501ba166f31dec39ef9e30cc7dd8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 16 Sep 2022 09:05:05 +0200 Subject: fix(treesitter): return full metadata for get_captures_at_position (#20203) fix(treesitter): get_captures_at_position returns metadata Return the full `metadata` table for the capture instead of just the priority. Further cleanup of related docs. --- runtime/doc/treesitter.txt | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index dc81a31856..eda1a5e496 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -203,7 +203,7 @@ purpose, e.g., `queries/lua/highlights.scm` for highlighting Lua files. By default, the first query on `runtimepath` is used (which usually implies that user config takes precedence over plugins, which take precedence over queries bundled with Neovim). If a query should extend other queries instead -of replacing them, use |ts-query-modeline-extends|. +of replacing them, use |treesitter-query-modeline-extends|. See |lua-treesitter-query| for the list of available methods for working with treesitter queries from Lua. @@ -220,28 +220,28 @@ to only match identifier corresponding to the `"foo"` text. The following predicates are built in: - `eq?` *ts-predicate-eq?* + `eq?` *treesitter-predicate-eq?* Match a string against the text corresponding to a node: > ((identifier) @foo (#eq? @foo "foo")) ((node1) @left (node2) @right (#eq? @left @right)) < - `match?` *ts-predicate-match?* - `vim-match?` *ts-predicate-vim-match?* + `match?` *treesitter-predicate-match?* + `vim-match?` *treesitter-predicate-vim-match?* Match a |regexp| against the text corresponding to a node: > ((identifier) @constant (#match? @constant "^[A-Z_]+$")) < Note: The `^` and `$` anchors will match the start and end of the node's text. - `lua-match?` *ts-predicate-lua-match?* + `lua-match?` *treesitter-predicate-lua-match?* Match a |lua-pattern| against the text corresponding to a node, similar to `match?` - `contains?` *ts-predicate-contains?* + `contains?` *treesitter-predicate-contains?* Match a string against parts of the text corresponding to a node: > ((identifier) @foo (#contains? @foo "foo")) ((identifier) @foo-bar (#contains @foo-bar "foo" "bar")) < - `any-of?` *ts-predicate-any-of?* + `any-of?` *treesitter-predicate-any-of?* Match any of the given strings against the text corresponding to a node: > ((identifier) @foo (#any-of? @foo "foo" "bar")) @@ -267,7 +267,7 @@ effects. For example, the |set!| predicate sets metadata on the match or node: > < The following directives are built in: - `set!` *ts-directive-set!* + `set!` *treesitter-directive-set!* Sets key/value metadata for a specific match or capture. Value is accessible as either `metadata[key]` (match specific) or `metadata[capture_id][key]` (capture specific). @@ -281,7 +281,7 @@ The following directives are built in: ((identifier) @foo (#set! @foo "kind" "parameter")) ((node1) @left (node2) @right (#set! "type" "pair")) < - `offset!` *ts-directive-offset!* + `offset!` *treesitter-directive-offset!* Takes the range of the captured node and applies an offset. This will generate a new range object for the captured node as `metadata[capture_id].range`. @@ -302,13 +302,13 @@ Use `vim.treesitter.query.`|list_directives()| to list all available directives. -TREESITTER QUERY MODELINES *ts-query-modeline* +TREESITTER QUERY MODELINES *treesitter-query-modeline* Neovim supports to customize the behavior of the queries using a set of "modelines", that is comments in the queries starting with `;`. Here are the currently supported modeline alternatives: - `inherits: {lang}...` *ts-query-modeline-inherits* + `inherits: {lang}...` *treesitter-query-modeline-inherits* Specifies that this query should inherit the queries from {lang}. This will recursively descend in the queries of {lang} unless wrapped in parentheses: `({lang})`. @@ -316,7 +316,7 @@ currently supported modeline alternatives: language. If you want your query to extend the queries of the same language, use `extends`. - `extends` *ts-query-modeline-extends* + `extends` *treesitter-query-modeline-extends* Specifies that this query should be used as an extension for the query, i.e. that it should be merged with the others. Note: The order of the extensions, and the query that will be used as @@ -436,14 +436,20 @@ get_captures_at_cursor({winnr}) *get_captures_at_cursor()* *get_captures_at_position()* get_captures_at_position({bufnr}, {row}, {col}) + Returns a list of highlight captures at the given position + + Each capture is represented by a table containing the capture name as a + string as well as a table of metadata (`priority`, `conceal`, ...; empty + if none are defined). + Parameters: ~ {bufnr} (number) Buffer number (0 for current buffer) {row} (number) Position row {col} (number) Position column Return: ~ - table[] Captures of the form `{ capture = "capture name", priority = - capture priority }` + table[] List of captures `{ capture = "capture name", metadata = { ... + } }` get_node_at_cursor({winnr}) *get_node_at_cursor()* Returns the smallest named node under the cursor -- cgit From 0f93aa12fdb07fd452706da8d13c590c86ce21de Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Fri, 16 Sep 2022 09:18:42 +0200 Subject: docs(autocmds): re-add buffer param to docstring (#20204) --- runtime/doc/api.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 00a3759936..7e55bb8f4e 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3378,7 +3378,10 @@ nvim_get_autocmds({*opts}) *nvim_get_autocmds()* • event (string|array): event or events to match against |autocmd-events|. • pattern (string|array): pattern or patterns to match against - |autocmd-pattern|. + |autocmd-pattern|. Cannot be used with {buffer} + • buffer: Buffer number or list of buffer numbers for buffer + local autocommands |autocmd-buflocal|. Cannot be used with + {pattern} Return: ~ Array of autocommands matching the criteria, with each item containing -- cgit From 67df3347fd1e637f643b35239f7a20ac813ee588 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 18 Sep 2022 15:20:20 +0200 Subject: vim-patch:9712ff1288f9 (#20240) Update runtime files https://github.com/vim/vim/commit/9712ff1288f942736ed76c0dec014909f067eec9 --- runtime/doc/change.txt | 19 ++++++++++++++----- runtime/doc/intro.txt | 4 ++++ runtime/doc/spell.txt | 2 +- runtime/doc/userfunc.txt | 4 ++-- 4 files changed, 21 insertions(+), 8 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index a4ff4474e6..bed5cb26d7 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1130,11 +1130,20 @@ used. If you do need it you can use |p| with another register. E.g., yank the text to copy, Visually select the text to replace and use "0p . You can repeat this as many times as you like, and the unnamed register will be changed each time. - -When you use a blockwise Visual mode command and yank only a single line into -a register, a paste on a visual selected area will paste that single line on -each of the selected lines (thus replacing the blockwise selected region by a -block of the pasted line). + *blockwise-put* +When a register contains text from one line (characterwise), using a +blockwise Visual selection, putting that register will paste that text +repeatedly in each of the selected lines, thus replacing the blockwise +selected region by multiple copies of the register text. For example: + - yank the word "TEXT" into a register with `yw` + - select a visual block, marked with "v" in this text: + aaavvaaa + bbbvvbbb + cccvvccc + - press `p`, results in: + aaaTEXTaaa + bbbTEXTbbb + cccTEXTccc *blockwise-register* If you use a blockwise Visual mode command to get the text into the register, diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index ae80935032..a5630dabaa 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -416,6 +416,10 @@ one always works. To get a literal "" in a mapping: > :map lt> +The notation can be used in a double quoted strings, using "\<" at the start, +e.g. "\". This results in a special key code. To convert this back +to readable text use `keytrans()`. + ============================================================================== Modes, introduction *vim-modes-intro* *vim-modes* diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 23d5905ec3..15aa0117ec 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1583,7 +1583,7 @@ CHECKCOMPOUNDTRIPLE (Hunspell) *spell-CHECKCOMPOUNDTRIPLE* Forbid three identical characters when compounding. Not supported. -CHECKSHARPS (Hunspell)) *spell-CHECKSHARPS* +CHECKSHARPS (Hunspell) *spell-CHECKSHARPS* SS letter pair in uppercased (German) words may be upper case sharp s (ß). Not supported. diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt index c701834383..c015b12c27 100644 --- a/runtime/doc/userfunc.txt +++ b/runtime/doc/userfunc.txt @@ -12,7 +12,7 @@ This is introduced in section |41.7| of the user manual. ============================================================================== -1. Defining a fuction ~ +1. Defining a function ~ *define-function* New functions can be defined. These can be called just like builtin functions. The function executes a sequence of Ex commands. Normal mode @@ -287,7 +287,7 @@ This function can then be called with: > < ============================================================================== -2. Calling a fuction ~ +2. Calling a function ~ *:cal* *:call* *E107* *E117* :[range]cal[l] {name}([arguments]) Call a function. The name of the function and its arguments -- cgit From e76215830522f75dea1495a0de38933d18954eca Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 20 Sep 2022 10:42:45 +0100 Subject: docs(lua): opts in `vim.keymap.{set,del}` can be optional (#20255) --- runtime/doc/lua.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 45ee69d5e4..4be706f1bf 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2212,7 +2212,7 @@ del({modes}, {lhs}, {opts}) *vim.keymap.del()* < Parameters: ~ - {opts} (table) A table of optional arguments: + {opts} (table|nil) A table of optional arguments: • buffer: (number or boolean) Remove a mapping from the given buffer. When "true" or 0, use the current buffer. @@ -2257,7 +2257,7 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()* {lhs} (string) Left-hand side |{lhs}| of the mapping. {rhs} string|function Right-hand side |{rhs}| of the mapping. Can also be a Lua function. - {opts} (table) A table of |:map-arguments|. + {opts} (table|nil) A table of |:map-arguments|. • Accepts options accepted by the {opts} parameter in |nvim_set_keymap()|, with the following notable differences: • replace_keycodes: Defaults to `true` if "expr" is `true`. -- cgit From b4b05f160dbb6b9b945c173b7e910b0e4c1a8b01 Mon Sep 17 00:00:00 2001 From: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com> Date: Wed, 21 Sep 2022 23:58:57 +0200 Subject: feat(filetype): expand environment variables in filetype patterns (#20145) --- runtime/doc/lua.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 4be706f1bf..a6a51c1e36 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2082,7 +2082,10 @@ add({filetypes}) *vim.filetype.add()* Filename patterns can specify an optional priority to resolve cases when a file path matches multiple patterns. Higher priorities are matched first. - When omitted, the priority defaults to 0. + When omitted, the priority defaults to 0. A pattern can contain + environment variables of the form "${SOME_VAR}" that will be automatically + expanded. If the environment variable is not set, the pattern won't be + matched. See $VIMRUNTIME/lua/vim/filetype.lua for more examples. @@ -2112,6 +2115,8 @@ add({filetypes}) *vim.filetype.add()* ['.*/etc/foo/.*'] = 'fooscript', -- Using an optional priority ['.*/etc/foo/.*%.conf'] = { 'dosini', { priority = 10 } }, + -- A pattern containing an environment variable + ['${XDG_CONFIG_HOME}/foo/git'] = 'git', ['README.(a+)$'] = function(path, bufnr, ext) if ext == 'md' then return 'markdown' -- cgit From 5c1b8d7bf80d03c70a5972432ac11e60e903d232 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Thu, 22 Sep 2022 14:17:49 +0100 Subject: docs(lua): correct docs for option accessor metatables (#20256) --- runtime/doc/lua.txt | 81 +++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 39 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index a6a51c1e36..88547edfe5 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1090,6 +1090,20 @@ Example: > vim.g.foo = nil -- Delete (:unlet) the Vimscript variable. vim.b[2].foo = 6 -- Set b:foo for buffer 2 < + +Note that setting dictionary fields directly will not write them back into +Nvim. This is because the index into the namespace simply returns a copy. +Instead the whole dictionary must be written as one. This can be achieved by +creating a short-lived temporary. + +Example: > + + vim.g.my_dict.field1 = 'value' -- Does not work + + local my_dict = vim.g.my_dict -- + my_dict.field1 = 'value' -- Instead do + vim.g.my_dict = my_dict -- + vim.g *vim.g* Global (|g:|) editor variables. Key with no value returns `nil`. @@ -1133,32 +1147,23 @@ Vim options can be accessed through |vim.o|, which behaves like Vimscript Examples: ~ To set a boolean toggle: - In Vimscript: - `set number` - - In Lua: - `vim.o.number = true` + Vimscript: `set number` + Lua: `vim.o.number = true` To set a string value: - In Vimscript: - `set wildignore=*.o,*.a,__pycache__` - - In Lua: - `vim.o.wildignore = '*.o,*.a,__pycache__'` - -Similarly, there exist |vim.bo| and |vim.wo| for setting buffer-local and -window-local options, respectively, similarly to |:setlocal|. There is also -|vim.go| that only sets the global value of a |global-local| option, see -|:setglobal|. The following table summarizes this relation. - - lua command global_value local_value ~ -vim.o :set set set -vim.bo/vim.wo :setlocal - set -vim.go :setglobal set - + Vimscript: `set wildignore=*.o,*.a,__pycache__` + Lua: `vim.o.wildignore = '*.o,*.a,__pycache__'` +Similarly, there is |vim.bo| and |vim.wo| for setting buffer-scoped and +window-scoped options. Note that this must NOT be confused with +|local-options| and |:setlocal|. There is also |vim.go| that only accesses the +global value of a |global-local| option, see |:setglobal|. vim.o *vim.o* - Get or set editor options, like |:set|. Invalid key is an error. + Get or set an |option|. Like `:set`. Invalid key is an error. + + Note: this works on both buffer-scoped and window-scoped options using the + current buffer and window. Example: > vim.o.cmdheight = 4 @@ -1166,14 +1171,12 @@ vim.o *vim.o* print(vim.o.foo) -- error: invalid key < vim.go *vim.go* - Get or set an |option|. Invalid key is an error. - - This is a wrapper around |nvim_set_option_value()| and - |nvim_get_option_value()|. + Get or set a global |option|. Like `:setglobal`. Invalid key is + an error. - NOTE: This is different from |vim.o| because this ONLY sets the global - option, which generally produces confusing behavior for options with - |global-local| values. + Note: this is different from |vim.o| because this accesses the global + option value and thus is mostly useful for use with |global-local| + options. Example: > vim.go.cmdheight = 4 @@ -1181,12 +1184,11 @@ vim.go *vim.go* print(vim.go.bar) -- error: invalid key < vim.bo[{bufnr}] *vim.bo* - Get or set buffer-scoped |local-options| for the buffer with number {bufnr}. - If [{bufnr}] is omitted, use the current buffer. Invalid {bufnr} or key is - an error. + Get or set buffer-scoped |options| for the buffer with number {bufnr}. + Like `:set` and `:setlocal`. If [{bufnr}] is omitted then the current + buffer is used. Invalid {bufnr} or key is an error. - This is a wrapper around |nvim_set_option_value()| and - |nvim_get_option_value()| with `opts = {scope = local, buf = bufnr}` . + Note: this is equivalent to both `:set` and `:setlocal`. Example: > local bufnr = vim.api.nvim_get_current_buf() @@ -1195,13 +1197,14 @@ vim.bo[{bufnr}] * print(vim.bo.baz) -- error: invalid key < vim.wo[{winid}] *vim.wo* - Get or set window-scoped |local-options| for the window with handle {winid}. - If [{winid}] is omitted, use the current window. Invalid {winid} or key - is an error. - - This is a wrapper around |nvim_set_option_value()| and - |nvim_get_option_value()| with `opts = {scope = local, win = winid}` . + Get or set window-scoped |options| for the window with handle {winid}. + Like `:set`. If [{winid}] is omitted then the current window is used. + Invalid {winid} or key is an error. + Note: this does not access |local-options| (`:setlocal`) instead use: > + nvim_get_option_value(OPTION, { scope = 'local', win = winid }) + nvim_set_option_value(OPTION, VALUE, { scope = 'local', win = winid } +< Example: > local winid = vim.api.nvim_get_current_win() vim.wo[winid].number = true -- same as vim.wo.number = true -- cgit From 40f0851bd853eeb32a0334cb338e8083f31a21dc Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 11 Sep 2022 02:15:06 -0700 Subject: docs: deprecate :checkhealth vimscript interface --- runtime/doc/deprecated.txt | 5 ++ runtime/doc/pi_health.txt | 140 ++++++++++++++------------------------------- 2 files changed, 47 insertions(+), 98 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index eb6d9b6dc9..b1dd650e7d 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -47,6 +47,11 @@ Functions ~ *buffer_name()* Obsolete name for |bufname()|. *buffer_number()* Obsolete name for |bufnr()|. *file_readable()* Obsolete name for |filereadable()|. +*health#report_error* Use Lua |vim.health.report_error()| instead. +*health#report_info* Use Lua |vim.health.report_info()| instead. +*health#report_ok* Use Lua |vim.health.report_ok()| instead. +*health#report_start* Use Lua |vim.health.report_start()| instead. +*health#report_warn* Use Lua |vim.health.report_warn()| instead. *highlight_exists()* Obsolete name for |hlexists()|. *highlightID()* Obsolete name for |hlID()|. *inputdialog()* Use |input()| instead. diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt index 04e04b5165..cc36e7186c 100644 --- a/runtime/doc/pi_health.txt +++ b/runtime/doc/pi_health.txt @@ -7,11 +7,12 @@ Author: TJ DeVries ============================================================================== Introduction *health* -health.vim is a minimal framework to help with troubleshooting user -configuration. Nvim ships with healthchecks for configuration, performance, -python support, ruby support, clipboard support, and more. +health.vim is a minimal framework to help users troubleshoot configuration and +any other environment conditions that a plugin might care about. Nvim ships +with healthchecks for configuration, performance, python support, ruby +support, clipboard support, and more. -To run the healthchecks, use this command: > +To run all healthchecks, use: > :checkhealth < @@ -21,7 +22,7 @@ Plugin authors are encouraged to write new healthchecks. |health-dev| Commands *health-commands* *:checkhealth* *:CheckHealth* -:checkhealth Run all healthchecks. +:checkhealth Run all healthchecks. *E5009* Nvim depends on |$VIMRUNTIME|, 'runtimepath' and 'packpath' to find the standard "runtime files" for syntax highlighting, @@ -35,23 +36,21 @@ Commands *health-commands* :checkhealth nvim < To run the healthchecks for the "foo" and "bar" plugins - (assuming these plugins are on 'runtimepath' or 'packpath' and - they have implemented the Lua or Vimscript interface - require("foo.health").check() and health#bar#check(), - respectively): > + (assuming they are on 'runtimepath' and they have implemented + the Lua `require("foo.health").check()` interface): > :checkhealth foo bar < - To run healthchecks for lua submodules, use dot notation or - "*" to refer to all submodules. For example nvim provides - `vim.lsp` and `vim.treesitter` > + To run healthchecks for Lua submodules, use dot notation or + "*" to refer to all submodules. For example Nvim provides + `vim.lsp` and `vim.treesitter`: > :checkhealth vim.lsp vim.treesitter :checkhealth vim* < ============================================================================== -Lua Functions *health-functions-lua* *health-lua* *vim.health* +Functions *health-functions* *vim.health* -The Lua "health" module can be used to create new healthchecks (see also -|health-functions-vim|). To get started, simply use: +The Lua "health" module can be used to create new healthchecks. To get started +see |health-dev|. vim.health.report_start({name}) *vim.health.report_start()* Starts a new report. Most plugins should call this only once, but if @@ -65,36 +64,43 @@ vim.health.report_ok({msg}) *vim.health.report_ok()* Reports a "success" message. vim.health.report_warn({msg} [, {advice}]) *vim.health.report_warn()* - Reports a warning. {advice} is an optional List of suggestions. + Reports a warning. {advice} is an optional list of suggestions to + present to the user. vim.health.report_error({msg} [, {advice}]) *vim.health.report_error()* - Reports an error. {advice} is an optional List of suggestions. + Reports an error. {advice} is an optional list of suggestions to + present to the user. ============================================================================== -Create a Lua healthcheck *health-dev-lua* - -Healthchecks are functions that check the user environment, configuration, -etc. Nvim has built-in healthchecks in $VIMRUNTIME/autoload/health/. - -To add a new healthcheck for your own plugin, simply define a Lua module in -your plugin that returns a table with a "check()" function. |:checkhealth| -will automatically find and invoke this function. - -If your plugin is named "foo", then its healthcheck module should be a file in -one of these locations on 'runtimepath' or 'packpath': +Create a healthcheck *health-dev* + +Healthchecks are functions that check the user environment, configuration, or +any other prerequisities that a plugin cares about. Nvim ships with +healthchecks in: + - $VIMRUNTIME/autoload/health/ + - $VIMRUNTIME/lua/vim/lsp/health.lua + - $VIMRUNTIME/lua/vim/treesitter/health.lua + - and more... + +To add a new healthcheck for your own plugin, simply create a "health.lua" +module on 'runtimepath' that returns a table with a "check()" function. Then +|:checkhealth| will automatically find and invoke the function. + +For example if your plugin is named "foo", define your healthcheck module at +one of these locations (on 'runtimepath'): - lua/foo/health/init.lua - lua/foo/health.lua -If your plugin provides a submodule named "bar" for which you want a separate -healthcheck, define the healthcheck at one of these locations on 'runtimepath' -or 'packpath': +If your plugin also provides a submodule named "bar" for which you want +a separate healthcheck, define the healthcheck at one of these locations: - lua/foo/bar/health/init.lua - lua/foo/bar/health.lua -All submodules should return a Lua table containing the method `check()`. +All such health modules must return a Lua table containing a `check()` +function. -Copy this sample code into `lua/foo/health/init.lua` or `lua/foo/health.lua`, -replacing "foo" in the path with your plugin name: > +Copy this sample code into `lua/foo/health.lua`, replacing "foo" in the path +with your plugin name: > local M = {} @@ -102,9 +108,9 @@ replacing "foo" in the path with your plugin name: > vim.health.report_start("my_plugin report") -- make sure setup function parameters are ok if check_setup() then - vim.health.report_ok("Setup function is correct") + vim.health.report_ok("Setup is correct") else - vim.health.report_error("Setup function is incorrect") + vim.health.report_error("Setup is incorrect") end -- do some more checking -- ... @@ -112,67 +118,5 @@ replacing "foo" in the path with your plugin name: > return M -============================================================================== -Vimscript Functions *health-functions-vimscript* *health-vimscript* - -health.vim functions are for creating new healthchecks. (See also -|health-functions-lua|) - -health#report_start({name}) *health#report_start* - Starts a new report. Most plugins should call this only once, but if - you want different sections to appear in your report, call this once - per section. - -health#report_info({msg}) *health#report_info* - Reports an informational message. - -health#report_ok({msg}) *health#report_ok* - Reports a "success" message. - -health#report_warn({msg} [, {advice}]) *health#report_warn* - Reports a warning. {advice} is an optional List of suggestions. - -health#report_error({msg} [, {advice}]) *health#report_error* - Reports an error. {advice} is an optional List of suggestions. - -health#{plugin}#check() *health.user_checker* - Healthcheck function for {plugin}. Called by |:checkhealth| - automatically. Example: > - - function! health#my_plug#check() abort - silent call s:check_environment_vars() - silent call s:check_python_configuration() - endfunction -< -============================================================================== -Create a healthcheck *health-dev-vim* - -Healthchecks are functions that check the user environment, configuration, -etc. Nvim has built-in healthchecks in $VIMRUNTIME/autoload/health/. - -To add a new healthcheck for your own plugin, simply define a -health#{plugin}#check() function in autoload/health/{plugin}.vim. -|:checkhealth| automatically finds and invokes such functions. - -If your plugin is named "foo", then its healthcheck function must be > - health#foo#check() - -defined in this file on 'runtimepath' or 'packpath': - - autoload/health/foo.vim - -Copy this sample code into autoload/health/foo.vim and replace "foo" with your -plugin name: > - function! health#foo#check() abort - call health#report_start('sanity checks') - " perform arbitrary checks - " ... - - if looks_good - call health#report_ok('found required dependencies') - else - call health#report_error('cannot find foo', - \ ['npm install --save foo']) - endif - endfunction vim:et:tw=78:ts=8:ft=help:fdm=marker -- cgit From 09b64d75bd92a95d89c4f39f9df7918760abe98d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 27 Mar 2022 19:47:34 -0700 Subject: feat(docs): gen_help_html.lua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: The :help docs HTML generated is driven by an old awk script `runtime/doc/makehtml.awk` that is hard to maintain (ad hoc parser and no one has touched it in decades) and has bugs like: - https://github.com/neovim/neovim.github.io/issues/96 - https://github.com/neovim/neovim.github.io/issues/97 Solution: Use Lua + treesitter (https://github.com/vigoux/tree-sitter-vimdoc) to generate :help docs HTML. Also validates tag links. fix https://github.com/neovim/neovim.github.io/issues/96 fix https://github.com/neovim/neovim.github.io/issues/97 TODO: - delete doc_html build task - delete runtime/doc/Makefile - delete makehtml.awk - delete maketags.awk OUTPUT: $ nvim -V1 -es --clean +"lua require('scripts.gen_help_html')" output dir: /…/neovim.github.io/_site/doc/ generated (207 errors): api.txt => api.html generated (122 errors): arabic.txt => arabic.html generated (285 errors): autocmd.txt => autocmd.html generated (641 errors): builtin.txt => builtin.html generated (623 errors): change.txt => change.html generated (65 errors): channel.txt => channel.html generated (353 errors): cmdline.txt => cmdline.html generated (3 errors): debug.txt => debug.html generated (28 errors): deprecated.txt => deprecated.html generated (193 errors): dev_style.txt => dev_style.html generated (460 errors): develop.txt => develop.html generated (19 errors): diagnostic.txt => diagnostic.html generated (57 errors): diff.txt => diff.html generated (818 errors): digraph.txt => digraph.html generated (330 errors): editing.txt => editing.html generated (368 errors): eval.txt => eval.html generated (184 errors): fold.txt => fold.html generated (61 errors): ft_ada.txt => ft_ada.html generated (0 errors): ft_ps1.txt => ft_ps1.html generated (20 errors): ft_raku.txt => ft_raku.html generated (5 errors): ft_rust.txt => ft_rust.html generated (41 errors): ft_sql.txt => ft_sql.html generated (110 errors): gui.txt => gui.html generated (79 errors): hebrew.txt => hebrew.html generated (17 errors): help.txt => index.html generated (104 errors): helphelp.txt => helphelp.html generated (0 errors): if_cscop.txt => if_cscop.html generated (23 errors): if_perl.txt => if_perl.html generated (16 errors): if_pyth.txt => if_pyth.html generated (9 errors): if_ruby.txt => if_ruby.html generated (216 errors): indent.txt => indent.html generated (634 errors): index.txt => vimindex.html generated (320 errors): insert.txt => insert.html generated (265 errors): intro.txt => intro.html generated (9 errors): job_control.txt => job_control.html generated (0 errors): lsp-extension.txt => lsp-extension.html generated (214 errors): lsp.txt => lsp.html generated (311 errors): lua.txt => lua.html generated (592 errors): luaref.txt => luaref.html generated (798 errors): luvref.txt => luvref.html generated (663 errors): map.txt => map.html generated (228 errors): mbyte.txt => mbyte.html generated (228 errors): message.txt => message.html generated (0 errors): mlang.txt => mlang.html generated (761 errors): motion.txt => motion.html generated (4 errors): nvim.txt => nvim.html generated (226 errors): nvim_terminal_emulator.txt => nvim_terminal_emulator.html generated (988 errors): options.txt => options.html generated (567 errors): pattern.txt => pattern.html generated (15 errors): pi_gzip.txt => pi_gzip.html generated (10 errors): pi_health.txt => pi_health.html generated (27 errors): pi_msgpack.txt => pi_msgpack.html generated (2177 errors): pi_netrw.txt => pi_netrw.html generated (41 errors): pi_paren.txt => pi_paren.html generated (9 errors): pi_spec.txt => pi_spec.html generated (218 errors): pi_tar.txt => pi_tar.html generated (0 errors): pi_tutor.txt => pi_tutor.html generated (235 errors): pi_zip.txt => pi_zip.html generated (265 errors): print.txt => print.html generated (31 errors): provider.txt => provider.html generated (335 errors): quickfix.txt => quickfix.html generated (572 errors): quickref.txt => quickref.html generated (109 errors): recover.txt => recover.html generated (14 errors): remote.txt => remote.html generated (14 errors): remote_plugin.txt => remote_plugin.html generated (351 errors): repeat.txt => repeat.html generated (23 errors): rileft.txt => rileft.html generated (12 errors): russian.txt => russian.html generated (6 errors): scroll.txt => scroll.html generated (106 errors): sign.txt => sign.html generated (347 errors): spell.txt => spell.html generated (784 errors): starting.txt => starting.html generated (1499 errors): syntax.txt => syntax.html generated (23 errors): tabpage.txt => tabpage.html generated (257 errors): tagsrch.txt => tagsrch.html generated (31 errors): term.txt => term.html generated (0 errors): testing.txt => testing.html generated (96 errors): tips.txt => tips.html generated (57 errors): treesitter.txt => treesitter.html generated (71 errors): uganda.txt => uganda.html generated (74 errors): ui.txt => ui.html generated (87 errors): undo.txt => undo.html generated (17 errors): userfunc.txt => userfunc.html generated (1 errors): usr_01.txt => usr_01.html generated (89 errors): usr_02.txt => usr_02.html generated (293 errors): usr_03.txt => usr_03.html generated (46 errors): usr_04.txt => usr_04.html generated (96 errors): usr_05.txt => usr_05.html generated (54 errors): usr_06.txt => usr_06.html generated (20 errors): usr_07.txt => usr_07.html generated (241 errors): usr_08.txt => usr_08.html generated (130 errors): usr_09.txt => usr_09.html generated (50 errors): usr_10.txt => usr_10.html generated (33 errors): usr_11.txt => usr_11.html generated (32 errors): usr_12.txt => usr_12.html generated (22 errors): usr_20.txt => usr_20.html generated (75 errors): usr_21.txt => usr_21.html generated (8 errors): usr_22.txt => usr_22.html generated (3 errors): usr_23.txt => usr_23.html generated (163 errors): usr_25.txt => usr_25.html generated (13 errors): usr_26.txt => usr_26.html generated (84 errors): usr_27.txt => usr_27.html generated (173 errors): usr_28.txt => usr_28.html generated (285 errors): usr_29.txt => usr_29.html generated (280 errors): usr_30.txt => usr_30.html generated (11 errors): usr_31.txt => usr_31.html generated (13 errors): usr_32.txt => usr_32.html generated (156 errors): usr_40.txt => usr_40.html generated (134 errors): usr_41.txt => usr_41.html generated (35 errors): usr_42.txt => usr_42.html generated (19 errors): usr_43.txt => usr_43.html generated (60 errors): usr_44.txt => usr_44.html generated (13 errors): usr_45.txt => usr_45.html generated (1 errors): usr_toc.txt => usr_toc.html generated (69 errors): various.txt => various.html generated (68 errors): vi_diff.txt => vi_diff.html generated (437 errors): vim_diff.txt => vim_diff.html generated (296 errors): visual.txt => visual.html generated (181 errors): windows.txt => windows.html generated 119 html pages total errors: 23862 invalid tags: 537 --- runtime/doc/autocmd.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 7a2c540ea2..e55534b163 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -57,7 +57,7 @@ The special pattern or defines a buffer-local autocommand. See |autocmd-buflocal|. Note: The ":autocmd" command can only be followed by another command when the -'|' appears where the pattern is expected. This works: > +"|" appears where the pattern is expected. This works: > :augroup mine | au! BufRead | augroup END But this sees "augroup" as part of the defined command: > :augroup mine | au! BufRead * | augroup END -- cgit From 2a3cb0893b03aeff4d8c0b2116cbddda53bba5a2 Mon Sep 17 00:00:00 2001 From: Louis Sven Goulet <31444858+lorlouis@users.noreply.github.com> Date: Sat, 24 Sep 2022 21:57:10 -0400 Subject: feat: ":write!" skips "file changed" warning #18665 Problem: Cannot opt-out of "WARNING: The file has been changed since reading it!!!", even with ":write!". Solution: Change ":write!" to skip the warning. closes #7270 --- runtime/doc/editing.txt | 6 +++--- runtime/doc/vim_diff.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index dcb0bf8a2e..21a30ca429 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -941,7 +941,7 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write* Vim will warn you if you try to overwrite a file that has been changed -elsewhere. See |timestamp|. +elsewhere (unless "!" was used). See |timestamp|. *backup* *E207* *E506* *E507* *E508* *E509* *E510* If you write to an existing file (but do not append) while the 'backup', @@ -1481,8 +1481,8 @@ doing something there and closing it should be OK (if there are no side effects from other autocommands). Closing unrelated windows and buffers will get you into trouble. -Before writing a file the timestamp is checked. If it has changed, Vim will -ask if you really want to overwrite the file: +Before writing a file, the timestamp is checked (unless "!" was used). +If it has changed, Vim will ask if you really want to overwrite the file: WARNING: The file has been changed since reading it!!! Do you really want to write to it (y/n)? diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index b013e00fe8..e254e5edd0 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -372,6 +372,7 @@ Lua interface (|lua.txt|): Commands: |:doautocmd| does not warn about "No matching autocommands". |:wincmd| accepts a count. + `:write!` does not show a prompt if the file was updated externally. Command line completion: The meanings of arrow keys do not change depending on 'wildoptions'. -- cgit From 3169fc54a129f6dd1c0baf2d404e50381cf48e8f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 25 Sep 2022 00:45:15 +0200 Subject: refactor(treesitter): rename x_position => x_pos "pos" has a long precedent as "position" in vim, and there is no reason to use a verbose name here. --- runtime/doc/develop.txt | 6 ++++++ runtime/doc/treesitter.txt | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index b31ac47bda..4f17e7d34a 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -251,6 +251,12 @@ Use existing common {action} names if possible: list Get all things set Set a thing (or group of things) +Use existing common {thing} names if possible: + buf Buffer + pos Position + tab Tabpage + win Window + Use consistent names for {thing} in all API functions. E.g. a buffer is called "buf" everywhere, not "buffer" in some places and "buf" in others. diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index eda1a5e496..3102c6da9a 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -434,8 +434,7 @@ get_captures_at_cursor({winnr}) *get_captures_at_cursor()* Return: ~ string[] List of capture names - *get_captures_at_position()* -get_captures_at_position({bufnr}, {row}, {col}) +get_captures_at_pos({bufnr}, {row}, {col}) *get_captures_at_pos()* Returns a list of highlight captures at the given position Each capture is represented by a table containing the capture name as a @@ -460,8 +459,7 @@ get_node_at_cursor({winnr}) *get_node_at_cursor()* Return: ~ (string) Name of node under the cursor - *get_node_at_position()* -get_node_at_position({bufnr}, {row}, {col}, {opts}) +get_node_at_pos({bufnr}, {row}, {col}, {opts}) *get_node_at_pos()* Returns the smallest named node at the given position Parameters: ~ -- cgit From 63be7651829f8b77c4974d08ebe09f7775e41a8a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 25 Sep 2022 19:58:27 -0400 Subject: fix(docs): invalid :help links #20345 Fix those naughty single quotes. closes #20159 --- runtime/doc/api.txt | 38 +++--- runtime/doc/autocmd.txt | 6 +- runtime/doc/builtin.txt | 32 ++--- runtime/doc/cmdline.txt | 2 +- runtime/doc/ft_ada.txt | 30 ++--- runtime/doc/ft_rust.txt | 8 +- runtime/doc/ft_sql.txt | 2 +- runtime/doc/help.txt | 1 - runtime/doc/index.txt | 23 ++-- runtime/doc/insert.txt | 4 +- runtime/doc/lsp.txt | 75 ++++++----- runtime/doc/lua.txt | 26 ++-- runtime/doc/luaref.txt | 323 ++++++++++++++++++--------------------------- runtime/doc/map.txt | 2 +- runtime/doc/mbyte.txt | 5 +- runtime/doc/options.txt | 6 +- runtime/doc/pi_netrw.txt | 14 +- runtime/doc/print.txt | 2 +- runtime/doc/provider.txt | 2 +- runtime/doc/quickfix.txt | 6 +- runtime/doc/quickref.txt | 7 - runtime/doc/repeat.txt | 2 +- runtime/doc/starting.txt | 2 - runtime/doc/syntax.txt | 16 +-- runtime/doc/treesitter.txt | 16 +-- runtime/doc/ui.txt | 4 +- runtime/doc/userfunc.txt | 5 +- runtime/doc/usr_41.txt | 2 +- runtime/doc/usr_45.txt | 3 +- runtime/doc/vim_diff.txt | 33 ++--- 30 files changed, 312 insertions(+), 385 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 7e55bb8f4e..ec16d5c650 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -345,7 +345,7 @@ LUA ~ In-process Lua plugins can receive buffer updates in the form of Lua callbacks. These callbacks are called frequently in various contexts; |textlock| prevents changing buffer contents and window layout (use -|vim.schedule| to defer such operations to the main loop instead). +|vim.schedule()| to defer such operations to the main loop instead). |nvim_buf_attach()| will take keyword args for the callbacks. "on_lines" will receive parameters ("lines", {buf}, {changedtick}, {firstline}, {lastline}, @@ -989,7 +989,7 @@ nvim_get_proc_children({pid}) *nvim_get_proc_children()* nvim_get_runtime_file({name}, {all}) *nvim_get_runtime_file()* Find files in runtime directories - 'name' can contain wildcards. For example + "name" can contain wildcards. For example nvim_get_runtime_file("colors/*.vim", true) will return all color scheme files. Always use forward slashes (/) in the search pattern for subdirectories regardless of platform. @@ -1164,7 +1164,7 @@ nvim_open_term({buffer}, {opts}) *nvim_open_term()* terminal mode. Note: keypresses are sent raw as they would be to the pty master end. For instance, a carriage return is sent as a "\r", not as a "\n". |textlock| applies. It - is possible to call |nvim_chan_send| directly in the + is possible to call |nvim_chan_send()| directly in the callback however. ["input", term, bufnr, data] Return: ~ @@ -1396,15 +1396,15 @@ nvim_set_hl({ns_id}, {name}, {*val}) *nvim_set_hl()* • link: name of another highlight group to link to, see |:hi-link|. • default: Don't override existing definition |:hi-default| - • ctermfg: Sets foreground of cterm color |highlight-ctermfg| - • ctermbg: Sets background of cterm color |highlight-ctermbg| + • ctermfg: Sets foreground of cterm color |ctermfg| + • ctermbg: Sets background of cterm color |ctermbg| • cterm: cterm attribute map, like |highlight-args|. If not set, cterm attributes will match those from the attribute map documented above. nvim_set_hl_ns({ns_id}) *nvim_set_hl_ns()* Set active namespace for highlights. This can be set for a single window, - see |nvim_win_set_hl_ns|. + see |nvim_win_set_hl_ns()|. Parameters: ~ {ns_id} the namespace to use @@ -1413,7 +1413,7 @@ nvim_set_hl_ns_fast({ns_id}) *nvim_set_hl_ns_fast()* Set active namespace for highlights while redrawing. This function meant to be called while redrawing, primarily from - |nvim_set_decoration_provider| on_win and on_line callbacks, which are + |nvim_set_decoration_provider()| on_win and on_line callbacks, which are allowed to change the namespace during a redraw cycle. Attributes: ~ @@ -1445,7 +1445,7 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()* {rhs} Right-hand-side |{rhs}| of the mapping. {opts} Optional parameters map: keys are |:map-arguments|, values are booleans (default false). Accepts all |:map-arguments| as keys - excluding || but including |noremap| and "desc". + excluding || but including |:noremap| and "desc". Unknown key is an error. "desc" can be used to give a description to the mapping. When called from Lua, also accepts a "callback" key that takes a Lua function to call when the @@ -1886,7 +1886,7 @@ nvim_get_all_options_info() *nvim_get_all_options_info()* Gets the option information for all options. The dictionary has the full option names as keys and option metadata - dictionaries as detailed at |nvim_get_option_info|. + dictionaries as detailed at |nvim_get_option_info()|. Return: ~ dictionary of all options @@ -1960,7 +1960,7 @@ nvim_set_option_value({name}, {value}, {*opts}) {name} Option name {value} New option value {opts} Optional parameters - • scope: One of 'global' or 'local'. Analogous to + • scope: One of "global" or "local". Analogous to |:setglobal| and |:setlocal|, respectively. • win: |window-ID|. Used for setting window local option. • buf: Buffer number. Used for setting buffer local option. @@ -2576,7 +2576,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts}) highlight groups that will be stacked (highest priority last). A highlight group can be supplied either as a string or as an integer, the latter which can be obtained - using |nvim_get_hl_id_by_name|. + using |nvim_get_hl_id_by_name()|. • virt_text_pos : position of virtual text. Possible values: • "eol": right after eol character (default) • "overlay": display over the specified column, without @@ -2608,7 +2608,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts}) • virt_lines_above: place virtual lines above instead. • virt_lines_leftcol: Place extmarks in the leftmost column of the window, bypassing sign and number columns. - • ephemeral : for use with |nvim_set_decoration_provider| + • ephemeral : for use with |nvim_set_decoration_provider()| callbacks. The mark will only be used for the current redraw cycle, and not be permantently stored in the buffer. @@ -2686,7 +2686,7 @@ nvim_set_decoration_provider({ns_id}, {*opts}) triggered during the redraw code. The expected usage is to set extmarks for the currently redrawn buffer. - |nvim_buf_set_extmark| can be called to add marks on a per-window or + |nvim_buf_set_extmark()| can be called to add marks on a per-window or per-lines basis. Use the `ephemeral` key to only use the mark for the current screen redraw (the callback will be called again for the next redraw ). @@ -2844,7 +2844,7 @@ nvim_win_hide({window}) *nvim_win_hide()* Like |:hide| the buffer becomes hidden unless another window is editing it, or 'bufhidden' is `unload`, `delete` or `wipe` as opposed to |:close| - or |nvim_win_close|, which will close the buffer. + or |nvim_win_close()|, which will close the buffer. Attributes: ~ not allowed when |textlock| is active @@ -3012,7 +3012,7 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()* options. 'signcolumn' is changed to `auto` and 'colorcolumn' is cleared. The end-of-buffer region is hidden by setting `eob` flag of 'fillchars' to a space - char, and clearing the |EndOfBuffer| region in + char, and clearing the |hl-EndOfBuffer| region in 'winhighlight'. • border: Style of (optional) window border. This can either @@ -3148,7 +3148,7 @@ Autocmd Functions *api-autocmd* nvim_clear_autocmds({*opts}) *nvim_clear_autocmds()* Clear all autocommands that match the corresponding {opts}. To delete a - particular autocmd, see |nvim_del_autocmd|. + particular autocmd, see |nvim_del_autocmd()|. Parameters: ~ {opts} Parameters @@ -3295,7 +3295,7 @@ nvim_del_augroup_by_id({id}) *nvim_del_augroup_by_id()* To get a group id one can use |nvim_get_autocmds()|. - NOTE: behavior differs from |augroup-delete|. When deleting a group, + NOTE: behavior differs from |:augroup-delete|. When deleting a group, autocommands contained in this group will also be deleted and cleared. This group will no longer exist. @@ -3309,7 +3309,7 @@ nvim_del_augroup_by_id({id}) *nvim_del_augroup_by_id()* nvim_del_augroup_by_name({name}) *nvim_del_augroup_by_name()* Delete an autocommand group by name. - NOTE: behavior differs from |augroup-delete|. When deleting a group, + NOTE: behavior differs from |:augroup-delete|. When deleting a group, autocommands contained in this group will also be deleted and cleared. This group will no longer exist. @@ -3317,7 +3317,7 @@ nvim_del_augroup_by_name({name}) *nvim_del_augroup_by_name()* {name} String The name of the group. See also: ~ - |autocommand-groups| + |autocmd-groups| nvim_del_autocmd({id}) *nvim_del_autocmd()* Delete an autocommand by id. diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index e55534b163..97a1bdc134 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -835,13 +835,13 @@ QuitPre When using `:quit`, `:wq` or `:qall`, before See also |ExitPre|, |WinClosed|. *RemoteReply* RemoteReply When a reply from a Vim that functions as - server was received |server2client()|. The + server was received server2client(). The pattern is matched against the {serverid}. is equal to the {serverid} from which the reply was sent, and is the actual reply string. Note that even if an autocommand is defined, - the reply should be read with |remote_read()| + the reply should be read with remote_read() to consume it. *SearchWrapped* SearchWrapped After making a search with |n| or |N| if the @@ -1206,7 +1206,7 @@ still executed. ============================================================================== 7. Buffer-local autocommands *autocmd-buflocal* *autocmd-buffer-local* - ** ** *E680* + ** ** ** *E680* Buffer-local autocommands are attached to a specific buffer. They are useful if the buffer does not have a name and when the name does not match a specific diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 7b1a50c1fb..77b85406b9 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1537,7 +1537,7 @@ cursor({list}) debugbreak({pid}) *debugbreak()* Specifically used to interrupt a program being debugged. It will cause process {pid} to get a SIGTRAP. Behavior for other - processes is undefined. See |terminal-debugger|. + processes is undefined. See |terminal-debug|. {Sends a SIGINT to a process {pid} other than MS-Windows} Returns |TRUE| if successfully interrupted the program. @@ -3289,18 +3289,18 @@ getmatches([{win}]) *getmatches()* an empty list is returned. Example: > :echo getmatches() -< [{'group': 'MyGroup1', 'pattern': 'TODO', - 'priority': 10, 'id': 1}, {'group': 'MyGroup2', - 'pattern': 'FIXME', 'priority': 10, 'id': 2}] > +< [{"group": "MyGroup1", "pattern": "TODO", + "priority": 10, "id": 1}, {"group": "MyGroup2", + "pattern": "FIXME", "priority": 10, "id": 2}] > :let m = getmatches() :call clearmatches() :echo getmatches() < [] > :call setmatches(m) :echo getmatches() -< [{'group': 'MyGroup1', 'pattern': 'TODO', - 'priority': 10, 'id': 1}, {'group': 'MyGroup2', - 'pattern': 'FIXME', 'priority': 10, 'id': 2}] > +< [{"group": "MyGroup1", "pattern": "TODO", + "priority": 10, "id": 1}, {"group": "MyGroup2", + "pattern": "FIXME", "priority": 10, "id": 2}] > :unlet m < getmousepos() *getmousepos()* @@ -3499,7 +3499,7 @@ getreginfo([{regname}]) *getreginfo()* Dictionary with the following entries: regcontents List of lines contained in register {regname}, like - |getreg|({regname}, 1, 1). + getreg({regname}, 1, 1). regtype the type of register {regname}, as in |getregtype()|. isunnamed Boolean flag, v:true if this register @@ -4415,7 +4415,7 @@ jobstart({cmd} [, {opts}]) *jobstart()* killed when Nvim exits. If the process exits before Nvim, `on_exit` will be invoked. env: (dict) Map of environment variable name:value - pairs extending (or replacing with |clear_env|) + pairs extending (or replace with "clear_env") the current environment. |jobstart-env| height: (number) Height of the `pty` terminal. |on_exit|: (function) Callback invoked when the job exits. @@ -5209,12 +5209,12 @@ matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()* Example: > :echo matchfuzzypos(['testing'], 'tsg') -< results in [['testing'], [[0, 2, 6]], [99]] > +< results in [["testing"], [[0, 2, 6]], [99]] > :echo matchfuzzypos(['clay', 'lacy'], 'la') -< results in [['lacy', 'clay'], [[0, 1], [1, 2]], [153, 133]] > +< results in [["lacy", "clay"], [[0, 1], [1, 2]], [153, 133]] > :echo [{'text': 'hello', 'id' : 10}] \ ->matchfuzzypos('ll', {'key' : 'text'}) -< results in [[{'id': 10, 'text': 'hello'}], [[2, 3]], [127]] +< results in [[{"id": 10, "text": "hello"}], [[2, 3]], [127]] matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* Same as |match()|, but return a |List|. The first item in the @@ -8247,7 +8247,7 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* "bg" background color (as with "fg") "font" font name (only available in the GUI) |highlight-font| - "sp" special color (as with "fg") |highlight-guisp| + "sp" special color (as with "fg") |guisp| "fg#" like "fg", but for the GUI and the GUI is running the name in "#RRGGBB" form "bg#" like "fg#" for "bg" @@ -9106,12 +9106,12 @@ winlayout([{tabnr}]) *winlayout()* returns an empty list. For a leaf window, it returns: - ['leaf', {winid}] + ["leaf", {winid}] For horizontally split windows, which form a column, it returns: - ['col', [{nested list of windows}]] + ["col", [{nested list of windows}]] For vertically split windows, which form a row, it returns: - ['row', [{nested list of windows}]] + ["row", [{nested list of windows}]] Example: > " Only one window in the tab page diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index f19671e713..b1013420fa 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -764,7 +764,7 @@ Count and Range *N:* When giving a count before entering ":", this is translated into: :.,.+(count - 1) -In words: The 'count' lines at and after the cursor. Example: To delete +In words: The "count" lines at and after the cursor. Example: To delete three lines: > 3:d is translated into: .,.+2d < diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt index f6dfa708fb..fa069057c4 100644 --- a/runtime/doc/ft_ada.txt +++ b/runtime/doc/ft_ada.txt @@ -288,7 +288,7 @@ g:ada_rainbow_color bool (true when exists) rainbow_parenthesis for this to work. *g:ada_folding* -g:ada_folding set ('sigpft') +g:ada_folding set ("sigpft") Use folding for Ada sources. 's': activate syntax folding on load 'p': fold packages @@ -296,10 +296,10 @@ g:ada_folding set ('sigpft') 't': fold types 'c': fold conditionals 'g': activate gnat pretty print folding on load - 'i': lone 'is' folded with line above - 'b': lone 'begin' folded with line above - 'p': lone 'private' folded with line above - 'x': lone 'exception' folded with line above + 'i': lone "is" folded with line above + 'b': lone "begin" folded with line above + 'p': lone "private" folded with line above + 'x': lone "exception" folded with line above 'i': activate indent folding on load Note: Syntax folding is in an early (unusable) stage and @@ -334,10 +334,10 @@ g:ada_omni_with_keywords completion (|i_CTRL-X_CTRL-U|). *g:ada_extended_tagging* -g:ada_extended_tagging enum ('jump', 'list') +g:ada_extended_tagging enum ("jump", "list") use extended tagging, two options are available - 'jump': use tjump to jump. - 'list': add tags quick fix list. + "jump": use tjump to jump. + "list": add tags quick fix list. Normal tagging does not support function or operator overloading as these features are not available in C and tagging was originally developed for C. @@ -359,8 +359,8 @@ g:ada_with_gnat_project_files bool (true when exists) *g:ada_default_compiler* g:ada_default_compiler string - set default compiler. Currently supported are 'gnat' and - 'decada'. + set default compiler. Currently supported are "gnat" and + "decada". An "exists" type is a boolean considered true when the variable is defined and false when the variable is undefined. The value to which the variable is set @@ -406,14 +406,14 @@ makes no difference. g:gnat object Control object which manages GNAT compiles. The object is created when the first Ada source code is loaded provided - that |g:ada_default_compiler| is set to 'gnat'. See + that |g:ada_default_compiler| is set to "gnat". See |gnat_members| for details. *g:decada* g:decada object Control object which manages Dec Ada compiles. The object is created when the first Ada source code is loaded provided - that |g:ada_default_compiler| is set to 'decada'. See + that |g:ada_default_compiler| is set to "decada". See |decada_members| for details. ------------------------------------------------------------------------------ @@ -459,11 +459,11 @@ ada#List_Tag([{line}, {col}]) *ada#Listtags()* ada#Jump_Tag ({ident}, {mode}) *ada#Jump_Tag()* List all occurrences of the Ada entity under the cursor (or at given line/column) in the tag jump list. Mode can either be - 'tjump' or 'stjump'. + "tjump" or "stjump". ada#Create_Tags ({option}) *ada#Create_Tags()* - Creates tag file using Ctags. The option can either be 'file' - for the current file, 'dir' for the directory of the current + Creates tag file using Ctags. The option can either be "file" + for the current file, "dir" for the directory of the current file or a file name. gnat#Insert_Tags_Header() *gnat#Insert_Tags_Header()* diff --git a/runtime/doc/ft_rust.txt b/runtime/doc/ft_rust.txt index 5c8782ec7a..34932c48fb 100644 --- a/runtime/doc/ft_rust.txt +++ b/runtime/doc/ft_rust.txt @@ -92,8 +92,8 @@ g:ftplugin_rust_source_path~ *g:rustfmt_command* g:rustfmt_command~ - Set this option to the name of the 'rustfmt' executable in your $PATH. If - not specified it defaults to 'rustfmt' : > + Set this option to the name of the "rustfmt" executable in your $PATH. If + not specified it defaults to "rustfmt" : > let g:rustfmt_command = 'rustfmt' < *g:rustfmt_autosave* @@ -104,14 +104,14 @@ g:rustfmt_autosave~ < *g:rustfmt_fail_silently* g:rustfmt_fail_silently~ - Set this option to 1 to prevent 'rustfmt' from populating the + Set this option to 1 to prevent "rustfmt" from populating the |location-list| with errors. If not specified it defaults to 0: > let g:rustfmt_fail_silently = 0 < *g:rustfmt_options* g:rustfmt_options~ Set this option to a string of options to pass to 'rustfmt'. The - write-mode is already set to 'overwrite'. If not specified it + write-mode is already set to "overwrite". If not specified it defaults to '' : > let g:rustfmt_options = '' < diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index 335faf266e..685726de90 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -244,7 +244,7 @@ key to complete the optional parameter. After typing the function name and a space, you can use the completion to supply a parameter. The function takes the name of the Vim script you want to source. Using the |cmdline-completion| feature, the SQLSetType function will -search the |'runtimepath'| for all Vim scripts with a name containing 'sql'. +search the |'runtimepath'| for all Vim scripts with a name containing "sql". This takes the guess work out of the spelling of the names. The following are examples: > :SQLSetType diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 34213f7512..a1bedfa500 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -98,7 +98,6 @@ General subjects ~ |help.txt| overview and quick reference (this file) |helphelp.txt| about using the help files |index.txt| alphabetical index of all commands -|help-tags| all the tags you can jump to (index of tags) |tips.txt| various tips on using Vim |message.txt| (error) messages and explanations |develop.txt| development of Nvim diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 7f3ef20762..f9ef99f819 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -13,7 +13,6 @@ to look for deleting something, use: "/delete". For an overview of options see |option-list|. For an overview of built-in functions see |functions|. For a list of Vim variables see |vim-variable|. -For a complete listing of all help items see |help-tags|. Type |gO| to see the table of contents. @@ -61,7 +60,7 @@ tag char action in Insert mode ~ |i_CTRL-Q| CTRL-Q same as CTRL-V, unless used for terminal control flow |i_CTRL-SHIFT-Q| CTRL-SHIFT-Q {char} - like CTRL-Q unless |modifyOtherKeys| is active + like CTRL-Q unless |tui-modifyOtherKeys| is active |i_CTRL-R| CTRL-R {register} insert the contents of a register |i_CTRL-R_CTRL-R| CTRL-R CTRL-R {register} @@ -79,7 +78,7 @@ tag char action in Insert mode ~ line |i_CTRL-V| CTRL-V {char} insert next non-digit literally |i_CTRL-SHIFT-V| CTRL-SHIFT-V {char} - like CTRL-V unless |modifyOtherKeys| is active + like CTRL-V unless |tui-modifyOtherKeys| is active |i_CTRL-V_digit| CTRL-V {number} insert three digit decimal number as a single byte. |i_CTRL-W| CTRL-W delete word before the cursor @@ -454,14 +453,14 @@ tag char note action in Normal mode ~ || 1 same as CTRL-B || 2 same as "u" || 1 same as "k" -|| move window three lines down -|| move window one page down -|| move window three lines up -|| move window one page up -|| move window six columns left -|| move window one page left -|| move window six columns right -|| move window one page right +** move window three lines down +** move window one page down +** move window three lines up +** move window one page up +** move window six columns left +** move window one page left +** move window six columns right +** move window one page right ============================================================================== 2.1 Text objects *objects* @@ -700,7 +699,7 @@ tag char note action in Normal mode ~ tag char note action in Normal mode ~ ------------------------------------------------------------------------------ -|g_CTRL-A| g CTRL-A dump a memory profile +g_CTRL-A g CTRL-A dump a memory profile |g_CTRL-G| g CTRL-G show information about current cursor position |g_CTRL-H| g CTRL-H start Select block mode diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 6b0899334b..f4ef8e65c4 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1519,7 +1519,7 @@ RUBY *ft-ruby-omni* NOTE: |compl-omni| for Ruby code requires |provider-ruby| to be installed. Ruby completion will parse your buffer on demand in order to provide a list of -completions. These completions will be drawn from modules loaded by 'require' +completions. These completions will be drawn from modules loaded by "require" and modules defined in the current buffer. The completions provided by CTRL-X CTRL-O are sensitive to the context: @@ -1759,7 +1759,7 @@ In the example four special elements are visible: dialect. 2. If the list containing possible values of attributes has one element and this element is equal to the name of the attribute this attribute will be - treated as boolean and inserted as 'attrname' and not as 'attrname="' + treated as boolean and inserted as "attrname" and not as 'attrname="' 3. "vimxmltaginfo" - a special key with a Dictionary containing tag names as keys and two element List as values, for additional menu info and the long description. diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 00aaf759e2..26bca21507 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -40,7 +40,7 @@ Follow these steps to get LSP features: root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]), }) < - See |vim.lsp.start| for details. + See |vim.lsp.start()| for details. 3. Configure keymaps and autocmds to utilize LSP features. See |lsp-config|. @@ -48,19 +48,19 @@ Follow these steps to get LSP features: *lsp-config* Starting a LSP client will automatically report diagnostics via -|vim.diagnostic|. Read |vim.diagnostic.config| to learn how to customize the +|vim.diagnostic|. Read |vim.diagnostic.config()| to learn how to customize the display. It also sets some buffer options if the options are otherwise empty and if the language server supports the functionality. -- |omnifunc| is set to |vim.lsp.omnifunc|. This allows to trigger completion - using |i_CTRL-X_CTRL-o| -- |tagfunc| is set to |vim.lsp.tagfunc|. This enables features like +- 'omnifunc' is set to |vim.lsp.omnifunc()|. This allows to trigger completion + using |i_CTRL-X_CTRL-O| +- 'tagfunc' is set to |vim.lsp.tagfunc()|. This enables features like go-to-definition, |:tjump|, and keymaps like |CTRL-]|, |CTRL-W_]|, |CTRL-W_}| to utilize the language server. -- |formatexpr| is set to |vim.lsp.formatexpr| if both |formatprg| and - |formatexpr| are empty. This allows to format lines via |gq| if the language +- 'formatexpr' is set to |vim.lsp.formatexpr()| if both 'formatprg' and + 'formatexpr' are empty. This allows to format lines via |gq| if the language server supports it. To use other LSP features like hover, rename, etc. you can setup some @@ -245,7 +245,7 @@ For |lsp-request|, each |lsp-handler| has this signature: > Where `err` must be shaped like an RPC error: `{ code, message, data? }` - You can use |vim.lsp.rpc_response_error()| to create this object. + You can use |vim.lsp.rpc.rpc_response_error()| to create this object. For |lsp-notification|, each |lsp-handler| has this signature: > @@ -338,8 +338,8 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method } < Some handlers do not have an explicitly named handler function (such as - |on_publish_diagnostics()|). To override these, first create a reference - to the existing handler: > + ||vim.lsp.diagnostic.on_publish_diagnostics()|). To override these, first + create a reference to the existing handler: > local on_references = vim.lsp.handlers["textDocument/references"] vim.lsp.handlers["textDocument/references"] = vim.lsp.with( @@ -360,7 +360,7 @@ Handlers can be set by: vim.lsp.handlers["textDocument/definition"] = my_custom_default_definition < -- The {handlers} parameter for |vim.lsp.start_client|. +- The {handlers} parameter for |vim.lsp.start_client()|. This will set the |lsp-handler| as the default handler for this server. For example: > @@ -514,7 +514,7 @@ callback in the "data" table. Example: > end, }) < -In addition, the following |User| |autocommands| are provided: +Also the following |User| |autocommand|s are provided: LspProgressUpdate *LspProgressUpdate* Upon receipt of a progress notification from the server. See @@ -788,7 +788,8 @@ start({config}, {opts}) *vim.lsp.start()* }) < - See |lsp.start_client| for all available options. The most important are: + See |vim.lsp.start_client()| for all available options. The most important + are: `name` is an arbitrary name for the LSP client. It should be unique per language server. @@ -798,9 +799,9 @@ start({config}, {opts}) *vim.lsp.start()* constructs like `~` are NOT expanded. `root_dir` path to the project root. By default this is used to decide if - an existing client should be re-used. The example above uses |vim.fs.find| - and |vim.fs.dirname| to detect the root by traversing the file system - upwards starting from the current directory until either a + an existing client should be re-used. The example above uses + |vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing + the file system upwards starting from the current directory until either a `pyproject.toml` or `setup.py` file is found. `workspace_folders` a list of { uri:string, name: string } tables. The @@ -812,13 +813,13 @@ start({config}, {opts}) *vim.lsp.start()* the project folder. To ensure a language server is only started for languages it can handle, - make sure to call |vim.lsp.start| within a |FileType| autocmd. Either use - |:au|, |nvim_create_autocmd()| or put the call in a + make sure to call |vim.lsp.start()| within a |FileType| autocmd. Either + use |:au|, |nvim_create_autocmd()| or put the call in a `ftplugin/.lua` (See |ftplugin-name|) Parameters: ~ {config} (table) Same configuration as documented in - |lsp.start_client()| + |vim.lsp.start_client()| {opts} nil|table Optional keyword arguments: • reuse_client (fun(client: client, config: table): boolean) Predicate used to decide if a client should be re-used. @@ -837,15 +838,16 @@ start_client({config}) *vim.lsp.start_client()* Parameters: ~ {cmd} (table|string|fun(dispatchers: table):table) - command string or list treated like |jobstart|. + command string or list treated like |jobstart()|. The command must launch the language server process. `cmd` can also be a function that creates an RPC client. The function receives a dispatchers table and must return a table with the functions `request`, `notify`, `is_closing` - and `terminate` See |vim.lsp.rpc.request| and - |vim.lsp.rpc.notify| For TCP there is a built-in - rpc client factory: |vim.lsp.rpc.connect| + and `terminate` See |vim.lsp.rpc.request()| and + |vim.lsp.rpc.notify()| For TCP there is a + built-in rpc client factory: + |vim.lsp.rpc.connect()| {cmd_cwd} (string, default=|getcwd()|) Directory to launch the `cmd` process. Not related to `root_dir`. {cmd_env} (table) Environment flags to pass to the LSP on @@ -900,7 +902,7 @@ start_client({config}) *vim.lsp.start_client()* when the client operation throws an error. `code` is a number describing the error. Other arguments may be passed depending on the error kind. See - |vim.lsp.rpc.client_errors| for possible errors. + `vim.lsp.rpc.client_errors` for possible errors. Use `vim.lsp.rpc.client_errors[code]` to get human-friendly name. {before_init} Callback with parameters (initialize_params, @@ -945,9 +947,9 @@ start_client({config}) *vim.lsp.start_client()* debounce occurs if nil • exit_timeout (number|boolean, default false): Milliseconds to wait for server to exit cleanly - after sending the 'shutdown' request before + after sending the "shutdown" request before sending kill -15. If set to false, nvim exits - immediately after sending the 'shutdown' + immediately after sending the "shutdown" request to the server. {root_dir} (string) Directory where the LSP server will base its workspaceFolders, rootUri, and rootPath on @@ -1047,7 +1049,7 @@ completion({context}) *vim.lsp.buf.completion()* character, if applicable) See also: ~ - |vim.lsp.protocol.constants.CompletionTriggerKind| + vim.lsp.protocol.constants.CompletionTriggerKind declaration({options}) *vim.lsp.buf.declaration()* Jumps to the declaration of the symbol under the cursor. @@ -1084,7 +1086,8 @@ document_highlight() *vim.lsp.buf.document_highlight()* Note: Usage of |vim.lsp.buf.document_highlight()| requires the following highlight groups to be defined or you won't be able to see the actual - highlights. |LspReferenceText| |LspReferenceRead| |LspReferenceWrite| + highlights. |hl-LspReferenceText| |hl-LspReferenceRead| + |hl-LspReferenceWrite| document_symbol({options}) *vim.lsp.buf.document_symbol()* Lists all symbols in the current buffer in the quickfix window. @@ -1193,7 +1196,7 @@ formatting_sync({options}, {timeout_ms}) {timeout_ms} (number) Request timeout See also: ~ - |vim.lsp.buf.formatting_seq_sync| + |vim.lsp.buf.format()| hover() *vim.lsp.buf.hover()* Displays hover information about the symbol under the cursor in a floating @@ -1211,7 +1214,7 @@ implementation({options}) *vim.lsp.buf.implementation()* incoming_calls() *vim.lsp.buf.incoming_calls()* Lists all the call sites of the symbol under the cursor in the |quickfix| window. If the symbol can resolve to multiple items, the user can pick one - in the |inputlist|. + in the |inputlist()|. list_workspace_folders() *vim.lsp.buf.list_workspace_folders()* List workspace folders. @@ -1219,7 +1222,7 @@ list_workspace_folders() *vim.lsp.buf.list_workspace_folders()* outgoing_calls() *vim.lsp.buf.outgoing_calls()* Lists all the items that are called by the symbol under the cursor in the |quickfix| window. If the symbol can resolve to multiple items, the user - can pick one in the |inputlist|. + can pick one in the |inputlist()|. *vim.lsp.buf.range_code_action()* range_code_action({context}, {start_pos}, {end_pos}) @@ -1434,7 +1437,7 @@ signature_help({_}, {result}, {ctx}, {config}) {config} (table) Configuration table. • border: (default=nil) • Add borders to the floating window - • See |vim.api.nvim_open_win()| + • See |nvim_open_win()| ============================================================================== @@ -1565,7 +1568,7 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()* (number) indentation size See also: ~ - |shiftwidth| + 'shiftwidth' *vim.lsp.util.jump_to_location()* jump_to_location({location}, {offset_encoding}, {reuse_win}) @@ -1722,7 +1725,7 @@ open_floating_preview({contents}, {syntax}, {opts}) {contents} (table) of lines to show in window {syntax} (string) of syntax to set for opened buffer {opts} (table) with optional fields (additional keys are passed - on to |vim.api.nvim_open_win()|) + on to |nvim_open_win()|) • height: (number) height of floating window • width: (number) width of floating window • wrap: (boolean, default true) wrap long lines @@ -1859,7 +1862,7 @@ try_trim_markdown_code_blocks({lines}) {lines} (table) list of lines Return: ~ - (string) filetype or 'markdown' if it was unchanged. + (string) filetype or "markdown" if it was unchanged. ============================================================================== @@ -1964,7 +1967,7 @@ start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params}) Starts an LSP server process and create an LSP RPC client object to interact with it. Communication with the spawned process happens via stdio. For communication via TCP, spawn a process manually and use - |vim.lsp.rpc.connect| + |vim.lsp.rpc.connect()| Parameters: ~ {cmd} (string) Command to start the LSP server. diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 88547edfe5..0c6eb6af78 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -285,7 +285,7 @@ These commands execute a Lua chunk from either the command line (:lua, :luado) or a file (:luafile) on the given line [range]. As always in Lua, each chunk has its own scope (closure), so only global variables are shared between command calls. The |lua-stdlib| modules, user modules, and anything else on -|lua-package-path| are available. +|package.path| are available. The Lua print() function redirects its output to the Nvim message area, with arguments separated by " " (space) instead of "\t" (tab). @@ -617,7 +617,7 @@ A subset of the `vim.*` API is available in threads. This includes: - `vim.loop` with a separate event loop per thread. - `vim.mpack` and `vim.json` (useful for serializing messages between threads) -- `require` in threads can use lua packages from the global |lua-package-path| +- `require` in threads can use lua packages from the global |package.path| - `print()` and `vim.inspect` - `vim.diff` - most utility functions in `vim.*` for working with pure lua values @@ -663,7 +663,7 @@ vim.highlight.range({bufnr}, {ns}, {hlgroup}, {start}, {finish}, {opts}) {finish} finish position (tuple {line,col}) {opts} optional parameters: • `regtype`: type of range (characterwise, linewise, - or blockwise, see |setreg|), default `'v'` + or blockwise, see |setreg()|), default `'v'` • `inclusive`: range includes end position, default `false` • `priority`: priority of highlight, default @@ -906,7 +906,7 @@ vim.defer_fn({fn}, {timeout}) *vim.defer_fn* Defers calling {fn} until {timeout} ms passes. Use to do a one-shot timer that calls {fn}. - Note: The {fn} is |schedule_wrap|ped automatically, so API functions are + Note: The {fn} is |vim.schedule_wrap()|ped automatically, so API functions are safe to call. Parameters: ~ @@ -1160,7 +1160,7 @@ window-scoped options. Note that this must NOT be confused with global value of a |global-local| option, see |:setglobal|. vim.o *vim.o* - Get or set an |option|. Like `:set`. Invalid key is an error. + Get or set |options|. Like `:set`. Invalid key is an error. Note: this works on both buffer-scoped and window-scoped options using the current buffer and window. @@ -1171,7 +1171,7 @@ vim.o *vim.o* print(vim.o.foo) -- error: invalid key < vim.go *vim.go* - Get or set a global |option|. Like `:setglobal`. Invalid key is + Get or set global |options|. Like `:setglobal`. Invalid key is an error. Note: this is different from |vim.o| because this accesses the global @@ -1260,7 +1260,7 @@ offers object-oriented method for adding and removing entries. Note that |vim.opt| returns an `Option` object, not the value of the option, -which is accessed through |Option:get()|: +which is accessed through |vim.opt:get()|: Examples: ~ @@ -1275,8 +1275,8 @@ which is accessed through |Option:get()|: `vim.pretty_print(vim.opt.wildignore:get())` -In any of the above examples, to replicate the behavior |setlocal|, use -`vim.opt_local`. Additionally, to replicate the behavior of |setglobal|, use +In any of the above examples, to replicate the behavior |:setlocal|, use +`vim.opt_local`. Additionally, to replicate the behavior of |:setglobal|, use `vim.opt_global`. @@ -1406,8 +1406,8 @@ connection_failure_errmsg({consequence}) defer_fn({fn}, {timeout}) *vim.defer_fn()* Defers calling `fn` until `timeout` ms passes. - Use to do a one-shot timer that calls `fn` Note: The {fn} is |schedule_wrap|ped automatically, so API functions are - safe to call. + Use to do a one-shot timer that calls `fn` Note: The {fn} is |vim.schedule_wrap()|ped automatically, so API functions + are safe to call. Parameters: ~ {fn} Callback to call once `timeout` expires @@ -1541,7 +1541,7 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()* {bufnr} (number) of buffer {pos1} (line, column) tuple marking beginning of region {pos2} (line, column) tuple marking end of region - {regtype} type of selection (:help setreg) + {regtype} type of selection, see |setreg()| {inclusive} (boolean) indicating whether the selection is end-inclusive @@ -1773,7 +1773,7 @@ tbl_deep_extend({behavior}, {...}) *vim.tbl_deep_extend()* (table) Merged table See also: ~ - |tbl_extend()| + |vim.tbl_extend()| tbl_extend({behavior}, {...}) *vim.tbl_extend()* Merges two or more map-like tables. diff --git a/runtime/doc/luaref.txt b/runtime/doc/luaref.txt index 9dbd2d4de5..ecb92d4bb6 100644 --- a/runtime/doc/luaref.txt +++ b/runtime/doc/luaref.txt @@ -20,72 +20,7 @@ See |luaref-copyright| for copyright and licenses. - CONTENTS - ============ - - 1 INTRODUCTION........................|luaref-intro| - - 2 THE LANGUAGE........................|luaref-language| - 2.1 Lexical Conventions...............|luaref-langLexConv| - 2.2 Values and Types..................|luaref-langValTypes| - 2.2.1 Coercion........................|luaref-langCoercion| - 2.3 Variables.........................|luaref-langVariables| - 2.4 Statements........................|luaref-langStats| - 2.4.1 Chunks..........................|luaref-langChunks| - 2.4.2 Blocks..........................|luaref-langBlocks| - 2.4.3 Assignment......................|luaref-langAssign| - 2.4.4 Control Structures..............|luaref-langContStructs| - 2.4.5 For Statement...................|luaref-langForStat| - 2.4.6 Function Calls as Statements....|luaref-langFuncStat| - 2.4.7 Local Declarations..............|luaref-langLocalDec| - 2.5 Expressions.......................|luaref-langExpressions| - 2.5.1 Arithmetic Operators............|luaref-langArithOp| - 2.5.2 Relational Operators............|luaref-langRelOp| - 2.5.3 Logical Operators...............|luaref-langLogOp| - 2.5.4 Concatenation...................|luaref-langConcat| - 2.5.5 The Length Operator.............|luaref-langLength| - 2.5.6 Precedence......................|luaref-langPrec| - 2.5.7 Table Constructors..............|luaref-langTableConst| - 2.5.8 Function Calls..................|luaref-langFuncCalls| - 2.5.9 Function Definitions............|luaref-langFuncDefs| - 2.6 Visibility Rules..................|luaref-langVisibRules| - 2.7 Error Handling....................|luaref-langError| - 2.8 Metatables........................|luaref-langMetatables| - 2.9 Environments......................|luaref-langEnvironments| - 2.10 Garbage Collection...............|luaref-langGC| - 2.10.1 Garbage-Collection Metamethods.|luaref-langGCMeta| - 2.10.2 Weak Tables....................|luaref-langWeaktables| - 2.11 Coroutines.......................|luaref-langCoro| - - 3 THE APPLICATION PROGRAM INTERFACE...|luaref-api| - 3.1 The Stack.........................|luaref-apiStack| - 3.2 Stack Size........................|luaref-apiStackSize| - 3.3 Pseudo-Indices....................|luaref-apiPseudoIndices| - 3.4 C Closures........................|luaref-apiCClosures| - 3.5 Registry..........................|luaref-apiRegistry| - 3.6 Error Handling in C...............|luaref-apiError| - 3.7 Functions and Types...............|luaref-apiFunctions| - 3.8 The Debug Interface...............|luaref-apiDebug| - - 4 THE AUXILIARY LIBRARY...............|luaref-aux| - 4.1 Functions and Types...............|luaref-auxFunctions| - - 5 STANDARD LIBRARIES..................|luaref-lib| - 5.1 Basic Functions...................|luaref-libBasic| - 5.2 Coroutine Manipulation............|luaref-libCoro| - 5.3 Modules...........................|luaref-libModule| - 5.4 String Manipulation...............|luaref-libString| - 5.4.1 Patterns........................|luaref-libStringPat| - 5.5 Table Manipulation................|luaref-libTable| - 5.6 Mathematical Functions............|luaref-libMath| - 5.7 Input and Output Facilities.......|luaref-libIO| - 5.8 Operating System Facilities.......|luaref-libOS| - 5.9 The Debug Library.................|luaref-libDebug| - - A BIBLIOGRAPHY........................|luaref-bibliography| - B COPYRIGHT & LICENSES................|luaref-copyright| - C LUAREF DOC..........................|luaref-doc| - +Type |gO| to see the table of contents. ============================================================================== 1 INTRODUCTION *luaref-intro* @@ -292,7 +227,7 @@ parameter passing, and function returns always manipulate references to such values; these operations do not imply any kind of copy. The library function `type` returns a string describing the type of a given -value (see |luaref-type|). +value (see |luaref-type()|). ------------------------------------------------------------------------------ 2.2.1 Coercion *luaref-langCoercion* @@ -303,7 +238,7 @@ string to a number, following the usual conversion rules. Conversely, whenever a number is used where a string is expected, the number is converted to a string, in a reasonable format. For complete control of how numbers are converted to strings, use the `format` function from the string library (see -|luaref-string.format|). +|string.format()|). ============================================================================== 2.3 Variables *luaref-langVariables* @@ -344,7 +279,7 @@ has its own reference to an environment, so that all global variables in this function will refer to this environment table. When a function is created, it inherits the environment from the function that created it. To get the environment table of a Lua function, you call `getfenv` (see -|luaref-getfenv|). To replace it, you call `setfenv` (see |luaref-setfenv|). +|lua_getfenv()|). To replace it, you call `setfenv` (see |luaref-setfenv()|). (You can only manipulate the environment of C functions through the debug library; see |luaref-libDebug|.) @@ -634,7 +569,7 @@ they are explained in |luaref-langFuncDefs|. Binary operators comprise arithmetic operators (see |luaref-langArithOp|), relational operators (see |luaref-langRelOp|), logical operators (see |luaref-langLogOp|), and the concatenation operator (see |luaref-langConcat|). -Unary operators comprise the unary minus (see |luaref-labgArithOp|), the unary +Unary operators comprise the unary minus (see |luaref-langArithOp|), the unary `not` (see |luaref-langLogOp|), and the unary length operator (see |luaref-langLength|). @@ -1050,13 +985,13 @@ them share the same `x`. Because Lua is an embedded extension language, all Lua actions start from C code in the host program calling a function from the Lua library (see -|luaref-lua_pcall|). Whenever an error occurs during Lua compilation or +|lua_pcall()|). Whenever an error occurs during Lua compilation or execution, control returns to C, which can take appropriate measures (such as print an error message). Lua code can explicitly generate an error by calling the `error` function (see -|luaref-error|). If you need to catch errors in Lua, you can use -the `pcall` function (see |luaref-pcall|). +|luaref-error()|). If you need to catch errors in Lua, you can use +the `pcall` function (see |luaref-pcall()|). ============================================================================== 2.8 Metatables *luaref-metatable* *luaref-langMetatables* @@ -1074,10 +1009,10 @@ previous example, the event is "add" and the metamethod is the function that performs the addition. You can query the metatable of any value through the `getmetatable` function -(see |luaref-getmetatable|). +(see |luaref-getmetatable()|). You can replace the metatable of tables through the `setmetatable` function (see -|luaref-setmetatable|). You cannot change the metatable of other types from Lua +|luaref-setmetatable()|). You cannot change the metatable of other types from Lua (except using the debug library); you must use the C API for that. Tables and userdata have individual metatables (although multiple tables and @@ -1385,8 +1320,8 @@ convenience feature for programmers to associate a table to a userdata. Environments associated with threads are called global environments. They are used as the default environment for their threads and non-nested functions -created by the thread (through `loadfile` |luaref-loadfile|, `loadstring` -|luaref-loadstring| or `load` |luaref-load|) and can be directly accessed by C +created by the thread (through `loadfile` |luaref-loadfile()|, `loadstring` +|luaref-loadstring()| or `load` |luaref-load()|) and can be directly accessed by C code (see |luaref-apiPseudoIndices|). Environments associated with C functions can be directly accessed by C code @@ -1399,10 +1334,10 @@ used as the default environment for other Lua functions created by the function. You can change the environment of a Lua function or the running thread by -calling `setfenv` (see |luaref-setenv|). You can get the environment of a Lua -function or the running thread by calling `getfenv` (see |luaref-getfenv|). To -manipulate the environment of other objects (userdata, C functions, other -threads) you must use the C API. +calling `setfenv`. You can get the environment of a Lua function or the +running thread by calling `getfenv` (see |lua_getfenv()|). To manipulate the +environment of other objects (userdata, C functions, other threads) you must +use the C API. ============================================================================== 2.10 Garbage Collection *luaref-langGC* @@ -1432,8 +1367,8 @@ collector too slow and may result in the collector never finishing a cycle. The default, 2, means that the collector runs at "twice" the speed of memory allocation. -You can change these numbers by calling `lua_gc` (see |luaref-lua_gc|) in C or -`collectgarbage` (see |luaref-collectgarbage|) in Lua. Both get percentage +You can change these numbers by calling `lua_gc` (see |lua_gc()|) in C or +`collectgarbage` (see |luaref-collectgarbage()|) in Lua. Both get percentage points as arguments (so an argument of 100 means a real value of 1). With these functions you can also control the collector directly (e.g., stop and restart it). @@ -1496,12 +1431,12 @@ multithread systems, however, a coroutine only suspends its execution by explicitly calling a yield function. You create a coroutine with a call to `coroutine.create` (see -|luaref-coroutine.create|). Its sole argument is a function that is the main +|coroutine.create()|). Its sole argument is a function that is the main function of the coroutine. The `create` function only creates a new coroutine and returns a handle to it (an object of type `thread`); it does not start the coroutine execution. -When you first call `coroutine.resume` (see |luaref-coroutine.resume|), +When you first call `coroutine.resume` (see |coroutine.resume()|), passing as its first argument the thread returned by `coroutine.create`, the coroutine starts its execution, at the first line of its main function. Extra arguments passed to `coroutine.resume` are passed on to the coroutine main @@ -1516,7 +1451,7 @@ main function. In case of errors, `coroutine.resume` returns `false` plus an error message. A coroutine yields by calling `coroutine.yield` (see -|luaref-coroutine.yield|). When a coroutine yields, the corresponding +|coroutine.yield()|). When a coroutine yields, the corresponding `coroutine.resume` returns immediately, even if the yield happens inside nested function calls (that is, not in the main function, but in a function directly or indirectly called by the main function). In the case of a yield, @@ -1526,7 +1461,7 @@ its execution from the point where it yielded, with the call to `coroutine.yield` returning any extra arguments passed to `coroutine.resume`. Like `coroutine.create`, the `coroutine.wrap` function (see -|luaref-coroutine.wrap|) also creates a coroutine, but instead of returning +|coroutine.wrap()|) also creates a coroutine, but instead of returning the coroutine itself, it returns a function that, when called, resumes the coroutine. Any arguments passed to this function go as extra arguments to `coroutine.resume`. `coroutine.wrap` returns all the values returned by @@ -1595,7 +1530,7 @@ Whenever Lua calls C, the called function gets a new stack, which is independent of previous stacks and of stacks of C functions that are still active. This stack initially contains any arguments to the C function and it is where the C function pushes its results to be returned to the caller (see -|luaref-lua_CFunction|). +|lua_CFunction()|). *luaref-stackindex* For convenience, most query operations in the API do not follow a strict stack @@ -1615,7 +1550,7 @@ if `1 <= abs(index) <= top`). When you interact with Lua API, you are responsible for ensuring consistency. In particular, you are responsible for controlling stack overflow. You can use the function `lua_checkstack` to grow the stack size (see -|luaref-lua_checkstack|). +|lua_checkstack()|). Whenever Lua calls C, it ensures that at least `LUA_MINSTACK` stack positions are available. `LUA_MINSTACK` is defined as 20, so that usually you do not @@ -1656,14 +1591,14 @@ global variable, do When a C function is created, it is possible to associate some values with it, thus creating a C closure; these values are called upvalues and are accessible -to the function whenever it is called (see |luaref-lua_pushcclosure|). +to the function whenever it is called (see |lua_pushcclosure()|). Whenever a C function is called, its upvalues are located at specific pseudo-indices. These pseudo-indices are produced by the macro -`lua_upvalueindex` (see |luaref-lua_upvalueindex|). The first value associated -with a function is at position `lua_upvalueindex(1)`, and so on. Any access to -`lua_upvalueindex(` `n` `)`, where `n` is greater than the number of upvalues of -the current function, produces an acceptable (but invalid) index. +`lua_upvalueindex`. The first value associated with a function is at position +`lua_upvalueindex(1)`, and so on. Any access to `lua_upvalueindex(` `n` `)`, +where `n` is greater than the number of upvalues of the current function, +produces an acceptable (but invalid) index. ============================================================================== 3.5 Registry *luaref-registry* *luaref-apiRegistry* @@ -1694,11 +1629,11 @@ Almost any function in the API may raise an error, for instance due to a memory allocation error. The following functions run in protected mode (that is, they create a protected environment to run), so they never raise an error: `lua_newstate`, `lua_close`, `lua_load`, `lua_pcall`, and `lua_cpcall` (see -|luaref-lua_newstate|, |luaref-lua_close|, |luaref-lua_load|, -|luaref-lua_pcall|, and |luaref-lua_cpcall|). +|lua_newstate()|, |lua_close()|, |lua_load()|, +|lua_pcall()|, and |lua_cpcall()|). Inside a C function you can raise an error by calling `lua_error` (see -|luaref-lua_error|). +|lua_error()|). ============================================================================== 3.7 Functions and Types *luaref-apiFunctions* @@ -1715,7 +1650,7 @@ lua_Alloc *lua_Alloc()* The type of the memory-allocation function used by Lua states. The allocator function must provide a functionality similar to `realloc`, but not exactly the same. Its arguments are `ud`, an opaque pointer - passed to `lua_newstate` (see |luaref-lua_newstate|); `ptr`, a pointer + passed to `lua_newstate` (see |lua_newstate()|); `ptr`, a pointer to the block being allocated/reallocated/freed; `osize`, the original size of the block; `nsize`, the new size of the block. `ptr` is `NULL` if and only if `osize` is zero. When `nsize` is zero, the allocator @@ -1729,7 +1664,7 @@ lua_Alloc *lua_Alloc()* Here is a simple implementation for the allocator function. It is used in the auxiliary library by `luaL_newstate` (see - |luaref-luaL_newstate|). + |luaL_newstate()|). > static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { @@ -1813,7 +1748,7 @@ lua_CFunction *luaref-cfunction* *lua_CFunction()* following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the - function starts, `lua_gettop(L)` (see |luaref-lua_gettop|) returns the + function starts, `lua_gettop(L)` (see |lua_gettop()|) returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index `lua_gettop(L)`. To return values to Lua, a C function just pushes them onto the stack, @@ -1881,7 +1816,7 @@ lua_cpcall *lua_cpcall()* Calls the C function `func` in protected mode. `func` starts with only one element in its stack, a light userdata containing `ud`. In case of errors, `lua_cpcall` returns the same error codes as `lua_pcall` (see - |luaref-lua_pcall|), plus the error object on the top of the stack; + |lua_pcall()|), plus the error object on the top of the stack; otherwise, it returns zero, and does not change the stack. All values returned by `func` are discarded. @@ -1893,7 +1828,7 @@ lua_createtable *lua_createtable()* has space pre-allocated for `narr` array elements and `nrec` non-array elements. This pre-allocation is useful when you know exactly how many elements the table will have. Otherwise you can use the function - `lua_newtable` (see |luaref-lua_newtable|). + `lua_newtable` (see |lua_newtable()|). lua_dump *lua_dump()* > @@ -1903,7 +1838,7 @@ lua_dump *lua_dump()* of the stack and produces a binary chunk that, if loaded again, results in a function equivalent to the one dumped. As it produces parts of the chunk, `lua_dump` calls function `writer` (see - |luaref-lua_Writer|) with the given `data` to write them. + |lua_Writer()|) with the given `data` to write them. The value returned is the error code returned by the last call to the writer; 0 means no errors. @@ -1925,7 +1860,7 @@ lua_error *lua_error()* < Generates a Lua error. The error message (which can actually be a Lua value of any type) must be on the stack top. This function does a long - jump, and therefore never returns (see |luaref-luaL_error|). + jump, and therefore never returns (see |luaL_error()|). lua_gc *lua_gc()* > @@ -1965,7 +1900,7 @@ lua_getallocf *lua_getallocf()* < Returns the memory-allocation function of a given state. If `ud` is not `NULL`, Lua stores in `*ud` the opaque pointer passed to - `lua_newstate` (see |luaref-lua_newstate|). + `lua_newstate` (see |lua_newstate()|). lua_getfenv *lua_getfenv()* > @@ -2136,10 +2071,10 @@ lua_load *lua_load()* This function only loads a chunk; it does not run it. `lua_load` automatically detects whether the chunk is text or binary, - and loads it accordingly (see program `luac`, |luaref-luac|). + and loads it accordingly (see program `luac`). The `lua_load` function uses a user-supplied `reader` function to read - the chunk (see |luaref-lua_Reader|). The `data` argument is an opaque + the chunk (see |lua_Reader()|). The `data` argument is an opaque value passed to the reader function. The `chunkname` argument gives a name to the chunk, which is used for @@ -2161,14 +2096,14 @@ lua_newtable *lua_newtable()* < Creates a new empty table and pushes it onto the stack. It is equivalent to `lua_createtable(L, 0, 0)` (see - |luaref-lua_createtable|). + |lua_createtable()|). lua_newthread *lua_newthread()* > lua_State *lua_newthread (lua_State *L); < Creates a new thread, pushes it on the stack, and returns a pointer to - a `lua_State` (see |luaref-lua_State|) that represents this new + a `lua_State` (see |lua_State()|) that represents this new thread. The new state returned by this function shares with the original state all global objects (such as tables), but has an independent execution stack. @@ -2218,7 +2153,7 @@ lua_next *lua_next()* } < While traversing a table, do not call `lua_tolstring` (see - |luaref-lua_tolstring|) directly on a key, unless you know that the + |lua_tolstring()|) directly on a key, unless you know that the key is actually a string. Recall that `lua_tolstring` `changes` the value at the given index; this confuses the next call to `lua_next`. @@ -2248,7 +2183,7 @@ lua_pcall *lua_pcall()* Calls a function in protected mode. Both `nargs` and `nresults` have the same meaning as in `lua_call` - (see |luaref-lua_call|). If there are no errors during the call, + (see |lua_call()|). If there are no errors during the call, `lua_pcall` behaves exactly like `lua_call`. However, if there is any error, `lua_pcall` catches it, pushes a single value on the stack (the error message), and returns an error code. Like `lua_call`, @@ -2314,7 +2249,7 @@ lua_pushcfunction *lua_pushcfunction()* Any function to be registered in Lua must follow the correct protocol to receive its parameters and return its results (see - |luaref-lua_CFunction|). + |lua_CFunction()|). `lua_pushcfunction` is defined as a macro: > @@ -2408,7 +2343,7 @@ lua_pushvfstring *lua_pushvfstring()* const char *fmt, va_list argp); < - Equivalent to `lua_pushfstring` (see |luaref-pushfstring|), except + Equivalent to `lua_pushfstring` (see |lua_pushfstring()|), except that it receives a `va_list` instead of a variable number of arguments. @@ -2425,7 +2360,7 @@ lua_rawget *lua_rawget()* > void lua_rawget (lua_State *L, int index); < - Similar to `lua_gettable` (see |luaref-lua_gettable|), but does a raw + Similar to `lua_gettable` (see |lua_gettable()|), but does a raw access (i.e., without metamethods). lua_rawgeti *lua_rawgeti()* @@ -2440,7 +2375,7 @@ lua_rawset *lua_rawset()* > void lua_rawset (lua_State *L, int index); < - Similar to `lua_settable` (see |luaref-lua_settable|), but does a raw + Similar to `lua_settable` (see |lua_settable()|), but does a raw assignment (i.e., without metamethods). lua_rawseti *lua_rawseti()* @@ -2459,7 +2394,7 @@ lua_Reader *lua_Reader()* void *data, size_t *size); < - The reader function used by `lua_load` (see |luaref-lua_load|). Every + The reader function used by `lua_load` (see |lua_load()|). Every time it needs another piece of the chunk, `lua_load` calls the reader, passing along its `data` parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set `size` to @@ -2504,15 +2439,15 @@ lua_resume *lua_resume()* Starts and resumes a coroutine in a given thread. To start a coroutine, you first create a new thread (see - |luaref-lua_newthread|); then you push onto its stack the main + |lua_newthread()|); then you push onto its stack the main function plus any arguments; then you call `lua_resume` (see - |luaref-lua_resume|) with `narg` being the number of arguments. This + |lua_resume()|) with `narg` being the number of arguments. This call returns when the coroutine suspends or finishes its execution. When it returns, the stack contains all values passed to `lua_yield` - (see |luaref-lua_yield|), or all values returned by the body function. + (see |lua_yield()|), or all values returned by the body function. `lua_resume` returns `LUA_YIELD` if the coroutine yields, 0 if the coroutine finishes its execution without errors, or an error code in - case of errors (see |luaref-lua_pcall|). In case of errors, the stack + case of errors (see |lua_pcall()|). In case of errors, the stack is not unwound, so you can use the debug API over it. The error message is on the top of the stack. To restart a coroutine, you put on its stack only the values to be passed as results from `lua_yield`, @@ -2593,7 +2528,7 @@ lua_State *lua_State()* A pointer to this state must be passed as the first argument to every function in the library, except to `lua_newstate` (see - |luaref-lua_newstate|), which creates a Lua state from scratch. + |lua_newstate()|), which creates a Lua state from scratch. lua_status *lua_status()* > @@ -2614,7 +2549,7 @@ lua_toboolean *lua_toboolean()* any Lua value different from `false` and `nil`; otherwise it returns 0. It also returns 0 when called with a non-valid index. (If you want to accept only actual boolean values, use `lua_isboolean` - |luaref-lua_isboolean| to test the value's type.) + |lua_isboolean()| to test the value's type.) lua_tocfunction *lua_tocfunction()* > @@ -2628,7 +2563,7 @@ lua_tointeger *lua_tointeger()* lua_Integer lua_tointeger (lua_State *L, int idx); < Converts the Lua value at the given acceptable index to the signed - integral type `lua_Integer` (see |luaref-lua_Integer|). The Lua value + integral type `lua_Integer` (see |lua_Integer()|). The Lua value must be a number or a string convertible to a number (see |luaref-langCoercion|); otherwise, `lua_tointeger` returns 0. @@ -2644,7 +2579,7 @@ lua_tolstring *lua_tolstring()* Lua value must be a string or a number; otherwise, the function returns `NULL`. If the value is a number, then `lua_tolstring` also `changes the actual value in the stack to a` `string`. (This change - confuses `lua_next` |luaref-lua_next| when `lua_tolstring` is applied + confuses `lua_next` |lua_next()| when `lua_tolstring` is applied to keys during a table traversal.) `lua_tolstring` returns a fully aligned pointer to a string inside the @@ -2659,7 +2594,7 @@ lua_tonumber *lua_tonumber()* lua_Number lua_tonumber (lua_State *L, int index); < Converts the Lua value at the given acceptable index to the C type - `lua_Number` (see |luaref-lua_Number|). The Lua value must be a number + `lua_Number` (see |lua_Number()|). The Lua value must be a number or a string convertible to a number (see |luaref-langCoercion|); otherwise, `lua_tonumber` returns 0. @@ -2679,7 +2614,7 @@ lua_tostring *lua_tostring()* > const char *lua_tostring (lua_State *L, int index); < - Equivalent to `lua_tolstring` (see |luaref-lua_tolstring|) with `len` + Equivalent to `lua_tolstring` (see |lua_tolstring()|) with `len` equal to `NULL`. lua_tothread *lua_tothread()* @@ -2687,7 +2622,7 @@ lua_tothread *lua_tothread()* lua_State *lua_tothread (lua_State *L, int index); < Converts the value at the given acceptable index to a Lua thread - (represented as `lua_State*` |luaref-lua_State|). This value must be a + (represented as `lua_State*` |lua_State()|). This value must be a thread; otherwise, the function returns `NULL`. lua_touserdata *lua_touserdata()* @@ -2723,7 +2658,7 @@ lua_Writer *lua_Writer()* size_t sz, void* ud); < - The writer function used by `lua_dump` (see |luaref-lua_dump|). Every + The writer function used by `lua_dump` (see |lua_dump()|). Every time it produces another piece of chunk, `lua_dump` calls the writer, passing along the buffer to be written (`p`), its size (`sz`), and the `data` parameter supplied to `lua_dump`. @@ -2753,7 +2688,7 @@ lua_yield *lua_yield()* < When a C function calls `lua_yield` in that way, the running coroutine suspends its execution, and the call to `lua_resume` (see - |luaref-lua_resume|) that started this coroutine returns. The + |lua_resume()|) that started this coroutine returns. The parameter `nresults` is the number of values from the stack that are passed as results to `lua_resume`. @@ -2798,9 +2733,9 @@ lua_Debug *lua_Debug()* `} lua_Debug;` A structure used to carry different pieces of information about an active -function. `lua_getstack` (see |luaref-lua_getstack|) fills only the private part +function. `lua_getstack` (see |lua_getstack()|) fills only the private part of this structure, for later use. To fill the other fields of `lua_Debug` with -useful information, call `lua_getinfo` (see |luaref-lua_getinfo|). +useful information, call `lua_getinfo` (see |lua_getinfo()|). The fields of `lua_Debug` have the following meaning: @@ -2858,8 +2793,8 @@ lua_getinfo *lua_getinfo()* To get information about a function invocation, the parameter `ar` must be a valid activation record that was filled by a previous call - to `lua_getstack` (see |luaref-lua_getstack|) or given as argument to - a hook (see |luaref-lua_Hook|). + to `lua_getstack` (see |lua_getstack()|) or given as argument to + a hook (see |lua_Hook()|). To get information about a function you push it onto the stack and start the `what` string with the character `>`. (In that case, @@ -2896,8 +2831,8 @@ lua_getlocal *lua_getlocal()* < Gets information about a local variable of a given activation record. The parameter `ar` must be a valid activation record that was filled - by a previous call to `lua_getstack` (see |luaref-lua_getstack|) or - given as argument to a hook (see |luaref-lua_Hook|). The index `n` + by a previous call to `lua_getstack` (see |lua_getstack()|) or + given as argument to a hook (see |lua_Hook()|). The index `n` selects which local variable to inspect (1 is the first parameter or active local variable, and so on, until the last active local variable). `lua_getlocal` pushes the variable's value onto the stack @@ -2916,7 +2851,7 @@ lua_getstack *lua_getstack()* < Gets information about the interpreter runtime stack. - This function fills parts of a `lua_Debug` (see |luaref-lua_Debug|) + This function fills parts of a `lua_Debug` (see |lua_Debug()|) structure with an identification of the `activation record` of the function executing at a given level. Level 0 is the current running function, whereas level `n+1` is the function that has called level @@ -2951,7 +2886,7 @@ lua_Hook *lua_Hook()* `LUA_HOOKTAILRET`, `LUA_HOOKLINE`, and `LUA_HOOKCOUNT`. Moreover, for line events, the field `currentline` is also set. To get the value of any other field in `ar`, the hook must call `lua_getinfo` (see - |luaref-lua_getinfo|). For return events, `event` may be + |lua_getinfo()|). For return events, `event` may be `LUA_HOOKRET`, the normal value, or `LUA_HOOKTAILRET`. In the latter case, Lua is simulating a return from a function that did a tail call; in this case, it is useless to call `lua_getinfo`. @@ -2996,7 +2931,7 @@ lua_setlocal *lua_setlocal()* < Sets the value of a local variable of a given activation record. Parameters `ar` and `n` are as in `lua_getlocal` (see - |luaref-lua_getlocal|). `lua_setlocal` assigns the value at the top of + |lua_getlocal()|). `lua_setlocal` assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. @@ -3010,7 +2945,7 @@ lua_setupvalue *lua_setupvalue()* Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. Parameters `funcindex` and `n` are as in the - `lua_getupvalue` (see |luaref-lua_getupvalue|). + `lua_getupvalue` (see |lua_getupvalue()|). Returns `NULL` (and pops nothing) when the index is greater than the number of upvalues. @@ -3071,36 +3006,36 @@ luaL_addchar *luaL_addchar()* > void luaL_addchar (luaL_Buffer *B, char c); < - Adds the character `c` to the buffer `B` (see |luaref-luaL_Buffer|). + Adds the character `c` to the buffer `B` (see |luaL_Buffer()|). luaL_addlstring *luaL_addlstring()* > void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); < Adds the string pointed to by `s` with length `l` to the buffer `B` - (see |luaref-luaL_Buffer|). The string may contain embedded zeros. + (see |luaL_Buffer()|). The string may contain embedded zeros. luaL_addsize *luaL_addsize()* > void luaL_addsize (luaL_Buffer *B, size_t n); < - Adds to the buffer `B` (see |luaref-luaL_Buffer|) a string of length + Adds to the buffer `B` (see |luaL_Buffer()|) a string of length `n` previously copied to the buffer area (see - |luaref-luaL_prepbuffer|). + |luaL_prepbuffer()|). luaL_addstring *luaL_addstring()* > void luaL_addstring (luaL_Buffer *B, const char *s); < Adds the zero-terminated string pointed to by `s` to the buffer `B` - (see |luaref-luaL_Buffer|). The string may not contain embedded zeros. + (see |luaL_Buffer()|). The string may not contain embedded zeros. luaL_addvalue *luaL_addvalue()* > void luaL_addvalue (luaL_Buffer *B); < Adds the value at the top of the stack to the buffer `B` (see - |luaref-luaL_Buffer|). Pops the value. + |luaL_Buffer()|). Pops the value. This is the only function on string buffers that can (and must) be called with an extra element on the stack, which is the value to be @@ -3142,11 +3077,11 @@ luaL_Buffer *luaL_Buffer()* - First you declare a variable `b` of type `luaL_Buffer`. - Then you initialize it with a call `luaL_buffinit(L, &b)` (see - |luaref-luaL_buffinit|). + |luaL_buffinit()|). - Then you add string pieces to the buffer calling any of the `luaL_add*` functions. - You finish by calling `luaL_pushresult(&b)` (see - |luaref-luaL_pushresult|). This call leaves the final string on the + |luaL_pushresult()|). This call leaves the final string on the top of the stack. During its normal operation, a string buffer uses a variable number of @@ -3156,7 +3091,7 @@ luaL_Buffer *luaL_Buffer()* that is, when you call a buffer operation, the stack is at the same level it was immediately after the previous buffer operation. (The only exception to this rule is `luaL_addvalue` - |luaref-luaL_addvalue|.) After calling `luaL_pushresult` the stack is + |luaL_addvalue()|.) After calling `luaL_pushresult` the stack is back to its level when the buffer was initialized, plus the final string on its top. @@ -3165,7 +3100,7 @@ luaL_buffinit *luaL_buffinit()* void luaL_buffinit (lua_State *L, luaL_Buffer *B); < Initializes a buffer `B`. This function does not allocate any space; - the buffer must be declared as a variable (see |luaref-luaL_Buffer|). + the buffer must be declared as a variable (see |luaL_Buffer()|). luaL_callmeta *luaL_callmeta()* > @@ -3199,7 +3134,7 @@ luaL_checkinteger *luaL_checkinteger()* lua_Integer luaL_checkinteger (lua_State *L, int narg); < Checks whether the function argument `narg` is a number and returns - this number cast to a `lua_Integer` (see |luaref-lua_Integer|). + this number cast to a `lua_Integer` (see |lua_Integer()|). luaL_checklong *luaL_checklong()* > @@ -3220,7 +3155,7 @@ luaL_checknumber *luaL_checknumber()* lua_Number luaL_checknumber (lua_State *L, int narg); < Checks whether the function argument `narg` is a number and returns - this number (see |luaref-lua_Number|). + this number (see |lua_Number()|). luaL_checkoption *luaL_checkoption()* > @@ -3262,14 +3197,14 @@ luaL_checktype *luaL_checktype()* void luaL_checktype (lua_State *L, int narg, int t); < Checks whether the function argument `narg` has type `t` (see - |luaref-lua_type|). + |lua_type()|). luaL_checkudata *luaL_checkudata()* > void *luaL_checkudata (lua_State *L, int narg, const char *tname); < Checks whether the function argument `narg` is a userdata of the type - `tname` (see |luaref-luaL_newmetatable|). + `tname` (see |luaL_newmetatable()|). luaL_dofile *luaL_dofile()* > @@ -3297,7 +3232,7 @@ luaL_error *luaL_error()* < Raises an error. The error message format is given by `fmt` plus any extra arguments, following the same rules of `lua_pushfstring` (see - |luaref-lua_pushfstring|). It also adds at the beginning of the + |lua_pushfstring()|). It also adds at the beginning of the message the file name and the line number where the error occurred, if this information is available. @@ -3317,7 +3252,7 @@ luaL_getmetatable *luaL_getmetatable()* void luaL_getmetatable (lua_State *L, const char *tname); < Pushes onto the stack the metatable associated with name `tname` in - the registry (see |luaref-luaL_newmetatable|). + the registry (see |luaL_newmetatable()|). luaL_gsub *luaL_gsub()* > @@ -3338,7 +3273,7 @@ luaL_loadbuffer *luaL_loadbuffer()* const char *name); < Loads a buffer as a Lua chunk. This function uses `lua_load` (see - |luaref-lua_load|) to load the chunk in the buffer pointed to by + |lua_load()|) to load the chunk in the buffer pointed to by `buff` with size `sz`. This function returns the same results as `lua_load`. `name` is the @@ -3349,7 +3284,7 @@ luaL_loadfile *luaL_loadfile()* int luaL_loadfile (lua_State *L, const char *filename); < Loads a file as a Lua chunk. This function uses `lua_load` (see - |luaref-lua_load|) to load the chunk in the file named `filename`. If + |lua_load()|) to load the chunk in the file named `filename`. If `filename` is `NULL`, then it loads from the standard input. The first line in the file is ignored if it starts with a `#`. @@ -3363,7 +3298,7 @@ luaL_loadstring *luaL_loadstring()* int luaL_loadstring (lua_State *L, const char *s); < Loads a string as a Lua chunk. This function uses `lua_load` (see - |luaref-lua_load|) to load the chunk in the zero-terminated string + |lua_load()|) to load the chunk in the zero-terminated string `s`. This function returns the same results as `lua_load`. @@ -3387,9 +3322,9 @@ luaL_newstate *luaL_newstate()* lua_State *luaL_newstate (void); < Creates a new Lua state. It calls `lua_newstate` (see - |luaref-lua_newstate|) with an allocator based on the standard C + |lua_newstate()|) with an allocator based on the standard C `realloc` function and then sets a panic function (see - |luaref-lua_atpanic|) that prints an error message to the standard + |lua_atpanic()|) that prints an error message to the standard error output in case of fatal errors. Returns the new state, or `NULL` if there is a memory allocation @@ -3417,7 +3352,7 @@ luaL_optinteger *luaL_optinteger()* lua_Integer d); < If the function argument `narg` is a number, returns this number cast - to a `lua_Integer` (see |luaref-lua_Integer|). If this argument is + to a `lua_Integer` (see |lua_Integer()|). If this argument is absent or is `nil`, returns `d`. Otherwise, raises an error. luaL_optlong *luaL_optlong()* @@ -3464,9 +3399,9 @@ luaL_prepbuffer *luaL_prepbuffer()* char *luaL_prepbuffer (luaL_Buffer *B); < Returns an address to a space of size `LUAL_BUFFERSIZE` where you can - copy a string to be added to buffer `B` (see |luaref-luaL_Buffer|). + copy a string to be added to buffer `B` (see |luaL_Buffer()|). After copying the string into this space you must call `luaL_addsize` - (see |luaref-luaL_addsize|) with the size of the string to actually + (see |luaL_addsize()|) with the size of the string to actually add it to the buffer. luaL_pushresult *luaL_pushresult()* @@ -3486,8 +3421,8 @@ luaL_ref *luaL_ref()* A reference is a unique integer key. As long as you do not manually add integer keys into table `t`, `luaL_ref` ensures the uniqueness of the key it returns. You can retrieve an object referred by reference - `r` by calling `lua_rawgeti(L, t, r)` (see |luaref-lua_rawgeti|). - Function `luaL_unref` (see |luaref-luaL_unref|) frees a reference and + `r` by calling `lua_rawgeti(L, t, r)` (see |lua_rawgeti()|). + Function `luaL_unref` (see |luaL_unref()|) frees a reference and its associated object. If the object at the top of the stack is `nil`, `luaL_ref` returns the @@ -3502,7 +3437,7 @@ luaL_Reg *luaL_Reg()* } luaL_Reg; < Type for arrays of functions to be registered by `luaL_register` (see - |luaref-luaL_register|). `name` is the function name and `func` is a + |luaL_register()|). `name` is the function name and `func` is a pointer to the function. Any array of `luaL_Reg` must end with a sentinel entry in which both `name` and `func` are `NULL`. @@ -3515,7 +3450,7 @@ luaL_register *luaL_register()* Opens a library. When called with `libname` equal to `NULL`, it simply registers all - functions in the list `l` (see |luaref-luaL_Reg|) into the table on + functions in the list `l` (see |luaL_Reg()|) into the table on the top of the stack. When called with a non-null `libname`, `luaL_register` creates a new @@ -3543,7 +3478,7 @@ luaL_typerror *luaL_typerror()* `expected, got` `rt` `)` where `location` is produced by `luaL_where` (see - |luaref-luaL_where|), `func` is the name of the current function, and + |luaL_where()|), `func` is the name of the current function, and `rt` is the type name of the actual argument. luaL_unref *luaL_unref()* @@ -3551,7 +3486,7 @@ luaL_unref *luaL_unref()* void luaL_unref (lua_State *L, int t, int ref); < Releases reference `ref` from the table at index `t` (see - |luaref-luaL_ref|). The entry is removed from the table, so that the + |luaL_ref()|). The entry is removed from the table, so that the referred object can be collected. The reference `ref` is also freed to be used again. @@ -3601,14 +3536,14 @@ functions as fields of a global table or as methods of its objects. *luaref-openlibs* To have access to these libraries, the C host program should call the `luaL_openlibs` function, which opens all standard libraries (see -|luaref-luaL_openlibs|). Alternatively, the host program can open the libraries +|luaL_openlibs()|). Alternatively, the host program can open the libraries individually by calling `luaopen_base` (for the basic library), `luaopen_package` (for the package library), `luaopen_string` (for the string library), `luaopen_table` (for the table library), `luaopen_math` (for the mathematical library), `luaopen_io` (for the I/O and the Operating System libraries), and `luaopen_debug` (for the debug library). These functions are declared in `lualib.h` and should not be called directly: you must call them -like any other Lua C function, e.g., by using `lua_call` (see |luaref-lua_call|). +like any other Lua C function, e.g., by using `lua_call` (see |lua_call()|). ============================================================================== 5.1 Basic Functions *luaref-libBasic* @@ -3700,11 +3635,11 @@ load({func} [, {chunkname}]) *luaref-load()* information. loadfile([{filename}]) *luaref-loadfile()* - Similar to `load` (see |luaref-load|), but gets the chunk from file + Similar to `load` (see |luaref-load()|), but gets the chunk from file {filename} or from the standard input, if no file name is given. loadstring({string} [, {chunkname}]) *luaref-loadstring()* - Similar to `load` (see |luaref-load|), but gets the chunk from the + Similar to `load` (see |luaref-load()|), but gets the chunk from the given {string}. To load and run a given string, use the idiom @@ -3724,14 +3659,14 @@ next({table} [, {index}]) *luaref-next()* The order in which the indices are enumerated is not specified, `even for` `numeric indices`. (To traverse a table in numeric order, use a - numerical `for` or the `ipairs` |luaref-ipairs| function.) + numerical `for` or the `ipairs` |luaref-ipairs()| function.) The behavior of `next` is `undefined` if, during the traversal, you assign any value to a non-existent field in the table. You may however modify existing fields. In particular, you may clear existing fields. pairs({t}) *luaref-pairs()* - Returns three values: the `next` |luaref-next| function, the table + Returns three values: the `next` |luaref-next()| function, the table {t}, and `nil`, so that the construction `for k,v in pairs(t) do` `body` `end` @@ -3749,10 +3684,10 @@ pcall({f}, {arg1}, {...}) *luaref-pcall()* print({...}) *luaref-print()* Receives any number of arguments, and prints their values to `stdout`, - using the `tostring` |luaref-tostring| function to convert them to + using the `tostring` |luaref-tostring()| function to convert them to strings. `print` is not intended for formatted output, but only as a quick way to show a value, typically for debugging. For formatted - output, use `string.format` (see |luaref-string.format|). + output, use `string.format` (see |string.format()|). rawequal({v1}, {v2}) *luaref-rawequal()* Checks whether {v1} is equal to {v2}, without invoking any metamethod. @@ -3807,7 +3742,7 @@ tonumber({e} [, {base}]) *luaref-tonumber()* tostring({e}) *luaref-tostring()* Receives an argument of any type and converts it to a string in a reasonable format. For complete control of how numbers are converted, - use `string.format` (see |luaref-string.format|). + use `string.format` (see |string.format()|). *__tostring* If the metatable of {e} has a `"__tostring"` field, `tostring` calls @@ -3836,7 +3771,7 @@ _VERSION *luaref-_VERSION()* `"Lua 5.1"` . xpcall({f}, {err}) *luaref-xpcall()* - This function is similar to `pcall` (see |luaref-pcall|), except that + This function is similar to `pcall` (see |luaref-pcall()|), except that you can set a new error handler. `xpcall` calls function {f} in protected mode, using {err} as the @@ -3901,7 +3836,7 @@ coroutine.yield({...}) *coroutine.yield()* The package library provides basic facilities for loading and building modules in Lua. It exports two of its functions directly in the global environment: -`require` and `module` (see |luaref-require| and |luaref-module|). Everything else is +`require` and `module` (see |luaref-require()| and |luaref-module()|). Everything else is exported in a table `package`. module({name} [, {...}]) *luaref-module()* @@ -3914,7 +3849,7 @@ module({name} [, {...}]) *luaref-module()* `t._PACKAGE` with the package name (the full module name minus last component; see below). Finally, `module` sets `t` as the new environment of the current function and the new value of - `package.loaded[name]`, so that `require` (see |luaref-require|) + `package.loaded[name]`, so that `require` (see |luaref-require()|) returns `t`. If {name} is a compound name (that is, one with components separated @@ -3968,7 +3903,7 @@ require({modname}) *luaref-require()* If there is any error loading or running the module, or if it cannot find any loader for the module, then `require` signals an error. -package.cpath *package.cpath()* +package.cpath *package.cpath* The path used by `require` to search for a C loader. Lua initializes the C path `package.cpath` in the same way it @@ -3985,7 +3920,7 @@ package.loadlib({libname}, {funcname}) *package.loadlib()* Dynamically links the host program with the C library {libname}. Inside this library, looks for a function {funcname} and returns this function as a C function. (So, {funcname} must follow the protocol - (see |luaref-lua_CFunction|)). + (see |lua_CFunction()|)). This is a low-level function. It completely bypasses the package and module system. Unlike `require`, it does not perform any path @@ -3998,7 +3933,7 @@ package.loadlib({libname}, {funcname}) *package.loadlib()* available on some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix systems that support the `dlfcn` standard). -package.path *package.path()* +package.path *package.path* The path used by `require` to search for a Lua loader. At start-up, Lua initializes this variable with the value of the @@ -4019,7 +3954,7 @@ package.path *package.path()* order. package.preload *package.preload()* - A table to store loaders for specific modules (see |luaref-require|). + A table to store loaders for specific modules (see |luaref-require()|). package.seeall({module}) *package.seeall()* Sets a metatable for {module} with its `__index` field referring to @@ -4059,7 +3994,7 @@ string.char({...}) *string.char()* string.dump({function}) *string.dump()* Returns a string containing a binary representation of the given - function, so that a later |luaref-loadstring| on this string returns a + function, so that a later |luaref-loadstring()| on this string returns a copy of the function. {function} must be a Lua function without upvalues. @@ -4341,7 +4276,7 @@ table.foreach({table}, {f}) *table.foreach()* returns a non-`nil` value, then the loop is broken, and this value is returned as the final value of `table.foreach`. - See |luaref-next| for extra information about table traversals. + See |luaref-next()| for extra information about table traversals. table.foreachi({table}, {f}) *table.foreachi()* Executes the given {f} over the numerical indices of {table}. For each @@ -4658,7 +4593,7 @@ file:setvbuf({mode} [, {size}]) *luaref-file:setvbuf()* immediately. `"full"` full buffering; output operation is performed only when the buffer is full (or when you explicitly `flush` the file - (see |luaref-io.flush|). + (see |io.flush()|). `"line"` line buffering; output is buffered until a newline is output or there is any input from some special files (such as a terminal device). @@ -4669,7 +4604,7 @@ file:setvbuf({mode} [, {size}]) *luaref-file:setvbuf()* file:write({...}) *luaref-file:write()* Writes the value of each of its arguments to `file`. The arguments must be strings or numbers. To write other values, use `tostring` - |luaref-tostring| or `string.format` |luaref-string.format| before + |luaref-tostring()| or `string.format` |string.format()| before `write`. ============================================================================== @@ -4686,7 +4621,7 @@ os.date([{format} [, {time}]]) *os.date()* according to the given string {format}. If the {time} argument is present, this is the time to be formatted - (see the `os.time` function |luaref-os.time| for a description of this + (see the `os.time` function |os.time()| for a description of this value). Otherwise, `date` formats the current time. If {format} starts with `!`, then the date is formatted in @@ -4744,7 +4679,7 @@ os.time([{table}]) *os.time()* representing the date and time specified by the given table. This table must have fields `year`, `month`, and `day`, and may have fields `hour`, `min`, `sec`, and `isdst` (for a description of these fields, - see the `os.date` function |luaref-os.date|). + see the `os.date` function |os.date()|). The returned value is a number, whose meaning depends on your system. In POSIX, Windows, and some other systems, this number counts the @@ -4802,7 +4737,7 @@ debug.getinfo([{thread},] {function} [, {what}]) *debug.getinfo()* functions, then `getinfo` returns `nil`. The returned table may contain all the fields returned by - `lua_getinfo` (see |luaref-lua_getinfo|), with the string {what} + `lua_getinfo` (see |lua_getinfo()|), with the string {what} describing which fields to fill in. The default for {what} is to get all information available, except the table of valid lines. If present, the option `f` adds a field named `func` with the function @@ -4821,7 +4756,7 @@ debug.getlocal([{thread},] {level}, {local}) *debug.getlocal()* last active local variable.) The function returns `nil` if there is no local variable with the given index, and raises an error when called with a {level} out of range. (You can call `debug.getinfo` - |luaref-debug.getinfo| to check whether the level is valid.) + |debug.getinfo()| to check whether the level is valid.) Variable names starting with `(` (open parentheses) represent internal variables (loop control variables, temporaries, and C @@ -4953,7 +4888,7 @@ C LUAREF DOC *luarefvim* *luarefvimdoc* *luaref-help* *luaref-d This is a Vim help file containing a reference for Lua 5.1, and it is -- with a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual (see |luaref-bibliography|). For usage information, refer to -|luaref-docUsage|. For copyright information, see |luaref-copyright|. +|luaref-doc|. For copyright information, see |luaref-copyright|. The main ideas and concepts on how to implement this reference were taken from Christian Habermann's CRefVim project diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index da6a305e89..e5d22de748 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1673,7 +1673,7 @@ backslash followed by a character other than white space or a backslash remains unmodified. Overview: command ~ - XX ab 'ab' + XX ab "ab" XX a\b 'a\b' XX a\ b 'a b' XX a\ b 'a ', 'b' diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 2aa49cee1e..7a76c57fc2 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -86,9 +86,8 @@ You can also set 'guifont' alone, the Nvim GUI will try to find a matching INPUT There are several ways to enter multibyte characters: -- For X11 XIM can be used. See |XIM|. -- For MS-Windows IME can be used. See |IME|. -- For all systems keymaps can be used. See |mbyte-keymap|. +- Your system IME can be used. +- Keymaps can be used. See |mbyte-keymap|. The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose the different input methods or disable them temporarily. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 14b7eb2d71..e5ad61062f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5704,7 +5704,7 @@ A jump table for the options with a short description can be found at |Q_op|. "yes:[1-9]" always, with fixed space for signs up to the given number (maximum 9), e.g. "yes:3" "number" display signs in the 'number' column. If the number - column is not present, then behaves like 'auto'. + column is not present, then behaves like "auto". Note regarding 'orphaned signs': with signcolumn numbers higher than 1, deleting lines will also remove the associated signs automatically, @@ -6481,7 +6481,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'termguicolors' 'tgc' boolean (default off) global Enables 24-bit RGB color in the |TUI|. Uses "gui" |:highlight| - attributes instead of "cterm" attributes. |highlight-guifg| + attributes instead of "cterm" attributes. |guifg| Requires an ISO-8613-3 compatible terminal. *'termpastefilter'* *'tpf'* @@ -7136,7 +7136,7 @@ A jump table for the options with a short description can be found at |Q_op|. the window. Note: highlight namespaces take precedence over 'winhighlight'. - See |nvim_win_set_hl_ns| and |nvim_set_hl|. + See |nvim_win_set_hl_ns()| and |nvim_set_hl()|. Highlights of vertical separators are determined by the window to the left of the separator. The 'tabline' highlight of a tabpage is diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 1eaa76264f..ae0169491b 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -2353,7 +2353,7 @@ MARKED FILES: DIFF *netrw-md* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the global marked file list) -Use |vimdiff| to visualize difference between selected files (two or +Use vimdiff to visualize difference between selected files (two or three may be selected for this). Uses the global marked file list. MARKED FILES: EDITING *netrw-me* {{{2 @@ -3469,7 +3469,7 @@ Example: Clear netrw's marked file list via a mapping on gu > *netrw-p4* P4. I would like long listings to be the default. {{{2 - Put the following statement into your |.vimrc|: > + Put the following statement into your |vimrc|: > let g:netrw_liststyle= 1 < @@ -3482,7 +3482,7 @@ Example: Clear netrw's marked file list via a mapping on gu > Does your system's strftime() accept the "%c" to yield dates such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime" and find out what option should be used. Then - put it into your |.vimrc|: > + put it into your |vimrc|: > let g:netrw_timefmt= "%X" (where X is the option) < @@ -3490,7 +3490,7 @@ Example: Clear netrw's marked file list via a mapping on gu > P6. I want my current directory to track my browsing. {{{2 How do I do that? - Put the following line in your |.vimrc|: + Put the following line in your |vimrc|: > let g:netrw_keepdir= 0 < @@ -3839,7 +3839,7 @@ netrw: or http://vim.sourceforge.net/scripts/script.php?script_id=120 - Decho.vim is provided as a "vimball"; see |vimball-intro|. You + Decho.vim is provided as a "vimball". You should edit the Decho.vba.gz file and source it in: > vim Decho.vba.gz @@ -3917,7 +3917,7 @@ netrw: * Installed |g:netrw_clipboard| setting * Installed option bypass for |'guioptions'| a/A settings - * Changed popup_beval() to |popup_atcursor()| + * Changed popup_beval() to popup_atcursor() in netrw#ErrorMsg (lacygoill). Apparently popup_beval doesn't reliably close the popup when the mouse is moved. @@ -3943,7 +3943,7 @@ netrw: did not restore options correctly that had a single quote in the option string. Apr 13, 2020 * implemented error handling via popup - windows (see |popup_beval()|) + windows (see popup_beval()) Apr 30, 2020 * (reported by Manatsu Takahashi) while using Lexplore, a modified file could be overwritten. Sol'n: will not overwrite, diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt index 924fab175e..0e02c7d42d 100644 --- a/runtime/doc/print.txt +++ b/runtime/doc/print.txt @@ -659,7 +659,7 @@ It is possible to achieve a poor man's version of duplex printing using the PS utility psselect. This utility has options -e and -o for printing just the even or odd pages of a PS file respectively. -First generate a PS file with the 'hardcopy' command, then generate new +First generate a PS file with the ":hardcopy" command, then generate new files with all the odd and even numbered pages with: > psselect -o test.ps odd.ps diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 9fd35f19c5..782bd19441 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -240,7 +240,7 @@ a list of lines and `regtype` is a register type conforming to |setreg()|. Paste *provider-paste* *paste* "Paste" is a separate concept from |clipboard|: paste means "dump a bunch of -text to the editor", whereas clipboard provides features like |quote-+| to get +text to the editor", whereas clipboard provides features like |quote+| to get and set the OS clipboard directly. For example, middle-click or CTRL-SHIFT-v (macOS: CMD-v) in your terminal is "paste", not "clipboard": the terminal application (Nvim) just gets a stream of text, it does not interact with the diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index dab3bfa280..80110211f9 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -466,7 +466,7 @@ You can parse a list of lines using 'errorformat' without creating or modifying a quickfix list using the |getqflist()| function. Examples: > echo getqflist({'lines' : ["F1:10:Line10", "F2:20:Line20"]}) echo getqflist({'lines' : systemlist('grep -Hn quickfix *')}) -This returns a dictionary where the 'items' key contains the list of quickfix +This returns a dictionary where the "items" key contains the list of quickfix entries parsed from lines. The following shows how to use a custom 'errorformat' to parse the lines without modifying the 'errorformat' option: > echo getqflist({'efm' : '%f#%l#%m', 'lines' : ['F1#10#Line']}) @@ -585,7 +585,7 @@ can go back to the unfiltered list using the |:colder|/|:lolder| command. quickfix command or function, the |b:changedtick| variable is incremented. You can get the number of this buffer using the getqflist() and getloclist() - functions by passing the 'qfbufnr' item. For a + functions by passing the "qfbufnr" item. For a location list, this buffer is wiped out when the location list is removed. @@ -1965,7 +1965,7 @@ The function should return a single line of text to display in the quickfix window for each entry from start_idx to end_idx. The function can obtain information about the entries using the |getqflist()| function and specifying the quickfix list identifier "id". For a location list, getloclist() function -can be used with the 'winid' argument. If an empty list is returned, then the +can be used with the "winid" argument. If an empty list is returned, then the default format is used to display all the entries. If an item in the returned list is an empty string, then the default format is used to display the corresponding entry. diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 9f3993506a..cb065cef2c 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -615,10 +615,6 @@ Short explanation of each option: *option-list* 'backupdir' 'bdir' list of directories for the backup file 'backupext' 'bex' extension used for the backup file 'backupskip' 'bsk' no backup for files that match these patterns -'balloondelay' 'bdlay' delay in mS before a balloon may pop up -'ballooneval' 'beval' switch on balloon evaluation in the GUI -'balloonevalterm' 'bevalterm' switch on balloon evaluation in the terminal -'balloonexpr' 'bexpr' expression to show in balloon 'belloff' 'bo' do not ring the bell for these reasons 'binary' 'bin' read/write/edit file in binary mode 'bomb' prepend a Byte Order Mark to the file @@ -817,8 +813,6 @@ Short explanation of each option: *option-list* 'printoptions' 'popt' controls the format of :hardcopy output 'pumheight' 'ph' maximum height of the popup menu 'pumwidth' 'pw' minimum width of the popup menu -'pythondll' name of the Python 2 dynamic library -'pythonthreedll' name of the Python 3 dynamic library 'pyxversion' 'pyx' Python version used for pyx* commands 'quoteescape' 'qe' escape characters used in a string 'readonly' 'ro' disallow writing the buffer @@ -829,7 +823,6 @@ Short explanation of each option: *option-list* 'revins' 'ri' inserting characters will work backwards 'rightleft' 'rl' window is right-to-left oriented 'rightleftcmd' 'rlc' commands for which editing works right-to-left -'rubydll' name of the Ruby dynamic library 'ruler' 'ru' show cursor line and column in the status line 'rulerformat' 'ruf' custom format for the ruler 'runtimepath' 'rtp' list of directories used for runtime files diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 508565dea4..0b316b4727 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -591,7 +591,7 @@ This could be done if some conditions are met. For example, depending on whether Vim supports a feature or a dependency is missing. You can also load an optional plugin at startup, by putting this command in -your |.vimrc|: > +your |config|: > :packadd! foodebug The extra "!" is so that the plugin isn't loaded if Vim was started with |--noplugin|. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index d57a85423c..351fe868d9 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -82,12 +82,10 @@ argument. --help *-h* *--help* *-?* -? -h Give usage (help) message and exit. - See |info-message| about capturing the text. --version *-v* *--version* -v Print version information and exit. Same output as for |:version| command. - See |info-message| about capturing the text. *--clean* --clean Mimics a fresh install of Nvim: diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 6fcf292513..1368814952 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -3118,7 +3118,7 @@ The default is to use the twice sh_minlines. Set it to a smaller number to speed up displaying. The disadvantage is that highlight errors may appear. syntax/sh.vim tries to flag certain problems as errors; usually things like -extra ']'s, 'done's, 'fi's, etc. If you find the error handling problematic +extra "]"s, "done"s, "fi"s, etc. If you find the error handling problematic for your purposes, you may suppress such error highlighting by putting the following line in your .vimrc: > @@ -4935,7 +4935,7 @@ cterm={attr-list} *attr-list* *highlight-cterm* *E418* have the same effect. "undercurl", "underdouble", "underdotted", and "underdashed" fall back to "underline" in a terminal that does not support them. The color is - set using |highlight-guisp|. + set using |guisp|. start={term-list} *highlight-start* *E422* stop={term-list} *term-list* *highlight-stop* @@ -4956,8 +4956,8 @@ stop={term-list} *term-list* *highlight-stop* like "" and "". Example: start=[27h;[r; -ctermfg={color-nr} *highlight-ctermfg* *E421* -ctermbg={color-nr} *highlight-ctermbg* +ctermfg={color-nr} *ctermfg* *E421* +ctermbg={color-nr} *ctermbg* The {color-nr} argument is a color number. Its range is zero to (not including) the number of |tui-colors| available. The actual color with this number depends on the type of terminal @@ -5064,9 +5064,9 @@ font={font-name} *highlight-font* Example: > :hi comment font='Monospace 10' -guifg={color-name} *highlight-guifg* -guibg={color-name} *highlight-guibg* -guisp={color-name} *highlight-guisp* +guifg={color-name} *guifg* +guibg={color-name} *guibg* +guisp={color-name} *guisp* These give the foreground (guifg), background (guibg) and special (guisp) color to use in the GUI. "guisp" is used for various underlines. @@ -5123,7 +5123,7 @@ Cursor Character under the cursor. lCursor Character under the cursor when |language-mapping| is used (see 'guicursor'). *hl-CursorIM* -CursorIM Like Cursor, but used when in IME mode. |CursorIM| +CursorIM Like Cursor, but used when in IME mode. *CursorIM* *hl-CursorColumn* CursorColumn Screen-column at the cursor, when 'cursorcolumn' is set. *hl-CursorLine* diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 3102c6da9a..75395e89ac 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -50,13 +50,13 @@ Whenever you need to access the current syntax tree, parse the buffer: > tstree = tsparser:parse() < -This will return a table of immutable |lua-treesitter-tree|s that represent the +This will return a table of immutable |treesitter-tree|s that represent the current state of the buffer. When the plugin wants to access the state after a (possible) edit it should call `parse()` again. If the buffer wasn't edited, the same tree will be returned again without extra work. If the buffer was parsed before, incremental parsing will be done of the changed parts. -Note: To use the parser directly inside a |nvim_buf_attach/)| Lua callback, you +Note: To use the parser directly inside a |nvim_buf_attach()| Lua callback, you must call |get_parser()| before you register your callback. But preferably parsing shouldn't be done directly in the change callback anyway as they will be very frequent. Rather a plugin that does any kind of analysis on a tree @@ -233,7 +233,7 @@ The following predicates are built in: node's text. `lua-match?` *treesitter-predicate-lua-match?* - Match a |lua-pattern| against the text corresponding to a node, + Match |lua-patterns| against the text corresponding to a node, similar to `match?` `contains?` *treesitter-predicate-contains?* @@ -394,7 +394,7 @@ still highlighted the same as other operators: > "!=" @operator (#set! conceal "≠") < -Conceals specified in this way respect |conceallevel|. +Conceals specified in this way respect 'conceallevel'. *treesitter-highlight-priority* Treesitter uses |nvim_buf_set_extmark()| to set highlights with a default @@ -650,7 +650,7 @@ get_query({lang}, {query_name}) *get_query()* Parameters: ~ {lang} (string) Language to use for the query - {query_name} (string) Name of the query (e.g. 'highlights') + {query_name} (string) Name of the query (e.g. "highlights") Return: ~ Query Parsed query @@ -661,7 +661,7 @@ get_query_files({lang}, {query_name}, {is_included}) Parameters: ~ {lang} (string) Language to get query for - {query_name} (string) Name of the query to load (e.g., 'highlights') + {query_name} (string) Name of the query to load (e.g., "highlights") {is_included} (boolean|nil) Internal parameter, most of the time left as `nil` @@ -742,7 +742,7 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop}) Iterates the matches of self on a given range. Iterate over all matches within a {node}. The arguments are the same as - for |query:iter_captures()| but the iterated values are different: an + for |Query:iter_captures()| but the iterated values are different: an (1-based) index of the pattern in the query, a table mapping capture indices to nodes, and metadata from any directives processing the match. If the query has more than one pattern, the capture table might be sparse @@ -780,7 +780,7 @@ set_query({lang}, {query_name}, {text}) *set_query()* Parameters: ~ {lang} (string) Language to use for the query - {query_name} (string) Name of the query (e.g., 'highlights') + {query_name} (string) Name of the query (e.g., "highlights") {text} (string) Query text (unparsed). diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 955af84679..2d0c8d3b75 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -576,7 +576,7 @@ The multigrid extension gives UIs more control over how windows are displayed: per-window. Or reserve space around the border of the window for its own elements, such as scrollbars from the UI toolkit. - A dedicated grid is used for messages, which may scroll over the window - area. (Alternatively |ext_messages| can be used). + area. (Alternatively |ui-messages| can be used). By default, the grid size is handled by Nvim and set to the outer grid size (i.e. the size of the window frame in Nvim) whenever the split is created. @@ -618,7 +618,7 @@ tabs. flag). The Builtin TUI draws a full line filled with `sep_char` and |hl-MsgSeparator| highlight. - When |ext_messages| is active, no message grid is used, and this event + When |ui-messages| is active, no message grid is used, and this event will not be sent. ["win_viewport", grid, win, topline, botline, curline, curcol] diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt index c015b12c27..32c5b0b671 100644 --- a/runtime/doc/userfunc.txt +++ b/runtime/doc/userfunc.txt @@ -214,7 +214,7 @@ It is allowed to define another function inside a function body. You can provide default values for positional named arguments. This makes them optional for function calls. When a positional argument is not specified at a call, the default expression is used to initialize it. -This only works for functions declared with |function|, not for +This only works for functions declared with |:function|, not for lambda expressions |expr-lambda|. Example: > @@ -422,8 +422,7 @@ Also note that if you have two script files, and one calls a function in the other and vice versa, before the used function is defined, it won't work. Avoid using the autoload functionality at the toplevel. -Hint: If you distribute a bunch of scripts you can pack them together with the -|vimball| utility. Also read the user manual |distribute-script|. +Hint: If you distribute a bunch of scripts read |distribute-script|. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 1aa9aaa0c4..adb5130a53 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1710,7 +1710,7 @@ There is a little "catch" with comments for some commands. Examples: > :execute cmd " do it :!ls *.c " list C files -The abbreviation 'dev' will be expanded to 'development " shorthand'. The +The abbreviation "dev" will be expanded to 'development " shorthand'. The mapping of will actually be the whole line after the 'o# ....' including the '" insert include'. The "execute" command will give an error. The "!" command will send everything after it to the shell, causing an error for an diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt index 3199c4d8ea..0d23ef50fd 100644 --- a/runtime/doc/usr_45.txt +++ b/runtime/doc/usr_45.txt @@ -300,8 +300,7 @@ can use digraphs. This was already explained in |24.9|. keyboard, you will want to use an Input Method (IM). This requires learning the translation from typed keys to resulting character. When you need an IM you probably already have one on your system. It should work with Vim like -with other programs. For details see |mbyte-XIM| for the X Window system and -|mbyte-IME| for MS-Windows. +with other programs. KEYMAPS diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index e254e5edd0..672d064478 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -417,8 +417,8 @@ Normal commands: Options: 'ttimeout', 'ttimeoutlen' behavior was simplified - |jumpoptions| "stack" behavior - |jumpoptions| "view" tries to restore the |mark-view| when moving through + 'jumpoptions' "stack" behavior + 'jumpoptions' "view" tries to restore the |mark-view| when moving through the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|. 'shortmess' the "F" flag does not affect output from autocommands @@ -498,13 +498,16 @@ Working directory (Vim implemented some of these later than Nvim): ============================================================================== 5. Missing legacy features *nvim-features-missing* -Some legacy Vim features are not implemented: +Some legacy Vim features are not yet implemented: -- |if_lua|: Nvim Lua API is not compatible with Vim's "if_lua" +- *if_lua* : Nvim |Lua| API is not compatible with Vim's "if_lua" - *if_mzscheme* -- |if_py|: *python-bindeval* *python-Function* are not supported +- |if_pyth|: *python-bindeval* *python-Function* are not supported - *if_tcl* +*:gui* +*:gvim* + ============================================================================== 6. Removed features *nvim-features-removed* @@ -566,18 +569,18 @@ Highlight groups: < Options: - 'antialias' + antialias *'balloondelay'* *'bdlay'* *'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'* *'balloonexpr'* *'bexpr'* - 'bioskey' (MS-DOS) - 'conskey' (MS-DOS) + bioskey (MS-DOS) + conskey (MS-DOS) *'cp'* *'nocompatible'* *'nocp'* *'compatible'* (Nvim is always "nocompatible".) 'cpoptions' (gjkHw<*- and all POSIX flags were removed) *'cryptmethod'* *'cm'* *'key'* (Vim encryption implementation) *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'* 'encoding' ("utf-8" is always used) - 'esckeys' + esckeys 'guioptions' "t" flag was removed *'guifontset'* *'gfs'* (Use 'guifont' instead.) *'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.) @@ -618,18 +621,18 @@ Options: Nvim always displays up to 6 combining characters. You can still edit text with more than 6 combining characters, you just can't see them. Use |g8| or |ga|. See |mbyte-combining|. - 'maxmem' Nvim delegates memory-management to the OS. - 'maxmemtot' Nvim delegates memory-management to the OS. + *'maxmem'* Nvim delegates memory-management to the OS. + *'maxmemtot'* Nvim delegates memory-management to the OS. *'prompt'* *'noprompt'* *'remap'* *'noremap'* *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'* - 'shelltype' + *'shelltype'* *'shortname'* *'sn'* *'noshortname'* *'nosn'* *'swapsync'* *'sws'* *'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows) *'terse'* *'noterse'* (Add "s" to 'shortmess' instead) - 'textauto' - 'textmode' + textauto + textmode *'toolbar'* *'tb'* *'toolbariconsize'* *'tbis'* *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'* @@ -637,7 +640,7 @@ Options: *'ttymouse'* *'ttym'* *'ttyscroll'* *'tsl'* *'ttytype'* *'tty'* - 'weirdinvert' + weirdinvert Startup: --literal (file args are always literal; to expand wildcards on Windows, use -- cgit From c815aadfccd6bada47ecfb09fe188ee7f7c5caf3 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:43:23 +0200 Subject: docs: fix typos (#20150) Co-authored-by: Miguel Carneiro Co-authored-by: Gregory Anders Co-authored-by: Raphael Co-authored-by: C.D. MacEachern Co-authored-by: zeertzjq --- runtime/doc/api.txt | 6 +++--- runtime/doc/builtin.txt | 19 +++++++++++-------- runtime/doc/diagnostic.txt | 2 +- runtime/doc/eval.txt | 13 ++++++++----- runtime/doc/insert.txt | 3 ++- runtime/doc/motion.txt | 12 ++++++------ runtime/doc/options.txt | 6 +++--- runtime/doc/pi_health.txt | 2 +- runtime/doc/quickfix.txt | 4 ++-- runtime/doc/syntax.txt | 8 ++++---- runtime/doc/tabpage.txt | 2 +- runtime/doc/userfunc.txt | 2 +- runtime/doc/usr_22.txt | 2 +- runtime/doc/usr_41.txt | 1 + runtime/doc/windows.txt | 11 ++++++----- 15 files changed, 51 insertions(+), 42 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index ec16d5c650..ce59f5ad52 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3435,8 +3435,8 @@ nvim_ui_detach() *nvim_ui_detach()* *nvim_ui_pum_set_bounds()* nvim_ui_pum_set_bounds({width}, {height}, {row}, {col}) - Tells Nvim the geometry of the popumenu, to align floating windows with an - external popup menu. + Tells Nvim the geometry of the popupmenu, to align floating windows with + an external popup menu. Note that this method is not to be confused with |nvim_ui_pum_set_height()|, which sets the number of visible items in the @@ -3455,7 +3455,7 @@ nvim_ui_pum_set_bounds({width}, {height}, {row}, {col}) {col} Popupmenu height. nvim_ui_pum_set_height({height}) *nvim_ui_pum_set_height()* - Tells Nvim the number of elements displaying in the popumenu, to decide + Tells Nvim the number of elements displaying in the popupmenu, to decide and movement. Attributes: ~ diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 77b85406b9..735116f9a0 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1131,13 +1131,14 @@ chdir({dir}) *chdir()* directory (|:tcd|) then changes the tabpage local directory. - Otherwise, changes the global directory. + {dir} must be a String. If successful, returns the previous working directory. Pass this to another chdir() to restore the directory. On failure, returns an empty string. Example: > let save_dir = chdir(newdir) - if save_dir + if save_dir != "" " ... do some work call chdir(save_dir) endif @@ -3240,7 +3241,7 @@ getloclist({nr} [, {what}]) *getloclist()* In addition to the items supported by |getqflist()| in {what}, the following item is supported by |getloclist()|: - filewinid id of the window used to display files + filewinid id of the window used to display files from the location list. This field is applicable only when called from a location list window. See @@ -6069,6 +6070,8 @@ rand([{expr}]) *rand()* *readdir()* readdir({directory} [, {expr}]) Return a list with file and directory names in {directory}. + You can also use |glob()| if you don't need to do complicated + things, such as limiting the number of matches. When {expr} is omitted all entries are included. When {expr} is given, it is evaluated to check what to do: @@ -8303,12 +8306,12 @@ synconcealed({lnum}, {col}) *synconcealed()* the text is "123456" and both "23" and "45" are concealed and replaced by the character "X", then: call returns ~ - synconcealed(lnum, 1) [0, '', 0] - synconcealed(lnum, 2) [1, 'X', 1] - synconcealed(lnum, 3) [1, 'X', 1] - synconcealed(lnum, 4) [1, 'X', 2] - synconcealed(lnum, 5) [1, 'X', 2] - synconcealed(lnum, 6) [0, '', 0] + synconcealed(lnum, 1) [0, '', 0] + synconcealed(lnum, 2) [1, 'X', 1] + synconcealed(lnum, 3) [1, 'X', 1] + synconcealed(lnum, 4) [1, 'X', 2] + synconcealed(lnum, 5) [1, 'X', 2] + synconcealed(lnum, 6) [0, '', 0] synstack({lnum}, {col}) *synstack()* diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 78254c6f2b..ada7b93f7c 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -296,7 +296,7 @@ EVENTS *diagnostic-events* *DiagnosticChanged* DiagnosticChanged After diagnostics have changed. When used from Lua, - the new diagnostics are passed to the autocmcd + the new diagnostics are passed to the autocmd callback in the "data" table. Example: > diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 3e068e3b4e..bfaa3b12e8 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -457,7 +457,7 @@ String automatically. Thus the String '4' and the number 4 will find the same entry. Note that the String '04' and the Number 04 are different, since the Number will be converted to the String '4', leading zeros are dropped. The empty string can also be used as a key. - *literal-Dict* + *literal-Dict* *#{}* To avoid having to put quotes around every key the #{} form can be used. This does require the key to consist only of ASCII letters, digits, '-' and '_'. Example: > @@ -681,7 +681,7 @@ similar to -1. > :let shortblob = myblob[2:2] " Blob with one byte: 0z22 :let otherblob = myblob[:] " make a copy of the Blob -If the first index is beyond the last byte of the Blob or the second byte is +If the first index is beyond the last byte of the Blob or the second index is before the first index, the result is an empty Blob. There is no error message. @@ -704,8 +704,8 @@ The length of the replaced bytes must be exactly the same as the value provided. *E972* To change part of a blob you can specify the first and last byte to be -modified. The value must at least have the number of bytes in the range: > - :let blob[3:5] = [3, 4, 5] +modified. The value must have the same number of bytes in the range: > + :let blob[3:5] = 0z334455 You can also use the functions |add()|, |remove()| and |insert()|. @@ -1228,7 +1228,10 @@ And NOT: > \ ->map(mapexpr) \ ->sort() \ ->join() -< + +When using the lambda form there must be no white space between the } and the +(. + *expr9* number diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index f4ef8e65c4..9ea963c812 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1126,7 +1126,8 @@ that contains the List. The Dict can have these items: leading text is changed. Other items are ignored. -For acting upon end of completion, see the |CompleteDone| autocommand event. +For acting upon end of completion, see the |CompleteDonePre| and +|CompleteDone| autocommand event. For example, the function can contain this: > let matches = ... list of words ... diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 511b1bd7b2..77b6b83289 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -831,12 +831,12 @@ deletes the lines from the cursor position to mark 't'. Hint: Use mark 't' for Top, 'b' for Bottom, etc.. Lowercase marks are restored when using undo and redo. -Uppercase marks 'A to 'Z include the file name. -You can use them to jump from file to file. You can only use an uppercase -mark with an operator if the mark is in the current file. The line number of -the mark remains correct, even if you insert/delete lines or edit another file -for a moment. When the 'shada' option is not empty, uppercase marks are -kept in the .shada file. See |shada-file-marks|. +Uppercase marks 'A to 'Z include the file name. You can use them to jump from +file to file. You can only use an uppercase mark with an operator if the mark +is in the current file. The line number of the mark remains correct, even if +you insert/delete lines or edit another file for a moment. When the 'shada' +option is not empty, uppercase marks are kept in the .shada file. See +|shada-file-marks|. Numbered marks '0 to '9 are quite different. They can not be set directly. They are only present when using a shada file |shada-file|. Basically '0 diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index e5ad61062f..c1a0836f5b 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -6748,11 +6748,11 @@ A jump table for the options with a short description can be found at |Q_op|. final value applying to all subsequent tabs. For example, when editing assembly language files where statements - start in the 8th column and comments in the 40th, it may be useful + start in the 9th column and comments in the 41st, it may be useful to use the following: > :set varsofttabstop=8,32,8 -< This will set soft tabstops at the 8th and 40th columns, and at every - 8th column thereafter. +< This will set soft tabstops with 8 and 8 + 32 spaces, and 8 more + for every column thereafter. Note that the value of |'softtabstop'| will be ignored while 'varsofttabstop' is set. diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt index cc36e7186c..8a6437fdc8 100644 --- a/runtime/doc/pi_health.txt +++ b/runtime/doc/pi_health.txt @@ -75,7 +75,7 @@ vim.health.report_error({msg} [, {advice}]) *vim.health.report_error Create a healthcheck *health-dev* Healthchecks are functions that check the user environment, configuration, or -any other prerequisities that a plugin cares about. Nvim ships with +any other prerequisites that a plugin cares about. Nvim ships with healthchecks in: - $VIMRUNTIME/autoload/health/ - $VIMRUNTIME/lua/vim/lsp/health.lua diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 80110211f9..924a6d4743 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -916,7 +916,7 @@ To get the number of the current list in the stack: > screen). 5. The errorfile is read using 'errorformat'. 6. All relevant |QuickFixCmdPost| autocommands are - executed. See example below. + executed. See example below. 7. If [!] is not given the first error is jumped to. 8. The errorfile is deleted. 9. You can now move through the errors with commands @@ -1939,7 +1939,7 @@ list window is: The values displayed in each line correspond to the "bufnr", "lnum", "col" and "text" fields returned by the |getqflist()| function. -For some quickfix/location lists, the displayed text need to be customized. +For some quickfix/location lists, the displayed text needs to be customized. For example, if only the filename is present for a quickfix entry, then the two "|" field separator characters after the filename are not needed. Another use case is to customize the path displayed for a filename. By default, the diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 1368814952..83f19db4a9 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -2057,7 +2057,7 @@ The g:lisp_rainbow option provides 10 levels of individual colorization for the parentheses and backquoted parentheses. Because of the quantity of colorization levels, unlike non-rainbow highlighting, the rainbow mode specifies its highlighting using ctermfg and guifg, thereby bypassing the -usual colorscheme control using standard highlighting groups. The actual +usual color scheme control using standard highlighting groups. The actual highlighting used depends on the dark/bright setting (see |'bg'|). @@ -4838,7 +4838,7 @@ in their own color. To customize a color scheme use another name, e.g. "~/.config/nvim/colors/mine.vim", and use `:runtime` to - load the original colorscheme: > + load the original color scheme: > runtime colors/evening.vim hi Statement ctermfg=Blue guifg=Blue @@ -4846,7 +4846,7 @@ in their own color. |ColorSchemePre| autocommand event is triggered. After the color scheme has been loaded the |ColorScheme| autocommand event is triggered. - For info about writing a colorscheme file: > + For info about writing a color scheme file: > :edit $VIMRUNTIME/colors/README.txt :hi[ghlight] List all the current highlight groups that have @@ -5016,7 +5016,7 @@ ctermbg={color-nr} *ctermbg* explicitly. This causes the highlight groups that depend on 'background' to change! This means you should set the colors for Normal first, before setting other colors. - When a colorscheme is being used, changing 'background' causes it to + When a color scheme is being used, changing 'background' causes it to be reloaded, which may reset all colors (including Normal). First delete the "g:colors_name" variable when you don't want this. diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 9197710819..49b2773253 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -186,8 +186,8 @@ gt *i_CTRL-* *i_* :+2tabnext " go to the two next tab page :1tabnext " go to the first tab page :$tabnext " go to the last tab page - :tabnext # " go to the last accessed tab page :tabnext $ " as above + :tabnext # " go to the last accessed tab page :tabnext - " go to the previous tab page :tabnext -1 " as above :tabnext + " go to the next tab page diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt index 32c5b0b671..5462fa952c 100644 --- a/runtime/doc/userfunc.txt +++ b/runtime/doc/userfunc.txt @@ -214,7 +214,7 @@ It is allowed to define another function inside a function body. You can provide default values for positional named arguments. This makes them optional for function calls. When a positional argument is not specified at a call, the default expression is used to initialize it. -This only works for functions declared with |:function|, not for +This only works for functions declared with `:function`, not for lambda expressions |expr-lambda|. Example: > diff --git a/runtime/doc/usr_22.txt b/runtime/doc/usr_22.txt index f53d578456..539bda3980 100644 --- a/runtime/doc/usr_22.txt +++ b/runtime/doc/usr_22.txt @@ -220,7 +220,7 @@ a tab page share this directory except for windows with a window-local directory. Any new windows opened in this tab page will use this directory as the current working directory. Using a `:cd` command in a tab page will not change the working directory of tab pages which have a tab local directory. -When the global working directory is changed using the ":cd" command in a tab +When the global working directory is changed using the `:cd` command in a tab page, it will also change the current tab page working directory. diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index adb5130a53..4e7ec00148 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1016,6 +1016,7 @@ Testing: *test-functions* assert_beeps() assert that a command beeps assert_nobeep() assert that a command does not cause a beep assert_fails() assert that a command fails + assert_report() report a test failure Timers: *timer-functions* timer_start() create a timer diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 6386e4ace1..3dc718a68f 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -148,7 +148,7 @@ CTRL-W CTRL-S *CTRL-W_CTRL-S* Note: CTRL-S does not work on all terminals and might block further input, use CTRL-Q to get going again. Also see |++opt| and |+cmd|. - *E242* + *E242* *E1159* Be careful when splitting a window in an autocommand, it may mess up the window layout if this happens while making other window layout changes. @@ -291,9 +291,8 @@ Closing a window :{count}q[uit] *:count_quit* CTRL-W q *CTRL-W_q* CTRL-W CTRL-Q *CTRL-W_CTRL-Q* - Without {count}: Quit the current window. If {count} is - given quit the {count} window - + Without {count}: Quit the current window. If {count} is + given quit the {count} window. *edit-window* When quitting the last edit window (not counting help or preview windows), exit Vim. @@ -352,7 +351,7 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C* window, but that does not work, because the CTRL-C cancels the command. - *:hide* + *:hide* :hid[e] :{count}hid[e] Without {count}: Quit the current window, unless it is the @@ -751,6 +750,7 @@ can also get to them with the buffer list commands, like ":bnext". the current window. {cmd} can contain '|' to concatenate several commands. {cmd} must not open or close windows or reorder them. + Also see |:tabdo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo| and |:lfdo|. @@ -778,6 +778,7 @@ can also get to them with the buffer list commands, like ":bnext". autocommand event is disabled by adding it to 'eventignore'. This considerably speeds up editing each buffer. + Also see |:tabdo|, |:argdo|, |:windo|, |:cdo|, |:ldo|, |:cfdo| and |:lfdo|. -- cgit From 9a5ac065093b58cceb676700b988584931cef150 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 26 Sep 2022 09:56:07 -0400 Subject: fix(docs): invalid :help links #20353 ref #20159 --- runtime/doc/builtin.txt | 8 ++++---- runtime/doc/eval.txt | 4 ++-- runtime/doc/ft_rust.txt | 2 +- runtime/doc/ft_sql.txt | 2 +- runtime/doc/insert.txt | 2 +- runtime/doc/pi_netrw.txt | 2 +- runtime/doc/quickref.txt | 1 - runtime/doc/usr_41.txt | 2 +- runtime/doc/windows.txt | 2 +- 9 files changed, 12 insertions(+), 13 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 735116f9a0..4a889c67be 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2628,7 +2628,7 @@ get({dict}, {key} [, {default}]) {default} is omitted. Useful example: > let val = get(g:, 'var_name', 'default') < This gets the value of g:var_name if it exists, and uses - 'default' when it does not exist. + "default" when it does not exist. get({func}, {what}) Get item {what} from Funcref {func}. Possible values for {what} are: @@ -3035,7 +3035,7 @@ getcurpos([{winid}]) cursor vertically. Also see |getcursorcharpos()| and |getpos()|. The first "bufnum" item is always zero. The byte position of - the cursor is returned in 'col'. To get the character + the cursor is returned in "col". To get the character position, use |getcursorcharpos()|. The optional {winid} argument can specify the window. It can @@ -3414,7 +3414,7 @@ getqflist([{what}]) *getqflist()* |quickfix-ID|; zero means the id for the current list or the list specified by "nr" idx get information for the quickfix entry at this - index in the list specified by 'id' or 'nr'. + index in the list specified by "id" or "nr". If set to zero, then uses the current entry. See |quickfix-index| items quickfix list entries @@ -7226,7 +7226,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()* See |quickfix-parse| id quickfix list identifier |quickfix-ID| idx index of the current entry in the quickfix - list specified by 'id' or 'nr'. If set to '$', + list specified by "id" or "nr". If set to '$', then the last entry in the list is set as the current entry. See |quickfix-index| items list of quickfix entries. Same as the {list} diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index bfaa3b12e8..ae28977556 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -40,7 +40,7 @@ List An ordered sequence of items, see |List| for details. Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| Examples: - {'blue': "#0000ff", 'red': "#ff0000"} + {"blue": "#0000ff", "red": "#ff0000"} #{blue: "#0000ff", red: "#ff0000"} Blob Binary Large Object. Stores any sequence of bytes. See |Blob| @@ -2531,7 +2531,7 @@ text... echo 'done' endif END -< Results in: ["if ok", " echo 'done'", "endif"] +< Results in: `["if ok", " echo 'done'", "endif"]` The marker must line up with "let" and the indentation of the first line is removed from all the text lines. Specifically: all the leading indentation exactly diff --git a/runtime/doc/ft_rust.txt b/runtime/doc/ft_rust.txt index 34932c48fb..3a0bf2293e 100644 --- a/runtime/doc/ft_rust.txt +++ b/runtime/doc/ft_rust.txt @@ -110,7 +110,7 @@ g:rustfmt_fail_silently~ < *g:rustfmt_options* g:rustfmt_options~ - Set this option to a string of options to pass to 'rustfmt'. The + Set this option to a string of options to pass to "rustfmt". The write-mode is already set to "overwrite". If not specified it defaults to '' : > let g:rustfmt_options = '' diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index 685726de90..03d9082aab 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -757,7 +757,7 @@ the syntax items for Perl. Step 2 ------ -Manually setting the filetype to 'sql' will also fire the appropriate filetype +Manually setting the filetype to "sql" will also fire the appropriate filetype files ftplugin/sql.vim. This file will define a number of buffer specific maps for SQL completion, see |sql-completion-maps|. Now these maps have been created and the SQL completion plugin has been initialized. All SQL diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 9ea963c812..63ceab78a8 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1534,7 +1534,7 @@ The completions provided by CTRL-X CTRL-O are sensitive to the context: 3. After '.', '::' or ':' Methods applicable to the object being dereferenced - 4. After ':' or ':foo' Symbol name (beginning with 'foo') + 4. After ':' or ':foo' Symbol name (beginning with "foo") Notes: - Vim will load/evaluate code in order to provide completions. This may diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index ae0169491b..63d4496dc4 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -3569,7 +3569,7 @@ Example: Clear netrw's marked file list via a mapping on gu > http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready (8.3 Getting ready for public key authentication) < - How to use a private key with 'pscp': > + How to use a private key with "pscp": > http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html (5.2.4 Using public key authentication with PSCP) diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index cb065cef2c..23ce16a40a 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -798,7 +798,6 @@ Short explanation of each option: *option-list* 'patchexpr' 'pex' expression used to patch a file 'patchmode' 'pm' keep the oldest version of a file 'path' 'pa' list of directories searched with "gf" et.al. -'perldll' name of the Perl dynamic library 'preserveindent' 'pi' preserve the indent structure when reindenting 'previewheight' 'pvh' height of the preview window 'previewpopup' 'pvp' use popup window for preview diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 4e7ec00148..fb9d59f885 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1762,7 +1762,7 @@ does not exist as a mapped sequence. An error will be issued, which is very hard to identify, because the ending whitespace character in ":unmap ,ab " is not visible. -And this is the same as what happens when one uses a comment after an 'unmap' +And this is the same as what happens when one uses a comment after an "unmap" command: > :unmap ,ab " comment diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 3dc718a68f..45cedd2cd8 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -119,7 +119,7 @@ windows. *filler-lines* The lines after the last buffer line in a window are called filler lines. By -default, these lines start with a tilde (~) character. The 'eob' item in the +default, these lines start with a tilde (~) character. The "eob" item in the 'fillchars' option can be used to change this character. By default, these characters are highlighted as NonText (|hl-NonText|). The EndOfBuffer highlight group (|hl-EndOfBuffer|) can be used to change the highlighting of -- cgit From 35e2c4a2edd28f72c48c70530c5486365c2502a4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 28 Sep 2022 18:27:59 +0800 Subject: fix(lua): fix architecture-dependent behavior in usercmd "reg" (#20384) I don't think using an integer as a NUL-terminated string can work on big-endian systems, at least. This is also not tested. Add a test. Also fix a mistake in the docs of nvim_parse_cmd. --- runtime/doc/api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index ce59f5ad52..f0145344a4 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1811,7 +1811,7 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* range items were specified. • count: (number) Any || that was supplied to the command. -1 if command cannot take a count. - • reg: (number) The optional command ||, if specified. Empty + • reg: (string) The optional command ||, if specified. Empty string if not specified or if command cannot take a register. • bang: (boolean) Whether command contains a || (!) modifier. • args: (array) Command arguments. -- cgit From 9ca313fb968448011aae0509e6552c52b9f8aa8c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 28 Sep 2022 12:48:36 +0200 Subject: vim-patch:9fbdbb814f4a (#20376) Update runtime files https://github.com/vim/vim/commit/9fbdbb814f4ad67a14979aba4a6a49800c2f1a99 Skip ftplugin/vim.vim (vim9script change) Drop indent/vim.vim and autoload/dist/vimindent.vim (vim9script rewrite) --- runtime/doc/map.txt | 14 +++++++++----- runtime/doc/motion.txt | 2 +- runtime/doc/repeat.txt | 3 ++- runtime/doc/syntax.txt | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index e5d22de748..cbc92a8cb5 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1660,7 +1660,8 @@ The valid escape sequences are If the first two characters of an escape sequence are "q-" (for example, ) then the value is quoted in such a way as to make it a valid value for use in an expression. This uses the argument as one single value. -When there is no argument is an empty string. +When there is no argument is an empty string. See the +|q-args-example| below. ** To allow commands to pass their arguments on to a user-defined function, there is a special form ("function args"). This splits the command @@ -1670,7 +1671,7 @@ See the Mycmd example below. If no arguments are given is removed. To embed whitespace into an argument of , prepend a backslash. replaces every pair of backslashes (\\) with one backslash. A backslash followed by a character other than white space or a backslash -remains unmodified. Overview: +remains unmodified. Also see |f-args-example| below. Overview: command ~ XX ab "ab" @@ -1684,7 +1685,8 @@ remains unmodified. Overview: XX a\\\\b 'a\\b' XX a\\\\ b 'a\\', 'b' -Examples > + +Examples for user commands: > " Delete everything after here to the end :com Ddel +,$d @@ -1700,7 +1702,8 @@ Examples > " Count the number of lines in the range :com! -range -nargs=0 Lines echo - + 1 "lines" - " Call a user function (example of ) +< *f-args-example* +Call a user function (example of ) > :com -nargs=* Mycmd call Myfunc() When executed as: > @@ -1708,7 +1711,8 @@ When executed as: > This will invoke: > :call Myfunc("arg1","arg2") - :" A more substantial example +< *q-args-example* +A more substantial example: > :function Allargs(command) : let i = 0 : while i < argc() diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 77b6b83289..8ff4ed4f96 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1172,7 +1172,7 @@ g; Go to [count] older position in change list. (not a motion command) *g,* *E663* -g, Go to [count] newer cursor position in change list. +g, Go to [count] newer position in change list. Just like |g;| but in the opposite direction. (not a motion command) diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 0b316b4727..b0332269d7 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -83,7 +83,8 @@ pattern and do not match another pattern: > This first finds all lines containing "found", but only executes {cmd} when there is no match for "notfound". -To execute a non-Ex command, you can use the `:normal` command: > +Any Ex command can be used, see |ex-cmd-index|. To execute a Normal mode +command, you can use the `:normal` command: > :g/pat/normal {commands} Make sure that {commands} ends with a whole command, otherwise Vim will wait for you to type the rest of the command for each match. The screen will not diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 83f19db4a9..c97376a629 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -3118,7 +3118,7 @@ The default is to use the twice sh_minlines. Set it to a smaller number to speed up displaying. The disadvantage is that highlight errors may appear. syntax/sh.vim tries to flag certain problems as errors; usually things like -extra "]"s, "done"s, "fi"s, etc. If you find the error handling problematic +unmatched "]", "done", "fi", etc. If you find the error handling problematic for your purposes, you may suppress such error highlighting by putting the following line in your .vimrc: > -- cgit From 47b821eccf7bd08f429bb16e9d4ea309d6994896 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 28 Sep 2022 16:16:02 +0200 Subject: docs: mark cmdheight=0 and vim.attach_ui as experimental These will require further work for user experience out of the box during the 0.9 cycle. --- runtime/doc/lua.txt | 6 ++++++ runtime/doc/options.txt | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 0c6eb6af78..3026476ab9 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -978,6 +978,12 @@ vim.ui_attach({ns}, {options}, {callback}) *vim.ui_attach()* {callback} receives event name plus additional parameters. See |ui-popupmenu| and the sections below for event format for respective events. + WARNING: This api is considered experimental. Usability will vary for + different screen elements. In particular `ext_messages` behavior is subject + to further changes and usability improvements. This is expected to be + used to handle messages when setting 'cmdheight' to zero (which is + likewise experimental). + Example (stub for a |ui-popupmenu| implementation): > ns = vim.api.nvim_create_namespace('my_fancy_pum') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index c1a0836f5b..0654265dbe 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1338,9 +1338,13 @@ A jump table for the options with a short description can be found at |Q_op|. When 'cmdheight' is zero, there is no command-line unless it is being used. The command-line will cover the last line of the screen when - shown. Some informative messages will not be displayed, any other - messages will cause the |hit-enter| prompt. Expect some other - unexpected behavior too. + shown. + + WARNING: `cmdheight=0` is considered experimental. Except some + unwanted behaviour. Some 'shortmess' flags and similar + mechanism might fail to take effect, causing unwanted hit-enter + prompts. Some informative messages, both from Nvim itself and + plugins, will not be displayed. *'cmdwinheight'* *'cwh'* 'cmdwinheight' 'cwh' number (default 7) -- cgit From 16336c486ecb5a60e85a870904316308c7d7fc3f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 25 Sep 2022 02:20:47 +0200 Subject: feat(gen_help_html.lua): adapt to new parser - adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16 - numerous other generator improvements --- runtime/doc/api.txt | 53 +++++++------ runtime/doc/develop.txt | 17 ++++ runtime/doc/eval.txt | 2 +- runtime/doc/filetype.txt | 2 +- runtime/doc/helphelp.txt | 7 +- runtime/doc/luaref.txt | 110 +++++++++++++------------- runtime/doc/quickref.txt | 45 ++++++++++- runtime/doc/ui.txt | 201 +++++++++++++++++++++++------------------------ 8 files changed, 244 insertions(+), 193 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index f0145344a4..59d1d36be9 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -83,6 +83,7 @@ and |rpcnotify()|: let nvim = jobstart(['nvim', '--embed'], {'rpc': v:true}) echo rpcrequest(nvim, 'nvim_eval', '"Hello " . "world!"') call jobstop(nvim) +< ============================================================================== API Definitions *api-definitions* @@ -92,7 +93,7 @@ The Nvim C API defines custom types for all function parameters. Some are just typedefs around C99 standard types, others are Nvim-defined data structures. Basic types ~ - +> API Type C type ------------------------------------------------------------------------ Nil @@ -103,7 +104,7 @@ Basic types ~ Array Dictionary (msgpack: map) Object - +< Note: empty Array is accepted as a valid argument for Dictionary parameter. Special types (msgpack EXT) ~ @@ -115,13 +116,13 @@ Special types (msgpack EXT) ~ The EXT object data is the (integer) object handle. The EXT type codes given in the |api-metadata| `types` key are stable: they will not change and are thus forward-compatible. - +> EXT Type C type Data ------------------------------------------------------------------------ Buffer enum value kObjectTypeBuffer |bufnr()| Window enum value kObjectTypeWindow |window-ID| Tabpage enum value kObjectTypeTabpage internal handle - +< *api-indexing* Most of the API uses 0-based indices, and ranges are end-exclusive. For the @@ -130,19 +131,19 @@ end of a range, -1 denotes the last line/column. Exception: the following API functions use "mark-like" indexing (1-based lines, 0-based columns): - |nvim_get_mark()| - |nvim_buf_get_mark()| - |nvim_buf_set_mark()| - |nvim_win_get_cursor()| - |nvim_win_set_cursor()| +- |nvim_get_mark()| +- |nvim_buf_get_mark()| +- |nvim_buf_set_mark()| +- |nvim_win_get_cursor()| +- |nvim_win_set_cursor()| Exception: the following API functions use |extmarks| indexing (0-based indices, end-inclusive): - |nvim_buf_del_extmark()| - |nvim_buf_get_extmark_by_id()| - |nvim_buf_get_extmarks()| - |nvim_buf_set_extmark()| +- |nvim_buf_del_extmark()| +- |nvim_buf_get_extmark_by_id()| +- |nvim_buf_get_extmarks()| +- |nvim_buf_set_extmark()| *api-fast* Most API functions are "deferred": they are queued on the main loop and @@ -162,19 +163,19 @@ and return values. Nvim exposes its API metadata as a Dictionary with these items: -version Nvim version, API level/compatibility -version.api_level API version integer *api-level* -version.api_compatible API is backwards-compatible with this level -version.api_prerelease Declares the API as unstable/unreleased > - (version.api_prerelease && fn.since == version.api_level) -functions API function signatures, containing |api-types| info - describing the return value and parameters. -ui_events |UI| event signatures -ui_options Supported |ui-option|s -{fn}.since API level where function {fn} was introduced -{fn}.deprecated_since API level where function {fn} was deprecated -types Custom handle types defined by Nvim -error_types Possible error types returned by API functions +- version Nvim version, API level/compatibility +- version.api_level API version integer *api-level* +- version.api_compatible API is backwards-compatible with this level +- version.api_prerelease Declares the API as unstable/unreleased + `(version.api_prerelease && fn.since == version.api_level)` +- functions API function signatures, containing |api-types| info + describing the return value and parameters. +- ui_events |UI| event signatures +- ui_options Supported |ui-option|s +- {fn}.since API level where function {fn} was introduced +- {fn}.deprecated_since API level where function {fn} was deprecated +- types Custom handle types defined by Nvim +- error_types Possible error types returned by API functions About the `functions` map: diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 4f17e7d34a..ebb0dfeb4e 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -151,6 +151,23 @@ DOCUMENTATION *dev-doc* /// @param dirname The path fragment before `pend` < +Documentation format ~ + +For Nvim-owned docs, use the following strict subset of "vimdoc" to ensure +the help doc renders nicely in other formats (such as HTML: +https://neovim.io/doc/user ). + +Strict "vimdoc" subset: + +- Use lists (like this!) prefixed with "-", "*", or "•", for adjacent lines + that you don't want auto-wrapped. Lists are always rendered with "flow" + (soft-wrapped) layout instead of preformatted (hard-wrapped) layout common + in legacy :help docs. +- Separate blocks (paragraphs) of content by a blank line(s). +- Do not use indentation in random places—that prevents the page from using + "flow" layout. If you need a preformatted section, put it in + a |help-codeblock| starting with ">". + C docstrings ~ Nvim API documentation lives in the source code, as docstrings (Doxygen diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ae28977556..6a9fb6d03c 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4119,7 +4119,7 @@ This example sorts lines with a specific compare function. > As a one-liner: > :call setline(1, sort(getline(1, '$'), function("Strcmp"))) - +< scanf() replacement ~ *sscanf* diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 9f8ef248f8..ac54a6b6ca 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -178,7 +178,7 @@ If a file type that you want to use is not detected yet, there are a few ways to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.lua or $VIMRUNTIME/filetype.vim files. They will be overwritten when installing a new version of Nvim. The following explains the legacy Vim mechanism (enabled -if |do_legacy_filetype| is set). For Nvim's default mechanism, see +if |g:do_legacy_filetype| is set). For Nvim's default mechanism, see |vim.filetype.add()|. A. If you want to overrule all default file type checks. diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 569995d319..4758cd37c6 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -212,12 +212,6 @@ This is done when viewing the file in Vim, the file itself is not changed. It is done by going through all help files and obtaining the first line of each file. The files in $VIMRUNTIME/doc are skipped. - *help-xterm-window* -If you want to have the help in another xterm window, you could use this -command: > - :!xterm -e vim +help & -< - *:helpt* *:helptags* *E150* *E151* *E152* *E153* *E154* *E670* *E856* :helpt[ags] [++t] {dir} @@ -372,6 +366,7 @@ To separate sections in a help file, place a series of '=' characters in a line starting from the first column. The section separator line is highlighted differently. + *help-codeblock* To quote a block of ex-commands verbatim, place a greater than (>) character at the end of the line before the block and a less than (<) character as the first non-blank on a line following the block. Any line starting in column 1 diff --git a/runtime/doc/luaref.txt b/runtime/doc/luaref.txt index ecb92d4bb6..0b04005e1a 100644 --- a/runtime/doc/luaref.txt +++ b/runtime/doc/luaref.txt @@ -55,7 +55,6 @@ Lua means "moon" in Portuguese and is pronounced LOO-ah. ============================================================================== 2 THE LANGUAGE *luaref-language* -============================================================================== This section describes the lexis, the syntax, and the semantics of Lua. In other words, this section describes which tokens are valid, how they can be @@ -450,21 +449,22 @@ through an arithmetic progression. It has the following syntax: < The `block` is repeated for `name` starting at the value of the first `exp`, until it passes the second `exp` by steps of the third `exp`. More precisely, -a `for` statement like +a `for` statement like > - `for var =` `e1, e2, e3` `do` `block` `end` + for var = e1, e2, e3 do block end -is equivalent to the code: +< is equivalent to the code: > - `do` - `local` `var, limit, step` `= tonumber(e1), tonumber(e2), tonumber(e3)` - `if not (` `var` `and` `limit` `and` `step` `) then error() end` - `while (` `step` `>0 and` `var` `<=` `limit` `)` - `or (` `step` `<=0 and` `var` `>=` `limit` `) do` - `block` - `var` `=` `var` `+` `step` - `end` - `end` + do + local var, limit, step = tonumber(e1), tonumber(e2), tonumber(e3) + if not ( var and limit and step ) then error() end + while ( step >0 and var <= limit ) + or ( step <=0 and var >= limit ) do + block + var = var + step + end + end +< Note the following: @@ -490,18 +490,18 @@ A `for` statement like `for` `var1, ..., varn` `in` `explist` `do` `block` `end` -is equivalent to the code: - - `do` - `local` `f, s, var` `=` `explist` - `while true do` - `local` `var1, ..., varn` `=` `f(s, var)` - `var` `=` `var1` - `if` `var` `== nil then break end` - `block` - `end` - `end` +is equivalent to the code: > + do + local f, s, var = explist + while true do + local var1, ..., varn = f(s, var) + var = var1 + if var == nil then break end + block + end + end +< Note the following: - `explist` is evaluated only once. Its results are an iterator function, @@ -1871,25 +1871,25 @@ lua_gc *lua_gc()* This function performs several tasks, according to the value of the parameter `what`: - `LUA_GCSTOP` stops the garbage collector. - `LUA_GCRESTART` restarts the garbage collector. - `LUA_GCCOLLECT` performs a full garbage-collection cycle. - `LUA_GCCOUNT` returns the current amount of memory (in Kbytes) in + - `LUA_GCSTOP` stops the garbage collector. + - `LUA_GCRESTART` restarts the garbage collector. + - `LUA_GCCOLLECT` performs a full garbage-collection cycle. + - `LUA_GCCOUNT` returns the current amount of memory (in Kbytes) in use by Lua. - `LUA_GCCOUNTB` returns the remainder of dividing the current + - `LUA_GCCOUNTB` returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024. - `LUA_GCSTEP` performs an incremental step of garbage collection. + - `LUA_GCSTEP` performs an incremental step of garbage collection. The step "size" is controlled by `data` (larger values mean more steps) in a non-specified way. If you want to control the step size you must experimentally tune the value of `data`. The function returns 1 if the step finished a garbage-collection cycle. - `LUA_GCSETPAUSE` sets `data` /100 as the new value for the + - `LUA_GCSETPAUSE` sets `data` /100 as the new value for the `pause` of the collector (see |luaref-langGC|). The function returns the previous value of the pause. - `LUA_GCSETSTEPMUL` sets `data` /100 as the new value for the + - `LUA_GCSETSTEPMUL`sets `data` /100 as the new value for the `step` `multiplier` of the collector (see |luaref-langGC|). The function returns the previous value of the step multiplier. @@ -2717,20 +2717,22 @@ need "inside information" from the interpreter. lua_Debug *lua_Debug()* - `typedef struct lua_Debug {` - `int event;` - `const char *name; /* (n) */` - `const char *namewhat; /* (n) */` - `const char *what; /* (S) */` - `const char *source; /* (S) */` - `int currentline; /* (l) */` - `int nups; /* (u) number of upvalues */` - `int linedefined; /* (S) */` - `int lastlinedefined; /* (S) */` - `char short_src[LUA_IDSIZE]; /* (S) */` - `/* private part */` - `other fields` - `} lua_Debug;` +> + typedef struct lua_Debug { + int event; + const char *name; /* (n) */ + const char *namewhat; /* (n) */ + const char *what; /* (S) */ + const char *source; /* (S) */ + int currentline; /* (l) */ + int nups; /* (u) number of upvalues */ + int linedefined; /* (S) */ + int lastlinedefined; /* (S) */ + char short_src[LUA_IDSIZE]; /* (S) */ + /* private part */ + other fields + } lua_Debug; +< A structure used to carry different pieces of information about an active function. `lua_getstack` (see |lua_getstack()|) fills only the private part @@ -2739,28 +2741,28 @@ useful information, call `lua_getinfo` (see |lua_getinfo()|). The fields of `lua_Debug` have the following meaning: - `source` If the function was defined in a string, then `source` is +- `source` If the function was defined in a string, then `source` is that string. If the function was defined in a file, then `source` starts with a `@` followed by the file name. - `short_src` a "printable" version of `source`, to be used in error messages. - `linedefined` the line number where the definition of the function starts. - `lastlinedefined` the line number where the definition of the function ends. - `what` the string `"Lua"` if the function is a Lua function, +- `short_src` a "printable" version of `source`, to be used in error messages. +- `linedefined` the line number where the definition of the function starts. +- `lastlinedefined` the line number where the definition of the function ends. +- `what` the string `"Lua"` if the function is a Lua function, `"C"` if it is a C function, `"main"` if it is the main part of a chunk, and `"tail"` if it was a function that did a tail call. In the latter case, Lua has no other information about the function. - `currentline` the current line where the given function is executing. +- `currentline` the current line where the given function is executing. When no line information is available, `currentline` is set to -1. - `name` a reasonable name for the given function. Because +- `name` a reasonable name for the given function. Because functions in Lua are first-class values, they do not have a fixed name: some functions may be the value of multiple global variables, while others may be stored only in a table field. The `lua_getinfo` function checks how the function was called to find a suitable name. If it cannot find a name, then `name` is set to `NULL`. - `namewhat` explains the `name` field. The value of `namewhat` can be +- `namewhat` explains the `name` field. The value of `namewhat` can be `"global"`, `"local"`, `"method"`, `"field"`, `"upvalue"`, or `""` (the empty string), according to how the function was called. (Lua uses the empty string when diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 23ce16a40a..bdb0f7447c 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -3,7 +3,8 @@ VIM REFERENCE MANUAL by Bram Moolenaar - Quick reference guide +============================================================================== +Quick reference guide *quickref* *Contents* tag subject tag subject ~ @@ -29,11 +30,11 @@ |Q_to| Text objects |Q_gu| GUI commands |Q_fo| Folding ------------------------------------------------------------------------------- -N is used to indicate an optional count that can be given before the command. ------------------------------------------------------------------------------ *Q_lr* Left-right motions +N is used to indicate an optional count that can be given before the command. + |h| N h left (also: CTRL-H, , or key) |l| N l right (also: or key) |0| 0 to first character in the line (also: key) @@ -56,6 +57,7 @@ N is used to indicate an optional count that can be given before the command. |;| N ; repeat the last "f", "F", "t", or "T" N times |,| N , repeat the last "f", "F", "t", or "T" N times in opposite direction + ------------------------------------------------------------------------------ *Q_ud* Up-down motions @@ -73,6 +75,7 @@ N is used to indicate an optional count that can be given before the command. given, otherwise it is the |%| command |gk| N gk up N screen lines (differs from "k" when line wraps) |gj| N gj down N screen lines (differs from "j" when line wraps) + ------------------------------------------------------------------------------ *Q_tm* Text object motions @@ -105,6 +108,7 @@ N is used to indicate an optional count that can be given before the command. |]#| N ]# N times forward to unclosed "#else" or "#endif" |[star| N [* N times back to start of comment "/*" |]star| N ]* N times forward to end of comment "*/" + ------------------------------------------------------------------------------ *Q_pa* Pattern searches @@ -168,6 +172,7 @@ N is used to indicate an optional count that can be given before the command. b[+num] [num] identical to s[+num] above (mnemonic: begin) b[-num] [num] identical to s[-num] above (mnemonic: begin) ;{search-command} execute {search-command} next + ------------------------------------------------------------------------------ *Q_ma* Marks and motions @@ -188,6 +193,7 @@ N is used to indicate an optional count that can be given before the command. |CTRL-O| N CTRL-O go to Nth older position in jump list |CTRL-I| N CTRL-I go to Nth newer position in jump list |:ju| :ju[mps] print the jump list + ------------------------------------------------------------------------------ *Q_vm* Various motions @@ -202,6 +208,7 @@ N is used to indicate an optional count that can be given before the command. |go| N go go to Nth byte in the buffer |:go| :[range]go[to] [off] go to [off] byte in the buffer + ------------------------------------------------------------------------------ *Q_ta* Using tags @@ -229,6 +236,7 @@ N is used to indicate an optional count that can be given before the command. |:ptjump| :ptj[ump] like ":tjump" but show tag in preview window |:pclose| :pc[lose] close tag preview window |CTRL-W_z| CTRL-W z close tag preview window + ------------------------------------------------------------------------------ *Q_sc* Scrolling @@ -247,6 +255,7 @@ These only work when 'wrap' is off: |zl| N zl scroll screen N characters to the left |zH| N zH scroll screen half a screenwidth to the right |zL| N zL scroll screen half a screenwidth to the left + ------------------------------------------------------------------------------ *Q_in* Inserting text @@ -263,6 +272,7 @@ These only work when 'wrap' is off: in Visual block mode: |v_b_I| I insert the same text in front of all the selected lines |v_b_A| A append the same text after all the selected lines + ------------------------------------------------------------------------------ *Q_ai* Insert mode keys @@ -279,6 +289,7 @@ moving around: |i_| shift-up/down one screenful backward/forward |i_| cursor after last character in the line |i_| cursor to first character in the line + ------------------------------------------------------------------------------ *Q_ss* Special keys in Insert mode @@ -313,6 +324,7 @@ moving around: |i_0_CTRL-D| 0 CTRL-D delete all indent in the current line |i_^_CTRL-D| ^ CTRL-D delete all indent in the current line, restore indent in next line + ------------------------------------------------------------------------------ *Q_di* Digraphs @@ -325,12 +337,14 @@ In Insert or Command-line mode: enter digraph |i_digraph| {char1} {char2} enter digraph if 'digraph' option set + ------------------------------------------------------------------------------ *Q_si* Special inserts |:r| :r [file] insert the contents of [file] below the cursor |:r!| :r! {command} insert the standard output of {command} below the cursor + ------------------------------------------------------------------------------ *Q_de* Deleting text @@ -346,6 +360,7 @@ In Insert or Command-line mode: |gJ| N gJ like "J", but without inserting spaces |v_gJ| {visual}gJ like "{visual}J", but without inserting spaces |:d| :[range]d [x] delete [range] lines [into register x] + ------------------------------------------------------------------------------ *Q_cm* Copying and moving text @@ -363,6 +378,7 @@ In Insert or Command-line mode: |[p| N [p like P, but adjust indent to current line |gp| N gp like p, but leave cursor after the new text |gP| N gP like P, but leave cursor after the new text + ------------------------------------------------------------------------------ *Q_ch* Changing text @@ -418,6 +434,7 @@ In Insert or Command-line mode: left-align the lines in [range] (with [indent]) |:ri| :[range]ri[ght] [width] right-align the lines in [range] + ------------------------------------------------------------------------------ *Q_co* Complex changes @@ -444,6 +461,7 @@ In Insert or Command-line mode: |:ret| :[range]ret[ab][!] [tabstop] set 'tabstop' to new value and adjust white space accordingly + ------------------------------------------------------------------------------ *Q_vi* Visual mode @@ -457,6 +475,7 @@ In Insert or Command-line mode: |v_v| v highlight characters or stop highlighting |v_V| V highlight linewise or stop highlighting |v_CTRL-V| CTRL-V highlight blockwise or stop highlighting + ------------------------------------------------------------------------------ *Q_to* Text objects (only in Visual mode or after an operator) @@ -509,6 +528,7 @@ In Insert or Command-line mode: |:sl| :sl[eep] [sec] don't do anything for [sec] seconds |gs| N gs goto Sleep for N seconds + ------------------------------------------------------------------------------ *Q_km* Key mapping @@ -556,6 +576,7 @@ In Insert or Command-line mode: like ":mkvimrc", but store current files, windows, etc. too, to be able to continue this session later + ------------------------------------------------------------------------------ *Q_ab* Abbreviations @@ -570,6 +591,7 @@ In Insert or Command-line mode: |:abclear| :abc[lear] remove all abbreviations |:cabclear| :cabc[lear] remove all abbr's for Cmdline mode |:iabclear| :iabc[lear] remove all abbr's for Insert mode + ------------------------------------------------------------------------------ *Q_op* Options @@ -940,18 +962,21 @@ Short explanation of each option: *option-list* 'writeany' 'wa' write to file with no need for "!" override 'writebackup' 'wb' make a backup before overwriting a file 'writedelay' 'wd' delay this many msec for each char (for debug) + ------------------------------------------------------------------------------ *Q_ur* Undo/Redo commands |u| N u undo last N changes |CTRL-R| N CTRL-R redo last N undone changes |U| U restore last changed line + ------------------------------------------------------------------------------ *Q_et* External commands |:!| :!{command} execute {command} with a shell |K| K lookup keyword under the cursor with 'keywordprg' program (default: "man") + ------------------------------------------------------------------------------ *Q_qf* Quickfix commands @@ -975,6 +1000,7 @@ Short explanation of each option: *option-list* error |:grep| :gr[ep] [args] execute 'grepprg' to find matches and jump to the first one + ------------------------------------------------------------------------------ *Q_vc* Various commands @@ -1000,6 +1026,7 @@ Short explanation of each option: *option-list* unsaved changes or read-only files |:browse| :browse {command} open/read/write file, using a file selection dialog + ------------------------------------------------------------------------------ *Q_ce* Command-line editing @@ -1046,6 +1073,7 @@ Context-sensitive completion on the command-line: to next match |c_CTRL-P| CTRL-P after 'wildchar' with multiple matches: go to previous match + ------------------------------------------------------------------------------ *Q_ra* Ex ranges @@ -1066,6 +1094,7 @@ Context-sensitive completion on the command-line: (default: 1) |:range| -[num] subtract [num] from the preceding line number (default: 1) + ------------------------------------------------------------------------------ *Q_ex* Special Ex characters @@ -1098,6 +1127,7 @@ Context-sensitive completion on the command-line: |::r| :r root (extension removed) |::e| :e extension |::s| :s/{pat}/{repl}/ substitute {pat} with {repl} + ------------------------------------------------------------------------------ *Q_st* Starting Vim @@ -1134,6 +1164,7 @@ Context-sensitive completion on the command-line: |--help| --help show list of arguments and exit |--version| --version show version info and exit |--| - read file from stdin + ------------------------------------------------------------------------------ *Q_ed* Editing a file @@ -1153,6 +1184,7 @@ Context-sensitive completion on the command-line: position |:file| :f[ile] {name} set the current file name to {name} |:files| :files show alternate file names + ------------------------------------------------------------------------------ *Q_fl* Using the argument list |argument-list| @@ -1173,6 +1205,7 @@ Context-sensitive completion on the command-line: |:Next| :N[ext] :sN[ext] edit previous file |:first| :fir[st] :sfir[st] edit first file |:last| :la[st] :sla[st] edit last file + ------------------------------------------------------------------------------ *Q_wq* Writing and quitting @@ -1210,6 +1243,7 @@ Context-sensitive completion on the command-line: |:stop| :st[op][!] suspend Vim or start new shell; if 'aw' option is set and [!] not given write the buffer |CTRL-Z| CTRL-Z same as ":stop" + ------------------------------------------------------------------------------ *Q_ac* Automatic Commands @@ -1241,6 +1275,7 @@ Context-sensitive completion on the command-line: with {pat} |:autocmd| :au! {event} {pat} {cmd} remove all autocommands for {event} with {pat} and enter new one + ------------------------------------------------------------------------------ *Q_wi* Multi-window commands @@ -1286,6 +1321,7 @@ Context-sensitive completion on the command-line: |CTRL-W_>| CTRL-W > increase current window width |CTRL-W_bar| CTRL-W | set current window width (default: widest possible) + ------------------------------------------------------------------------------ *Q_bu* Buffer list commands @@ -1307,6 +1343,7 @@ Context-sensitive completion on the command-line: |:bfirst| :bfirst :sbfirst to first arg/buf |:blast| :blast :sblast to last arg/buf |:bmodified| :[N]bmod [N] :[N]sbmod [N] to Nth modified buf + ------------------------------------------------------------------------------ *Q_sy* Syntax Highlighting @@ -1333,6 +1370,7 @@ Context-sensitive completion on the command-line: |:filetype| :filetype plugin indent on switch on file type detection, with automatic indenting and settings + ------------------------------------------------------------------------------ *Q_gu* GUI commands @@ -1345,6 +1383,7 @@ Context-sensitive completion on the command-line: add toolbar item, giving {rhs} |:tmenu| :tmenu {mpath} {text} add tooltip to menu {mpath} |:unmenu| :unmenu {mpath} remove menu {mpath} + ------------------------------------------------------------------------------ *Q_fo* Folding diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 2d0c8d3b75..7ce6cd251f 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -23,40 +23,37 @@ screen grid with a size of width × height cells. This is typically done by an embedder at startup (see |ui-startup|), but UIs can also connect to a running Nvim instance and invoke nvim_ui_attach(). The `options` parameter is a map with these (optional) keys: + *ui-rgb* - `rgb` Decides the color format. - true: (default) 24-bit RGB colors - false: Terminal colors (8-bit, max 256) +- `rgb` Decides the color format. + - true: (default) 24-bit RGB colors + - false: Terminal colors (8-bit, max 256) *ui-override* - `override` Decides how UI capabilities are resolved. - true: Enable requested UI capabilities, even - if not supported by all connected UIs - (including |TUI|). - false: (default) Disable UI capabilities not - supported by all connected UIs - (including TUI). +- `override` Decides how UI capabilities are resolved. + - true: Enable requested UI capabilities, even if not + supported by all connected UIs (including |TUI|). + - false: (default) Disable UI capabilities not + supported by all connected UIs (including TUI). *ui-ext-options* - `ext_cmdline` Externalize the cmdline. |ui-cmdline| - `ext_hlstate` Detailed highlight state. |ui-hlstate| - Sets `ext_linegrid` implicitly. - `ext_linegrid` Line-based grid events. |ui-linegrid| - Deactivates |ui-grid-old| implicitly. - `ext_messages` Externalize messages. |ui-messages| - Sets `ext_linegrid` and `ext_cmdline` implicitly. - `ext_multigrid` Per-window grid events. |ui-multigrid| - Sets `ext_linegrid` implicitly. - `ext_popupmenu` Externalize |popupmenu-completion| and - 'wildmenu'. |ui-popupmenu| - `ext_tabline` Externalize the tabline. |ui-tabline| - `ext_termcolors` Use external default colors. - `term_name` Sets the name of the terminal 'term'. - `term_colors` Sets the number of supported colors 't_Co'. - `term_background` Sets the default value of 'background'. - `stdin_fd` Read buffer from `fd` as if it was a stdin pipe - This option can only used by |--embed| ui, - see |ui-startup-stdin|. - - +- `ext_cmdline` Externalize the cmdline. |ui-cmdline| +- `ext_hlstate` Detailed highlight state. |ui-hlstate| + Sets `ext_linegrid` implicitly. +- `ext_linegrid` Line-based grid events. |ui-linegrid| + Deactivates |ui-grid-old| implicitly. +- `ext_messages` Externalize messages. |ui-messages| + Sets `ext_linegrid` and `ext_cmdline` implicitly. +- `ext_multigrid` Per-window grid events. |ui-multigrid| + Sets `ext_linegrid` implicitly. +- `ext_popupmenu` Externalize |popupmenu-completion| and + 'wildmenu'. |ui-popupmenu| +- `ext_tabline` Externalize the tabline. |ui-tabline| +- `ext_termcolors` Use external default colors. +- `term_name` Sets the name of the terminal 'term'. +- `term_colors` Sets the number of supported colors 't_Co'. +- `term_background` Sets the default value of 'background'. +- `stdin_fd` Read buffer from `fd` as if it was a stdin pipe + This option can only used by |--embed| ui, + see |ui-startup-stdin|. Specifying an unknown option is an error; UIs can check the |api-metadata| `ui_options` key for supported options. @@ -164,13 +161,13 @@ Global Events *ui-global* The following UI events are always emitted, and describe global state of the editor. -["set_title", title] -["set_icon", icon] +["set_title", title] ~ +["set_icon", icon] ~ Set the window title, and icon (minimized) window title, respectively. In windowing systems not distinguishing between the two, "set_icon" can be ignored. -["mode_info_set", cursor_style_enabled, mode_info] +["mode_info_set", cursor_style_enabled, mode_info] ~ `cursor_style_enabled` is a boolean indicating if the UI should set the cursor style. `mode_info` is a list of mode property maps. The current mode is given by the `mode_idx` field of the `mode_change` @@ -197,21 +194,21 @@ the editor. `hl_id`: Use `attr_id` instead. `hl_lm`: Use `attr_id_lm` instead. -["option_set", name, value] +["option_set", name, value] ~ UI-related option changed, where `name` is one of: - 'arabicshape' - 'ambiwidth' - 'emoji' - 'guifont' - 'guifontwide' - 'linespace' - 'mousefocus' - 'mousemoveevent' - 'pumblend' - 'showtabline' - 'termguicolors' - "ext_*" (all |ui-ext-options|) + - 'arabicshape' + - 'ambiwidth' + - 'emoji' + - 'guifont' + - 'guifontwide' + - 'linespace' + - 'mousefocus' + - 'mousemoveevent' + - 'pumblend' + - 'showtabline' + - 'termguicolors' + - "ext_*" (all |ui-ext-options|) Triggered when the UI first connects to Nvim, and whenever an option is changed by the user or a plugin. @@ -224,7 +221,7 @@ the editor. however a UI might still use such options when rendering raw text sent from Nvim, like for |ui-cmdline|. -["mode_change", mode, mode_idx] +["mode_change", mode, mode_idx] ~ Editor mode changed. The `mode` parameter is a string representing the current mode. `mode_idx` is an index into the array emitted in the `mode_info_set` event. UIs should change the cursor style @@ -233,30 +230,30 @@ the editor. instance more submodes and temporary states might be represented as separate modes. -["mouse_on"] -["mouse_off"] +["mouse_on"] ~ +["mouse_off"] ~ 'mouse' was enabled/disabled in the current editor mode. Useful for a terminal UI, or embedding into an application where Nvim mouse would conflict with other usages of the mouse. Other UI:s may ignore this event. -["busy_start"] -["busy_stop"] +["busy_start"] ~ +["busy_stop"] ~ Indicates to the UI that it must stop rendering the cursor. This event is misnamed and does not actually have anything to do with busyness. -["suspend"] +["suspend"] ~ |:suspend| command or |CTRL-Z| mapping is used. A terminal client (or another client where it makes sense) could suspend itself. Other clients can safely ignore it. -["update_menu"] +["update_menu"] ~ The menu mappings changed. -["bell"] -["visual_bell"] +["bell"] ~ +["visual_bell"] ~ Notify the user with an audible or visual bell, respectively. -["flush"] +["flush"] ~ Nvim is done redrawing the screen. For an implementation that renders to an internal buffer, this is the time to display the redrawn parts to the user. @@ -279,11 +276,11 @@ be created; to enable per-window grids, activate |ui-multigrid|. Highlight attribute groups are predefined. UIs should maintain a table to map numerical highlight ids to the actual attributes. -["grid_resize", grid, width, height] +["grid_resize", grid, width, height] ~ Resize a `grid`. If `grid` wasn't seen by the client before, a new grid is being created with this size. -["default_colors_set", rgb_fg, rgb_bg, rgb_sp, cterm_fg, cterm_bg] +["default_colors_set", rgb_fg, rgb_bg, rgb_sp, cterm_fg, cterm_bg] ~ The first three arguments set the default foreground, background and special colors respectively. `cterm_fg` and `cterm_bg` specifies the default color codes to use in a 256-color terminal. @@ -300,7 +297,7 @@ numerical highlight ids to the actual attributes. screen with changed background color itself. *ui-event-hl_attr_define* -["hl_attr_define", id, rgb_attr, cterm_attr, info] +["hl_attr_define", id, rgb_attr, cterm_attr, info] ~ Add a highlight with `id` to the highlight table, with the attributes specified by the `rgb_attr` and `cterm_attr` dicts, with the following (all optional) keys. @@ -346,7 +343,7 @@ numerical highlight ids to the actual attributes. `info` is an empty array by default, and will be used by the |ui-hlstate| extension explained below. -["hl_group_set", name, hl_id] +["hl_group_set", name, hl_id] ~ The bulitin highlight group `name` was set to use the attributes `hl_id` defined by a previous `hl_attr_define` call. This event is not needed to render the grids which use attribute ids directly, but is useful @@ -355,7 +352,7 @@ numerical highlight ids to the actual attributes. use the |hl-Pmenu| family of builtin highlights. *ui-event-grid_line* -["grid_line", grid, row, col_start, cells] +["grid_line", grid, row, col_start, cells] ~ Redraw a continuous part of a `row` on a `grid`, starting at the column `col_start`. `cells` is an array of arrays each with 1 to 3 items: `[text(, hl_id, repeat)]` . `text` is the UTF-8 text that should be put in @@ -374,19 +371,19 @@ numerical highlight ids to the actual attributes. enough to cover the remaining line, will be sent when the rest of the line should be cleared. -["grid_clear", grid] +["grid_clear", grid] ~ Clear a `grid`. -["grid_destroy", grid] +["grid_destroy", grid] ~ `grid` will not be used anymore and the UI can free any data associated with it. -["grid_cursor_goto", grid, row, column] +["grid_cursor_goto", grid, row, column] ~ Makes `grid` the current grid and `row, column` the cursor position on this grid. This event will be sent at most once in a `redraw` batch and indicates the visible cursor position. -["grid_scroll", grid, top, bot, left, right, rows, cols] +["grid_scroll", grid, top, bot, left, right, rows, cols] ~ Scroll a region of `grid`. This is semantically unrelated to editor |scrolling|, rather this is an optimized way to say "copy these screen cells". @@ -439,30 +436,30 @@ Grid Events (cell-based) *ui-grid-old* This is the legacy representation of the screen grid, emitted if |ui-linegrid| is not active. New UIs should implement |ui-linegrid| instead. -["resize", width, height] +["resize", width, height] ~ The grid is resized to `width` and `height` cells. -["clear"] +["clear"] ~ Clear the grid. -["eol_clear"] +["eol_clear"] ~ Clear from the cursor position to the end of the current line. -["cursor_goto", row, col] +["cursor_goto", row, col] ~ Move the cursor to position (row, col). Currently, the same cursor is used to define the position for text insertion and the visible cursor. However, only the last cursor position, after processing the entire array in the "redraw" event, is intended to be a visible cursor position. -["update_fg", color] -["update_bg", color] -["update_sp", color] +["update_fg", color] ~ +["update_bg", color] ~ +["update_sp", color] ~ Set the default foreground, background and special colors respectively. *ui-event-highlight_set* -["highlight_set", attrs] +["highlight_set", attrs] ~ Set the attributes that the next text put on the grid will have. `attrs` is a dict with the keys below. Any absent key is reset to its default value. Color defaults are set by the `update_fg` etc @@ -482,18 +479,18 @@ is not active. New UIs should implement |ui-linegrid| instead. `underdotted`: underdotted text. The dots have `special` color. `underdashed`: underdashed text. The dashes have `special` color. -["put", text] +["put", text] ~ The (utf-8 encoded) string `text` is put at the cursor position (and the cursor is advanced), with the highlights as set by the last `highlight_set` update. -["set_scroll_region", top, bot, left, right] +["set_scroll_region", top, bot, left, right] ~ Define the scroll region used by `scroll` below. Note: ranges are end-inclusive, which is inconsistent with API conventions. -["scroll", count] +["scroll", count] ~ Scroll the text in the scroll region. The diagrams below illustrate what will happen, depending on the scroll direction. "=" is used to represent the SR(scroll region) boundaries and "-" the moved rectangles. @@ -588,29 +585,29 @@ A window can be hidden and redisplayed without its grid being deallocated. This can happen multiple times for the same window, for instance when switching tabs. -["win_pos", grid, win, start_row, start_col, width, height] +["win_pos", grid, win, start_row, start_col, width, height] ~ Set the position and size of the grid in Nvim (i.e. the outer grid size). If the window was previously hidden, it should now be shown again. -["win_float_pos", grid, win, anchor, anchor_grid, anchor_row, anchor_col, focusable] +["win_float_pos", grid, win, anchor, anchor_grid, anchor_row, anchor_col, focusable] ~ Display or reconfigure floating window `win`. The window should be displayed above another grid `anchor_grid` at the specified position `anchor_row` and `anchor_col`. For the meaning of `anchor` and more details of positioning, see |nvim_open_win()|. -["win_external_pos", grid, win] +["win_external_pos", grid, win] ~ Display or reconfigure external window `win`. The window should be displayed as a separate top-level window in the desktop environment, or something similar. -["win_hide", grid] +["win_hide", grid] ~ Stop displaying the window. The window can be shown again later. -["win_close", grid] +["win_close", grid] ~ Close the window. -["msg_set_pos", grid, row, scrolled, sep_char] +["msg_set_pos", grid, row, scrolled, sep_char] ~ Display messages on `grid`. The grid will be displayed at `row` on the default grid (grid=1), covering the full column width. `scrolled` indicates whether the message area has been scrolled to cover other @@ -621,13 +618,13 @@ tabs. When |ui-messages| is active, no message grid is used, and this event will not be sent. -["win_viewport", grid, win, topline, botline, curline, curcol] +["win_viewport", grid, win, topline, botline, curline, curcol] ~ Indicates the range of buffer text displayed in the window, as well as the cursor position in the buffer. All positions are zero-based. `botline` is set to one more than the line count of the buffer, if there are filler lines past the end. -["win_extmark", grid, win, ns_id, mark_id, row, col] +["win_extmark", grid, win, ns_id, mark_id, row, col] ~ Updates the position of an extmark which is currently visible in a window. Only emitted if the mark has the `ui_watched` attribute. @@ -639,7 +636,7 @@ Activated by the `ext_popupmenu` |ui-option|. This UI extension delegates presentation of the |popupmenu-completion| and command-line 'wildmenu'. -["popupmenu_show", items, selected, row, col, grid] +["popupmenu_show", items, selected, row, col, grid] ~ Show |popupmenu-completion|. `items` is an array of completion items to show; each item is an array of the form [word, kind, menu, info] as defined at |complete-items|, except that `word` is replaced by `abbr` @@ -651,12 +648,12 @@ command-line 'wildmenu'. set to -1 to indicate the popupmenu should be anchored to the external cmdline. Then `col` will be a byte position in the cmdline text. -["popupmenu_select", selected] +["popupmenu_select", selected] ~ Select an item in the current popupmenu. `selected` is a zero-based index into the array of items from the last popupmenu_show event, or -1 if no item is selected. -["popupmenu_hide"] +["popupmenu_hide"] ~ Hide the popupmenu. ============================================================================== @@ -664,7 +661,7 @@ Tabline Events *ui-tabline* Activated by the `ext_tabline` |ui-option|. -["tabline_update", curtab, tabs, curbuf, buffers] +["tabline_update", curtab, tabs, curbuf, buffers] ~ Tabline was updated. UIs should present this data in a custom tabline widget. Note: options `curbuf` + `buffers` were added in API7. curtab: Current Tabpage @@ -680,7 +677,7 @@ Activated by the `ext_cmdline` |ui-option|. This UI extension delegates presentation of the |cmdline| (except 'wildmenu'). For command-line 'wildmenu' UI events, activate |ui-popupmenu|. -["cmdline_show", content, pos, firstc, prompt, indent, level] +["cmdline_show", content, pos, firstc, prompt, indent, level] ~ content: List of [attrs, string] [[{}, "t"], [attrs, "est"], ...] @@ -703,10 +700,10 @@ For command-line 'wildmenu' UI events, activate |ui-popupmenu|. prompt has level 2. A command line invoked from the |cmdline-window| has a higher level than than the edited command line. -["cmdline_pos", pos, level] +["cmdline_pos", pos, level] ~ Change the cursor position in the cmdline. -["cmdline_special_char", c, shift, level] +["cmdline_special_char", c, shift, level] ~ Display a special char in the cmdline at the cursor position. This is typically used to indicate a pending state, e.g. after |c_CTRL-V|. If `shift` is true the text after the cursor should be shifted, otherwise @@ -714,10 +711,10 @@ For command-line 'wildmenu' UI events, activate |ui-popupmenu|. Should be hidden at next cmdline_show. -["cmdline_hide"] +["cmdline_hide"] ~ Hide the cmdline. -["cmdline_block_show", lines] +["cmdline_block_show", lines] ~ Show a block of context to the current command line. For example if the user defines a |:function| interactively: > :function Foo() @@ -727,10 +724,10 @@ For command-line 'wildmenu' UI events, activate |ui-popupmenu|. `lines` is a list of lines of highlighted chunks, in the same form as the "cmdline_show" `contents` parameter. -["cmdline_block_append", line] +["cmdline_block_append", line] ~ Append a line at the end of the currently shown block. -["cmdline_block_hide"] +["cmdline_block_hide"] ~ Hide the block. ============================================================================== @@ -747,7 +744,7 @@ Nvim will not allocate screen space for the cmdline or messages, and 'cmdheight' will be forced zero. Cmdline state is emitted as |ui-cmdline| events, which the UI must handle. -["msg_show", kind, content, replace_last] +["msg_show", kind, content, replace_last] ~ Display a message to the user. kind @@ -781,25 +778,25 @@ events, which the UI must handle. true: Replace the message in the most-recent `msg_show` call, but any other visible message should still remain. -["msg_clear"] +["msg_clear"] ~ Clear all messages currently displayed by "msg_show". (Messages sent by other "msg_" events below will not be affected). -["msg_showmode", content] +["msg_showmode", content] ~ Shows 'showmode' and |recording| messages. `content` has the same format as in "msg_show". This event is sent with empty `content` to hide the last message. -["msg_showcmd", content] +["msg_showcmd", content] ~ Shows 'showcmd' messages. `content` has the same format as in "msg_show". This event is sent with empty `content` to hide the last message. -["msg_ruler", content] +["msg_ruler", content] ~ Used to display 'ruler' when there is no space for the ruler in a statusline. `content` has the same format as in "msg_show". This event is sent with empty `content` to hide the last message. -["msg_history_show", entries] +["msg_history_show", entries] ~ Sent when |:messages| command is invoked. History is sent as a list of entries, where each entry is a `[kind, content]` tuple. -- cgit From e46eef75ac2c3336928269e28a1fa138f7327207 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Wed, 28 Sep 2022 17:43:18 +0600 Subject: feat(nvim_cmd): allow using first argument as count Allows `nvim_cmd` to use the first argument as count for applicable commands. Also adds support for non-String arguments to `nvim_cmd`. --- runtime/doc/api.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 59d1d36be9..9515dea9a2 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1697,7 +1697,13 @@ nvim_cmd({*cmd}, {*opts}) *nvim_cmd()* of a String. This allows for easier construction and manipulation of an Ex command. This also allows for things such as having spaces inside a command argument, expanding filenames in a command that otherwise doesn't - expand filenames, etc. + expand filenames, etc. Command arguments may also be Number, Boolean or + String. + + The first argument may also be used instead of count for commands that + support it in order to make their usage simpler with |vim.cmd()|. For + example, instead of `vim.cmd.bdelete{ count = 2 }`, you may do + `vim.cmd.bdelete(2)`. On execution error: fails with VimL error, updates v:errmsg. -- cgit From cb62592bcb03d7934416cf46bede3b8296254c87 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 27 Sep 2022 14:40:10 +0800 Subject: fix(api)!: nvim_parse_cmd omit "count" "range" "reg" if not supported --- runtime/doc/api.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 59d1d36be9..d6bec9f244 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1805,15 +1805,15 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* Return: ~ Dictionary containing command information, with these keys: • cmd: (string) Command name. - • range: (array) Command . Can have 0-2 elements depending on - how many items the range contains. Has no elements if command - doesn't accept a range or if no range was specified, one element if - only a single range item was specified and two elements if both - range items were specified. - • count: (number) Any || that was supplied to the command. -1 - if command cannot take a count. - • reg: (string) The optional command ||, if specified. Empty - string if not specified or if command cannot take a register. + • range: (array) (optional) Command range (|| ||). + Omitted if command doesn't accept a range. Otherwise, has no + elements if no range was specified, one element if only a single + range item was specified, or two elements if both range items were + specified. + • count: (number) (optional) Command ||. Omitted if command + cannot take a count. + • reg: (string) (optional) Command ||. Omitted if command + cannot take a register. • bang: (boolean) Whether command contains a || (!) modifier. • args: (array) Command arguments. • addr: (string) Value of |:command-addr|. Uses short name. -- cgit From df646572c53f55268a5dbb61628d7c3b302d5663 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Fri, 30 Sep 2022 09:53:52 +0200 Subject: docs: fix typos (#20394) Co-authored-by: Raphael Co-authored-by: smjonas Co-authored-by: zeertzjq --- runtime/doc/api.txt | 4 ++-- runtime/doc/ft_ada.txt | 2 +- runtime/doc/luvref.txt | 2 +- runtime/doc/options.txt | 2 +- runtime/doc/syntax.txt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 9515dea9a2..2748d2b04c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2579,7 +2579,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts}) • virt_text : virtual text to link to this mark. A list of [text, highlight] tuples, each representing a text chunk with specified highlight. `highlight` element can either - be a a single highlight group, or an array of multiple + be a single highlight group, or an array of multiple highlight groups that will be stacked (highest priority last). A highlight group can be supplied either as a string or as an integer, the latter which can be obtained @@ -2897,7 +2897,7 @@ nvim_win_set_hl_ns({window}, {ns_id}) *nvim_win_set_hl_ns()* Set highlight namespace for a window. This will use highlights defined in this namespace, but fall back to global highlights (ns=0) when missing. - This takes predecence over the 'winhighlight' option. + This takes precedence over the 'winhighlight' option. Parameters: ~ {ns_id} the namespace to use diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt index fa069057c4..3f002f2df7 100644 --- a/runtime/doc/ft_ada.txt +++ b/runtime/doc/ft_ada.txt @@ -489,7 +489,7 @@ backup.vim http://www.vim.org/scripts/script.php?script_id=1537 Keeps as many backups as you like so you don't have to. -rainbow_parenthsis.vim +rainbow_parenthesis.vim http://www.vim.org/scripts/script.php?script_id=1561 Very helpful since Ada uses only '(' and ')'. diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt index ee45444b42..6b77ee89a8 100644 --- a/runtime/doc/luvref.txt +++ b/runtime/doc/luvref.txt @@ -3355,7 +3355,7 @@ uv.getnameinfo({address} [, {callback}]) *uv.getnameinfo()* - `family`: `string` or `integer` or `nil` - `callback`: `callable` (async version) or `nil` (sync version) - - `err`: `nil` or `sring` + - `err`: `nil` or `string` - `host`: `string` or `nil` - `service`: `string` or `nil` diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 0654265dbe..836272a60f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1340,7 +1340,7 @@ A jump table for the options with a short description can be found at |Q_op|. used. The command-line will cover the last line of the screen when shown. - WARNING: `cmdheight=0` is considered experimental. Except some + WARNING: `cmdheight=0` is considered experimental. Expect some unwanted behaviour. Some 'shortmess' flags and similar mechanism might fail to take effect, causing unwanted hit-enter prompts. Some informative messages, both from Nvim itself and diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index c97376a629..8ebe0f3569 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -2365,7 +2365,7 @@ you set the variable: > :let papp_include_html=1 -in your startup file it will try to syntax-hilight html code inside phtml +in your startup file it will try to syntax-highlight html code inside phtml sections, but this is relatively slow and much too colourful to be able to edit sensibly. ;) -- cgit From b4d42bb9058308c38e3fe9d59458ce65b3f65eb0 Mon Sep 17 00:00:00 2001 From: Enan Ajmain <3nan.ajmain@gmail.com> Date: Wed, 20 Jul 2022 01:43:26 +0600 Subject: fix: make_filter_cmd for :! powershell Problem: `Start-Process` requires the command to be split into the shell command and its arguments. Previously it was done by parsing, which didn't handle cases such as - commands with escaped space in their filepath - quoted commands with space in their filepath Solution: Use - `pwsh -Command` instead of `Start-Process` - `Get-Content` instead of `-RedirectStandardInput` - `Out-File` instead of `-RedirectStandardOutput` --- runtime/doc/options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 836272a60f..5871b82d9c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5357,7 +5357,7 @@ A jump table for the options with a short description can be found at |Q_op|. To use PowerShell: > let &shell = executable('pwsh') ? 'pwsh' : 'powershell' let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' - let &shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait' + let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' set shellquote= shellxquote= -- cgit From e54541f7f941427b408f8d5a7bab446c141b5f76 Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Sat, 1 Oct 2022 11:35:36 +0200 Subject: refactor(lsp): remove deprecated lsp functions (#20421) --- runtime/doc/lsp.txt | 79 ----------------------------------------------------- 1 file changed, 79 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 26bca21507..b3bff89224 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1145,59 +1145,6 @@ format({options}) *vim.lsp.buf.format()* Defaults to `nil` in other modes, formatting the full buffer -formatting({options}) *vim.lsp.buf.formatting()* - Formats the current buffer. - - Parameters: ~ - {options} (table|nil) Can be used to specify FormattingOptions. Some - unspecified options will be automatically derived from the - current Neovim options. - - See also: ~ - https://microsoft.github.io/language-server-protocol/specification#textDocument_formatting - - *vim.lsp.buf.formatting_seq_sync()* -formatting_seq_sync({options}, {timeout_ms}, {order}) - Formats the current buffer by sequentially requesting formatting from - attached clients. - - Useful when multiple clients with formatting capability are attached. - - Since it's synchronous, can be used for running on save, to make sure - buffer is formatted prior to being saved. {timeout_ms} is passed on to the - |vim.lsp.client| `request_sync` method. Example: > - - vim.api.nvim_command[[autocmd BufWritePre lua vim.lsp.buf.formatting_seq_sync()]] -< - - Parameters: ~ - {options} (table|nil) `FormattingOptions` entries - {timeout_ms} (number|nil) Request timeout - {order} (table|nil) List of client names. Formatting is - requested from clients in the following order: first all - clients that are not in the `order` list, then the - remaining clients in the order as they occur in the - `order` list. - - *vim.lsp.buf.formatting_sync()* -formatting_sync({options}, {timeout_ms}) - Performs |vim.lsp.buf.formatting()| synchronously. - - Useful for running on save, to make sure buffer is formatted prior to - being saved. {timeout_ms} is passed on to |vim.lsp.buf_request_sync()|. - Example: -> - - autocmd BufWritePre lua vim.lsp.buf.formatting_sync() -< - - Parameters: ~ - {options} (table|nil) with valid `FormattingOptions` entries - {timeout_ms} (number) Request timeout - - See also: ~ - |vim.lsp.buf.format()| - hover() *vim.lsp.buf.hover()* Displays hover information about the symbol under the cursor in a floating window. Calling the function twice will jump into the floating window. @@ -1224,32 +1171,6 @@ outgoing_calls() *vim.lsp.buf.outgoing_calls()* |quickfix| window. If the symbol can resolve to multiple items, the user can pick one in the |inputlist()|. - *vim.lsp.buf.range_code_action()* -range_code_action({context}, {start_pos}, {end_pos}) - Performs |vim.lsp.buf.code_action()| for a given range. - - Parameters: ~ - {context} (table|nil) `CodeActionContext` of the LSP specification: - • diagnostics: (table|nil) LSP`Diagnostic[]` . Inferred from the current position if not provided. - • only: (table|nil) List of LSP `CodeActionKind`s used to - filter the code actions. Most language servers support - values like `refactor` or `quickfix`. - {start_pos} ({number, number}, optional) mark-indexed position. - Defaults to the start of the last visual selection. - {end_pos} ({number, number}, optional) mark-indexed position. - Defaults to the end of the last visual selection. - - *vim.lsp.buf.range_formatting()* -range_formatting({options}, {start_pos}, {end_pos}) - Formats a given range. - - Parameters: ~ - {options} Table with valid `FormattingOptions` entries. - {start_pos} ({number, number}, optional) mark-indexed position. - Defaults to the start of the last visual selection. - {end_pos} ({number, number}, optional) mark-indexed position. - Defaults to the end of the last visual selection. - references({context}, {options}) *vim.lsp.buf.references()* Lists all the references to the symbol under the cursor in the quickfix window. -- cgit From 85c7d4f7a92326dcd70317b048bafe96c8051701 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 1 Oct 2022 18:32:08 +0800 Subject: vim-patch:9.0.0620: matchaddpos() can only add up to 8 matches Problem: matchaddpos() can only add up to 8 matches. Solution: Allocate the array of positions. (closes vim/vim#11248) https://github.com/vim/vim/commit/50faf02f43d7f1a56ec2023028fca7c72dbce83e --- runtime/doc/builtin.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 4a889c67be..ba345bf03c 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -5068,8 +5068,6 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) ignored, as well as entries with negative column numbers and lengths. - The maximum number of positions in {pos} is 8. - Returns -1 on error. Example: > -- cgit From cb310d2901a0eb63721ac5930daaadee91929208 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 1 Oct 2022 21:59:53 +0800 Subject: vim-patch:9.0.0622: matchaddpos() can get slow when adding many matches Problem: matchaddpos() can get slow when adding many matches. Solution: Update the next available match ID when manually picking an ID and remove check if the available ID can be used. (idea by Rick Howe) https://github.com/vim/vim/commit/9f573a8df02d9f699a43d2afbd1d2841d700b9ad --- runtime/doc/builtin.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index ba345bf03c..2f44a41699 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -5010,7 +5010,7 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) respectively. 3 is reserved for use by the |matchparen| plugin. If the {id} argument is not specified or -1, |matchadd()| - automatically chooses a free ID. + automatically chooses a free ID, which is at least 1000. The optional {dict} argument allows for further custom values. Currently this is used to specify a match specific -- cgit From 51d379d40d14d35ccb8e4038504d6c0cda9be62c Mon Sep 17 00:00:00 2001 From: Enan Ajmain <3nan.ajmain@gmail.com> Date: Tue, 4 Oct 2022 02:14:18 +0600 Subject: docs(shell): mention "&" for piping with powershell #20459 New behaviour since PR #19438 --- runtime/doc/various.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index cae9c76030..cd178cfbbb 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -259,6 +259,10 @@ g8 Print the hex values of the bytes used in the or stderr, the streams are closed immediately. |E5677| Use |jobstart()| instead. > :call jobstart('foo', {'detach':1}) +< + For powershell, chaining a stringed executable path + requires using the call operator (&). > + :!Write-Output "1`n2" | & "C:\Windows\System32\sort.exe" /r < *E34* Any "!" in {cmd} is replaced with the previous -- cgit From 088abbeb6e6aecfc34b42db9b8d1396f493a2466 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 29 Sep 2022 13:46:44 +0200 Subject: feat(docs): nested lists in HTML, update :help parser - Docs HTML: improvements in https://github.com/neovim/tree-sitter-vimdoc allow us to many hacks in `gen_help_html.lua`. - Docs HTML: support nested lists. - Docs HTML: avoid extra newlines (too much whitespace) in old (preformatted) layout. - Docs HTML: disable golden-grid for narrow viewport. - Workaround for https://github.com/neovim/neovim/issues/20404 closes https://github.com/neovim/neovim/issues/20404 --- runtime/doc/api.txt | 12 ++++++------ runtime/doc/builtin.txt | 2 +- runtime/doc/index.txt | 11 +++++++++++ runtime/doc/luaref.txt | 2 +- runtime/doc/pi_netrw.txt | 2 +- runtime/doc/repeat.txt | 4 ++-- runtime/doc/starting.txt | 2 +- 7 files changed, 23 insertions(+), 12 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index d53ca01df0..6f7f0bf416 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -434,7 +434,7 @@ its config is non-empty: > if vim.api.nvim_win_get_config(window_id).relative ~= '' then -- window with this window_id is floating end -> +< Buffer text can be highlighted by typical mechanisms (syntax highlighting, |api-highlights|). The |hl-NormalFloat| group highlights normal text; @@ -456,7 +456,7 @@ Example: create a float with scratch buffer: > let win = nvim_open_win(buf, 0, opts) " optional: change highlight, otherwise Pmenu is used call nvim_win_set_option(win, 'winhl', 'Normal:MyHighlight') -> +< ============================================================================== Extended marks *api-extended-marks* *extmarks* @@ -500,8 +500,8 @@ Let's set an extmark at the first row (row=0) and third column (column=2). 01 2345678 0 ex|ample.. -< ^ extmark position -> + ^ extmark position + let g:mark_ns = nvim_create_namespace('myplugin') let g:mark_id = nvim_buf_set_extmark(0, g:mark_ns, 0, 2, {}) < @@ -520,8 +520,8 @@ use |nvim_buf_del_extmark()|. Deleting "x" in our example: > 0 12345678 0 e|ample.. -< ^ extmark position -> + ^ extmark position + echo nvim_buf_get_extmark_by_id(0, g:mark_ns, g:mark_id, {}) => [0, 1] < diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 2f44a41699..9de8db1f43 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -7716,7 +7716,7 @@ sqrt({expr}) *sqrt()* :echo sqrt(100) < 10.0 > :echo sqrt(-4.01) -< str2float('nan') +< str2float("nan") NaN may be different, it depends on system libraries. Can also be used as a |method|: > diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index f9ef99f819..8dd3d708a3 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -21,6 +21,7 @@ For a list of Vim variables see |vim-variable|. tag char action in Insert mode ~ ----------------------------------------------------------------------- + |i_CTRL-@| CTRL-@ insert previously inserted text and stop insert |i_CTRL-A| CTRL-A insert previously inserted text @@ -184,6 +185,7 @@ note: 1 = cursor movement command; 2 = can be undone/redone tag char note action in Normal mode ~ ------------------------------------------------------------------------------ + CTRL-@ not used |CTRL-A| CTRL-A 2 add N to number at/after cursor |CTRL-B| CTRL-B 1 scroll N screens Backwards @@ -469,6 +471,7 @@ These can be used after an operator or in Visual mode to select an object. tag command action in op-pending and Visual mode ~ ------------------------------------------------------------------------------ + |v_aquote| a" double quoted string |v_a'| a' single quoted string |v_a(| a( same as ab @@ -511,6 +514,7 @@ tag command action in op-pending and Visual mode ~ tag command action in Normal mode ~ ------------------------------------------------------------------------------ + |CTRL-W_CTRL-B| CTRL-W CTRL-B same as "CTRL-W b" |CTRL-W_CTRL-C| CTRL-W CTRL-C same as "CTRL-W c" |CTRL-W_CTRL-D| CTRL-W CTRL-D same as "CTRL-W d" @@ -609,6 +613,7 @@ tag command action in Normal mode ~ tag char note action in Normal mode ~ ------------------------------------------------------------------------------ + |[_CTRL-D| [ CTRL-D jump to first #define found in current and included files matching the word under the cursor, start searching at beginning of @@ -699,6 +704,7 @@ tag char note action in Normal mode ~ tag char note action in Normal mode ~ ------------------------------------------------------------------------------ + g_CTRL-A g CTRL-A dump a memory profile |g_CTRL-G| g CTRL-G show information about current cursor position @@ -802,6 +808,7 @@ g_CTRL-A g CTRL-A dump a memory profile tag char note action in Normal mode ~ ------------------------------------------------------------------------------ + |z| z redraw, cursor line to top of window, cursor on first non-blank |zN| z{height} redraw, make window {height} lines high @@ -876,6 +883,7 @@ These can be used after an operator, but before a {motion} has been entered. tag char action in Operator-pending mode ~ ----------------------------------------------------------------------- + |o_v| v force operator to work charwise |o_V| V force operator to work linewise |o_CTRL-V| CTRL-V force operator to work blockwise @@ -888,6 +896,7 @@ here are those that are different. tag command note action in Visual mode ~ ------------------------------------------------------------------------------ + |v_CTRL-\_CTRL-N| CTRL-\ CTRL-N stop Visual mode |v_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to Normal mode |v_CTRL-A| CTRL-A 2 add N to number in highlighted text @@ -1008,6 +1017,7 @@ file names, tags, commands etc. as appropriate. tag command action in Command-line editing mode ~ ------------------------------------------------------------------------------ + CTRL-@ not used |c_CTRL-A| CTRL-A do completion on the pattern in front of the cursor and insert all matches @@ -1118,6 +1128,7 @@ The commands are sorted on the non-optional part of their name. tag command action ~ ------------------------------------------------------------------------------ + |:| : nothing |:range| :{range} go to last line in {range} |:!| :! filter lines or execute an external command diff --git a/runtime/doc/luaref.txt b/runtime/doc/luaref.txt index 0b04005e1a..9ce3637563 100644 --- a/runtime/doc/luaref.txt +++ b/runtime/doc/luaref.txt @@ -61,7 +61,7 @@ other words, this section describes which tokens are valid, how they can be combined, and what their combinations mean. The language constructs will be explained using the usual extended BNF -notation, in which { `a` } means 0 or more `a`'s, and [ `a` ] means an optional `a`. +notation, in which `{ a }` means 0 or more `a`'s, and `[ a ]` means an optional `a`. ============================================================================== 2.1 Lexical Conventions *luaref-langLexConv* diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 63d4496dc4..972c42107c 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -2782,7 +2782,7 @@ your browsing preferences. (see also: |netrw-settings|) history are saved (as .netrwbook and .netrwhist). Netrw uses |expand()| on the string. - default: stdpath('data') (see |stdpath()|) + default: stdpath("data") (see |stdpath()|) *g:netrw_keepdir* =1 (default) keep current directory immune from the browsing directory. diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index b0332269d7..b84274cc9e 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -471,7 +471,7 @@ flag when defining the function, it is not relevant when executing it. > :set cpo-=C < *line-continuation-comment* -To add a comment in between the lines start with '"\ '. Notice the space +To add a comment in between the lines start with `'"\ '`. Notice the space after the backslash. Example: > let array = [ "\ first entry comment @@ -491,7 +491,7 @@ Rationale: continuation lines to be part of the comment. Since it was like this for a long time, when making it possible to add a comment halfway a sequence of continuation lines, it was not possible to use \", since - that was a valid continuation line. Using '"\ ' comes closest, even + that was a valid continuation line. Using `'"\ '` comes closest, even though it may look a bit weird. Requiring the space after the backslash is to make it very unlikely this is a normal comment line. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 351fe868d9..4ac076027c 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1357,7 +1357,7 @@ LOG FILE *$NVIM_LOG_FILE* *E5430* Besides 'debug' and 'verbose', Nvim keeps a general log file for internal debugging, plugins and RPC clients. > :echo $NVIM_LOG_FILE -By default, the file is located at stdpath('log')/log unless that path +By default, the file is located at stdpath("log")/log unless that path is inaccessible or if $NVIM_LOG_FILE was set before |startup|. -- cgit From 03bc23de36c85b453bba6ac1338c4d51ea3508b1 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 29 Sep 2022 12:08:26 +0200 Subject: feat(gen_help_html.lua): remove old AWK scripts These files are no longer needed since gen_help_html.lua is working fairly well. ref https://github.com/neovim/neovim/pull/11967 --- runtime/doc/Makefile | 40 --- runtime/doc/makehtml.awk | 788 ----------------------------------------------- runtime/doc/maketags.awk | 42 --- 3 files changed, 870 deletions(-) delete mode 100644 runtime/doc/Makefile delete mode 100644 runtime/doc/makehtml.awk delete mode 100644 runtime/doc/maketags.awk (limited to 'runtime/doc') diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile deleted file mode 100644 index 18d32c0820..0000000000 --- a/runtime/doc/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# -# Makefile for the Vim documentation on Unix -# -# If you get "don't know how to make scratch", first run make in the source -# directory. Or remove the include below. - -AWK = awk - -DOCS = $(wildcard *.txt) -HTMLS = $(DOCS:.txt=.html) - -.SUFFIXES: -.SUFFIXES: .c .o .txt .html - -# Awk version of .txt to .html conversion. -html: noerrors vimindex.html $(HTMLS) - @if test -f errors.log; then cat errors.log; fi - -noerrors: - -rm -f errors.log - -$(HTMLS): tags.ref - -.txt.html: - $(AWK) -f makehtml.awk $< >$@ - -# index.html is the starting point for HTML, but for the help files it is -# help.txt. Therefore use vimindex.html for index.txt. -index.html: help.txt - $(AWK) -f makehtml.awk help.txt >index.html - -vimindex.html: index.txt - $(AWK) -f makehtml.awk index.txt >vimindex.html - -tags.ref tags.html: tags - $(AWK) -f maketags.awk tags >tags.html - -clean: - -rm -f *.html tags.ref $(HTMLS) errors.log tags - diff --git a/runtime/doc/makehtml.awk b/runtime/doc/makehtml.awk deleted file mode 100644 index 50f5611fa7..0000000000 --- a/runtime/doc/makehtml.awk +++ /dev/null @@ -1,788 +0,0 @@ -BEGIN { - # some initialization variables - asciiart="no"; - wasset="no"; - lineset=0; - sample="no"; - while ( getline ti <"tags.ref" > 0 ) { - nf=split(ti,tag," "); - # as help.txt renders into index.html and index.txt -> vimindex.html, - # this hack is needed to get the links right to those pages. - if ( tag[2] == "index.txt" ) { - tag[2] = "vimindex.txt" - } else if ( tag[2] == "help.txt" ) { - tag[2] = "index.txt" - } - tagkey[tag[1]]="yes";tagref[tag[1]]=tag[2]; - } - skip_word["and"]="yes"; - skip_word["backspace"]="yes"; - skip_word["beep"]="yes"; - skip_word["bugs"]="yes"; - skip_word["da"]="yes"; - skip_word["end"]="yes"; - skip_word["ftp"]="yes"; - skip_word["go"]="yes"; - skip_word["help"]="yes"; - skip_word["home"]="yes"; - skip_word["news"]="yes"; - skip_word["index"]="yes"; - skip_word["insert"]="yes"; - skip_word["into"]="yes"; - skip_word["put"]="yes"; - skip_word["reference"]="yes"; - skip_word["section"]="yes"; - skip_word["space"]="yes"; - skip_word["starting"]="yes"; - skip_word["toggle"]="yes"; - skip_word["various"]="yes"; - skip_word["version"]="yes"; - skip_word["is"]="yes"; -} -# -# protect special chars -# -/[><&]/ {gsub(/&/,"\\&");gsub(/>/,"\\>");gsub(/ 0 { sample = "no" } -# -# sample lines printed bold unless empty... -# -sample == "yes" && $0 =="" { print ""; next; } -sample == "yes" && $0 !="" { print "" $0 ""; next; } -# -# start of sample lines in next line -# -$0 == ">" { sample = "yes"; print ""; next; } -substr($0,length($0)-4,5) == " >" { sample = "yes"; gsub(/ >$/, ""); } -# -# header lines printed bold, colored -# -substr($0,length($0),1) == "~" { print "" substr($0,1,length($0)-1) ""; next; } -# -#ad hoc code -# -/^"\|& / {gsub(/\|/,"\\|"); } -/ = b / {gsub(/ b /," \\b "); } -# -# one letter tag -# -/[ ]\*.\*[ ]/ {gsub(/\*/,"ZWWZ"); } -# -# isolated "*" -# -/[ ]\*[ ]/ {gsub(/ \* /," \\* "); - gsub(/ \* /," \\* "); - gsub(/ \* /," \\* "); - gsub(/ \* /," \\* "); } -# -# tag start -# -/[ ]\*[^ ]/ {gsub(/ \*/," ZWWZ");gsub(/ \*/," ZWWZ");} -/^\*[^ ]/ {gsub(/^\*/,"ZWWZ");} -# -# tag end -# -/[^ ]\*$/ {gsub(/\*$/,"ZWWZ");} -/[^ \/ ]\*[ ]/ {gsub(/\*/,"ZWWZ");} -# -# isolated "|" -# -/[ ]\|[ ]/ {gsub(/ \| /," \\| "); - gsub(/ \| /," \\| "); - gsub(/ \| /," \\| "); - gsub(/ \| /," \\| "); } -/'\|'/ { gsub(/'\|'/,"'\\|'"); } -/\^V\|/ {gsub(/\^V\|/,"^V\\|");} -/ \\\| / {gsub(/\|/,"\\|");} -# -# one letter pipes and "||" false pipe (digraphs) -# -/[ ]\|.\|[ ]/ && asciiart == "no" {gsub(/\|/,"YXXY"); } -/^\|.\|[ ]/ {gsub(/\|/,"YXXY"); } -/\|\|/ {gsub(/\|\|/,"\\|\\|"); } -/^shellpipe/ {gsub(/\|/,"\\|"); } -# -# pipe start -# -/[ ]\|[^ ]/ && asciiart == "no" {gsub(/ \|/," YXXY"); - gsub(/ \|/," YXXY");} -/^\|[^ ]/ {gsub(/^\|/,"YXXY");} -# -# pipe end -# -/[^ ]\|$/ && asciiart == "no" {gsub(/\|$/,"YXXY");} -/[^ ]\|[s ,.); ]/ && asciiart == "no" {gsub(/\|/,"YXXY");} -/[^ ]\|]/ && asciiart == "no" {gsub(/\|/,"YXXY");} -# -# various -# -/'"/ {gsub(/'"/,"\\'\\"'");} -/"/ {gsub(/"/,"\\"");} -/%/ {gsub(/%/,"\\%");} - -NR == 1 { nf=split(FILENAME,f,".") - print ""; - - print "" - if ( FILENAME == "mbyte.txt" ) { - # needs utf-8 as uses many languages - print ""; - } else { - # common case - Latin1 - print ""; - } - print "Nvim documentation: " f[1] ""; - print ""; - - print ""; - print "

Nvim documentation: " f[1] "

"; - print ""; - if ( FILENAME != "help.txt" ) { - print "main help file\n"; - } - print "
"; - print "
";
-	filename=f[1]".html";
-}
-
-# set to a low value to test for few lines of text
-# NR == 99999 { exit; }
-
-# ignore underlines and tags
-substr($0,1,5) == " vim:" { next; }
-substr($0,1,4) == "vim:" { next; }
-# keep just whole lines of "-", "="
-substr($0,1,3) == "===" && substr($0,75,1) != "=" { next; }
-substr($0,1,3) == "---" && substr($0,75,1) != "-" { next; }
-
-{
-	nstar = split($0,s,"ZWWZ");
-	for ( i=2 ; i <= nstar ; i=i+2 ) {
-		nbla=split(s[i],blata,"[ 	]");
-		if ( nbla > 1 ) {
-			gsub("ZWWZ","*");
-			nstar = split($0,s,"ZWWZ");
-		}
-	}
-	npipe = split($0,p,"YXXY");
-	for ( i=2 ; i <= npipe ; i=i+2 ) {
-		nbla=split(p[i],blata,"[ 	]");
-		if ( nbla > 1 ) {
-			gsub("YXXY","|");
-			ntabs = split($0,p,"YXXY");
-		}
-	}
-}
-
-
-FILENAME == "gui.txt" && asciiart == "no"  \
-	  && $0 ~ /\+----/ && $0 ~ /----\+/ {
-	asciiart= "yes";
-	asciicnt=0;
-	}
-
-FILENAME == "usr_20.txt" && asciiart == "no" \
-	  && $0 ~ /an empty line at the end:/ {
-	asciiart= "yes";
-	asciicnt=0;
-	}
-
-asciiart == "yes" && $0=="" { asciicnt++; }
-
-asciiart == "yes" && asciicnt == 2 { asciiart = "no"; }
-
-asciiart == "yes" { npipe = 1; }
-#	{ print NR " <=> " asciiart; }
-
-#
-# line contains  "*"
-#
-nstar > 2 && npipe < 3 {
-	printf("\n");
-	for ( i=1; i <= nstar ; i=i+2 ) {
-		this=s[i];
-		put_this();
-		ii=i+1;
-		nbla = split(s[ii],blata," ");
-		if ( ii <= nstar ) {
-			if ( nbla == 1 && substr(s[ii],length(s[ii]),1) != " " ) {
-			printf("*",s[ii]);
-				printf("%s*",s[ii]);
-			} else {
-			printf("*%s*",s[ii]);
-			}
-		}
-	}
-	printf("\n");
-	next;
-	}
-#
-# line contains "|"
-#
-npipe > 2 && nstar < 3 {
-	if  ( npipe%2 == 0 ) {
-		for ( i=1; i < npipe ; i++ ) {
-			gsub("ZWWZ","*",p[i]);
-			printf("%s|",p[i]);
-		}
-		printf("%s\n",p[npipe]);
-		next;
-		}
-	for ( i=1; i <= npipe ; i++ )
-		{
-		if ( i % 2 == 1 ) {
-			gsub("ZWWZ","*",p[i]);
-			this=p[i];
-			put_this();
-			}
-			else {
-			nfn=split(p[i],f,".");
-			if ( nfn == 1 || f[2] == "" || f[1] == "" || length(f[2]) < 3 ) {
-				find_tag1();
-				}
-				else {
-					if ( f[1] == "index" ) {
-		printf "|" p[i] "|";
-					} else {
-						if ( f[1] == "help" ) {
-		printf "|" p[i] "|";
-						} else {
-		printf "|" p[i] "|";
-						}
-					}
-				}
-			}
-		}
-		printf("\n");
-		next;
-	}
-#
-# line contains both "|" and "*"
-#
-npipe > 2 && nstar > 2 {
-	printf("\n");
-	for ( j=1; j <= nstar ; j=j+2 ) {
-		npipe = split(s[j],p,"YXXY");
-		if ( npipe > 1 ) {
-			for ( np=1; np<=npipe; np=np+2 ) {
-				this=p[np];
-				put_this();
-				i=np+1;find_tag1();
-			}
-		} else {
-			this=s[j];
-			put_this();
-		}
-		jj=j+1;
-		nbla = split(s[jj],blata," ");
-		if ( jj <= nstar && nbla == 1 && s[jj] != "" ) {
-		printf("*",s[jj]);
-			printf("%s*",s[jj]);
-		} else {
-			if ( s[jj] != "" ) {
-			printf("*%s*",s[jj]);
-			}
-		}
-	}
-	printf("\n");
-	next;
-	}
-#
-# line contains e-mail address john.doe@some.place.edu
-#
-$0 ~ /@/ && $0 ~ /[a-zA-Z0-9]@[a-z]/ \
-	{
-	nemail=split($0,em," ");
-	if ( substr($0,1,1) == "	" ) { printf("	"); }
-	for ( i=1; i <= nemail; i++ ) {
-		if ( em[i] ~ /@/ ) {
-			if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-2,3) == "gt;" ) {
-				mailaddr=substr(em[i],5,length(em[i])-8);
-				printf("<%s> ",mailaddr,mailaddr);
-			} else {
-				if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-3,3) == "gt;" ) {
-					mailaddr=substr(em[i],5,length(em[i])-9);
-					printf("<%s>%s ",mailaddr,mailaddr,substr(em[i],length(em[i]),1));
-				} else {
-					printf("%s ",em[i],em[i]);
-				}
-			}
-		} else {
-				printf("%s ",em[i]);
-		}
-	}
-	#print "*** " NR " " FILENAME " - possible mail ref";
-	printf("\n");
-	next;
-	}
-#
-# line contains http / ftp reference
-#
-$0 ~ /http:\/\// || $0 ~ /ftp:\/\// {
-	gsub("URL:","");
-	gsub("<","");
-	gsub(">","");
-	gsub("\\(","");
-	gsub("\\)","");
-	nemail=split($0,em," ");
-	for ( i=1; i <= nemail; i++ ) {
-		if ( substr(em[i],1,5) == "http:" ||
-	     	substr(em[i],1,4) == "ftp:" ) {
-			if ( substr(em[i],length(em[i]),1) != "." ) {
-				printf("	%s",em[i],em[i]);
-			} else {
-				em[i]=substr(em[i],1,length(em[i])-1);
-				printf("	%s.",em[i],em[i]);
-			}
-		} else {
-		printf(" %s",em[i]);
-		}
-	}
-	#print "*** " NR " " FILENAME " - possible http ref";
-	printf("\n");
-	next;
-	}
-#
-# some lines contains just one "almost regular" "*"...
-#
-nstar == 2  {
-	this=s[1];
-	put_this();
-	printf("*");
-	this=s[2];
-	put_this();
-	printf("\n");
-	next;
-	}
-#
-# regular line
-#
-	{ ntabs = split($0,tb,"	");
-	for ( i=1; i < ntabs ; i++) {
-		this=tb[i];
-		put_this();
-		printf("	");
-		}
-	this=tb[ntabs];
-	put_this();
-	printf("\n");
-	}
-
-
-asciiart == "yes"  && $0 ~ /\+-\+--/  \
-	&& $0 ~ "scrollbar" { asciiart = "no"; }
-
-END {
-	topback();
-	print "
\n\n\n\n"; } - -# -# as main we keep index.txt (by default) -# -function topback () { - if ( FILENAME != "tags" ) { - if ( FILENAME != "help.txt" ) { - printf("top - "); - printf("main help file\n"); - } else { - printf("top\n"); - } - } -} - -function find_tag1() { - if ( p[i] == "" ) { return; } - if ( tagkey[p[i]] == "yes" ) { - which=tagref[p[i]]; - put_href(); - return; - } - # if not found, then we have a problem - print "============================================" >>"errors.log"; - print FILENAME ", line " NR ", pointer: >>" p[i] "<<" >>"errors.log"; - print $0 >>"errors.log"; - which="intro.html"; - put_href(); -} - -function see_tag() { -# ad-hoc code: -if ( atag == "\"--" || atag == "--\"" ) { return; } -if_already(); -if ( already == "yes" ) { - printf("%s",aword); - return; - } -allow_one_char="no"; -find_tag2(); -if ( done == "yes" ) { return; } -rightchar=substr(atag,length(atag),1); -if ( rightchar == "." \ - || rightchar == "," \ - || rightchar == ":" \ - || rightchar == ";" \ - || rightchar == "!" \ - || rightchar == "?" \ - || rightchar == ")" ) { - atag=substr(atag,1,length(atag)-1); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - find_tag2(); - if ( done == "yes" ) { printf("%s",rightchar);return; } - leftchar=substr(atag,1,1); - lastbut1=substr(atag,length(atag),1); - if ( leftchar == "'" && lastbut1 == "'" ) { - allow_one_char="yes"; - atag=substr(atag,2,length(atag)-2); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - printf("%s",leftchar); - aword=substr(atag,1,length(atag))""lastbut1""rightchar; - find_tag2(); - if ( done == "yes" ) { printf("%s%s",lastbut1,rightchar);return; } - } - } -atag=aword; -leftchar=substr(atag,1,1); -if ( leftchar == "'" && rightchar == "'" ) { - allow_one_char="yes"; - atag=substr(atag,2,length(atag)-2); - if ( atag == "<" ) { printf(" |%s|%s| ",atag,p[2]); } - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - printf("%s",leftchar); - find_tag2(); - if ( done == "yes" ) { printf("%s",rightchar);return; } - printf("%s%s",atag,rightchar); - return; - } -last2=substr(atag,length(atag)-1,2); -first2=substr(atag,1,2); -if ( first2 == "('" && last2 == "')" ) { - allow_one_char="yes"; - atag=substr(atag,3,length(atag)-4); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - printf("%s",first2); - find_tag2(); - if ( done == "yes" ) { printf("%s",last2);return; } - printf("%s%s",atag,last2); - return; - } -if ( last2 == ".)" ) { - atag=substr(atag,1,length(atag)-2); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - find_tag2(); - if ( done == "yes" ) { printf("%s",last2);return; } - printf("%s%s",atag,last2); - return; - } -if ( last2 == ")." ) { - atag=substr(atag,1,length(atag)-2); - find_tag2(); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - if ( done == "yes" ) { printf("%s",last2);return; } - printf("%s%s",atag,last2); - return; - } -first6=substr(atag,1,6); -last6=substr(atag,length(atag)-5,6); -if ( last6 == atag ) { - printf("%s",aword); - return; - } -last6of7=substr(atag,length(atag)-6,6); -if ( first6 == """ && last6of7 == """ && length(atag) > 12 ) { - allow_one_char="yes"; - atag=substr(atag,7,length(atag)-13); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - printf("%s",first6); - find_tag2(); - if ( done == "yes" ) { printf(""%s",rightchar); return; } - printf("%s"%s",atag,rightchar); - return; - } -if ( first6 == """ && last6 != """ ) { - allow_one_char="yes"; - atag=substr(atag,7,length(atag)-6); - if ( atag == "[" ) { printf(""%s",atag); return; } - if ( atag == "." ) { printf(""%s",atag); return; } - if ( atag == ":" ) { printf(""%s",atag); return; } - if ( atag == "a" ) { printf(""%s",atag); return; } - if ( atag == "A" ) { printf(""%s",atag); return; } - if ( atag == "g" ) { printf(""%s",atag); return; } - if_already(); - if ( already == "yes" ) { - printf(""%s",atag); - return; - } - printf("%s",first6); - find_tag2(); - if ( done == "yes" ) { return; } - printf("%s",atag); - return; - } -if ( last6 == """ && first6 == """ ) { - allow_one_char="yes"; - atag=substr(atag,7,length(atag)-12); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - printf("%s",first6); - find_tag2(); - if ( done == "yes" ) { printf("%s",last6);return; } - printf("%s%s",atag,last6); - return; - } -last6of7=substr(atag,length(atag)-6,6); -if ( last6of7 == """ && first6 == """ ) { - allow_one_char="yes"; - atag=substr(atag,7,length(atag)-13); - #printf("\natag=%s,aword=%s\n",atag,aword); - if_already(); - if ( already == "yes" ) { - printf("%s",aword); - return; - } - printf("%s",first6); - find_tag2(); - if ( done == "yes" ) { printf("%s%s",last6of7,rightchar);return; } - printf("%s%s%s",atag,last6of7,rightchar); - return; - } -printf("%s",aword); -} - -function find_tag2() { - done="no"; - # no blanks present in a tag... - ntags=split(atag,blata,"[ ]"); - if ( ntags > 1 ) { return; } - if ( ( allow_one_char == "no" ) && \ - ( index("!#$%&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",atag) !=0 ) ) { - return; - } - if ( skip_word[atag] == "yes" ) { return; } - if ( wasset == "yes" && lineset == NR ) { - wasset="no"; - see_opt(); - if ( done_opt == "yes" ) {return;} - } - if ( wasset == "yes" && lineset != NR ) { - wasset="no"; - } - if ( atag == ":set" ) { - wasset="yes"; - lineset=NR; - } - if ( tagkey[atag] == "yes" ) { - which=tagref[atag]; - put_href2(); - done="yes"; - } -} - -function find_tag3() { - done="no"; - # no blanks present in a tag... - ntags=split(btag,blata,"[ ]"); - if ( ntags > 1 ) { return; } - if ( ( allow_one_char == "no" ) && \ - ( index("!#$%&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",btag) !=0 ) ) { - return; - } - if ( skip_word[btag] == "yes" ) { return; } - if ( tagkey[btag] == "yes" ) { - which=tagref[btag]; - put_href3(); - done="yes"; - } -} - -function put_href() { - if ( p[i] == "" ) { return; } - if ( which == FILENAME ) { - printf("|%s|",p[i],p[i]); - } - else { - nz=split(which,zz,"."); - if ( zz[2] == "txt" || zz[1] == "tags" ) { - printf("|%s|",zz[1],p[i],p[i]); - } - else { - printf("|%s|",p[i],p[i]); - } - } -} - -function put_href2() { - if ( atag == "" ) { return; } - if ( which == FILENAME ) { - printf("%s",atag,atag); - } - else { - nz=split(which,zz,"."); - if ( zz[2] == "txt" || zz[1] == "tags" ) { - printf("%s",zz[1],atag,atag); - } - else { - printf("%s",atag,atag); - } - } -} - -function put_href3() { - if ( btag == "" ) { return; } - if ( which == FILENAME ) { - printf("%s",btag,btag2); - } - else { - nz=split(which,zz,"."); - if ( zz[2] == "txt" || zz[1] == "tags" ) { - printf("%s",zz[1],btag,btag2); - } - else { - printf("%s",btag,btag2); - } - } -} - -function put_this() { - ntab=split(this,ta," "); - for ( nta=1 ; nta <= ntab ; nta++ ) { - ata=ta[nta]; - lata=length(ata); - aword=""; - for ( iata=1 ; iata <=lata ; iata++ ) { - achar=substr(ata,iata,1); - if ( achar != " " ) { aword=aword""achar; } - else { - if ( aword != "" ) { atag=aword; - see_tag(); - aword=""; - printf(" "); } - else { - printf(" "); - } - } - } - if ( aword != "" ) { atag=aword; - see_tag(); - } - if ( nta != ntab ) { printf(" "); } - } -} - -function if_already() { - already="no"; - if ( npipe < 2 ) { return; } - if ( atag == ":au" && p[2] == ":autocmd" ) { already="yes";return; } - for ( npp=2 ; npp <= npipe ; npp=npp+2 ) { - if ( ( (index(p[npp],atag)) != 0 \ - && length(p[npp]) > length(atag) \ - && length(atag) >= 1 \ - ) \ - || (p[npp] == atag) \ - ) { - # printf("p=|%s|,tag=|%s| ",p[npp],atag); - already="yes"; return; } - } -} - -function see_opt() { - done_opt="no"; - stag=atag; - nfields = split(atag,tae,"="); - if ( nfields > 1 ) { - btag="'"tae[1]"'"; - btag2=tae[1]; - find_tag3(); - if (done == "yes") { - for ( ntae=2 ; ntae <= nfields ; ntae++ ) { - printf("=%s",tae[ntae]); - } - atag=stag; - done_opt="yes"; - return; - } - btag=tae[1]; - btag2=tae[1]; - find_tag3(); - if ( done=="yes" ) { - for ( ntae=2 ; ntae <= nfields ; ntae++ ) { - printf("=%s",tae[ntae]); - } - atag=stag; - done_opt="yes"; - return; - } - } - nfields = split(atag,tae,"""); - if ( nfields > 1 ) { - btag="'"tae[1]"'"; - btag2=tae[1]; - find_tag3(); - if (done == "yes") { - printf("""); - atag=stag; - done_opt="yes"; - return; - } - btag=tae[1]; - btag2=tae[1]; - find_tag3(); - if (done == "yes") { - printf("""); - atag=stag; - done_opt="yes"; - return; - } - } - btag="'"tae[1]"'"; - btag2=tae[1]; - find_tag3(); - if (done == "yes") { - atag=stag; - done_opt="yes"; - return; - } - btag=tae[1]; - btag2=tae[1]; - find_tag3(); - if (done == "yes") { - atag=stag; - done_opt="yes"; - return; - } - atag=stag; -} diff --git a/runtime/doc/maketags.awk b/runtime/doc/maketags.awk deleted file mode 100644 index c6b2cd91f3..0000000000 --- a/runtime/doc/maketags.awk +++ /dev/null @@ -1,42 +0,0 @@ -BEGIN { FS=" "; } - -NR == 1 { nf=split(FILENAME,f,".") - print ""; - print "" f[1] ""; - print ""; - print "

Vim Documentation: " f[1] "

"; - print ""; - print "
"; - print "
";
-}
-
-{
-	#
-	# protect special chars
-	#
-	gsub(/&/,"\\&");
-	gsub(/>/,"\\>");
-	gsub(/"tags.ref"
-	n=split($2,w,".");
-	printf ("|%s|	%s\n",w[1],$1,$1,$2);
-}
-
-END     {
-	topback();
-	print "
\n\n\n\n"; - } - -# -# as main we keep index.txt (by default) -# other candidate, help.txt -# -function topback () { - printf("top - "); - printf("back to help\n"); -} -- cgit From b075f49d9229b3e58a4d6677ed8e01db60687fa3 Mon Sep 17 00:00:00 2001 From: August Masquelier <31262046+levouh@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:44:19 -0600 Subject: feat(lsp): add bufnr option to lsp.start (#20473) --- runtime/doc/lsp.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index b3bff89224..d8dcf60c21 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -825,6 +825,8 @@ start({config}, {opts}) *vim.lsp.start()* Predicate used to decide if a client should be re-used. Used on all running clients. The default implementation re-uses a client if name and root_dir matches. + • bufnr (number) Buffer handle to attach to if starting or + re-using a client (0 for current). Return: ~ (number|nil) client_id -- cgit From ddc363dce9020bce7d5bd931929f0d11cc87ad6d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 4 Oct 2022 21:52:01 +0800 Subject: vim-patch:9.0.0656: cannot specify another character to use instead of '@' Problem: Cannot specify another character to use instead of '@' at the end of the window. Solution: Add "lastline" to 'fillchars'. (Martin Tournoij, closes vim/vim#11264, closes vim/vim#10963) https://github.com/vim/vim/commit/4ba5f1dab656103e8f4a4505452d1816b9e83c1e Use latest code in drawscreen.c instead. --- runtime/doc/options.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 5871b82d9c..b6431c9a40 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2148,6 +2148,9 @@ A jump table for the options with a short description can be found at |Q_op|. When neither "lastline" nor "truncate" is included, a last line that doesn't fit is replaced with "@" lines. + The "@" character can be changed by setting the "lastline" item in + 'fillchars'. The character is highlighted with |hl-NonText|. + *'eadirection'* *'ead'* 'eadirection' 'ead' string (default "both") global @@ -2483,6 +2486,7 @@ A jump table for the options with a short description can be found at |Q_op|. diff '-' deleted lines of the 'diff' option msgsep ' ' message separator 'display' eob '~' empty lines at the end of a buffer + lastline '@' 'display' contains lastline/truncate Any one that is omitted will fall back to the default. For "stl" and "stlnc" the space will be used when there is highlighting, '^' or '=' @@ -2520,6 +2524,7 @@ A jump table for the options with a short description can be found at |Q_op|. fold Folded |hl-Folded| diff DiffDelete |hl-DiffDelete| eob EndOfBuffer |hl-EndOfBuffer| + lastline NonText |hl-NonText| *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'* 'fixendofline' 'fixeol' boolean (default on) -- cgit From 06f4edc864479fb121d514ec1e7253dba85b740d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 5 Oct 2022 10:56:53 +0200 Subject: vim-patch:partial:f269eabc6c4f (#20470) Update runtime files https://github.com/vim/vim/commit/f269eabc6c4f5bdcef989cd5b4b95ba8ccaa4d8a --- runtime/doc/builtin.txt | 12 +++++++++--- runtime/doc/fold.txt | 2 +- runtime/doc/insert.txt | 14 +++++++------- runtime/doc/options.txt | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 9de8db1f43..ad757981b0 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -6,6 +6,8 @@ Builtin functions *builtin-functions* +For functions grouped by what they are used for see |function-list|. + Type |gO| to see the table of contents. ============================================================================== @@ -6168,7 +6170,9 @@ reg_recording() *reg_recording()* Returns the single letter name of the register being recorded. Returns an empty string when not recording. See |q|. -reltime([{start} [, {end}]]) *reltime()* +reltime() +reltime({start}) +reltime({start}, {end}) *reltime()* Return an item that represents a time value. The item is a list with items that depend on the system. The item can be passed to |reltimestr()| to convert it to a @@ -6222,7 +6226,8 @@ reltimestr({time}) *reltimestr()* Can also be used as a |method|: > reltime(start)->reltimestr() < -remove({list}, {idx} [, {end}]) *remove()* +remove({list}, {idx}) +remove({list}, {idx}, {end}) *remove()* Without {end}: Remove the item at {idx} from |List| {list} and return the item. With {end}: Remove items from {idx} to {end} (inclusive) and @@ -6240,7 +6245,8 @@ remove({list}, {idx} [, {end}]) *remove()* Can also be used as a |method|: > mylist->remove(idx) -remove({blob}, {idx} [, {end}]) +remove({blob}, {idx}) +remove({blob}, {idx}, {end}) Without {end}: Remove the byte at {idx} from |Blob| {blob} and return the byte. With {end}: Remove bytes from {idx} to {end} (inclusive) and diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 9e3d78faff..e97a0a6459 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -491,7 +491,7 @@ is evaluated to obtain the text displayed for a closed fold. Example: > This shows the first line of the fold, with "/*", "*/" and "{{{" removed. Note the use of backslashes to avoid some characters to be interpreted by the -":set" command. It's simpler to define a function and call that: > +":set" command. It is much simpler to define a function and call it: > :set foldtext=MyFoldText() :function MyFoldText() diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 63ceab78a8..792c6ee6f4 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -650,9 +650,9 @@ When the popup menu is displayed there are a few more special keys, see |popupmenu-keys|. Note: The keys that are valid in CTRL-X mode are not mapped. This allows for -":map ^F ^X^F" to work (where ^F is CTRL-F and ^X is CTRL-X). The key that -ends CTRL-X mode (any key that is not a valid CTRL-X mode command) is mapped. -Also, when doing completion with 'complete' mappings apply as usual. +`:map ` to work. The key that ends CTRL-X mode (any key that +is not a valid CTRL-X mode command) is mapped. Also, when doing completion +with 'complete' mappings apply as usual. *E565* Note: While completion is active Insert mode can't be used recursively and @@ -661,10 +661,10 @@ will generate an E565 error. The following mappings are suggested to make typing the completion commands a bit easier (although they will hide other commands): > - :inoremap ^] ^X^] - :inoremap ^F ^X^F - :inoremap ^D ^X^D - :inoremap ^L ^X^L + :inoremap + :inoremap + :inoremap + :inoremap As a special case, typing CTRL-R to perform register insertion (see |i_CTRL-R|) will not exit CTRL-X mode. This is primarily to allow the use of diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index b6431c9a40..15fc551dd9 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2130,7 +2130,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'display'* *'dy'* 'display' 'dy' string (default "lastline,msgsep") global - Change the way text is displayed. This is comma-separated list of + Change the way text is displayed. This is a comma-separated list of flags: lastline When included, as much as possible of the last line in a window will be displayed. "@@@" is put in the -- cgit From 18afacee1d98b9987391b8bdef08282fb156fa88 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 5 Oct 2022 08:15:55 -0400 Subject: feat(docs): format parameters as a list #20485 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: The {foo} parameters listed in `:help api` and similar generated docs, are intended to be a "list" but they aren't prefixed with a list symbol. This prevents parsers from understanding the list, which forces generators like `gen_help_html.lua` to use hard-wrapped/preformatted layout instead of a soft-wrapped "flow" layout. Solution: Modify gen_vimdoc.py to prefix {foo} parameters with a "•" symbol. --- runtime/doc/api.txt | 590 ++++++++++++++++++++++----------------------- runtime/doc/diagnostic.txt | 74 +++--- runtime/doc/lsp.txt | 338 +++++++++++++------------- runtime/doc/lua.txt | 180 +++++++------- runtime/doc/treesitter.txt | 180 +++++++------- 5 files changed, 681 insertions(+), 681 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 6f7f0bf416..6ffef22ec3 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -545,9 +545,9 @@ nvim__get_runtime({pat}, {all}, {*opts}) *nvim__get_runtime()* |api-fast| Parameters: ~ - {pat} pattern of files to search for - {all} whether to return all matches or only the first - {opts} is_lua: only search lua subdirs + • {pat} pattern of files to search for + • {all} whether to return all matches or only the first + • {opts} is_lua: only search lua subdirs Return: ~ list of absolute paths to the found files @@ -559,7 +559,7 @@ nvim__id({obj}) *nvim__id()* in plugins. Parameters: ~ - {obj} Object to return. + • {obj} Object to return. Return: ~ its argument. @@ -571,7 +571,7 @@ nvim__id_array({arr}) *nvim__id_array()* in plugins. Parameters: ~ - {arr} Array to return. + • {arr} Array to return. Return: ~ its argument. @@ -583,7 +583,7 @@ nvim__id_dictionary({dct}) *nvim__id_dictionary()* in plugins. Parameters: ~ - {dct} Dictionary to return. + • {dct} Dictionary to return. Return: ~ its argument. @@ -595,7 +595,7 @@ nvim__id_float({flt}) *nvim__id_float()* in plugins. Parameters: ~ - {flt} Value to return. + • {flt} Value to return. Return: ~ its argument. @@ -625,7 +625,7 @@ nvim_call_atomic({calls}) *nvim_call_atomic()* |RPC| only Parameters: ~ - {calls} an array of calls, where each call is described by an array + • {calls} an array of calls, where each call is described by an array with two elements: the request name, and an array of arguments. @@ -652,15 +652,15 @@ nvim_chan_send({chan}, {data}) *nvim_chan_send()* |vim.api| only Parameters: ~ - {chan} id of the channel - {data} data to write. 8-bit clean: can contain NUL bytes. + • {chan} id of the channel + • {data} data to write. 8-bit clean: can contain NUL bytes. nvim_create_buf({listed}, {scratch}) *nvim_create_buf()* Creates a new, empty, unnamed buffer. Parameters: ~ - {listed} Sets 'buflisted' - {scratch} Creates a "throwaway" |scratch-buffer| for temporary work + • {listed} Sets 'buflisted' + • {scratch} Creates a "throwaway" |scratch-buffer| for temporary work (always 'nomodified'). Also sets 'nomodeline' on the buffer. @@ -691,7 +691,7 @@ nvim_del_mark({name}) *nvim_del_mark()* fails with error if a lowercase or buffer local named mark is used. Parameters: ~ - {name} Mark name + • {name} Mark name Return: ~ true if the mark was deleted, else false. @@ -704,31 +704,31 @@ nvim_del_var({name}) *nvim_del_var()* Removes a global (g:) variable. Parameters: ~ - {name} Variable name + • {name} Variable name nvim_echo({chunks}, {history}, {opts}) *nvim_echo()* Echo a message. Parameters: ~ - {chunks} A list of [text, hl_group] arrays, each representing a text + • {chunks} A list of [text, hl_group] arrays, each representing a text chunk with specified highlight. `hl_group` element can be omitted for no highlight. - {history} if true, add to |message-history|. - {opts} Optional parameters. Reserved for future use. + • {history} if true, add to |message-history|. + • {opts} Optional parameters. Reserved for future use. nvim_err_write({str}) *nvim_err_write()* Writes a message to the Vim error buffer. Does not append "\n", the message is buffered (won't display) until a linefeed is written. Parameters: ~ - {str} Message + • {str} Message nvim_err_writeln({str}) *nvim_err_writeln()* Writes a message to the Vim error buffer. Appends "\n", so the buffer is flushed (and displayed). Parameters: ~ - {str} Message + • {str} Message See also: ~ nvim_err_write() @@ -740,8 +740,8 @@ nvim_eval_statusline({str}, {*opts}) *nvim_eval_statusline()* |api-fast| Parameters: ~ - {str} Statusline string (see 'statusline'). - {opts} Optional parameters. + • {str} Statusline string (see 'statusline'). + • {opts} Optional parameters. • winid: (number) |window-ID| of the window to use as context for statusline. • maxwidth: (number) Maximum width of statusline. @@ -776,8 +776,8 @@ nvim_exec_lua({code}, {args}) *nvim_exec_lua()* |RPC| only Parameters: ~ - {code} Lua code to execute - {args} Arguments to the code + • {code} Lua code to execute + • {args} Arguments to the code Return: ~ Return value of Lua code if present or NIL. @@ -798,9 +798,9 @@ nvim_feedkeys({keys}, {mode}, {escape_ks}) *nvim_feedkeys()* < Parameters: ~ - {keys} to be typed - {mode} behavior flags, see |feedkeys()| - {escape_ks} If true, escape K_SPECIAL bytes in `keys` This should be + • {keys} to be typed + • {mode} behavior flags, see |feedkeys()| + • {escape_ks} If true, escape K_SPECIAL bytes in `keys` This should be false if you already used |nvim_replace_termcodes()|, and true otherwise. @@ -854,7 +854,7 @@ nvim_get_color_by_name({name}) *nvim_get_color_by_name()* < Parameters: ~ - {name} Color name or "#rrggbb" string + • {name} Color name or "#rrggbb" string Return: ~ 24-bit RGB value, or -1 for invalid argument. @@ -872,7 +872,7 @@ nvim_get_context({*opts}) *nvim_get_context()* Gets a map of the current editor state. Parameters: ~ - {opts} Optional parameters. + • {opts} Optional parameters. • types: List of |context-types| ("regs", "jumps", "bufs", "gvars", …) to gather, or empty for "all". @@ -907,8 +907,8 @@ nvim_get_hl_by_id({hl_id}, {rgb}) *nvim_get_hl_by_id()* Gets a highlight definition by id. |hlID()| Parameters: ~ - {hl_id} Highlight id as returned by |hlID()| - {rgb} Export RGB colors + • {hl_id} Highlight id as returned by |hlID()| + • {rgb} Export RGB colors Return: ~ Highlight definition map @@ -920,8 +920,8 @@ nvim_get_hl_by_name({name}, {rgb}) *nvim_get_hl_by_name()* Gets a highlight definition by name. Parameters: ~ - {name} Highlight group name - {rgb} Export RGB colors + • {name} Highlight group name + • {rgb} Export RGB colors Return: ~ Highlight definition map @@ -938,7 +938,7 @@ nvim_get_keymap({mode}) *nvim_get_keymap()* Gets a list of global (non-buffer-local) |mapping| definitions. Parameters: ~ - {mode} Mode short-name ("n", "i", "v", ...) + • {mode} Mode short-name ("n", "i", "v", ...) Return: ~ Array of |maparg()|-like dictionaries describing mappings. The @@ -954,8 +954,8 @@ nvim_get_mark({name}, {opts}) *nvim_get_mark()* fails with error if a lowercase or buffer local named mark is used. Parameters: ~ - {name} Mark name - {opts} Optional parameters. Reserved for future use. + • {name} Mark name + • {opts} Optional parameters. Reserved for future use. Return: ~ 4-tuple (row, col, buffer, buffername), (0, 0, 0, '') if the mark is @@ -1001,8 +1001,8 @@ nvim_get_runtime_file({name}, {all}) *nvim_get_runtime_file()* |api-fast| Parameters: ~ - {name} pattern of files to search for - {all} whether to return all matches or only the first + • {name} pattern of files to search for + • {all} whether to return all matches or only the first Return: ~ list of absolute paths to the found files @@ -1011,7 +1011,7 @@ nvim_get_var({name}) *nvim_get_var()* Gets a global (g:) variable. Parameters: ~ - {name} Variable name + • {name} Variable name Return: ~ Variable value @@ -1020,7 +1020,7 @@ nvim_get_vvar({name}) *nvim_get_vvar()* Gets a v: variable. Parameters: ~ - {name} Variable name + • {name} Variable name Return: ~ Variable value @@ -1044,7 +1044,7 @@ nvim_input({keys}) *nvim_input()* |api-fast| Parameters: ~ - {keys} to be typed + • {keys} to be typed Return: ~ Number of bytes actually written (can be fewer than requested if the @@ -1068,18 +1068,18 @@ nvim_input_mouse({button}, {action}, {modifier}, {grid}, {row}, {col}) |api-fast| Parameters: ~ - {button} Mouse button: one of "left", "right", "middle", "wheel", + • {button} Mouse button: one of "left", "right", "middle", "wheel", "move". - {action} For ordinary buttons, one of "press", "drag", "release". + • {action} For ordinary buttons, one of "press", "drag", "release". For the wheel, one of "up", "down", "left", "right". Ignored for "move". - {modifier} String of modifiers each represented by a single char. The + • {modifier} String of modifiers each represented by a single char. The same specifiers are used as for a key press, except that the "-" separator is optional, so "C-A-", "c-a" and "CA" can all be used to specify Ctrl+Alt+click. - {grid} Grid number if the client uses |ui-multigrid|, else 0. - {row} Mouse row-position (zero-based, like redraw events) - {col} Mouse column-position (zero-based, like redraw events) + • {grid} Grid number if the client uses |ui-multigrid|, else 0. + • {row} Mouse row-position (zero-based, like redraw events) + • {col} Mouse column-position (zero-based, like redraw events) nvim_list_bufs() *nvim_list_bufs()* Gets the current list of buffer handles @@ -1130,7 +1130,7 @@ nvim_load_context({dict}) *nvim_load_context()* Sets the current editor state from the given |context| map. Parameters: ~ - {dict} |Context| map. + • {dict} |Context| map. nvim_notify({msg}, {log_level}, {opts}) *nvim_notify()* Notify the user with a message @@ -1139,9 +1139,9 @@ nvim_notify({msg}, {log_level}, {opts}) *nvim_notify()* echo area but can be overridden to trigger desktop notifications. Parameters: ~ - {msg} Message to display to the user - {log_level} The log level - {opts} Reserved for future use. + • {msg} Message to display to the user + • {log_level} The log level + • {opts} Reserved for future use. nvim_open_term({buffer}, {opts}) *nvim_open_term()* Open a terminal instance in a buffer @@ -1159,8 +1159,8 @@ nvim_open_term({buffer}, {opts}) *nvim_open_term()* virtual terminal having the intended size. Parameters: ~ - {buffer} the buffer to use (expected to be empty) - {opts} Optional parameters. + • {buffer} the buffer to use (expected to be empty) + • {opts} Optional parameters. • on_input: lua callback for input sent, i e keypresses in terminal mode. Note: keypresses are sent raw as they would be to the pty master end. For instance, a carriage return @@ -1176,7 +1176,7 @@ nvim_out_write({str}) *nvim_out_write()* message is buffered (won't display) until a linefeed is written. Parameters: ~ - {str} Message + • {str} Message nvim_paste({data}, {crlf}, {phase}) *nvim_paste()* Pastes at cursor, in any mode. @@ -1193,9 +1193,9 @@ nvim_paste({data}, {crlf}, {phase}) *nvim_paste()* not allowed when |textlock| is active Parameters: ~ - {data} Multiline input. May be binary (containing NUL bytes). - {crlf} Also break lines at CR and CRLF. - {phase} -1: paste in a single call (i.e. without streaming). To + • {data} Multiline input. May be binary (containing NUL bytes). + • {crlf} Also break lines at CR and CRLF. + • {phase} -1: paste in a single call (i.e. without streaming). To "stream" a paste, call `nvim_paste` sequentially with these `phase` values: • 1: starts the paste (exactly once) • 2: continues the paste (zero or more times) @@ -1215,15 +1215,15 @@ nvim_put({lines}, {type}, {after}, {follow}) *nvim_put()* not allowed when |textlock| is active Parameters: ~ - {lines} |readfile()|-style list of lines. |channel-lines| - {type} Edit behavior: any |getregtype()| result, or: + • {lines} |readfile()|-style list of lines. |channel-lines| + • {type} Edit behavior: any |getregtype()| result, or: • "b" |blockwise-visual| mode (may include width, e.g. "b3") • "c" |charwise| mode • "l" |linewise| mode • "" guess by contents, see |setreg()| - {after} If true insert after cursor (like |p|), or before (like + • {after} If true insert after cursor (like |p|), or before (like |P|). - {follow} If true place cursor at end of inserted text. + • {follow} If true place cursor at end of inserted text. *nvim_replace_termcodes()* nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special}) @@ -1231,10 +1231,10 @@ nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special}) the internal representation. Parameters: ~ - {str} String to be converted. - {from_part} Legacy Vim parameter. Usually true. - {do_lt} Also translate . Ignored if `special` is false. - {special} Replace |keycodes|, e.g. becomes a "\r" char. + • {str} String to be converted. + • {from_part} Legacy Vim parameter. Usually true. + • {do_lt} Also translate . Ignored if `special` is false. + • {special} Replace |keycodes|, e.g. becomes a "\r" char. See also: ~ replace_termcodes @@ -1250,12 +1250,12 @@ nvim_select_popupmenu_item({item}, {insert}, {finish}, {opts}) ensure the mapping doesn't end completion mode. Parameters: ~ - {item} Index (zero-based) of the item to select. Value of -1 + • {item} Index (zero-based) of the item to select. Value of -1 selects nothing and restores the original text. - {insert} Whether the selection should be inserted in the buffer. - {finish} Finish the completion and dismiss the popupmenu. Implies + • {insert} Whether the selection should be inserted in the buffer. + • {finish} Finish the completion and dismiss the popupmenu. Implies `insert`. - {opts} Optional parameters. Reserved for future use. + • {opts} Optional parameters. Reserved for future use. *nvim_set_client_info()* nvim_set_client_info({name}, {version}, {type}, {methods}, {attributes}) @@ -1277,8 +1277,8 @@ nvim_set_client_info({name}, {version}, {type}, {methods}, {attributes}) |RPC| only Parameters: ~ - {name} Short name for the connected client - {version} Dictionary describing the version, with these (optional) + • {name} Short name for the connected client + • {version} Dictionary describing the version, with these (optional) keys: • "major" major version (defaults to 0 if not set, for no release yet) @@ -1287,7 +1287,7 @@ nvim_set_client_info({name}, {version}, {type}, {methods}, {attributes}) • "prerelease" string describing a prerelease, like "dev" or "beta1" • "commit" hash or similar identifier of commit - {type} Must be one of the following values. Client libraries + • {type} Must be one of the following values. Client libraries should default to "remote" unless overridden by the user. • "remote" remote client connected to Nvim. @@ -1296,7 +1296,7 @@ nvim_set_client_info({name}, {version}, {type}, {methods}, {attributes}) example, IDE/editor implementing a vim mode). • "host" plugin host, typically started by nvim • "plugin" single plugin, started by nvim - {methods} Builtin methods in the client. For a host, this does not + • {methods} Builtin methods in the client. For a host, this does not include plugin methods which will be discovered later. The key should be the method name, the values are dicts with these (optional) keys (more keys may be added in @@ -1308,7 +1308,7 @@ nvim_set_client_info({name}, {version}, {type}, {methods}, {attributes}) • "nargs" Number of arguments. Could be a single integer or an array of two integers, minimum and maximum inclusive. - {attributes} Arbitrary string:string map of informal client + • {attributes} Arbitrary string:string map of informal client properties. Suggested keys: • "website": Client homepage URL (e.g. GitHub repository) @@ -1324,13 +1324,13 @@ nvim_set_current_buf({buffer}) *nvim_set_current_buf()* not allowed when |textlock| is active Parameters: ~ - {buffer} Buffer handle + • {buffer} Buffer handle nvim_set_current_dir({dir}) *nvim_set_current_dir()* Changes the global working directory. Parameters: ~ - {dir} Directory path + • {dir} Directory path nvim_set_current_line({line}) *nvim_set_current_line()* Sets the current line. @@ -1339,7 +1339,7 @@ nvim_set_current_line({line}) *nvim_set_current_line()* not allowed when |textlock| is active Parameters: ~ - {line} Line contents + • {line} Line contents nvim_set_current_tabpage({tabpage}) *nvim_set_current_tabpage()* Sets the current tabpage. @@ -1348,7 +1348,7 @@ nvim_set_current_tabpage({tabpage}) *nvim_set_current_tabpage()* not allowed when |textlock| is active Parameters: ~ - {tabpage} Tabpage handle + • {tabpage} Tabpage handle nvim_set_current_win({window}) *nvim_set_current_win()* Sets the current window. @@ -1357,7 +1357,7 @@ nvim_set_current_win({window}) *nvim_set_current_win()* not allowed when |textlock| is active Parameters: ~ - {window} Window handle + • {window} Window handle nvim_set_hl({ns_id}, {name}, {*val}) *nvim_set_hl()* Sets a highlight group. @@ -1375,10 +1375,10 @@ nvim_set_hl({ns_id}, {name}, {*val}) *nvim_set_hl()* using these values results in an error. Parameters: ~ - {ns_id} Namespace id for this highlight |nvim_create_namespace()|. + • {ns_id} Namespace id for this highlight |nvim_create_namespace()|. Use 0 to set a highlight group globally |:highlight|. - {name} Highlight group name, e.g. "ErrorMsg" - {val} Highlight definition map, accepts the following keys: + • {name} Highlight group name, e.g. "ErrorMsg" + • {val} Highlight definition map, accepts the following keys: • fg (or foreground): color name or "#RRGGBB", see note. • bg (or background): color name or "#RRGGBB", see note. • sp (or special): color name or "#RRGGBB" @@ -1408,7 +1408,7 @@ nvim_set_hl_ns({ns_id}) *nvim_set_hl_ns()* see |nvim_win_set_hl_ns()|. Parameters: ~ - {ns_id} the namespace to use + • {ns_id} the namespace to use nvim_set_hl_ns_fast({ns_id}) *nvim_set_hl_ns_fast()* Set active namespace for highlights while redrawing. @@ -1421,7 +1421,7 @@ nvim_set_hl_ns_fast({ns_id}) *nvim_set_hl_ns_fast()* |api-fast| Parameters: ~ - {ns_id} the namespace to activate + • {ns_id} the namespace to activate nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()* Sets a global |mapping| for the given mode. @@ -1440,11 +1440,11 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()* < Parameters: ~ - {mode} Mode short-name (map command prefix: "n", "i", "v", "x", …) or + • {mode} Mode short-name (map command prefix: "n", "i", "v", "x", …) or "!" for |:map!|, or empty string for |:map|. - {lhs} Left-hand-side |{lhs}| of the mapping. - {rhs} Right-hand-side |{rhs}| of the mapping. - {opts} Optional parameters map: keys are |:map-arguments|, values are + • {lhs} Left-hand-side |{lhs}| of the mapping. + • {rhs} Right-hand-side |{rhs}| of the mapping. + • {opts} Optional parameters map: keys are |:map-arguments|, values are booleans (default false). Accepts all |:map-arguments| as keys excluding || but including |:noremap| and "desc". Unknown key is an error. "desc" can be used to give a @@ -1459,22 +1459,22 @@ nvim_set_var({name}, {value}) *nvim_set_var()* Sets a global (g:) variable. Parameters: ~ - {name} Variable name - {value} Variable value + • {name} Variable name + • {value} Variable value nvim_set_vvar({name}, {value}) *nvim_set_vvar()* Sets a v: variable, if it is not readonly. Parameters: ~ - {name} Variable name - {value} Variable value + • {name} Variable name + • {value} Variable value nvim_strwidth({text}) *nvim_strwidth()* Calculates the number of display cells occupied by `text`. Control characters including count as one cell. Parameters: ~ - {text} Some text + • {text} Some text Return: ~ Number of cells @@ -1486,7 +1486,7 @@ nvim_subscribe({event}) *nvim_subscribe()* |RPC| only Parameters: ~ - {event} Event type string + • {event} Event type string nvim_unsubscribe({event}) *nvim_unsubscribe()* Unsubscribes to event broadcasts. @@ -1495,7 +1495,7 @@ nvim_unsubscribe({event}) *nvim_unsubscribe()* |RPC| only Parameters: ~ - {event} Event type string + • {event} Event type string ============================================================================== @@ -1508,9 +1508,9 @@ nvim_call_dict_function({dict}, {fn}, {args}) On execution error: fails with VimL error, updates v:errmsg. Parameters: ~ - {dict} Dictionary, or String evaluating to a VimL |self| dict - {fn} Name of the function defined on the VimL dict - {args} Function arguments packed in an Array + • {dict} Dictionary, or String evaluating to a VimL |self| dict + • {fn} Name of the function defined on the VimL dict + • {args} Function arguments packed in an Array Return: ~ Result of the function call @@ -1521,8 +1521,8 @@ nvim_call_function({fn}, {args}) *nvim_call_function()* On execution error: fails with VimL error, updates v:errmsg. Parameters: ~ - {fn} Function to call - {args} Function arguments packed in an Array + • {fn} Function to call + • {args} Function arguments packed in an Array Return: ~ Result of the function call @@ -1539,7 +1539,7 @@ nvim_command({command}) *nvim_command()* |nvim_parse_cmd()| in conjunction with |nvim_cmd()|. Parameters: ~ - {command} Ex command string + • {command} Ex command string nvim_eval({expr}) *nvim_eval()* Evaluates a VimL |expression|. Dictionaries and Lists are recursively @@ -1548,7 +1548,7 @@ nvim_eval({expr}) *nvim_eval()* On execution error: fails with VimL error, updates v:errmsg. Parameters: ~ - {expr} VimL expression string + • {expr} VimL expression string Return: ~ Evaluation result or expanded object @@ -1563,8 +1563,8 @@ nvim_exec({src}, {output}) *nvim_exec()* On execution error: fails with VimL error, updates v:errmsg. Parameters: ~ - {src} Vimscript code - {output} Capture and return all (non-error, non-shell |:!|) output + • {src} Vimscript code + • {output} Capture and return all (non-error, non-shell |:!|) output Return: ~ Output (non-error, non-shell |:!|) if `output` is true, else empty @@ -1583,8 +1583,8 @@ nvim_parse_expression({expr}, {flags}, {highlight}) |api-fast| Parameters: ~ - {expr} Expression to parse. Always treated as a single line. - {flags} Flags: + • {expr} Expression to parse. Always treated as a single line. + • {flags} Flags: • "m" if multiple expressions in a row are allowed (only the first one will be parsed), • "E" if EOC tokens are not allowed (determines whether @@ -1596,7 +1596,7 @@ nvim_parse_expression({expr}, {flags}, {highlight}) • "E" to parse like for "=". • empty string for ":call". • "lm" to parse for ":let". - {highlight} If true, return value will also include "highlight" key + • {highlight} If true, return value will also include "highlight" key containing array of 4-tuples (arrays) (Integer, Integer, Integer, String), where first three numbers define the highlighted region and represent line, starting column @@ -1664,7 +1664,7 @@ nvim_buf_create_user_command({buffer}, {name}, {command}, {*opts}) Create a new user command |user-commands| in the given buffer. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer. + • {buffer} Buffer handle, or 0 for current buffer. See also: ~ nvim_create_user_command @@ -1677,15 +1677,15 @@ nvim_buf_del_user_command({buffer}, {name}) |nvim_buf_create_user_command()| can be deleted with this function. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer. - {name} Name of the command to delete. + • {buffer} Buffer handle, or 0 for current buffer. + • {name} Name of the command to delete. nvim_buf_get_commands({buffer}, {*opts}) *nvim_buf_get_commands()* Gets a map of buffer-local |user-commands|. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {opts} Optional parameters. Currently not used. + • {buffer} Buffer handle, or 0 for current buffer + • {opts} Optional parameters. Currently not used. Return: ~ Map of maps describing commands. @@ -1708,11 +1708,11 @@ nvim_cmd({*cmd}, {*opts}) *nvim_cmd()* On execution error: fails with VimL error, updates v:errmsg. Parameters: ~ - {cmd} Command to execute. Must be a Dictionary that can contain the + • {cmd} Command to execute. Must be a Dictionary that can contain the same values as the return value of |nvim_parse_cmd()| except "addr", "nargs" and "nextcmd" which are ignored if provided. All values except for "cmd" are optional. - {opts} Optional parameters. + • {opts} Optional parameters. • output: (boolean, default false) Whether to return command output. @@ -1740,9 +1740,9 @@ nvim_create_user_command({name}, {command}, {*opts}) < Parameters: ~ - {name} Name of the new user command. Must begin with an uppercase + • {name} Name of the new user command. Must begin with an uppercase letter. - {command} Replacement command to execute when this user command is + • {command} Replacement command to execute when this user command is executed. When called from Lua, the command can also be a Lua function. The function is called with a single table argument that contains the following keys: @@ -1765,7 +1765,7 @@ nvim_create_user_command({name}, {command}, {*opts}) • smods: (table) Command modifiers in a structured format. Has the same structure as the "mods" key of |nvim_parse_cmd()|. - {opts} Optional command attributes. See |command-attributes| for + • {opts} Optional command attributes. See |command-attributes| for more details. To use boolean attributes (such as |:command-bang| or |:command-bar|) set the value to "true". In addition to the string options listed in @@ -1783,7 +1783,7 @@ nvim_del_user_command({name}) *nvim_del_user_command()* Delete a user-defined command. Parameters: ~ - {name} Name of the command to delete. + • {name} Name of the command to delete. nvim_get_commands({*opts}) *nvim_get_commands()* Gets a map of global (non-buffer-local) Ex commands. @@ -1791,7 +1791,7 @@ nvim_get_commands({*opts}) *nvim_get_commands()* Currently only |user-commands| are supported, not builtin Ex commands. Parameters: ~ - {opts} Optional parameters. Currently only supports {"builtin":false} + • {opts} Optional parameters. Currently only supports {"builtin":false} Return: ~ Map of maps describing commands. @@ -1805,8 +1805,8 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* |api-fast| Parameters: ~ - {str} Command line string to parse. Cannot contain "\n". - {opts} Optional parameters. Reserved for future use. + • {str} Command line string to parse. Cannot contain "\n". + • {opts} Optional parameters. Reserved for future use. Return: ~ Dictionary containing command information, with these keys: @@ -1874,8 +1874,8 @@ nvim_buf_get_option({buffer}, {name}) *nvim_buf_get_option()* Gets a buffer option value Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {name} Option name + • {buffer} Buffer handle, or 0 for current buffer + • {name} Option name Return: ~ Option value @@ -1885,9 +1885,9 @@ nvim_buf_set_option({buffer}, {name}, {value}) *nvim_buf_set_option()* (only works if there's a global fallback) Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {name} Option name - {value} Option value + • {buffer} Buffer handle, or 0 for current buffer + • {name} Option name + • {value} Option value nvim_get_all_options_info() *nvim_get_all_options_info()* Gets the option information for all options. @@ -1902,7 +1902,7 @@ nvim_get_option({name}) *nvim_get_option()* Gets the global value of an option. Parameters: ~ - {name} Option name + • {name} Option name Return: ~ Option value (global) @@ -1925,7 +1925,7 @@ nvim_get_option_info({name}) *nvim_get_option_info()* • flaglist: List of single char flags Parameters: ~ - {name} Option name + • {name} Option name Return: ~ Option Information @@ -1937,8 +1937,8 @@ nvim_get_option_value({name}, {*opts}) *nvim_get_option_value()* current buffer or window, unless "buf" or "win" is set in {opts}. Parameters: ~ - {name} Option name - {opts} Optional parameters + • {name} Option name + • {opts} Optional parameters • scope: One of "global" or "local". Analogous to |:setglobal| and |:setlocal|, respectively. • win: |window-ID|. Used for getting window local options. @@ -1952,8 +1952,8 @@ nvim_set_option({name}, {value}) *nvim_set_option()* Sets the global value of an option. Parameters: ~ - {name} Option name - {value} New option value + • {name} Option name + • {value} New option value *nvim_set_option_value()* nvim_set_option_value({name}, {value}, {*opts}) @@ -1964,9 +1964,9 @@ nvim_set_option_value({name}, {value}, {*opts}) Note the options {win} and {buf} cannot be used together. Parameters: ~ - {name} Option name - {value} New option value - {opts} Optional parameters + • {name} Option name + • {value} New option value + • {opts} Optional parameters • scope: One of "global" or "local". Analogous to |:setglobal| and |:setlocal|, respectively. • win: |window-ID|. Used for setting window local option. @@ -1976,8 +1976,8 @@ nvim_win_get_option({window}, {name}) *nvim_win_get_option()* Gets a window option value Parameters: ~ - {window} Window handle, or 0 for current window - {name} Option name + • {window} Window handle, or 0 for current window + • {name} Option name Return: ~ Option value @@ -1987,9 +1987,9 @@ nvim_win_set_option({window}, {name}, {value}) *nvim_win_set_option()* (only works if there's a global fallback) Parameters: ~ - {window} Window handle, or 0 for current window - {name} Option name - {value} Option value + • {window} Window handle, or 0 for current window + • {name} Option name + • {value} Option value ============================================================================== @@ -2020,13 +2020,13 @@ nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()* < Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {send_buffer} True if the initial notification should contain the + • {buffer} Buffer handle, or 0 for current buffer + • {send_buffer} True if the initial notification should contain the whole buffer: first notification will be `nvim_buf_lines_event`. Else the first notification will be `nvim_buf_changedtick_event`. Not for Lua callbacks. - {opts} Optional parameters. + • {opts} Optional parameters. • on_lines: Lua callback invoked on change. Return `true` to detach. Args: • the string "lines" • buffer handle @@ -2100,8 +2100,8 @@ nvim_buf_call({buffer}, {fun}) *nvim_buf_call()* |vim.api| only Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {fun} Function to call inside the buffer (currently lua callable + • {buffer} Buffer handle, or 0 for current buffer + • {fun} Function to call inside the buffer (currently lua callable only) Return: ~ @@ -2112,7 +2112,7 @@ nvim_buf_del_keymap({buffer}, {mode}, {lhs}) *nvim_buf_del_keymap()* Unmaps a buffer-local |mapping| for the given mode. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer See also: ~ |nvim_del_keymap()| @@ -2125,8 +2125,8 @@ nvim_buf_del_mark({buffer}, {name}) *nvim_buf_del_mark()* buffer it will return false. Parameters: ~ - {buffer} Buffer to set the mark on - {name} Mark name + • {buffer} Buffer to set the mark on + • {name} Mark name Return: ~ true if the mark was deleted, else false. @@ -2139,8 +2139,8 @@ nvim_buf_del_var({buffer}, {name}) *nvim_buf_del_var()* Removes a buffer-scoped (b:) variable Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {name} Variable name + • {buffer} Buffer handle, or 0 for current buffer + • {name} Variable name nvim_buf_delete({buffer}, {opts}) *nvim_buf_delete()* Deletes the buffer. See |:bwipeout| @@ -2149,8 +2149,8 @@ nvim_buf_delete({buffer}, {opts}) *nvim_buf_delete()* not allowed when |textlock| is active Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {opts} Optional parameters. Keys: + • {buffer} Buffer handle, or 0 for current buffer + • {opts} Optional parameters. Keys: • force: Force deletion and ignore unsaved changes. • unload: Unloaded only, do not delete. See |:bunload| @@ -2161,7 +2161,7 @@ nvim_buf_detach({buffer}) *nvim_buf_detach()* |RPC| only Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer Return: ~ False if detach failed (because the buffer isn't loaded); otherwise @@ -2175,7 +2175,7 @@ nvim_buf_get_changedtick({buffer}) *nvim_buf_get_changedtick()* Gets a changed tick of a buffer Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer Return: ~ `b:changedtick` value. @@ -2184,8 +2184,8 @@ nvim_buf_get_keymap({buffer}, {mode}) *nvim_buf_get_keymap()* Gets a list of buffer-local |mapping| definitions. Parameters: ~ - {mode} Mode short-name ("n", "i", "v", ...) - {buffer} Buffer handle, or 0 for current buffer + • {mode} Mode short-name ("n", "i", "v", ...) + • {buffer} Buffer handle, or 0 for current buffer Return: ~ Array of |maparg()|-like dictionaries describing mappings. The @@ -2203,10 +2203,10 @@ nvim_buf_get_lines({buffer}, {start}, {end}, {strict_indexing}) `strict_indexing` is set. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {start} First line index - {end} Last line index, exclusive - {strict_indexing} Whether out-of-bounds should be an error. + • {buffer} Buffer handle, or 0 for current buffer + • {start} First line index + • {end} Last line index, exclusive + • {strict_indexing} Whether out-of-bounds should be an error. Return: ~ Array of lines, or empty array for unloaded buffer. @@ -2218,8 +2218,8 @@ nvim_buf_get_mark({buffer}, {name}) *nvim_buf_get_mark()* Marks are (1,0)-indexed. |api-indexing| Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {name} Mark name + • {buffer} Buffer handle, or 0 for current buffer + • {name} Mark name Return: ~ (row, col) tuple, (0, 0) if the mark is not set, or is an @@ -2233,7 +2233,7 @@ nvim_buf_get_name({buffer}) *nvim_buf_get_name()* Gets the full file name for the buffer Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer Return: ~ Buffer name @@ -2250,8 +2250,8 @@ nvim_buf_get_offset({buffer}, {index}) *nvim_buf_get_offset()* for unloaded buffer. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {index} Line index + • {buffer} Buffer handle, or 0 for current buffer + • {index} Line index Return: ~ Integer byte offset, or -1 for unloaded buffer. @@ -2270,12 +2270,12 @@ nvim_buf_get_text({buffer}, {start_row}, {start_col}, {end_row}, {end_col}, Prefer |nvim_buf_get_lines()| when retrieving entire lines. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {start_row} First line index - {start_col} Starting column (byte offset) on first line - {end_row} Last line index, inclusive - {end_col} Ending column (byte offset) on last line, exclusive - {opts} Optional parameters. Currently unused. + • {buffer} Buffer handle, or 0 for current buffer + • {start_row} First line index + • {start_col} Starting column (byte offset) on first line + • {end_row} Last line index, inclusive + • {end_col} Ending column (byte offset) on last line, exclusive + • {opts} Optional parameters. Currently unused. Return: ~ Array of lines, or empty array for unloaded buffer. @@ -2284,8 +2284,8 @@ nvim_buf_get_var({buffer}, {name}) *nvim_buf_get_var()* Gets a buffer-scoped (b:) variable. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {name} Variable name + • {buffer} Buffer handle, or 0 for current buffer + • {name} Variable name Return: ~ Variable value @@ -2295,7 +2295,7 @@ nvim_buf_is_loaded({buffer}) *nvim_buf_is_loaded()* about unloaded buffers. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer Return: ~ true if the buffer is valid and loaded, false otherwise. @@ -2308,7 +2308,7 @@ nvim_buf_is_valid({buffer}) *nvim_buf_is_valid()* for more info about unloaded buffers. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer Return: ~ true if the buffer is valid, false otherwise. @@ -2317,7 +2317,7 @@ nvim_buf_line_count({buffer}) *nvim_buf_line_count()* Returns the number of lines in the given buffer. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer Return: ~ Line count, or 0 for unloaded buffer. |api-buffer| @@ -2327,7 +2327,7 @@ nvim_buf_set_keymap({buffer}, {mode}, {lhs}, {rhs}, {*opts}) Sets a buffer-local |mapping| for the given mode. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer + • {buffer} Buffer handle, or 0 for current buffer See also: ~ |nvim_set_keymap()| @@ -2350,11 +2350,11 @@ nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing}, {replacement}) not allowed when |textlock| is active Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {start} First line index - {end} Last line index, exclusive - {strict_indexing} Whether out-of-bounds should be an error. - {replacement} Array of lines to use as replacement + • {buffer} Buffer handle, or 0 for current buffer + • {start} First line index + • {end} Last line index, exclusive + • {strict_indexing} Whether out-of-bounds should be an error. + • {replacement} Array of lines to use as replacement *nvim_buf_set_mark()* nvim_buf_set_mark({buffer}, {name}, {line}, {col}, {opts}) @@ -2367,11 +2367,11 @@ nvim_buf_set_mark({buffer}, {name}, {line}, {col}, {opts}) Passing 0 as line deletes the mark Parameters: ~ - {buffer} Buffer to set the mark on - {name} Mark name - {line} Line number - {col} Column/row number - {opts} Optional parameters. Reserved for future use. + • {buffer} Buffer to set the mark on + • {name} Mark name + • {line} Line number + • {col} Column/row number + • {opts} Optional parameters. Reserved for future use. Return: ~ true if the mark was set, else false. @@ -2384,8 +2384,8 @@ nvim_buf_set_name({buffer}, {name}) *nvim_buf_set_name()* Sets the full file name for a buffer Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {name} Buffer name + • {buffer} Buffer handle, or 0 for current buffer + • {name} Buffer name *nvim_buf_set_text()* nvim_buf_set_text({buffer}, {start_row}, {start_col}, {end_row}, {end_col}, @@ -2407,20 +2407,20 @@ nvim_buf_set_text({buffer}, {start_row}, {start_col}, {end_row}, {end_col}, lines. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {start_row} First line index - {start_col} Starting column (byte offset) on first line - {end_row} Last line index, inclusive - {end_col} Ending column (byte offset) on last line, exclusive - {replacement} Array of lines to use as replacement + • {buffer} Buffer handle, or 0 for current buffer + • {start_row} First line index + • {start_col} Starting column (byte offset) on first line + • {end_row} Last line index, inclusive + • {end_col} Ending column (byte offset) on last line, exclusive + • {replacement} Array of lines to use as replacement nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()* Sets a buffer-scoped (b:) variable Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {name} Variable name - {value} Variable value + • {buffer} Buffer handle, or 0 for current buffer + • {name} Variable name + • {value} Variable value ============================================================================== @@ -2451,12 +2451,12 @@ nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, {col_start}, |nvim_create_namespace()| to create a new empty namespace. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {ns_id} namespace to use or -1 for ungrouped highlight - {hl_group} Name of the highlight group to use - {line} Line to highlight (zero-indexed) - {col_start} Start of (byte-indexed) column range to highlight - {col_end} End of (byte-indexed) column range to highlight, or -1 to + • {buffer} Buffer handle, or 0 for current buffer + • {ns_id} namespace to use or -1 for ungrouped highlight + • {hl_group} Name of the highlight group to use + • {line} Line to highlight (zero-indexed) + • {col_start} Start of (byte-indexed) column range to highlight + • {col_end} End of (byte-indexed) column range to highlight, or -1 to highlight to end of line Return: ~ @@ -2471,19 +2471,19 @@ nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end}) buffer, specify line_start=0 and line_end=-1. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {ns_id} Namespace to clear, or -1 to clear all namespaces. - {line_start} Start of range of lines to clear - {line_end} End of range of lines to clear (exclusive) or -1 to + • {buffer} Buffer handle, or 0 for current buffer + • {ns_id} Namespace to clear, or -1 to clear all namespaces. + • {line_start} Start of range of lines to clear + • {line_end} End of range of lines to clear (exclusive) or -1 to clear to end of buffer. nvim_buf_del_extmark({buffer}, {ns_id}, {id}) *nvim_buf_del_extmark()* Removes an extmark. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {ns_id} Namespace id from |nvim_create_namespace()| - {id} Extmark id + • {buffer} Buffer handle, or 0 for current buffer + • {ns_id} Namespace id from |nvim_create_namespace()| + • {id} Extmark id Return: ~ true if the extmark was found, else false @@ -2493,10 +2493,10 @@ nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts}) Gets the position (0-indexed) of an extmark. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {ns_id} Namespace id from |nvim_create_namespace()| - {id} Extmark id - {opts} Optional parameters. Keys: + • {buffer} Buffer handle, or 0 for current buffer + • {ns_id} Namespace id from |nvim_create_namespace()| + • {id} Extmark id + • {opts} Optional parameters. Keys: • details: Whether to include the details dict Return: ~ @@ -2535,14 +2535,14 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts}) < Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {ns_id} Namespace id from |nvim_create_namespace()| - {start} Start of range: a 0-indexed (row, col) or valid extmark id + • {buffer} Buffer handle, or 0 for current buffer + • {ns_id} Namespace id from |nvim_create_namespace()| + • {start} Start of range: a 0-indexed (row, col) or valid extmark id (whose position defines the bound). |api-indexing| - {end} End of range (inclusive): a 0-indexed (row, col) or valid + • {end} End of range (inclusive): a 0-indexed (row, col) or valid extmark id (whose position defines the bound). |api-indexing| - {opts} Optional parameters. Keys: + • {opts} Optional parameters. Keys: • limit: Maximum number of marks to return • details Whether to include the details dict @@ -2563,11 +2563,11 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts}) range of text, and also to associate virtual text to the mark. Parameters: ~ - {buffer} Buffer handle, or 0 for current buffer - {ns_id} Namespace id from |nvim_create_namespace()| - {line} Line where to place the mark, 0-based. |api-indexing| - {col} Column where to place the mark, 0-based. |api-indexing| - {opts} Optional parameters. + • {buffer} Buffer handle, or 0 for current buffer + • {ns_id} Namespace id from |nvim_create_namespace()| + • {line} Line where to place the mark, 0-based. |api-indexing| + • {col} Column where to place the mark, 0-based. |api-indexing| + • {opts} Optional parameters. • id : id of the extmark to edit. • end_row : ending line of the mark, 0-based inclusive. • end_col : ending col of the mark, 0-based exclusive. @@ -2674,7 +2674,7 @@ nvim_create_namespace({name}) *nvim_create_namespace()* new, anonymous namespace is created. Parameters: ~ - {name} Namespace name or empty string + • {name} Namespace name or empty string Return: ~ Namespace id @@ -2717,8 +2717,8 @@ nvim_set_decoration_provider({ns_id}, {*opts}) |vim.api| only Parameters: ~ - {ns_id} Namespace id from |nvim_create_namespace()| - {opts} Table of callbacks: + • {ns_id} Namespace id from |nvim_create_namespace()| + • {opts} Table of callbacks: • on_start: called first on each screen redraw ["start", tick] • on_buf: called for each buffer being redrawn (before window @@ -2741,8 +2741,8 @@ nvim_win_call({window}, {fun}) *nvim_win_call()* |vim.api| only Parameters: ~ - {window} Window handle, or 0 for current window - {fun} Function to call inside the window (currently lua callable + • {window} Window handle, or 0 for current window + • {fun} Function to call inside the window (currently lua callable only) Return: ~ @@ -2760,8 +2760,8 @@ nvim_win_close({window}, {force}) *nvim_win_close()* not allowed when |textlock| is active Parameters: ~ - {window} Window handle, or 0 for current window - {force} Behave like `:close!` The last window of a buffer with + • {window} Window handle, or 0 for current window + • {force} Behave like `:close!` The last window of a buffer with unwritten changes can be closed. The buffer will become hidden, even if 'hidden' is not set. @@ -2769,14 +2769,14 @@ nvim_win_del_var({window}, {name}) *nvim_win_del_var()* Removes a window-scoped (w:) variable Parameters: ~ - {window} Window handle, or 0 for current window - {name} Variable name + • {window} Window handle, or 0 for current window + • {name} Variable name nvim_win_get_buf({window}) *nvim_win_get_buf()* Gets the current buffer in a window Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ Buffer handle @@ -2785,7 +2785,7 @@ nvim_win_get_cursor({window}) *nvim_win_get_cursor()* Gets the (1,0)-indexed cursor position in the window. |api-indexing| Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ (row, col) tuple @@ -2794,7 +2794,7 @@ nvim_win_get_height({window}) *nvim_win_get_height()* Gets the window height Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ Height as a count of rows @@ -2803,7 +2803,7 @@ nvim_win_get_number({window}) *nvim_win_get_number()* Gets the window number Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ Window number @@ -2812,7 +2812,7 @@ nvim_win_get_position({window}) *nvim_win_get_position()* Gets the window position in display cells. First position is zero. Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ (row, col) tuple with the window position @@ -2821,7 +2821,7 @@ nvim_win_get_tabpage({window}) *nvim_win_get_tabpage()* Gets the window tabpage Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ Tabpage that contains the window @@ -2830,8 +2830,8 @@ nvim_win_get_var({window}, {name}) *nvim_win_get_var()* Gets a window-scoped (w:) variable Parameters: ~ - {window} Window handle, or 0 for current window - {name} Variable name + • {window} Window handle, or 0 for current window + • {name} Variable name Return: ~ Variable value @@ -2840,7 +2840,7 @@ nvim_win_get_width({window}) *nvim_win_get_width()* Gets the window width Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ Width as a count of columns @@ -2857,13 +2857,13 @@ nvim_win_hide({window}) *nvim_win_hide()* not allowed when |textlock| is active Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window nvim_win_is_valid({window}) *nvim_win_is_valid()* Checks if a window is valid Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ true if the window is valid, false otherwise @@ -2875,23 +2875,23 @@ nvim_win_set_buf({window}, {buffer}) *nvim_win_set_buf()* not allowed when |textlock| is active Parameters: ~ - {window} Window handle, or 0 for current window - {buffer} Buffer handle + • {window} Window handle, or 0 for current window + • {buffer} Buffer handle nvim_win_set_cursor({window}, {pos}) *nvim_win_set_cursor()* Sets the (1,0)-indexed cursor position in the window. |api-indexing| This scrolls the window even if it is not the current one. Parameters: ~ - {window} Window handle, or 0 for current window - {pos} (row, col) tuple representing the new position + • {window} Window handle, or 0 for current window + • {pos} (row, col) tuple representing the new position nvim_win_set_height({window}, {height}) *nvim_win_set_height()* Sets the window height. Parameters: ~ - {window} Window handle, or 0 for current window - {height} Height as a count of rows + • {window} Window handle, or 0 for current window + • {height} Height as a count of rows nvim_win_set_hl_ns({window}, {ns_id}) *nvim_win_set_hl_ns()* Set highlight namespace for a window. This will use highlights defined in @@ -2900,23 +2900,23 @@ nvim_win_set_hl_ns({window}, {ns_id}) *nvim_win_set_hl_ns()* This takes precedence over the 'winhighlight' option. Parameters: ~ - {ns_id} the namespace to use + • {ns_id} the namespace to use nvim_win_set_var({window}, {name}, {value}) *nvim_win_set_var()* Sets a window-scoped (w:) variable Parameters: ~ - {window} Window handle, or 0 for current window - {name} Variable name - {value} Variable value + • {window} Window handle, or 0 for current window + • {name} Variable name + • {value} Variable value nvim_win_set_width({window}, {width}) *nvim_win_set_width()* Sets the window width. This will only succeed if the screen is split vertically. Parameters: ~ - {window} Window handle, or 0 for current window - {width} Width as a count of columns + • {window} Window handle, or 0 for current window + • {width} Width as a count of columns ============================================================================== @@ -2961,9 +2961,9 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()* not allowed when |textlock| is active Parameters: ~ - {buffer} Buffer to display, or 0 for current buffer - {enter} Enter the window (make it the current window) - {config} Map defining the window configuration. Keys: + • {buffer} Buffer to display, or 0 for current buffer + • {enter} Enter the window (make it the current window) + • {config} Map defining the window configuration. Keys: • relative: Sets the window layout to "floating", placed at (row,col) coordinates relative to: • "editor" The global editor grid @@ -3064,7 +3064,7 @@ nvim_win_get_config({window}) *nvim_win_get_config()* `relative` is empty for normal windows. Parameters: ~ - {window} Window handle, or 0 for current window + • {window} Window handle, or 0 for current window Return: ~ Map defining the window configuration, see |nvim_open_win()| @@ -3077,8 +3077,8 @@ nvim_win_set_config({window}, {*config}) *nvim_win_set_config()* changed. `row`/`col` and `relative` must be reconfigured together. Parameters: ~ - {window} Window handle, or 0 for current window - {config} Map defining the window configuration, see |nvim_open_win()| + • {window} Window handle, or 0 for current window + • {config} Map defining the window configuration, see |nvim_open_win()| See also: ~ |nvim_open_win()| @@ -3091,14 +3091,14 @@ nvim_tabpage_del_var({tabpage}, {name}) *nvim_tabpage_del_var()* Removes a tab-scoped (t:) variable Parameters: ~ - {tabpage} Tabpage handle, or 0 for current tabpage - {name} Variable name + • {tabpage} Tabpage handle, or 0 for current tabpage + • {name} Variable name nvim_tabpage_get_number({tabpage}) *nvim_tabpage_get_number()* Gets the tabpage number Parameters: ~ - {tabpage} Tabpage handle, or 0 for current tabpage + • {tabpage} Tabpage handle, or 0 for current tabpage Return: ~ Tabpage number @@ -3107,8 +3107,8 @@ nvim_tabpage_get_var({tabpage}, {name}) *nvim_tabpage_get_var()* Gets a tab-scoped (t:) variable Parameters: ~ - {tabpage} Tabpage handle, or 0 for current tabpage - {name} Variable name + • {tabpage} Tabpage handle, or 0 for current tabpage + • {name} Variable name Return: ~ Variable value @@ -3117,7 +3117,7 @@ nvim_tabpage_get_win({tabpage}) *nvim_tabpage_get_win()* Gets the current window in a tabpage Parameters: ~ - {tabpage} Tabpage handle, or 0 for current tabpage + • {tabpage} Tabpage handle, or 0 for current tabpage Return: ~ Window handle @@ -3126,7 +3126,7 @@ nvim_tabpage_is_valid({tabpage}) *nvim_tabpage_is_valid()* Checks if a tabpage is valid Parameters: ~ - {tabpage} Tabpage handle, or 0 for current tabpage + • {tabpage} Tabpage handle, or 0 for current tabpage Return: ~ true if the tabpage is valid, false otherwise @@ -3135,7 +3135,7 @@ nvim_tabpage_list_wins({tabpage}) *nvim_tabpage_list_wins()* Gets the windows in a tabpage Parameters: ~ - {tabpage} Tabpage handle, or 0 for current tabpage + • {tabpage} Tabpage handle, or 0 for current tabpage Return: ~ List of windows in `tabpage` @@ -3145,9 +3145,9 @@ nvim_tabpage_set_var({tabpage}, {name}, {value}) Sets a tab-scoped (t:) variable Parameters: ~ - {tabpage} Tabpage handle, or 0 for current tabpage - {name} Variable name - {value} Variable value + • {tabpage} Tabpage handle, or 0 for current tabpage + • {name} Variable name + • {value} Variable value ============================================================================== @@ -3158,7 +3158,7 @@ nvim_clear_autocmds({*opts}) *nvim_clear_autocmds()* particular autocmd, see |nvim_del_autocmd()|. Parameters: ~ - {opts} Parameters + • {opts} Parameters • event: (string|table) Examples: • event: "pat1" • event: { "pat1" } @@ -3190,8 +3190,8 @@ nvim_create_augroup({name}, {*opts}) *nvim_create_augroup()* < Parameters: ~ - {name} String: The name of the group - {opts} Dictionary Parameters + • {name} String: The name of the group + • {opts} Dictionary Parameters • clear (bool) optional: defaults to true. Clear existing commands if the group already exists |autocmd-groups|. @@ -3254,9 +3254,9 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()* < Parameters: ~ - {event} (string|array) The event or events to register this + • {event} (string|array) The event or events to register this autocommand - {opts} Dictionary of autocommand options: + • {opts} Dictionary of autocommand options: • group (string|integer) optional: the autocommand group name or id to match against. • pattern (string|array) optional: pattern or patterns to @@ -3307,7 +3307,7 @@ nvim_del_augroup_by_id({id}) *nvim_del_augroup_by_id()* This group will no longer exist. Parameters: ~ - {id} Integer The id of the group. + • {id} Integer The id of the group. See also: ~ |nvim_del_augroup_by_name()| @@ -3321,7 +3321,7 @@ nvim_del_augroup_by_name({name}) *nvim_del_augroup_by_name()* This group will no longer exist. Parameters: ~ - {name} String The name of the group. + • {name} String The name of the group. See also: ~ |autocmd-groups| @@ -3332,7 +3332,7 @@ nvim_del_autocmd({id}) *nvim_del_autocmd()* NOTE: Only autocommands created via the API have an id. Parameters: ~ - {id} Integer The id returned by nvim_create_autocmd + • {id} Integer The id returned by nvim_create_autocmd See also: ~ |nvim_create_autocmd()| @@ -3342,8 +3342,8 @@ nvim_exec_autocmds({event}, {*opts}) *nvim_exec_autocmds()* |autocmd-execute|. Parameters: ~ - {event} (String|Array) The event or events to execute - {opts} Dictionary of autocommand options: + • {event} (String|Array) The event or events to execute + • {opts} Dictionary of autocommand options: • group (string|integer) optional: the autocommand group name or id to match against. |autocmd-groups|. • pattern (string|array) optional: defaults to "*" @@ -3379,7 +3379,7 @@ nvim_get_autocmds({*opts}) *nvim_get_autocmds()* autocommands that match any combination of them. Parameters: ~ - {opts} Dictionary with at least one of the following: + • {opts} Dictionary with at least one of the following: • group (string|integer): the autocommand group name or id to match against. • event (string|array): event or events to match against @@ -3428,9 +3428,9 @@ nvim_ui_attach({width}, {height}, {options}) *nvim_ui_attach()* |RPC| only Parameters: ~ - {width} Requested screen columns - {height} Requested screen rows - {options} |ui-option| map + • {width} Requested screen columns + • {height} Requested screen rows + • {options} |ui-option| map nvim_ui_detach() *nvim_ui_detach()* Deactivates UI events on the channel. @@ -3456,10 +3456,10 @@ nvim_ui_pum_set_bounds({width}, {height}, {row}, {col}) |RPC| only Parameters: ~ - {width} Popupmenu width. - {height} Popupmenu height. - {row} Popupmenu row. - {col} Popupmenu height. + • {width} Popupmenu width. + • {height} Popupmenu height. + • {row} Popupmenu row. + • {col} Popupmenu height. nvim_ui_pum_set_height({height}) *nvim_ui_pum_set_height()* Tells Nvim the number of elements displaying in the popupmenu, to decide @@ -3469,7 +3469,7 @@ nvim_ui_pum_set_height({height}) *nvim_ui_pum_set_height()* |RPC| only Parameters: ~ - {height} Popupmenu height, must be greater than zero. + • {height} Popupmenu height, must be greater than zero. nvim_ui_set_option({name}, {value}) *nvim_ui_set_option()* TODO: Documentation @@ -3494,8 +3494,8 @@ nvim_ui_try_resize_grid({grid}, {width}, {height}) |RPC| only Parameters: ~ - {grid} The handle of the grid to be changed. - {width} The new requested width. - {height} The new requested height. + • {grid} The handle of the grid to be changed. + • {width} The new requested width. + • {height} The new requested height. vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl: diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index ada7b93f7c..828093ddd4 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -342,7 +342,7 @@ config({opts}, {namespace}) *vim.diagnostic.config()* any of the above. Parameters: ~ - {opts} (table|nil) When omitted or "nil", retrieve the current + • {opts} (table|nil) When omitted or "nil", retrieve the current configuration. Otherwise, a configuration table with the following keys: • underline: (default true) Use underline for @@ -397,32 +397,32 @@ config({opts}, {namespace}) *vim.diagnostic.config()* severities are displayed before lower severities (e.g. ERROR is displayed before WARN). Options: • reverse: (boolean) Reverse sort order - {namespace} (number|nil) Update the options for the given namespace. + • {namespace} (number|nil) Update the options for the given namespace. When omitted, update the global diagnostic options. disable({bufnr}, {namespace}) *vim.diagnostic.disable()* Disable diagnostics in the given buffer. Parameters: ~ - {bufnr} (number|nil) Buffer number, or 0 for current buffer. When + • {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, disable diagnostics in all buffers. - {namespace} (number|nil) Only disable diagnostics for the given + • {namespace} (number|nil) Only disable diagnostics for the given namespace. enable({bufnr}, {namespace}) *vim.diagnostic.enable()* Enable diagnostics in the given buffer. Parameters: ~ - {bufnr} (number|nil) Buffer number, or 0 for current buffer. When + • {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, enable diagnostics in all buffers. - {namespace} (number|nil) Only enable diagnostics for the given + • {namespace} (number|nil) Only enable diagnostics for the given namespace. fromqflist({list}) *vim.diagnostic.fromqflist()* Convert a list of quickfix items to a list of diagnostics. Parameters: ~ - {list} (table) A list of quickfix items from |getqflist()| or + • {list} (table) A list of quickfix items from |getqflist()| or |getloclist()|. Return: ~ @@ -432,9 +432,9 @@ get({bufnr}, {opts}) *vim.diagnostic.get()* Get current diagnostics. Parameters: ~ - {bufnr} (number|nil) Buffer number to get diagnostics from. Use 0 for + • {bufnr} (number|nil) Buffer number to get diagnostics from. Use 0 for current buffer or nil for all buffers. - {opts} (table|nil) A table with the following keys: + • {opts} (table|nil) A table with the following keys: • namespace: (number) Limit diagnostics to the given namespace. • lnum: (number) Limit diagnostics to the given line number. @@ -447,7 +447,7 @@ get_namespace({namespace}) *vim.diagnostic.get_namespace()* Get namespace metadata. Parameters: ~ - {namespace} (number) Diagnostic namespace + • {namespace} (number) Diagnostic namespace Return: ~ (table) Namespace metadata @@ -462,7 +462,7 @@ get_next({opts}) *vim.diagnostic.get_next()* Get the next diagnostic closest to the cursor position. Parameters: ~ - {opts} (table) See |vim.diagnostic.goto_next()| + • {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ (table) Next diagnostic @@ -471,7 +471,7 @@ get_next_pos({opts}) *vim.diagnostic.get_next_pos()* Return the position of the next diagnostic in the current buffer. Parameters: ~ - {opts} (table) See |vim.diagnostic.goto_next()| + • {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ (table) Next diagnostic position as a (row, col) tuple. @@ -480,7 +480,7 @@ get_prev({opts}) *vim.diagnostic.get_prev()* Get the previous diagnostic closest to the cursor position. Parameters: ~ - {opts} (table) See |vim.diagnostic.goto_next()| + • {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ (table) Previous diagnostic @@ -489,7 +489,7 @@ get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()* Return the position of the previous diagnostic in the current buffer. Parameters: ~ - {opts} (table) See |vim.diagnostic.goto_next()| + • {opts} (table) See |vim.diagnostic.goto_next()| Return: ~ (table) Previous diagnostic position as a (row, col) tuple. @@ -498,7 +498,7 @@ goto_next({opts}) *vim.diagnostic.goto_next()* Move to the next diagnostic. Parameters: ~ - {opts} (table|nil) Configuration table with the following keys: + • {opts} (table|nil) Configuration table with the following keys: • namespace: (number) Only consider diagnostics from the given namespace. • cursor_position: (cursor position) Cursor position as a @@ -519,7 +519,7 @@ goto_prev({opts}) *vim.diagnostic.goto_prev()* Move to the previous diagnostic in the current buffer. Parameters: ~ - {opts} (table) See |vim.diagnostic.goto_next()| + • {opts} (table) See |vim.diagnostic.goto_next()| hide({namespace}, {bufnr}) *vim.diagnostic.hide()* Hide currently displayed diagnostics. @@ -532,9 +532,9 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()* |vim.diagnostic.disable()|. Parameters: ~ - {namespace} (number|nil) Diagnostic namespace. When omitted, hide + • {namespace} (number|nil) Diagnostic namespace. When omitted, hide diagnostics from all namespaces. - {bufnr} (number|nil) Buffer number, or 0 for current buffer. When + • {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, hide diagnostics in all buffers. *vim.diagnostic.match()* @@ -555,13 +555,13 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults}) < Parameters: ~ - {str} (string) String to parse diagnostics from. - {pat} (string) Lua pattern with capture groups. - {groups} (table) List of fields in a |diagnostic-structure| to + • {str} (string) String to parse diagnostics from. + • {pat} (string) Lua pattern with capture groups. + • {groups} (table) List of fields in a |diagnostic-structure| to associate with captures from {pat}. - {severity_map} (table) A table mapping the severity field from + • {severity_map} (table) A table mapping the severity field from {groups} with an item from |vim.diagnostic.severity|. - {defaults} (table|nil) Table of default values for any fields not + • {defaults} (table|nil) Table of default values for any fields not listed in {groups}. When omitted, numeric values default to 0 and "severity" defaults to ERROR. @@ -573,7 +573,7 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()* Show diagnostics in a floating window. Parameters: ~ - {opts} (table|nil) Configuration table with the same keys as + • {opts} (table|nil) Configuration table with the same keys as |vim.lsp.util.open_floating_preview()| in addition to the following: • bufnr: (number) Buffer number to show diagnostics from. @@ -631,27 +631,27 @@ reset({namespace}, {bufnr}) *vim.diagnostic.reset()* re-displayed, use |vim.diagnostic.hide()|. Parameters: ~ - {namespace} (number|nil) Diagnostic namespace. When omitted, remove + • {namespace} (number|nil) Diagnostic namespace. When omitted, remove diagnostics from all namespaces. - {bufnr} (number|nil) Remove diagnostics for the given buffer. + • {bufnr} (number|nil) Remove diagnostics for the given buffer. When omitted, diagnostics are removed for all buffers. set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()* Set diagnostics for the given namespace and buffer. Parameters: ~ - {namespace} (number) The diagnostic namespace - {bufnr} (number) Buffer number - {diagnostics} (table) A list of diagnostic items + • {namespace} (number) The diagnostic namespace + • {bufnr} (number) Buffer number + • {diagnostics} (table) A list of diagnostic items |diagnostic-structure| - {opts} (table|nil) Display options to pass to + • {opts} (table|nil) Display options to pass to |vim.diagnostic.show()| setloclist({opts}) *vim.diagnostic.setloclist()* Add buffer diagnostics to the location list. Parameters: ~ - {opts} (table|nil) Configuration table with the following keys: + • {opts} (table|nil) Configuration table with the following keys: • namespace: (number) Only add diagnostics from the given namespace. • winnr: (number, default 0) Window number to set location @@ -666,7 +666,7 @@ setqflist({opts}) *vim.diagnostic.setqflist()* Add all diagnostics to the quickfix list. Parameters: ~ - {opts} (table|nil) Configuration table with the following keys: + • {opts} (table|nil) Configuration table with the following keys: • namespace: (number) Only add diagnostics from the given namespace. • open: (boolean, default true) Open quickfix list after @@ -680,17 +680,17 @@ show({namespace}, {bufnr}, {diagnostics}, {opts}) Display diagnostics for the given namespace and buffer. Parameters: ~ - {namespace} (number|nil) Diagnostic namespace. When omitted, show + • {namespace} (number|nil) Diagnostic namespace. When omitted, show diagnostics from all namespaces. - {bufnr} (number|nil) Buffer number, or 0 for current buffer. + • {bufnr} (number|nil) Buffer number, or 0 for current buffer. When omitted, show diagnostics in all buffers. - {diagnostics} (table|nil) The diagnostics to display. When omitted, + • {diagnostics} (table|nil) The diagnostics to display. When omitted, use the saved diagnostics for the given namespace and buffer. This can be used to display a list of diagnostics without saving them or to display only a subset of diagnostics. May not be used when {namespace} or {bufnr} is nil. - {opts} (table|nil) Display options. See + • {opts} (table|nil) Display options. See |vim.diagnostic.config()|. toqflist({diagnostics}) *vim.diagnostic.toqflist()* @@ -698,7 +698,7 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()* passed to |setqflist()| or |setloclist()|. Parameters: ~ - {diagnostics} (table) List of diagnostics |diagnostic-structure|. + • {diagnostics} (table) List of diagnostics |diagnostic-structure|. Return: ~ array of quickfix list items |setqflist-what| diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index d8dcf60c21..6d5c51c210 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -539,8 +539,8 @@ buf_attach_client({bufnr}, {client_id}) *vim.lsp.buf_attach_client()* Without calling this, the server won't be notified of changes to a buffer. Parameters: ~ - {bufnr} (number) Buffer handle, or 0 for current - {client_id} (number) Client id + • {bufnr} (number) Buffer handle, or 0 for current + • {client_id} (number) Client id buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()* Detaches client from the specified buffer. Note: While the server is @@ -548,23 +548,23 @@ buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()* send notifications should it ignore this notification. Parameters: ~ - {bufnr} (number) Buffer handle, or 0 for current - {client_id} (number) Client id + • {bufnr} (number) Buffer handle, or 0 for current + • {client_id} (number) Client id buf_is_attached({bufnr}, {client_id}) *vim.lsp.buf_is_attached()* Checks if a buffer is attached for a particular client. Parameters: ~ - {bufnr} (number) Buffer handle, or 0 for current - {client_id} (number) the client id + • {bufnr} (number) Buffer handle, or 0 for current + • {client_id} (number) the client id buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()* Send a notification to a server Parameters: ~ - {bufnr} [number] (optional): The number of the buffer - {method} [string]: Name of the request method - {params} [string]: Arguments to send to the server + • {bufnr} [number] (optional): The number of the buffer + • {method} [string]: Name of the request method + • {params} [string]: Arguments to send to the server Return: ~ true if any client returns true; false otherwise @@ -576,10 +576,10 @@ buf_request_all({bufnr}, {method}, {params}, {callback}) |vim.lsp.buf_request()| but the return result and callback are different. Parameters: ~ - {bufnr} (number) Buffer handle, or 0 for current. - {method} (string) LSP method name - {params} (optional, table) Parameters to send to the server - {callback} (function) The callback to call when all requests are + • {bufnr} (number) Buffer handle, or 0 for current. + • {method} (string) LSP method name + • {params} (optional, table) Parameters to send to the server + • {callback} (function) The callback to call when all requests are finished. Return: ~ @@ -595,10 +595,10 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms}) result is different. Wait maximum of {timeout_ms} (default 1000) ms. Parameters: ~ - {bufnr} (number) Buffer handle, or 0 for current. - {method} (string) LSP method name - {params} (optional, table) Parameters to send to the server - {timeout_ms} (optional, number, default=1000) Maximum time in + • {bufnr} (number) Buffer handle, or 0 for current. + • {method} (string) LSP method name + • {params} (optional, table) Parameters to send to the server + • {timeout_ms} (optional, number, default=1000) Maximum time in milliseconds to wait for a result. Return: ~ @@ -666,7 +666,7 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()* Checks whether a client is stopped. Parameters: ~ - {client_id} (Number) + • {client_id} (Number) Return: ~ true if client is stopped, false otherwise. @@ -676,8 +676,8 @@ for_each_buffer_client({bufnr}, {fn}) Invokes a function for each LSP client attached to a buffer. Parameters: ~ - {bufnr} (number) Buffer number - {fn} (function) Function to run on each client attached to buffer + • {bufnr} (number) Buffer number + • {fn} (function) Function to run on each client attached to buffer {bufnr}. The function takes the client, client ID, and buffer number as arguments. Example: > @@ -696,7 +696,7 @@ formatexpr({opts}) *vim.lsp.formatexpr()* 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`. Parameters: ~ - {opts} (table) options for customizing the formatting expression + • {opts} (table) options for customizing the formatting expression which takes the following optional keys: • timeout_ms (default 500ms). The timeout period for the formatting request. @@ -705,7 +705,7 @@ get_active_clients({filter}) *vim.lsp.get_active_clients()* Get active clients. Parameters: ~ - {filter} (table|nil) A table with key-value pairs used to filter the + • {filter} (table|nil) A table with key-value pairs used to filter the returned clients. The available keys are: • id (number): Only return clients with the given id • bufnr (number): Only return clients attached to this @@ -720,7 +720,7 @@ get_buffers_by_client_id({client_id}) Returns list of buffers attached to client_id. Parameters: ~ - {client_id} (number) client id + • {client_id} (number) client id Return: ~ list of buffer ids @@ -730,7 +730,7 @@ get_client_by_id({client_id}) *vim.lsp.get_client_by_id()* not yet be fully initialized. Parameters: ~ - {client_id} (number) client id + • {client_id} (number) client id Return: ~ |vim.lsp.client| object, or nil @@ -745,8 +745,8 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()* Implements 'omnifunc' compatible LSP completion. Parameters: ~ - {findstart} 0 or 1, decides behavior - {base} If findstart=0, text to match against + • {findstart} 0 or 1, decides behavior + • {base} If findstart=0, text to match against Return: ~ (number) Decided by {findstart}: @@ -768,7 +768,7 @@ set_log_level({level}) *vim.lsp.set_log_level()* Use `lsp.log_levels` for reverse lookup. Parameters: ~ - {level} [number|string] the case insensitive level name or number + • {level} [number|string] the case insensitive level name or number See also: ~ |vim.lsp.log_levels| @@ -818,9 +818,9 @@ start({config}, {opts}) *vim.lsp.start()* `ftplugin/.lua` (See |ftplugin-name|) Parameters: ~ - {config} (table) Same configuration as documented in + • {config} (table) Same configuration as documented in |vim.lsp.start_client()| - {opts} nil|table Optional keyword arguments: + • {opts} nil|table Optional keyword arguments: • reuse_client (fun(client: client, config: table): boolean) Predicate used to decide if a client should be re-used. Used on all running clients. The default implementation @@ -839,7 +839,7 @@ start_client({config}) *vim.lsp.start_client()* The following parameters describe fields in the {config} table. Parameters: ~ - {cmd} (table|string|fun(dispatchers: table):table) + • {cmd} (table|string|fun(dispatchers: table):table) command string or list treated like |jobstart()|. The command must launch the language server process. `cmd` can also be a function that @@ -850,26 +850,26 @@ start_client({config}) *vim.lsp.start_client()* |vim.lsp.rpc.notify()| For TCP there is a built-in rpc client factory: |vim.lsp.rpc.connect()| - {cmd_cwd} (string, default=|getcwd()|) Directory to launch + • {cmd_cwd} (string, default=|getcwd()|) Directory to launch the `cmd` process. Not related to `root_dir`. - {cmd_env} (table) Environment flags to pass to the LSP on + • {cmd_env} (table) Environment flags to pass to the LSP on spawn. Can be specified using keys like a map or as a list with `k=v` pairs or both. Non-string values are coerced to string. Example: > { "PRODUCTION=true"; "TEST=123"; PORT = 8080; HOST = "0.0.0.0"; } < - {detached} (boolean, default true) Daemonize the server + • {detached} (boolean, default true) Daemonize the server process so that it runs in a separate process group from Nvim. Nvim will shutdown the process on exit, but if Nvim fails to exit cleanly this could leave behind orphaned server processes. - {workspace_folders} (table) List of workspace folders passed to the + • {workspace_folders} (table) List of workspace folders passed to the language server. For backwards compatibility rootUri and rootPath will be derived from the first workspace folder in this list. See `workspaceFolders` in the LSP spec. - {capabilities} Map overriding the default capabilities defined + • {capabilities} Map overriding the default capabilities defined by |vim.lsp.protocol.make_client_capabilities()|, passed to the language server on initialization. Hint: use make_client_capabilities() and modify @@ -877,44 +877,44 @@ start_client({config}) *vim.lsp.start_client()* • Note: To send an empty dictionary use `{[vim.type_idx]=vim.types.dictionary}`, else it will be encoded as an array. - {handlers} Map of language server method names to + • {handlers} Map of language server method names to |lsp-handler| - {settings} Map with language server specific settings. These + • {settings} Map with language server specific settings. These are returned to the language server if requested via `workspace/configuration`. Keys are case-sensitive. - {commands} (table) Table that maps string of clientside + • {commands} (table) Table that maps string of clientside commands to user-defined functions. Commands passed to start_client take precedence over the global command registry. Each key must be a unique command name, and the value is a function which is called if any LSP action (code action, code lenses, ...) triggers the command. - {init_options} Values to pass in the initialization request as + • {init_options} Values to pass in the initialization request as `initializationOptions`. See `initialize` in the LSP spec. - {name} (string, default=client-id) Name in log messages. - {get_language_id} function(bufnr, filetype) -> language ID as + • {name} (string, default=client-id) Name in log messages. + • {get_language_id} function(bufnr, filetype) -> language ID as string. Defaults to the filetype. - {offset_encoding} (default="utf-16") One of "utf-8", "utf-16", or + • {offset_encoding} (default="utf-16") One of "utf-8", "utf-16", or "utf-32" which is the encoding that the LSP server expects. Client does not verify this is correct. - {on_error} Callback with parameters (code, ...), invoked + • {on_error} Callback with parameters (code, ...), invoked when the client operation throws an error. `code` is a number describing the error. Other arguments may be passed depending on the error kind. See `vim.lsp.rpc.client_errors` for possible errors. Use `vim.lsp.rpc.client_errors[code]` to get human-friendly name. - {before_init} Callback with parameters (initialize_params, + • {before_init} Callback with parameters (initialize_params, config) invoked before the LSP "initialize" phase, where `params` contains the parameters being sent to the server and `config` is the config that was passed to |vim.lsp.start_client()|. You can use this to modify parameters before they are sent. - {on_init} Callback (client, initialize_result) invoked + • {on_init} Callback (client, initialize_result) invoked after LSP "initialize", where `result` is a table of `capabilities` and anything else the server may send. For example, clangd sends @@ -927,19 +927,19 @@ start_client({config}) *vim.lsp.start_client()* make this assumption. A `workspace/didChangeConfiguration` notification should be sent to the server during on_init. - {on_exit} Callback (code, signal, client_id) invoked on + • {on_exit} Callback (code, signal, client_id) invoked on client exit. • code: exit code of the process • signal: number describing the signal used to terminate (if any) • client_id: client handle - {on_attach} Callback (client, bufnr) invoked when client + • {on_attach} Callback (client, bufnr) invoked when client attaches to a buffer. - {trace} "off" | "messages" | "verbose" | nil passed + • {trace} "off" | "messages" | "verbose" | nil passed directly to the language server in the initialize request. Invalid/empty values will default to "off" - {flags} A table with flags for the client. The current + • {flags} A table with flags for the client. The current (experimental) flags are: • allow_incremental_sync (bool, default true): Allow using incremental sync for buffer edits @@ -953,7 +953,7 @@ start_client({config}) *vim.lsp.start_client()* sending kill -15. If set to false, nvim exits immediately after sending the "shutdown" request to the server. - {root_dir} (string) Directory where the LSP server will base + • {root_dir} (string) Directory where the LSP server will base its workspaceFolders, rootUri, and rootPath on initialization. @@ -976,8 +976,8 @@ stop_client({client_id}, {force}) *vim.lsp.stop_client()* for this client, then force-shutdown is attempted. Parameters: ~ - {client_id} client id or |vim.lsp.client| object, or list thereof - {force} (boolean) (optional) shutdown forcefully + • {client_id} client id or |vim.lsp.client| object, or list thereof + • {force} (boolean) (optional) shutdown forcefully tagfunc({...}) *vim.lsp.tagfunc()* Provides an interface between the built-in client and 'tagfunc'. @@ -988,8 +988,8 @@ tagfunc({...}) *vim.lsp.tagfunc()* LSP servers, falls back to using built-in tags. Parameters: ~ - {pattern} Pattern used to find a workspace symbol - {flags} See |tag-function| + • {pattern} Pattern used to find a workspace symbol + • {flags} See |tag-function| Return: ~ A list of matching tags @@ -998,8 +998,8 @@ with({handler}, {override_config}) *vim.lsp.with()* Function to manage overriding defaults for LSP handlers. Parameters: ~ - {handler} (function) See |lsp-handler| - {override_config} (table) Table containing the keys to override + • {handler} (function) See |lsp-handler| + • {override_config} (table) Table containing the keys to override behavior of the {handler} @@ -1018,7 +1018,7 @@ code_action({options}) *vim.lsp.buf.code_action()* Selects a code action available at the current cursor position. Parameters: ~ - {options} (table|nil) Optional table which holds the following + • {options} (table|nil) Optional table which holds the following optional fields: • context: (table|nil) Corresponds to `CodeActionContext` of the LSP specification: • diagnostics (table|nil): LSP`Diagnostic[]` . Inferred from the current position if not provided. @@ -1045,7 +1045,7 @@ completion({context}) *vim.lsp.buf.completion()* called in Insert mode. Parameters: ~ - {context} (context support not yet implemented) Additional + • {context} (context support not yet implemented) Additional information about the context in which a completion was triggered (how it was triggered, and by which trigger character, if applicable) @@ -1060,7 +1060,7 @@ declaration({options}) *vim.lsp.buf.declaration()* |vim.lsp.buf.definition()| instead. Parameters: ~ - {options} (table|nil) additional options + • {options} (table|nil) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. • on_list: (function) handler for list results. See @@ -1070,7 +1070,7 @@ definition({options}) *vim.lsp.buf.definition()* Jumps to the definition of the symbol under the cursor. Parameters: ~ - {options} (table|nil) additional options + • {options} (table|nil) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. • on_list: (function) handler for list results. See @@ -1095,7 +1095,7 @@ document_symbol({options}) *vim.lsp.buf.document_symbol()* Lists all symbols in the current buffer in the quickfix window. Parameters: ~ - {options} (table|nil) additional options + • {options} (table|nil) additional options • on_list: (function) handler for list results. See |lsp-on-list-handler| @@ -1103,7 +1103,7 @@ execute_command({command_params}) *vim.lsp.buf.execute_command()* Executes an LSP server command. Parameters: ~ - {command_params} (table) A valid `ExecuteCommandParams` object + • {command_params} (table) A valid `ExecuteCommandParams` object See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand @@ -1113,7 +1113,7 @@ format({options}) *vim.lsp.buf.format()* server clients. Parameters: ~ - {options} table|nil Optional table which holds the following optional + • {options} table|nil Optional table which holds the following optional fields: • formatting_options (table|nil): Can be used to specify FormattingOptions. Some unspecified options will be @@ -1156,7 +1156,7 @@ implementation({options}) *vim.lsp.buf.implementation()* quickfix window. Parameters: ~ - {options} (table|nil) additional options + • {options} (table|nil) additional options • on_list: (function) handler for list results. See |lsp-on-list-handler| @@ -1178,8 +1178,8 @@ references({context}, {options}) *vim.lsp.buf.references()* window. Parameters: ~ - {context} (table) Context for the request - {options} (table|nil) additional options + • {context} (table) Context for the request + • {options} (table|nil) additional options • on_list: (function) handler for list results. See |lsp-on-list-handler| @@ -1195,9 +1195,9 @@ rename({new_name}, {options}) *vim.lsp.buf.rename()* Renames all references to the symbol under the cursor. Parameters: ~ - {new_name} (string|nil) If not provided, the user will be prompted + • {new_name} (string|nil) If not provided, the user will be prompted for a new name using |vim.ui.input()|. - {options} (table|nil) additional options + • {options} (table|nil) additional options • filter (function|nil): Predicate used to filter clients. Receives a client as argument and must return a boolean. Clients matching the predicate are included. @@ -1219,7 +1219,7 @@ type_definition({options}) *vim.lsp.buf.type_definition()* Jumps to the definition of the type of the symbol under the cursor. Parameters: ~ - {options} (table|nil) additional options + • {options} (table|nil) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. • on_list: (function) handler for list results. See @@ -1233,8 +1233,8 @@ workspace_symbol({query}, {options}) *vim.lsp.buf.workspace_symbol()* string means no filtering is done. Parameters: ~ - {query} (string, optional) - {options} (table|nil) additional options + • {query} (string, optional) + • {options} (table|nil) additional options • on_list: (function) handler for list results. See |lsp-on-list-handler| @@ -1247,7 +1247,7 @@ get_namespace({client_id}) *vim.lsp.diagnostic.get_namespace()* |vim.diagnostic|. Parameters: ~ - {client_id} (number) The id of the LSP client + • {client_id} (number) The id of the LSP client *vim.lsp.diagnostic.on_publish_diagnostics()* on_publish_diagnostics({_}, {result}, {ctx}, {config}) @@ -1276,7 +1276,7 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config}) < Parameters: ~ - {config} (table) Configuration table (see |vim.diagnostic.config()|). + • {config} (table) Configuration table (see |vim.diagnostic.config()|). ============================================================================== @@ -1286,15 +1286,15 @@ display({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.display()* Display the lenses using virtual text Parameters: ~ - {lenses} (table) of lenses to display (`CodeLens[] | null`) - {bufnr} (number) - {client_id} (number) + • {lenses} (table) of lenses to display (`CodeLens[] | null`) + • {bufnr} (number) + • {client_id} (number) get({bufnr}) *vim.lsp.codelens.get()* Return all lenses for the given buffer Parameters: ~ - {bufnr} (number) Buffer number. 0 can be used for the current buffer. + • {bufnr} (number) Buffer number. 0 can be used for the current buffer. Return: ~ (table) (`CodeLens[]`) @@ -1318,9 +1318,9 @@ save({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.save()* Store lenses for a specific buffer and client Parameters: ~ - {lenses} (table) of lenses to store (`CodeLens[] | null`) - {bufnr} (number) - {client_id} (number) + • {lenses} (table) of lenses to store (`CodeLens[] | null`) + • {bufnr} (number) + • {client_id} (number) ============================================================================== @@ -1338,7 +1338,7 @@ hover({_}, {result}, {ctx}, {config}) *vim.lsp.handlers.hover()* < Parameters: ~ - {config} (table) Configuration table. + • {config} (table) Configuration table. • border: (default=nil) • Add borders to the floating window • See |nvim_open_win()| @@ -1357,7 +1357,7 @@ signature_help({_}, {result}, {ctx}, {config}) < Parameters: ~ - {config} (table) Configuration table. + • {config} (table) Configuration table. • border: (default=nil) • Add borders to the floating window • See |nvim_open_win()| @@ -1372,8 +1372,8 @@ apply_text_document_edit({text_document_edit}, {index}, {offset_encoding}) document. Parameters: ~ - {text_document_edit} table: a `TextDocumentEdit` object - {index} number: Optional index of the edit, if from a + • {text_document_edit} table: a `TextDocumentEdit` object + • {index} number: Optional index of the edit, if from a list of edits (or nil, if not from a list) See also: ~ @@ -1384,9 +1384,9 @@ apply_text_edits({text_edits}, {bufnr}, {offset_encoding}) Applies a list of text edits to a buffer. Parameters: ~ - {text_edits} (table) list of `TextEdit` objects - {bufnr} (number) Buffer id - {offset_encoding} (string) utf-8|utf-16|utf-32 + • {text_edits} (table) list of `TextEdit` objects + • {bufnr} (number) Buffer id + • {offset_encoding} (string) utf-8|utf-16|utf-32 See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit @@ -1396,24 +1396,24 @@ apply_workspace_edit({workspace_edit}, {offset_encoding}) Applies a `WorkspaceEdit`. Parameters: ~ - {workspace_edit} (table) `WorkspaceEdit` - {offset_encoding} (string) utf-8|utf-16|utf-32 (required) + • {workspace_edit} (table) `WorkspaceEdit` + • {offset_encoding} (string) utf-8|utf-16|utf-32 (required) buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()* Removes document highlights from a buffer. Parameters: ~ - {bufnr} (number) Buffer id + • {bufnr} (number) Buffer id *vim.lsp.util.buf_highlight_references()* buf_highlight_references({bufnr}, {references}, {offset_encoding}) Shows a list of document highlights for a certain buffer. Parameters: ~ - {bufnr} (number) Buffer id - {references} (table) List of `DocumentHighlight` objects to + • {bufnr} (number) Buffer id + • {references} (table) List of `DocumentHighlight` objects to highlight - {offset_encoding} (string) One of "utf-8", "utf-16", "utf-32". + • {offset_encoding} (string) One of "utf-8", "utf-16", "utf-32". See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight @@ -1423,10 +1423,10 @@ character_offset({buf}, {row}, {col}, {offset_encoding}) Returns the UTF-32 and UTF-16 offsets for a position in a certain buffer. Parameters: ~ - {buf} (number) buffer number (0 for current) - {row} 0-indexed line - {col} 0-indexed byte offset in line - {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to + • {buf} (number) buffer number (0 for current) + • {row} 0-indexed line + • {col} 0-indexed byte offset in line + • {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to `offset_encoding` of first client of `buf` Return: ~ @@ -1441,8 +1441,8 @@ convert_input_to_markdown_lines({input}, {contents}) `textDocument/signatureHelp`, and potentially others. Parameters: ~ - {input} (`MarkedString` | `MarkedString[]` | `MarkupContent`) - {contents} (table, optional, default `{}`) List of strings to extend + • {input} (`MarkedString` | `MarkedString[]` | `MarkupContent`) + • {contents} (table, optional, default `{}`) List of strings to extend with converted lines Return: ~ @@ -1456,10 +1456,10 @@ convert_signature_help_to_markdown_lines({signature_help}, {ft}, {triggers}) Converts `textDocument/SignatureHelp` response to markdown lines. Parameters: ~ - {signature_help} Response of `textDocument/SignatureHelp` - {ft} optional filetype that will be use as the `lang` for + • {signature_help} Response of `textDocument/SignatureHelp` + • {ft} optional filetype that will be use as the `lang` for the label markdown code block - {triggers} optional list of trigger characters from the lsp + • {triggers} optional list of trigger characters from the lsp server. used to better determine parameter offsets Return: ~ @@ -1473,7 +1473,7 @@ extract_completion_items({result}) Can be used to extract the completion items from a `textDocument/completion` request, which may return one of `CompletionItem[]` , `CompletionList` or null. Parameters: ~ - {result} (table) The result of a `textDocument/completion` request + • {result} (table) The result of a `textDocument/completion` request Return: ~ (table) List of completion items @@ -1485,7 +1485,7 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()* Returns indentation size. Parameters: ~ - {bufnr} (number|nil): Buffer handle, defaults to current + • {bufnr} (number|nil): Buffer handle, defaults to current Return: ~ (number) indentation size @@ -1498,9 +1498,9 @@ jump_to_location({location}, {offset_encoding}, {reuse_win}) Jumps to a location. Parameters: ~ - {location} (table) (`Location`|`LocationLink`) - {offset_encoding} (string) utf-8|utf-16|utf-32 (required) - {reuse_win} (boolean) Jump to existing window if buffer is + • {location} (table) (`Location`|`LocationLink`) + • {offset_encoding} (string) utf-8|utf-16|utf-32 (required) + • {reuse_win} (boolean) Jump to existing window if buffer is already opened. Return: ~ @@ -1515,8 +1515,8 @@ locations_to_items({locations}, {offset_encoding}) |setloclist()|. Parameters: ~ - {locations} (table) list of `Location`s or `LocationLink`s - {offset_encoding} (string) offset_encoding for locations + • {locations} (table) list of `Location`s or `LocationLink`s + • {offset_encoding} (string) offset_encoding for locations utf-8|utf-16|utf-32 Return: ~ @@ -1526,8 +1526,8 @@ lookup_section({settings}, {section}) *vim.lsp.util.lookup_section()* Helper function to return nested values in language server settings Parameters: ~ - {settings} a table of language server settings - {section} a string indicating the field of the settings table + • {settings} a table of language server settings + • {section} a string indicating the field of the settings table Return: ~ (table or string) The value of settings accessed via section @@ -1538,9 +1538,9 @@ make_floating_popup_options({width}, {height}, {opts}) table can be passed to |nvim_open_win()|. Parameters: ~ - {width} (number) window width (in character cells) - {height} (number) window height (in character cells) - {opts} (table, optional) + • {width} (number) window width (in character cells) + • {height} (number) window height (in character cells) + • {opts} (table, optional) • offset_x (number) offset to add to `col` • offset_y (number) offset to add to `row` • border (string or table) override `border` @@ -1556,7 +1556,7 @@ make_formatting_params({options}) cursor position. Parameters: ~ - {options} (table|nil) with valid `FormattingOptions` entries + • {options} (table|nil) with valid `FormattingOptions` entries Return: ~ `DocumentFormattingParams` object @@ -1570,13 +1570,13 @@ make_given_range_params({start_pos}, {end_pos}, {bufnr}, {offset_encoding}) similar to |vim.lsp.util.make_range_params()|. Parameters: ~ - {start_pos} number[]|nil {row, col} mark-indexed position. + • {start_pos} number[]|nil {row, col} mark-indexed position. Defaults to the start of the last visual selection. - {end_pos} number[]|nil {row, col} mark-indexed position. + • {end_pos} number[]|nil {row, col} mark-indexed position. Defaults to the end of the last visual selection. - {bufnr} (number|nil) buffer handle or 0 for current, + • {bufnr} (number|nil) buffer handle or 0 for current, defaults to current - {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to + • {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to `offset_encoding` of first client of `bufnr` Return: ~ @@ -1589,9 +1589,9 @@ make_position_params({window}, {offset_encoding}) cursor position. Parameters: ~ - {window} number|nil: window handle or 0 for current, + • {window} number|nil: window handle or 0 for current, defaults to current - {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to + • {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to `offset_encoding` of first client of buffer of `window` @@ -1609,9 +1609,9 @@ make_range_params({window}, {offset_encoding}) `textDocument/rangeFormatting`. Parameters: ~ - {window} number|nil: window handle or 0 for current, + • {window} number|nil: window handle or 0 for current, defaults to current - {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to + • {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to `offset_encoding` of first client of buffer of `window` @@ -1624,7 +1624,7 @@ make_text_document_params({bufnr}) Creates a `TextDocumentIdentifier` object for the current buffer. Parameters: ~ - {bufnr} number|nil: Buffer handle, defaults to current + • {bufnr} number|nil: Buffer handle, defaults to current Return: ~ `TextDocumentIdentifier` @@ -1637,17 +1637,17 @@ make_workspace_params({added}, {removed}) Create the workspace params Parameters: ~ - {added} - {removed} + • {added} + • {removed} *vim.lsp.util.open_floating_preview()* open_floating_preview({contents}, {syntax}, {opts}) Shows contents in a floating window. Parameters: ~ - {contents} (table) of lines to show in window - {syntax} (string) of syntax to set for opened buffer - {opts} (table) with optional fields (additional keys are passed + • {contents} (table) of lines to show in window + • {syntax} (string) of syntax to set for opened buffer + • {opts} (table) with optional fields (additional keys are passed on to |nvim_open_win()|) • height: (number) height of floating window • width: (number) width of floating window @@ -1676,7 +1676,7 @@ parse_snippet({input}) *vim.lsp.util.parse_snippet()* Parses snippets in a completion entry. Parameters: ~ - {input} (string) unparsed snippet + • {input} (string) unparsed snippet Return: ~ (string) parsed snippet @@ -1690,7 +1690,7 @@ preview_location({location}, {opts}) *vim.lsp.util.preview_location()* definition) Parameters: ~ - {location} a single `Location` or `LocationLink` + • {location} a single `Location` or `LocationLink` Return: ~ (bufnr,winnr) buffer and window number of floating window or nil @@ -1699,7 +1699,7 @@ rename({old_fname}, {new_fname}, {opts}) *vim.lsp.util.rename()* Rename old_fname to new_fname Parameters: ~ - {opts} (table) + • {opts} (table) set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()* Replaces text in a range with new text. @@ -1707,10 +1707,10 @@ set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()* CAUTION: Changes in-place! Parameters: ~ - {lines} (table) Original list of strings - {A} (table) Start position; a 2-tuple of {line, col} numbers - {B} (table) End position; a 2-tuple of {line, col} numbers - {new_lines} A list of strings to replace the original + • {lines} (table) Original list of strings + • {A} (table) Start position; a 2-tuple of {line, col} numbers + • {B} (table) End position; a 2-tuple of {line, col} numbers + • {new_lines} A list of strings to replace the original Return: ~ (table) The modified {lines} object @@ -1728,8 +1728,8 @@ stylize_markdown({bufnr}, {contents}, {opts}) `open_floating_preview` instead Parameters: ~ - {contents} (table) of lines to show in window - {opts} dictionary with optional fields + • {contents} (table) of lines to show in window + • {opts} dictionary with optional fields • height of floating window • width of floating window • wrap_at character to wrap at for computing height @@ -1746,7 +1746,7 @@ symbols_to_items({symbols}, {bufnr}) *vim.lsp.util.symbols_to_items()* Converts symbols to quickfix list items. Parameters: ~ - {symbols} DocumentSymbol[] or SymbolInformation[] + • {symbols} DocumentSymbol[] or SymbolInformation[] *vim.lsp.util.text_document_completion_list_to_complete_items()* text_document_completion_list_to_complete_items({result}, {prefix}) @@ -1754,10 +1754,10 @@ text_document_completion_list_to_complete_items({result}, {prefix}) vim-compatible |complete-items|. Parameters: ~ - {result} The result of a `textDocument/completion` call, e.g. from + • {result} The result of a `textDocument/completion` call, e.g. from |vim.lsp.buf.completion()|, which may be one of `CompletionItem[]`, `CompletionList` or `null` - {prefix} (string) the prefix to filter the completion items + • {prefix} (string) the prefix to filter the completion items Return: ~ { matches = complete-items table, incomplete = bool } @@ -1769,7 +1769,7 @@ trim_empty_lines({lines}) *vim.lsp.util.trim_empty_lines()* Removes empty lines from the beginning and end. Parameters: ~ - {lines} (table) list of lines to trim + • {lines} (table) list of lines to trim Return: ~ (table) trimmed list of lines @@ -1782,7 +1782,7 @@ try_trim_markdown_code_blocks({lines}) CAUTION: Modifies the input in-place! Parameters: ~ - {lines} (table) list of lines + • {lines} (table) list of lines Return: ~ (string) filetype or "markdown" if it was unchanged. @@ -1807,20 +1807,20 @@ set_format_func({handle}) *vim.lsp.log.set_format_func()* Sets formatting function used to format logs Parameters: ~ - {handle} (function) function to apply to logging arguments, pass + • {handle} (function) function to apply to logging arguments, pass vim.inspect for multi-line formatting set_level({level}) *vim.lsp.log.set_level()* Sets the current log level. Parameters: ~ - {level} (string or number) One of `vim.lsp.log.levels` + • {level} (string or number) One of `vim.lsp.log.levels` should_log({level}) *vim.lsp.log.should_log()* Checks whether the level is sufficient for logging. Parameters: ~ - {level} (number) log level + • {level} (number) log level Return: ~ (bool) true if would log, false if not @@ -1834,8 +1834,8 @@ connect({host}, {port}) *vim.lsp.rpc.connect()* and port Parameters: ~ - {host} (string) - {port} (number) + • {host} (string) + • {port} (number) Return: ~ (function) @@ -1844,7 +1844,7 @@ format_rpc_error({err}) *vim.lsp.rpc.format_rpc_error()* Constructs an error message from an LSP error object. Parameters: ~ - {err} (table) The error object + • {err} (table) The error object Return: ~ (string) The formatted error message @@ -1853,8 +1853,8 @@ notify({method}, {params}) *vim.lsp.rpc.notify()* Sends a notification to the LSP server. Parameters: ~ - {method} (string) The invoked LSP method - {params} (table|nil): Parameters for the invoked LSP method + • {method} (string) The invoked LSP method + • {params} (table|nil): Parameters for the invoked LSP method Return: ~ (bool) `true` if notification could be sent, `false` if not @@ -1864,11 +1864,11 @@ request({method}, {params}, {callback}, {notify_reply_callback}) Sends a request to the LSP server and runs {callback} upon response. Parameters: ~ - {method} (string) The invoked LSP method - {params} (table|nil) Parameters for the invoked LSP + • {method} (string) The invoked LSP method + • {params} (table|nil) Parameters for the invoked LSP method - {callback} (function) Callback to invoke - {notify_reply_callback} (function|nil) Callback to invoke as soon as + • {callback} (function) Callback to invoke + • {notify_reply_callback} (function|nil) Callback to invoke as soon as a request is no longer pending Return: ~ @@ -1880,10 +1880,10 @@ rpc_response_error({code}, {message}, {data}) Creates an RPC response object/table. Parameters: ~ - {code} (number) RPC error code defined in + • {code} (number) RPC error code defined in `vim.lsp.protocol.ErrorCodes` - {message} (string|nil) arbitrary message to send to server - {data} any|nil arbitrary data to send to server + • {message} (string|nil) arbitrary message to send to server + • {data} any|nil arbitrary data to send to server *vim.lsp.rpc.start()* start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params}) @@ -1893,16 +1893,16 @@ start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params}) |vim.lsp.rpc.connect()| Parameters: ~ - {cmd} (string) Command to start the LSP server. - {cmd_args} (table) List of additional string arguments to + • {cmd} (string) Command to start the LSP server. + • {cmd_args} (table) List of additional string arguments to pass to {cmd}. - {dispatchers} (table|nil) Dispatchers for LSP message types. + • {dispatchers} (table|nil) Dispatchers for LSP message types. Valid dispatcher names are: • `"notification"` • `"server_request"` • `"on_error"` • `"on_exit"` - {extra_spawn_params} (table|nil) Additional context for the LSP + • {extra_spawn_params} (table|nil) Additional context for the LSP server process. May contain: • {cwd} (string) Working directory for the LSP server process @@ -1926,14 +1926,14 @@ compute_diff({___MissingCloseParenHere___}) Returns the range table for the difference between prev and curr lines Parameters: ~ - {prev_lines} (table) list of lines - {curr_lines} (table) list of lines - {firstline} (number) line to begin search for first difference - {lastline} (number) line to begin search in old_lines for last + • {prev_lines} (table) list of lines + • {curr_lines} (table) list of lines + • {firstline} (number) line to begin search for first difference + • {lastline} (number) line to begin search in old_lines for last difference - {new_lastline} (number) line to begin search in new_lines for last + • {new_lastline} (number) line to begin search in new_lines for last difference - {offset_encoding} (string) encoding requested by language server + • {offset_encoding} (string) encoding requested by language server Return: ~ (table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent @@ -1952,7 +1952,7 @@ resolve_capabilities({server_capabilities}) Creates a normalized object describing LSP server capabilities. Parameters: ~ - {server_capabilities} (table) Table of capabilities supported by the + • {server_capabilities} (table) Table of capabilities supported by the server Return: ~ diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 3026476ab9..5898d04a73 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1395,7 +1395,7 @@ cmd({command}) *vim.cmd()* < Parameters: ~ - {command} string|table Command(s) to execute. If a string, executes + • {command} string|table Command(s) to execute. If a string, executes multiple lines of Vim script at once. In this case, it is an alias to |nvim_exec()|, where `output` is set to false. Thus it works identical to |:source|. If a table, executes @@ -1416,8 +1416,8 @@ defer_fn({fn}, {timeout}) *vim.defer_fn()* are safe to call. Parameters: ~ - {fn} Callback to call once `timeout` expires - {timeout} Number of milliseconds to wait before calling `fn` + • {fn} Callback to call once `timeout` expires + • {timeout} Number of milliseconds to wait before calling `fn` Return: ~ timer luv timer object @@ -1427,13 +1427,13 @@ deprecate({name}, {alternative}, {version}, {plugin}, {backtrace}) Display a deprecation notification to the user. Parameters: ~ - {name} string Deprecated function. - {alternative} (string|nil) Preferred alternative function. - {version} string Version in which the deprecated function will be + • {name} string Deprecated function. + • {alternative} (string|nil) Preferred alternative function. + • {version} string Version in which the deprecated function will be removed. - {plugin} string|nil Plugin name that the function will be + • {plugin} string|nil Plugin name that the function will be removed from. Defaults to "Nvim". - {backtrace} boolean|nil Prints backtrace. Defaults to true. + • {backtrace} boolean|nil Prints backtrace. Defaults to true. inspect({object}, {options}) *vim.inspect()* Return a human-readable representation of the given object. @@ -1450,9 +1450,9 @@ notify({msg}, {level}, {opts}) *vim.notify()* writes to |:messages|. Parameters: ~ - {msg} (string) Content of the notification to show to the user. - {level} (number|nil) One of the values from |vim.log.levels|. - {opts} (table|nil) Optional parameters. Unused by default. + • {msg} (string) Content of the notification to show to the user. + • {level} (number|nil) One of the values from |vim.log.levels|. + • {opts} (table|nil) Optional parameters. Unused by default. notify_once({msg}, {level}, {opts}) *vim.notify_once()* Display a notification only one time. @@ -1461,9 +1461,9 @@ notify_once({msg}, {level}, {opts}) *vim.notify_once()* display a notification. Parameters: ~ - {msg} (string) Content of the notification to show to the user. - {level} (number|nil) One of the values from |vim.log.levels|. - {opts} (table|nil) Optional parameters. Unused by default. + • {msg} (string) Content of the notification to show to the user. + • {level} (number|nil) One of the values from |vim.log.levels|. + • {opts} (table|nil) Optional parameters. Unused by default. Return: ~ (boolean) true if message was displayed, else false @@ -1482,11 +1482,11 @@ on_key({fn}, {ns_id}) *vim.on_key()* {fn} will receive the keys after mappings have been evaluated Parameters: ~ - {fn} function: Callback function. It should take one string + • {fn} function: Callback function. It should take one string argument. On each key press, Nvim passes the key char to fn(). |i_CTRL-V| If {fn} is nil, it removes the callback for the associated {ns_id} - {ns_id} number? Namespace ID. If nil or 0, generates and returns a + • {ns_id} number? Namespace ID. If nil or 0, generates and returns a new |nvim_create_namespace()| id. Return: ~ @@ -1514,8 +1514,8 @@ paste({lines}, {phase}) *vim.paste()* < Parameters: ~ - {lines} |readfile()|-style list of lines to paste. |channel-lines| - {phase} -1: "non-streaming" paste: the call contains all lines. If + • {lines} |readfile()|-style list of lines to paste. |channel-lines| + • {phase} -1: "non-streaming" paste: the call contains all lines. If paste is "streamed", `phase` indicates the stream state: • 1: starts the paste (exactly once) • 2: continues the paste (zero or more times) @@ -1544,11 +1544,11 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()* points Parameters: ~ - {bufnr} (number) of buffer - {pos1} (line, column) tuple marking beginning of region - {pos2} (line, column) tuple marking end of region - {regtype} type of selection, see |setreg()| - {inclusive} (boolean) indicating whether the selection is + • {bufnr} (number) of buffer + • {pos1} (line, column) tuple marking beginning of region + • {pos2} (line, column) tuple marking end of region + • {regtype} type of selection, see |setreg()| + • {inclusive} (boolean) indicating whether the selection is end-inclusive Return: ~ @@ -1571,8 +1571,8 @@ deep_equal({a}, {b}) *vim.deep_equal()* Tables are compared recursively unless they both provide the `eq` metamethod. All other types are compared using the equality `==` operator. Parameters: ~ - {a} any First value - {b} any Second value + • {a} any First value + • {b} any Second value Return: ~ (boolean) `true` if values are equals, else `false` @@ -1585,7 +1585,7 @@ deepcopy({orig}) *vim.deepcopy()* not copied and will throw an error. Parameters: ~ - {orig} (table) Table to copy + • {orig} (table) Table to copy Return: ~ (table) Table of copied keys and (nested) values. @@ -1606,7 +1606,7 @@ defaulttable({create}) *vim.defaulttable()* < Parameters: ~ - {create} (function|nil) The function called to create a missing + • {create} (function|nil) The function called to create a missing value. Return: ~ @@ -1616,8 +1616,8 @@ endswith({s}, {suffix}) *vim.endswith()* Tests if `s` ends with `suffix`. Parameters: ~ - {s} (string) String - {suffix} (string) Suffix to match + • {s} (string) String + • {suffix} (string) Suffix to match Return: ~ (boolean) `true` if `suffix` is a suffix of `s` @@ -1626,9 +1626,9 @@ gsplit({s}, {sep}, {plain}) *vim.gsplit()* Splits a string at each instance of a separator. Parameters: ~ - {s} (string) String to split - {sep} (string) Separator or pattern - {plain} (boolean) If `true` use `sep` literally (passed to + • {s} (string) String to split + • {sep} (string) Separator or pattern + • {plain} (boolean) If `true` use `sep` literally (passed to string.find) Return: ~ @@ -1643,7 +1643,7 @@ is_callable({f}) *vim.is_callable()* Returns true if object `f` can be called as a function. Parameters: ~ - {f} any Any object + • {f} any Any object Return: ~ (boolean) `true` if `f` is callable, else `false` @@ -1654,10 +1654,10 @@ list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()* NOTE: This mutates dst! Parameters: ~ - {dst} (table) List which will be modified and appended to - {src} (table) List from which values will be inserted - {start} (number) Start index on src. Defaults to 1 - {finish} (number) Final index on src. Defaults to `#src` + • {dst} (table) List which will be modified and appended to + • {src} (table) List from which values will be inserted + • {start} (number) Start index on src. Defaults to 1 + • {finish} (number) Final index on src. Defaults to `#src` Return: ~ (table) dst @@ -1670,9 +1670,9 @@ list_slice({list}, {start}, {finish}) *vim.list_slice()* (inclusive) Parameters: ~ - {list} (table) Table - {start} (number) Start range of slice - {finish} (number) End range of slice + • {list} (table) Table + • {start} (number) Start range of slice + • {finish} (number) End range of slice Return: ~ (table) Copy of table sliced from start to finish (inclusive) @@ -1681,7 +1681,7 @@ pesc({s}) *vim.pesc()* Escapes magic chars in |lua-patterns|. Parameters: ~ - {s} (string) String to escape + • {s} (string) String to escape Return: ~ (string) %-escaped pattern string @@ -1701,9 +1701,9 @@ split({s}, {sep}, {kwargs}) *vim.split()* < Parameters: ~ - {s} (string) String to split - {sep} (string) Separator or pattern - {kwargs} (table) Keyword arguments: + • {s} (string) String to split + • {sep} (string) Separator or pattern + • {kwargs} (table) Keyword arguments: • plain: (boolean) If `true` use `sep` literally (passed to string.find) • trimempty: (boolean) If `true` remove empty items from the @@ -1719,8 +1719,8 @@ startswith({s}, {prefix}) *vim.startswith()* Tests if `s` starts with `prefix`. Parameters: ~ - {s} (string) String - {prefix} (string) Prefix to match + • {s} (string) String + • {prefix} (string) Prefix to match Return: ~ (boolean) `true` if `prefix` is a prefix of `s` @@ -1732,7 +1732,7 @@ tbl_add_reverse_lookup({o}) *vim.tbl_add_reverse_lookup()* Note that this modifies the input. Parameters: ~ - {o} (table) Table to add the reverse to + • {o} (table) Table to add the reverse to Return: ~ (table) o @@ -1741,8 +1741,8 @@ tbl_contains({t}, {value}) *vim.tbl_contains()* Checks if a list-like (vector) table contains `value`. Parameters: ~ - {t} (table) Table to check - {value} any Value to compare + • {t} (table) Table to check + • {value} any Value to compare Return: ~ (boolean) `true` if `t` contains `value` @@ -1756,7 +1756,7 @@ tbl_count({t}) *vim.tbl_count()* < Parameters: ~ - {t} (table) Table + • {t} (table) Table Return: ~ (number) Number of non-nil values in table @@ -1768,12 +1768,12 @@ tbl_deep_extend({behavior}, {...}) *vim.tbl_deep_extend()* Merges recursively two or more map-like tables. Parameters: ~ - {behavior} (string) Decides what to do if a key is found in more than + • {behavior} (string) Decides what to do if a key is found in more than one map: • "error": raise an error • "keep": use value from the leftmost map • "force": use value from the rightmost map - {...} (table) Two or more map-like tables + • {...} (table) Two or more map-like tables Return: ~ (table) Merged table @@ -1785,12 +1785,12 @@ tbl_extend({behavior}, {...}) *vim.tbl_extend()* Merges two or more map-like tables. Parameters: ~ - {behavior} (string) Decides what to do if a key is found in more than + • {behavior} (string) Decides what to do if a key is found in more than one map: • "error": raise an error • "keep": use value from the leftmost map • "force": use value from the rightmost map - {...} (table) Two or more map-like tables + • {...} (table) Two or more map-like tables Return: ~ (table) Merged table @@ -1802,8 +1802,8 @@ tbl_filter({func}, {t}) *vim.tbl_filter()* Filter a table using a predicate function Parameters: ~ - {func} function|table Function or callable table - {t} (table) Table + • {func} function|table Function or callable table + • {t} (table) Table Return: ~ (table) Table of filtered values @@ -1813,7 +1813,7 @@ tbl_flatten({t}) *vim.tbl_flatten()* "unrolled" and appended to the result. Parameters: ~ - {t} (table) List-like table + • {t} (table) List-like table Return: ~ (table) Flattened copy of the given list-like table @@ -1832,8 +1832,8 @@ tbl_get({o}, {...}) *vim.tbl_get()* < Parameters: ~ - {o} (table) Table to index - {...} (string) Optional strings (0 or more, variadic) via which to + • {o} (table) Table to index + • {...} (string) Optional strings (0 or more, variadic) via which to index the table Return: ~ @@ -1843,7 +1843,7 @@ tbl_isempty({t}) *vim.tbl_isempty()* Checks if a table is empty. Parameters: ~ - {t} (table) Table to check + • {t} (table) Table to check Return: ~ (boolean) `true` if `t` is empty @@ -1859,7 +1859,7 @@ tbl_islist({t}) *vim.tbl_islist()* for example from |rpcrequest()| or |vim.fn|. Parameters: ~ - {t} (table) Table + • {t} (table) Table Return: ~ (boolean) `true` if array-like table, else `false` @@ -1869,7 +1869,7 @@ tbl_keys({t}) *vim.tbl_keys()* return table of keys is not guaranteed. Parameters: ~ - {t} (table) Table + • {t} (table) Table Return: ~ (table) List of keys @@ -1881,8 +1881,8 @@ tbl_map({func}, {t}) *vim.tbl_map()* Apply a function to all values of a table. Parameters: ~ - {func} function|table Function or callable table - {t} (table) Table + • {func} function|table Function or callable table + • {t} (table) Table Return: ~ (table) Table of transformed values @@ -1892,7 +1892,7 @@ tbl_values({t}) *vim.tbl_values()* return table of values is not guaranteed. Parameters: ~ - {t} (table) Table + • {t} (table) Table Return: ~ (table) List of values @@ -1901,7 +1901,7 @@ trim({s}) *vim.trim()* Trim whitespace (Lua pattern "%s") from both sides of a string. Parameters: ~ - {s} (string) String to trim + • {s} (string) String to trim Return: ~ (string) String with whitespace removed from its beginning and end @@ -1946,7 +1946,7 @@ validate({opt}) *vim.validate()* < Parameters: ~ - {opt} (table) Names of parameters to validate. Each key is a + • {opt} (table) Names of parameters to validate. Each key is a parameter name; each value is a tuple in one of these forms: 1. (arg_value, type_name, optional) • arg_value: argument value @@ -1971,7 +1971,7 @@ uri_from_bufnr({bufnr}) *vim.uri_from_bufnr()* Get a URI from a bufnr Parameters: ~ - {bufnr} (number) + • {bufnr} (number) Return: ~ (string) URI @@ -1980,7 +1980,7 @@ uri_from_fname({path}) *vim.uri_from_fname()* Get a URI from a file path. Parameters: ~ - {path} (string) Path to file + • {path} (string) Path to file Return: ~ (string) URI @@ -1990,7 +1990,7 @@ uri_to_bufnr({uri}) *vim.uri_to_bufnr()* the uri already exists. Parameters: ~ - {uri} (string) + • {uri} (string) Return: ~ (number) bufnr @@ -1999,7 +1999,7 @@ uri_to_fname({uri}) *vim.uri_to_fname()* Get a filename from a URI Parameters: ~ - {uri} (string) + • {uri} (string) Return: ~ (string) filename or unchanged URI for non-file URIs @@ -2019,7 +2019,7 @@ input({opts}, {on_confirm}) *vim.ui.input()* < Parameters: ~ - {opts} (table) Additional options. See |input()| + • {opts} (table) Additional options. See |input()| • prompt (string|nil) Text of the prompt • default (string|nil) Default reply to the input • completion (string|nil) Specifies type of completion @@ -2028,7 +2028,7 @@ input({opts}, {on_confirm}) *vim.ui.input()* "-complete=" argument. See |:command-completion| • highlight (function) Function that will be used for highlighting user inputs. - {on_confirm} (function) ((input|nil) -> ()) Called once the user + • {on_confirm} (function) ((input|nil) -> ()) Called once the user confirms or abort the input. `input` is what the user typed. `nil` if the user aborted the dialog. @@ -2052,8 +2052,8 @@ select({items}, {opts}, {on_choice}) *vim.ui.select()* < Parameters: ~ - {items} (table) Arbitrary items - {opts} (table) Additional options + • {items} (table) Arbitrary items + • {opts} (table) Additional options • prompt (string|nil) Text of the prompt. Defaults to `Select one of:` • format_item (function item -> text) Function to format @@ -2063,7 +2063,7 @@ select({items}, {opts}, {on_choice}) *vim.ui.select()* item shape. Plugins reimplementing `vim.ui.select` may wish to use this to infer the structure or semantics of `items`, or the context in which select() was called. - {on_choice} (function) ((item|nil, idx|nil) -> ()) Called once the + • {on_choice} (function) ((item|nil, idx|nil) -> ()) Called once the user made a choice. `idx` is the 1-based index of `item` within `items`. `nil` if the user aborted the dialog. @@ -2157,7 +2157,7 @@ add({filetypes}) *vim.filetype.add()* < Parameters: ~ - {filetypes} (table) A table containing new filetype maps (see + • {filetypes} (table) A table containing new filetype maps (see example). match({args}) *vim.filetype.match()* @@ -2192,7 +2192,7 @@ match({args}) *vim.filetype.match()* < Parameters: ~ - {args} (table) Table specifying which matching strategy to use. + • {args} (table) Table specifying which matching strategy to use. Accepted keys are: • buf (number): Buffer number to use for matching. Mutually exclusive with {contents} @@ -2226,7 +2226,7 @@ del({modes}, {lhs}, {opts}) *vim.keymap.del()* < Parameters: ~ - {opts} (table|nil) A table of optional arguments: + • {opts} (table|nil) A table of optional arguments: • buffer: (number or boolean) Remove a mapping from the given buffer. When "true" or 0, use the current buffer. @@ -2266,12 +2266,12 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()* < Parameters: ~ - {mode} string|table Same mode short names as |nvim_set_keymap()|. Can + • {mode} string|table Same mode short names as |nvim_set_keymap()|. Can also be list of modes to create mapping on multiple modes. - {lhs} (string) Left-hand side |{lhs}| of the mapping. - {rhs} string|function Right-hand side |{rhs}| of the mapping. Can + • {lhs} (string) Left-hand side |{lhs}| of the mapping. + • {rhs} string|function Right-hand side |{rhs}| of the mapping. Can also be a Lua function. - {opts} (table|nil) A table of |:map-arguments|. + • {opts} (table|nil) A table of |:map-arguments|. • Accepts options accepted by the {opts} parameter in |nvim_set_keymap()|, with the following notable differences: • replace_keycodes: Defaults to `true` if "expr" is `true`. @@ -2297,7 +2297,7 @@ basename({file}) *vim.fs.basename()* Return the basename of the given file or directory Parameters: ~ - {file} (string) File or directory + • {file} (string) File or directory Return: ~ (string) Basename of {file} @@ -2306,7 +2306,7 @@ dir({path}) *vim.fs.dir()* Return an iterator over the files and directories located in {path} Parameters: ~ - {path} (string) An absolute or relative path to the directory to + • {path} (string) An absolute or relative path to the directory to iterate over. The path is first normalized |vim.fs.normalize()|. @@ -2319,7 +2319,7 @@ dirname({file}) *vim.fs.dirname()* Return the parent directory of the given file or directory Parameters: ~ - {file} (string) File or directory + • {file} (string) File or directory Return: ~ (string) Parent directory of {file} @@ -2337,11 +2337,11 @@ find({names}, {opts}) *vim.fs.find()* specifying {type} to be "file" or "directory", respectively. Parameters: ~ - {names} (string|table|fun(name: string): boolean) Names of the files + • {names} (string|table|fun(name: string): boolean) Names of the files and directories to find. Must be base names, paths and globs are not supported. If a function it is called per file and dir within the traversed directories to test if they match. - {opts} (table) Optional keyword arguments: + • {opts} (table) Optional keyword arguments: • path (string): Path to begin searching from. If omitted, the current working directory is used. • upward (boolean, default false): If true, search upward @@ -2378,7 +2378,7 @@ normalize({path}) *vim.fs.normalize()* < Parameters: ~ - {path} (string) Path to normalize + • {path} (string) Path to normalize Return: ~ (string) Normalized path @@ -2402,7 +2402,7 @@ parents({start}) *vim.fs.parents()* < Parameters: ~ - {start} (string) Initial file or directory. + • {start} (string) Initial file or directory. Return: ~ (function) Iterator diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 75395e89ac..c836ccec8c 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -429,7 +429,7 @@ get_captures_at_cursor({winnr}) *get_captures_at_cursor()* Returns a list of highlight capture names under the cursor Parameters: ~ - {winnr} (number|nil) Window handle or 0 for current window (default) + • {winnr} (number|nil) Window handle or 0 for current window (default) Return: ~ string[] List of capture names @@ -442,9 +442,9 @@ get_captures_at_pos({bufnr}, {row}, {col}) *get_captures_at_pos()* if none are defined). Parameters: ~ - {bufnr} (number) Buffer number (0 for current buffer) - {row} (number) Position row - {col} (number) Position column + • {bufnr} (number) Buffer number (0 for current buffer) + • {row} (number) Position row + • {col} (number) Position column Return: ~ table[] List of captures `{ capture = "capture name", metadata = { ... @@ -454,7 +454,7 @@ get_node_at_cursor({winnr}) *get_node_at_cursor()* Returns the smallest named node under the cursor Parameters: ~ - {winnr} (number|nil) Window handle or 0 for current window (default) + • {winnr} (number|nil) Window handle or 0 for current window (default) Return: ~ (string) Name of node under the cursor @@ -463,10 +463,10 @@ get_node_at_pos({bufnr}, {row}, {col}, {opts}) *get_node_at_pos()* Returns the smallest named node at the given position Parameters: ~ - {bufnr} (number) Buffer number (0 for current buffer) - {row} (number) Position row - {col} (number) Position column - {opts} (table) Optional keyword arguments: + • {bufnr} (number) Buffer number (0 for current buffer) + • {row} (number) Position row + • {col} (number) Position column + • {opts} (table) Optional keyword arguments: • ignore_injections boolean Ignore injected languages (default true) @@ -477,7 +477,7 @@ get_node_range({node_or_range}) *get_node_range()* Returns the node's range or an unpacked range table Parameters: ~ - {node_or_range} (userdata|table) |tsnode| or table of positions + • {node_or_range} (userdata|table) |tsnode| or table of positions Return: ~ (table) `{ start_row, start_col, end_row, end_col }` @@ -489,11 +489,11 @@ get_parser({bufnr}, {lang}, {opts}) *get_parser()* If needed, this will create the parser. Parameters: ~ - {bufnr} (number|nil) Buffer the parser should be tied to (default: + • {bufnr} (number|nil) Buffer the parser should be tied to (default: current buffer) - {lang} (string|nil) Filetype of this parser (default: buffer + • {lang} (string|nil) Filetype of this parser (default: buffer filetype) - {opts} (table|nil) Options to pass to the created language tree + • {opts} (table|nil) Options to pass to the created language tree Return: ~ LanguageTree |LanguageTree| object to use for parsing @@ -502,9 +502,9 @@ get_string_parser({str}, {lang}, {opts}) *get_string_parser()* Returns a string parser Parameters: ~ - {str} (string) Text to parse - {lang} (string) Language of this string - {opts} (table|nil) Options to pass to the created language tree + • {str} (string) Text to parse + • {lang} (string) Language of this string + • {opts} (table|nil) Options to pass to the created language tree Return: ~ LanguageTree |LanguageTree| object to use for parsing @@ -513,8 +513,8 @@ is_ancestor({dest}, {source}) *is_ancestor()* Determines whether a node is the ancestor of another Parameters: ~ - {dest} userdata Possible ancestor |tsnode| - {source} userdata Possible descendant |tsnode| + • {dest} userdata Possible ancestor |tsnode| + • {source} userdata Possible descendant |tsnode| Return: ~ (boolean) True if {dest} is an ancestor of {source} @@ -523,9 +523,9 @@ is_in_node_range({node}, {line}, {col}) *is_in_node_range()* Determines whether (line, col) position is in node range Parameters: ~ - {node} userdata |tsnode| defining the range - {line} (number) Line (0-based) - {col} (number) Column (0-based) + • {node} userdata |tsnode| defining the range + • {line} (number) Line (0-based) + • {col} (number) Column (0-based) Return: ~ (boolean) True if the position is in node range @@ -534,8 +534,8 @@ node_contains({node}, {range}) *node_contains()* Determines if a node contains a range Parameters: ~ - {node} userdata |tsnode| - {range} (table) + • {node} userdata |tsnode| + • {range} (table) Return: ~ (boolean) True if the {node} contains the {range} @@ -560,16 +560,16 @@ start({bufnr}, {lang}) *start()* < Parameters: ~ - {bufnr} (number|nil) Buffer to be highlighted (default: current + • {bufnr} (number|nil) Buffer to be highlighted (default: current buffer) - {lang} (string|nil) Language of the parser (default: buffer + • {lang} (string|nil) Language of the parser (default: buffer filetype) stop({bufnr}) *stop()* Stops treesitter highlighting for a buffer Parameters: ~ - {bufnr} (number|nil) Buffer to stop highlighting (default: current + • {bufnr} (number|nil) Buffer to stop highlighting (default: current buffer) @@ -583,7 +583,7 @@ inspect_language({lang}) *inspect_language()* names, ... Parameters: ~ - {lang} (string) Language + • {lang} (string) Language Return: ~ (table) @@ -596,11 +596,11 @@ require_language({lang}, {path}, {silent}, {symbol_name}) {path} Parameters: ~ - {lang} (string) Language the parser should parse - {path} (string|nil) Optional path the parser is located at - {silent} (boolean|nil) Don't throw an error if language not + • {lang} (string) Language the parser should parse + • {path} (string|nil) Optional path the parser is located at + • {silent} (boolean|nil) Don't throw an error if language not found - {symbol_name} (string|nil) Internal symbol name for the language to + • {symbol_name} (string|nil) Internal symbol name for the language to load Return: ~ @@ -619,26 +619,26 @@ add_directive({name}, {handler}, {force}) *add_directive()* `metadata[capture_id].key = value` Parameters: ~ - {name} (string) Name of the directive, without leading # - {handler} function(match:string, pattern:string, bufnr:number, + • {name} (string) Name of the directive, without leading # + • {handler} function(match:string, pattern:string, bufnr:number, predicate:function, metadata:table) add_predicate({name}, {handler}, {force}) *add_predicate()* Adds a new predicate to be used in queries Parameters: ~ - {name} (string) Name of the predicate, without leading # - {handler} function(match:string, pattern:string, bufnr:number, + • {name} (string) Name of the predicate, without leading # + • {handler} function(match:string, pattern:string, bufnr:number, predicate:function) get_node_text({node}, {source}, {opts}) *get_node_text()* Gets the text corresponding to a given node Parameters: ~ - {node} userdata |tsnode| - {source} (number|string) Buffer or string from which the {node} is + • {node} userdata |tsnode| + • {source} (number|string) Buffer or string from which the {node} is extracted - {opts} (table|nil) Optional parameters. + • {opts} (table|nil) Optional parameters. • concat: (boolean) Concatenate result in a string (default true) @@ -649,8 +649,8 @@ get_query({lang}, {query_name}) *get_query()* Returns the runtime query {query_name} for {lang}. Parameters: ~ - {lang} (string) Language to use for the query - {query_name} (string) Name of the query (e.g. "highlights") + • {lang} (string) Language to use for the query + • {query_name} (string) Name of the query (e.g. "highlights") Return: ~ Query Parsed query @@ -660,9 +660,9 @@ get_query_files({lang}, {query_name}, {is_included}) Gets the list of files used to make up a query Parameters: ~ - {lang} (string) Language to get query for - {query_name} (string) Name of the query to load (e.g., "highlights") - {is_included} (boolean|nil) Internal parameter, most of the time left + • {lang} (string) Language to get query for + • {query_name} (string) Name of the query to load (e.g., "highlights") + • {is_included} (boolean|nil) Internal parameter, most of the time left as `nil` Return: ~ @@ -694,8 +694,8 @@ parse_query({lang}, {query}) *parse_query()* • `info.patterns` contains information about predicates. Parameters: ~ - {lang} (string) Language to use for the query - {query} (string) Query in s-expr syntax + • {lang} (string) Language to use for the query + • {query} (string) Query in s-expr syntax Return: ~ Query Parsed query @@ -726,11 +726,11 @@ Query:iter_captures({self}, {node}, {source}, {start}, {stop}) < Parameters: ~ - {node} userdata |tsnode| under which the search will occur - {source} (number|string) Source buffer or string to extract text from - {start} (number) Starting line for the search - {stop} (number) Stopping line for the search (end-exclusive) - {self} + • {node} userdata |tsnode| under which the search will occur + • {source} (number|string) Source buffer or string to extract text from + • {start} (number) Starting line for the search + • {stop} (number) Stopping line for the search (end-exclusive) + • {self} Return: ~ (number) capture Matching capture id @@ -761,11 +761,11 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop}) < Parameters: ~ - {node} userdata |tsnode| under which the search will occur - {source} (number|string) Source buffer or string to search - {start} (number) Starting line for the search - {stop} (number) Stopping line for the search (end-exclusive) - {self} + • {node} userdata |tsnode| under which the search will occur + • {source} (number|string) Source buffer or string to search + • {start} (number) Starting line for the search + • {stop} (number) Stopping line for the search (end-exclusive) + • {self} Return: ~ (number) pattern id @@ -779,9 +779,9 @@ set_query({lang}, {query_name}, {text}) *set_query()* by plugins. Parameters: ~ - {lang} (string) Language to use for the query - {query_name} (string) Name of the query (e.g., "highlights") - {text} (string) Query text (unparsed). + • {lang} (string) Language to use for the query + • {query_name} (string) Name of the query (e.g., "highlights") + • {text} (string) Query text (unparsed). ============================================================================== @@ -791,8 +791,8 @@ new({tree}, {opts}) *highlighter.new()* Creates a new highlighter using Parameters: ~ - {tree} LanguageTree |LanguageTree| parser object to use for highlighting - {opts} (table|nil) Configuration of the highlighter: + • {tree} LanguageTree |LanguageTree| parser object to use for highlighting + • {opts} (table|nil) Configuration of the highlighter: • queries table overwrite queries used by the highlighter Return: ~ @@ -802,7 +802,7 @@ TSHighlighter:destroy({self}) *TSHighlighter:destroy()* Removes all internal references to the highlighter Parameters: ~ - {self} + • {self} ============================================================================== @@ -812,14 +812,14 @@ LanguageTree:children({self}) *LanguageTree:children()* Returns a map of language to child tree. Parameters: ~ - {self} + • {self} LanguageTree:contains({self}, {range}) *LanguageTree:contains()* Determines whether {range} is contained in the |LanguageTree|. Parameters: ~ - {range} (table) `{ start_line, start_col, end_line, end_col }` - {self} + • {range} (table) `{ start_line, start_col, end_line, end_col }` + • {self} Return: ~ (boolean) @@ -832,17 +832,17 @@ LanguageTree:destroy({self}) *LanguageTree:destroy()* Note: This DOES NOT remove this tree from a parent. Instead, `remove_child` must be called on the parent to remove it. Parameters: ~ - {self} + • {self} *LanguageTree:for_each_child()* LanguageTree:for_each_child({self}, {fn}, {include_self}) Invokes the callback for each |LanguageTree| and its children recursively Parameters: ~ - {fn} function(tree: LanguageTree, lang: string) - {include_self} (boolean) Whether to include the invoking tree in the + • {fn} function(tree: LanguageTree, lang: string) + • {include_self} (boolean) Whether to include the invoking tree in the results - {self} + • {self} LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()* Invokes the callback for each |LanguageTree| recursively. @@ -850,40 +850,40 @@ LanguageTree:for_each_tree({self}, {fn}) *LanguageTree:for_each_tree()* Note: This includes the invoking tree's child trees as well. Parameters: ~ - {fn} function(tree: TSTree, languageTree: LanguageTree) - {self} + • {fn} function(tree: TSTree, languageTree: LanguageTree) + • {self} LanguageTree:included_regions({self}) *LanguageTree:included_regions()* Gets the set of included regions Parameters: ~ - {self} + • {self} LanguageTree:invalidate({self}, {reload}) *LanguageTree:invalidate()* Invalidates this parser and all its children Parameters: ~ - {self} + • {self} LanguageTree:is_valid({self}) *LanguageTree:is_valid()* Determines whether this tree is valid. If the tree is invalid, call `parse()` . This will return the updated tree. Parameters: ~ - {self} + • {self} LanguageTree:lang({self}) *LanguageTree:lang()* Gets the language of this tree node. Parameters: ~ - {self} + • {self} *LanguageTree:language_for_range()* LanguageTree:language_for_range({self}, {range}) Gets the appropriate language that contains {range}. Parameters: ~ - {range} (table) `{ start_line, start_col, end_line, end_col }` - {self} + • {range} (table) `{ start_line, start_col, end_line, end_col }` + • {self} Return: ~ LanguageTree Managing {range} @@ -893,11 +893,11 @@ LanguageTree:named_node_for_range({self}, {range}, {opts}) Gets the smallest named node that contains {range}. Parameters: ~ - {range} (table) `{ start_line, start_col, end_line, end_col }` - {opts} (table|nil) Optional keyword arguments: + • {range} (table) `{ start_line, start_col, end_line, end_col }` + • {opts} (table|nil) Optional keyword arguments: • ignore_injections boolean Ignore injected languages (default true) - {self} + • {self} Return: ~ userdata|nil Found |tsnode| @@ -908,7 +908,7 @@ LanguageTree:parse({self}) *LanguageTree:parse()* determine if any child languages should be created. Parameters: ~ - {self} + • {self} Return: ~ userdata[] Table of parsed |tstree| @@ -918,7 +918,7 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()* Registers callbacks for the |LanguageTree|. Parameters: ~ - {cbs} (table) An |nvim_buf_attach()|-like table argument with the + • {cbs} (table) An |nvim_buf_attach()|-like table argument with the following handlers: • `on_bytes` : see |nvim_buf_attach()|, but this will be called after the parsers callback. • `on_changedtree` : a callback that will be called every time @@ -929,24 +929,24 @@ LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()* tree. • `on_child_removed` : emitted when a child is removed from the tree. - {self} + • {self} LanguageTree:source({self}) *LanguageTree:source()* Returns the source content of the language tree (bufnr or string). Parameters: ~ - {self} + • {self} *LanguageTree:tree_for_range()* LanguageTree:tree_for_range({self}, {range}, {opts}) Gets the tree that contains {range}. Parameters: ~ - {range} (table) `{ start_line, start_col, end_line, end_col }` - {opts} (table|nil) Optional keyword arguments: + • {range} (table) `{ start_line, start_col, end_line, end_col }` + • {opts} (table|nil) Optional keyword arguments: • ignore_injections boolean Ignore injected languages (default true) - {self} + • {self} Return: ~ userdata|nil Contained |tstree| @@ -956,7 +956,7 @@ LanguageTree:trees({self}) *LanguageTree:trees()* languages. Parameters: ~ - {self} + • {self} new({source}, {lang}, {opts}) *languagetree.new()* A |LanguageTree| holds the treesitter parser for a given language {lang} @@ -964,9 +964,9 @@ new({source}, {lang}, {opts}) *languagetree.new()* may contain child languages themselves, hence the name). Parameters: ~ - {source} (number|string) Buffer or a string of text to parse - {lang} (string) Root language this tree represents - {opts} (table|nil) Optional keyword arguments: + • {source} (number|string) Buffer or a string of text to parse + • {lang} (string) Root language this tree represents + • {opts} (table|nil) Optional keyword arguments: • injections table Mapping language to injection query strings. This is useful for overriding the built-in runtime file searching for the injection language query -- cgit From 548a4e258777a405cc2b1225cab9a8292924407b Mon Sep 17 00:00:00 2001 From: Elizabeth Paź Date: Wed, 5 Oct 2022 13:21:45 +0200 Subject: docs(docstrings): fix runtime type annotations --- runtime/doc/lua.txt | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 5898d04a73..8e2270bc58 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1416,11 +1416,11 @@ defer_fn({fn}, {timeout}) *vim.defer_fn()* are safe to call. Parameters: ~ - • {fn} Callback to call once `timeout` expires - • {timeout} Number of milliseconds to wait before calling `fn` + • {fn} (function) Callback to call once `timeout` expires + • {timeout} integer Number of milliseconds to wait before calling `fn` Return: ~ - timer luv timer object + (table) timer luv timer object *vim.deprecate()* deprecate({name}, {alternative}, {version}, {plugin}, {backtrace}) @@ -1514,18 +1514,19 @@ paste({lines}, {phase}) *vim.paste()* < Parameters: ~ - • {lines} |readfile()|-style list of lines to paste. |channel-lines| - • {phase} -1: "non-streaming" paste: the call contains all lines. If - paste is "streamed", `phase` indicates the stream state: + • {lines} string[] # |readfile()|-style list of lines to paste. + |channel-lines| + • {phase} paste_phase -1: "non-streaming" paste: the call contains all + lines. If paste is "streamed", `phase` indicates the stream state: • 1: starts the paste (exactly once) • 2: continues the paste (zero or more times) • 3: ends the paste (exactly once) Return: ~ - false if client should cancel the paste. + (boolean) # false if client should cancel the paste. See also: ~ - |paste| + |paste| @alias paste_phase -1 | 1 | 2 | 3 pretty_print({...}) *vim.pretty_print()* Prints given arguments in human-readable format. Example: > @@ -1534,7 +1535,7 @@ pretty_print({...}) *vim.pretty_print()* < Return: ~ - given arguments. + any # given arguments. See also: ~ |vim.inspect()| @@ -1545,18 +1546,26 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()* Parameters: ~ • {bufnr} (number) of buffer - • {pos1} (line, column) tuple marking beginning of region - • {pos2} (line, column) tuple marking end of region - • {regtype} type of selection, see |setreg()| + • {pos1} integer[] (line, column) tuple marking beginning of + region + • {pos2} integer[] (line, column) tuple marking end of region + • {regtype} (string) type of selection, see |setreg()| • {inclusive} (boolean) indicating whether the selection is end-inclusive Return: ~ - region lua table of the form {linenr = {startcol,endcol}} + table region lua table of the form {linenr = + {startcol,endcol}} schedule_wrap({cb}) *vim.schedule_wrap()* Defers callback `cb` until the Nvim API is safe to call. + Parameters: ~ + • {cb} (function) + + Return: ~ + (function) + See also: ~ |lua-loop-callbacks| |vim.schedule()| @@ -1700,10 +1709,15 @@ split({s}, {sep}, {kwargs}) *vim.split()* split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'} < + @alias split_kwargs {plain: boolean, trimempty: boolean} | boolean | nil + + See also: ~ + |vim.gsplit()| + Parameters: ~ • {s} (string) String to split • {sep} (string) Separator or pattern - • {kwargs} (table) Keyword arguments: + • {kwargs} split_kwargs Keyword arguments: • plain: (boolean) If `true` use `sep` literally (passed to string.find) • trimempty: (boolean) If `true` remove empty items from the @@ -1712,9 +1726,6 @@ split({s}, {sep}, {kwargs}) *vim.split()* Return: ~ (table) List of split components - See also: ~ - |vim.gsplit()| - startswith({s}, {prefix}) *vim.startswith()* Tests if `s` starts with `prefix`. -- cgit From 6ae144a92171cf9ae52bddddc3a081a4efaabe9f Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 27 Sep 2022 16:19:15 +0200 Subject: feat(messages)!: graduate the 'msgsep' feature The old behaviour (e.g. via `set display-=msgsep`) will not be available. Assuming that messages always are being drawn on msg_grid (or not drawn at all, and forwarded to `ext_messages` enabled UI) will allows some simplifcations and enhancements moving forward. --- runtime/doc/options.txt | 7 ++----- runtime/doc/syntax.txt | 2 +- runtime/doc/ui.txt | 10 +++++----- runtime/doc/vim_diff.txt | 10 +++++++--- 4 files changed, 15 insertions(+), 14 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 15fc551dd9..065fe1af70 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2128,7 +2128,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'display'* *'dy'* -'display' 'dy' string (default "lastline,msgsep") +'display' 'dy' string (default "lastline") global Change the way text is displayed. This is a comma-separated list of flags: @@ -2140,10 +2140,7 @@ A jump table for the options with a short description can be found at |Q_op|. column of the last screen line. Overrules "lastline". uhex Show unprintable characters hexadecimal as instead of using ^C and ~C. - msgsep When showing messages longer than 'cmdheight', only - scroll the message lines, not the entire screen. The - separator line is decorated by |hl-MsgSeparator| and - the "msgsep" flag of 'fillchars'. + msgsep Obsolete flag. Allowed but takes no effect. |msgsep| When neither "lastline" nor "truncate" is included, a last line that doesn't fit is replaced with "@" lines. diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 8ebe0f3569..74778addc7 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -5187,7 +5187,7 @@ ModeMsg 'showmode' message (e.g., "-- INSERT --"). *hl-MsgArea* MsgArea Area for messages and cmdline. *hl-MsgSeparator* -MsgSeparator Separator for scrolled messages, `msgsep` flag of 'display'. +MsgSeparator Separator for scrolled messages |msgsep|. *hl-MoreMsg* MoreMsg |more-prompt| *hl-NonText* diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 7ce6cd251f..5685979c82 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -608,12 +608,12 @@ tabs. Close the window. ["msg_set_pos", grid, row, scrolled, sep_char] ~ - Display messages on `grid`. The grid will be displayed at `row` on the - default grid (grid=1), covering the full column width. `scrolled` + Display messages on `grid`. The grid will be displayed at `row` on + the default grid (grid=1), covering the full column width. `scrolled` indicates whether the message area has been scrolled to cover other - grids. It can be useful to draw a separator then ('display' msgsep - flag). The Builtin TUI draws a full line filled with `sep_char` and - |hl-MsgSeparator| highlight. + grids. It can be useful to draw a separator then |msgsep|. The Builtin + TUI draws a full line filled with `sep_char` ('fillchars' msgsep + field) and |hl-MsgSeparator| highlight. When |ui-messages| is active, no message grid is used, and this event will not be sent. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 672d064478..7c1658df76 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -38,7 +38,7 @@ centralized reference of the differences. - 'complete' excludes "i" - 'cscopeverbose' is enabled - 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created -- 'display' defaults to "lastline,msgsep" +- 'display' defaults to "lastline" - 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding) - 'fillchars' defaults (in effect) to "vert:│,fold:·,sep:│" - 'formatoptions' defaults to "tcqj" @@ -256,9 +256,8 @@ Normal commands: Options: 'cpoptions' flags: |cpo-_| - 'display' flags: "msgsep" minimizes scrolling when showing messages 'guicursor' works in the terminal - 'fillchars' flags: "msgsep" (see 'display'), "horiz", "horizup", + 'fillchars' flags: "msgsep", "horiz", "horizup", "horizdown", "vertleft", "vertright", "verthoriz" 'foldcolumn' supports up to 9 dynamic/fixed columns 'inccommand' shows interactive results for |:substitute|-like commands @@ -479,6 +478,11 @@ TUI: UI/Display: |Visual| selection highlights the character at cursor. |visual-use| + messages: When showing messages longer than 'cmdheight', only + scroll the message lines, not the entire screen. The + separator line is decorated by |hl-MsgSeparator| and + the "msgsep" flag of 'fillchars'. *msgsep* + Vimscript compatibility: `count` does not alias to |v:count| `errmsg` does not alias to |v:errmsg| -- cgit From 5acf52e19b1f9920fe95b55588eff256a439d816 Mon Sep 17 00:00:00 2001 From: luukvbaal <31730729+luukvbaal@users.noreply.github.com> Date: Thu, 6 Oct 2022 08:57:52 +0200 Subject: feat(window/ui): add splitkeep option (#19243) vim-patch:9.0.0445: when opening/closing window text moves up/down Problem: When opening/closing window text moves up/down. Solution: Add the 'splitscroll' option. When off text will keep its position as much as possible. https://github.com/vim/vim/commit/29ab524358ba429bcf6811710afc97a978641f0b vim-patch:9.0.0455: a few problems with 'splitscroll' Problem: A few problems with 'splitscroll'. Solution: Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117) https://github.com/vim/vim/commit/5ed391708a62b4ebaa84dd23e32a416e5c3383d9 vim-patch:9.0.0461: 'scroll' is not always updated Problem: 'scroll' is not always updated. Solution: Call win_init_size() at the right place. https://github.com/vim/vim/commit/470a14140bc06f1653edf26ab0b3c9b801080353 vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off. Solution: Temporarily set 'splitscroll' when jumping back to the original window. (closes vim/vim#11128) https://github.com/vim/vim/commit/e697d488901b6321ddaad68b553f0a434c97d849 vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off. Solution: Skip win_fix_cursor if called when cmdwin is open or closing. (Luuk van Baal, closes vim/vim#11134) https://github.com/vim/vim/commit/3735f11050616652525bf80b4fbcb2b3bfeab113 vim-patch:9.0.0478: test for 'splitscroll' takes too much time Problem: Test for 'splitscroll' takes too much time. Solution: Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139) https://github.com/vim/vim/commit/594f9e09cd68e6277b8aa08094405bc642c5792a vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help window closed. Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal, closes vim/vim#11150) https://github.com/vim/vim/commit/d5bc762dea1fd32fa04342f8149f95ccfc3b9709 vim-patch:9.0.0505: various problems with 'nosplitscroll' Problem: Various problems with 'nosplitscroll'. Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166) https://github.com/vim/vim/commit/faf1d412f5e3665021500b528c0e7301eb02bf0b vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin Problem: Scrolling with 'nosplitscroll' in callback changing curwin. Solution: Invalidate w_cline_row in the right place. (Luuk van Baal, closes vim/vim#11185) https://github.com/vim/vim/commit/20e58561abc4116f3bfbafaef242d886dd77b303 vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly Problem: With 'nosplitscroll' folds are not handled correctly. Solution: Take care of closed folds when moving the cursor. (Luuk van Baal, closes vim/vim#11234) https://github.com/vim/vim/commit/7c1cbb6cd437c6e0c3ccc05840cc931108b4a60a vim-patch:9.0.0605: dump file missing Problem: Dump file missing. Solution: Add the missing dump file. (issue vim/vim#11234) https://github.com/vim/vim/commit/439a2ba1749463718b6ce1e1375b68c7b7cff808 vim-patch:9.0.0647: the 'splitscroll' option is not a good name Problem: The 'splitscroll' option is not a good name. Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option, also supporting "topline". (Luuk van Baal, closes vim/vim#11258) https://github.com/vim/vim/commit/13ece2ae1d09009d3fb8acf858c288e7848ecdac vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen" Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas) Solution: Check the botline is not too large. (Luuk van Baal, closes vim/vim#11293, closes vim/vim#11292) https://github.com/vim/vim/commit/346823d3e5668b99d2c2fd920e7f215e21ad3ea7 --- runtime/doc/options.txt | 16 ++++++++++++++++ runtime/doc/quickref.txt | 1 + 2 files changed, 17 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 065fe1af70..8a629e0c05 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5961,6 +5961,22 @@ A jump table for the options with a short description can be found at |Q_op|. When on, splitting a window will put the new window below the current one. |:split| + *'splitkeep'* *'spk'* +'splitkeep' 'spk' string (default "cursor") + global + The value of this option determines the scroll behavior when opening, + closing or resizing horizontal splits. + + Possible values are: + cursor Keep the same relative cursor position. + screen Keep the text on the same screen line. + topline Keep the topline the same. + + For the "screen" and "topline" values, the cursor position will be + changed when necessary. In this case, the jumplist will be populated + with the previous cursor position. For "screen", the text cannot always + be kept on the same screen line when 'wrap' is enabled. + *'splitright'* *'spr'* *'nosplitright'* *'nospr'* 'splitright' 'spr' boolean (default off) global diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index bdb0f7447c..5b100c73a9 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -890,6 +890,7 @@ Short explanation of each option: *option-list* 'spelloptions' 'spo' options for spell checking 'spellsuggest' 'sps' method(s) used to suggest spelling corrections 'splitbelow' 'sb' new window from split is below the current one +'splitkeep' 'spk' determines scroll behavior for split windows 'splitright' 'spr' new window is put right of the current one 'startofline' 'sol' commands move cursor to first non-blank in line 'statusline' 'stl' custom format for the status line -- cgit From de47b4b9016803650117d2ce79a537b3975af2b7 Mon Sep 17 00:00:00 2001 From: Steve Thorne Date: Thu, 6 Oct 2022 04:07:04 -0400 Subject: docs(lsp): add formatting APIs to deprecated.txt (#20487) Add vim.lsp.buf.formatting() to deprecated.txt. Add vim.lsp.buf.range_formatting() to deprecated.txt. --- runtime/doc/deprecated.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index b1dd650e7d..d82e3ef895 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -118,6 +118,10 @@ LSP Functions ~ *vim.lsp.util.set_loclist()* Use |setloclist()| instead. *vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with {buffer = bufnr} instead. +*vim.lsp.buf.formatting()* Use |vim.lsp.buf.format()| with + {async = true} instead. +*vim.lsp.buf.range_formatting()* Use |vim.lsp.formatexpr()| + or |vim.lsp.format()| instead. Lua ~ *vim.register_keystroke_callback()* Use |vim.on_key()| instead. -- cgit From 2c08ab5369c79afd9138c38164e2d2c157ce8435 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Thu, 6 Oct 2022 13:00:13 +0200 Subject: docs: fix incorrect :help tag (#20511) vim.lsp.format() doesn't exist, which causes functionaltest to fail. Change to vim.lsp.buf.format(). --- runtime/doc/deprecated.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index d82e3ef895..bb8b24f5bf 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -121,7 +121,7 @@ LSP Functions ~ *vim.lsp.buf.formatting()* Use |vim.lsp.buf.format()| with {async = true} instead. *vim.lsp.buf.range_formatting()* Use |vim.lsp.formatexpr()| - or |vim.lsp.format()| instead. + or |vim.lsp.buf.format()| instead. Lua ~ *vim.register_keystroke_callback()* Use |vim.on_key()| instead. -- cgit From f7b175e049db9262a45ee1c5eb41a38bd5b8ac38 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 6 Oct 2022 09:16:00 -0400 Subject: fix(docs-html): keycodes, taglinks, column_heading #20498 Problem: - Docs HTML: "foo ~" headings (column_heading) are not aligned with their table columns/contents because the leading whitespace is not emitted. - taglinks starting with hyphen like |-x| were not recognized. - keycodes like `` and `CTRL-x` were not recognized. - ToC is not scrollable. Solution: - Add ws() to the column_heading case. - Update help parser to latest version - supports `keycode` - fixes for taglink, argument - Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297 fix https://github.com/neovim/neovim.github.io/issues/297 --- runtime/doc/autocmd.txt | 1 + runtime/doc/channel.txt | 28 ++++++++++++++------------- runtime/doc/ft_ada.txt | 2 +- runtime/doc/intro.txt | 48 +++++++++++++++++++++++----------------------- runtime/doc/luaref.txt | 9 +-------- runtime/doc/mbyte.txt | 4 ++-- runtime/doc/options.txt | 6 +++--- runtime/doc/pi_msgpack.txt | 10 +++++----- runtime/doc/starting.txt | 12 ++++++------ runtime/doc/testing.txt | 2 +- runtime/doc/usr_41.txt | 4 ++-- runtime/doc/usr_toc.txt | 8 ++++---- runtime/doc/vim_diff.txt | 25 +++++++++++------------- 13 files changed, 76 insertions(+), 83 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 97a1bdc134..e27f191e0d 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -590,6 +590,7 @@ FileChangedShell When Vim notices that the modification time of - executing a shell command - |:checktime| - |FocusGained| + Not used when 'autoread' is set and the buffer was not changed. If a FileChangedShell autocommand exists the warning message and diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index d4bed7a5f2..f4a17b1842 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -48,21 +48,22 @@ a job channel using RPC, bytes can still be read over its stderr. Similarly, only bytes can be written to Nvim's own stderr. *channel-callback* -on_stdout({chan-id}, {data}, {name}) *on_stdout* -on_stderr({chan-id}, {data}, {name}) *on_stderr* -on_stdin({chan-id}, {data}, {name}) *on_stdin* -on_data({chan-id}, {data}, {name}) *on_data* +- on_stdout({chan-id}, {data}, {name}) *on_stdout* +- on_stderr({chan-id}, {data}, {name}) *on_stderr* +- on_stdin({chan-id}, {data}, {name}) *on_stdin* +- on_data({chan-id}, {data}, {name}) *on_data* + Scripts can react to channel activity (received data) via callback functions assigned to the `on_stdout`, `on_stderr`, `on_stdin`, or `on_data` option keys. Callbacks should be fast: avoid potentially slow/expensive work. Parameters: ~ - {chan-id} Channel handle. |channel-id| - {data} Raw data (|readfile()|-style list of strings) read from + - {chan-id} Channel handle. |channel-id| + - {data} Raw data (|readfile()|-style list of strings) read from the channel. EOF is a single-item list: `['']`. First and last items may be partial lines! |channel-lines| - {name} Stream name (string) like "stdout", so the same function + - {name} Stream name (string) like "stdout", so the same function can handle multiple streams. Event names depend on how the channel was opened and in what mode/protocol. @@ -83,13 +84,14 @@ on_data({chan-id}, {data}, {name}) *on_data* the final `['']` emitted at EOF): - `foobar` may arrive as `['fo'], ['obar']` - `foo\nbar` may arrive as - `['foo','bar']` - or `['foo',''], ['bar']` - or `['foo'], ['','bar']` - or `['fo'], ['o','bar']` + - `['foo','bar']` + - or `['foo',''], ['bar']` + - or `['foo'], ['','bar']` + - or `['fo'], ['o','bar']` + There are two ways to deal with this: - 1. To wait for the entire output, use |channel-buffered| mode. - 2. To read line-by-line, use the following code: > + - 1. To wait for the entire output, use |channel-buffered| mode. + - 2. To read line-by-line, use the following code: > let s:lines = [''] func! s:on_event(job_id, data, event) dict let eof = (a:data == ['']) diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt index 3f002f2df7..e4ac37a86e 100644 --- a/runtime/doc/ft_ada.txt +++ b/runtime/doc/ft_ada.txt @@ -51,7 +51,7 @@ for a complete list. To enable them, assign a value to the option. For example, to turn one on: > > let g:ada_standard_types = 1 -> + To disable them use ":unlet". Example: > > unlet g:ada_standard_types diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index a5630dabaa..60c2b4c5dd 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -308,7 +308,7 @@ These names for keys are used in the documentation. They can also be used with the ":map" command. notation meaning equivalent decimal value(s) ~ ------------------------------------------------------------------------ +----------------------------------------------------------------------- ~ zero CTRL-@ 0 (stored as 10) ** backspace CTRL-H 8 *backspace* tab CTRL-I 9 *tab* *Tab* @@ -530,29 +530,29 @@ Ex :vi -- -- -- -- -- -- not possible -*1 Go from Normal mode to Insert mode by giving the command "i", "I", "a", - "A", "o", "O", "c", "C", "s" or S". -*2 Go from Visual mode to Normal mode by giving a non-movement command, which - causes the command to be executed, or by hitting "v", "V" or "CTRL-V" - (see |v_v|), which just stops Visual mode without side effects. -*3 Go from Command-line mode to Normal mode by: - - Hitting or , which causes the entered command to be executed. - - Deleting the complete line (e.g., with CTRL-U) and giving a final . - - Hitting CTRL-C or , which quits the command-line without executing - the command. - In the last case may be the character defined with the 'wildchar' - option, in which case it will start command-line completion. You can - ignore that and type again. -*4 Go from Normal to Select mode by: - - use the mouse to select text while 'selectmode' contains "mouse" - - use a non-printable command to move the cursor while keeping the Shift - key pressed, and the 'selectmode' option contains "key" - - use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd" - - use "gh", "gH" or "g CTRL-H" |g_CTRL-H| -*5 Go from Select mode to Normal mode by using a non-printable command to move - the cursor, without keeping the Shift key pressed. -*6 Go from Select mode to Insert mode by typing a printable character. The - selection is deleted and the character is inserted. +* 1 Go from Normal mode to Insert mode by giving the command "i", "I", "a", + "A", "o", "O", "c", "C", "s" or S". +* 2 Go from Visual mode to Normal mode by giving a non-movement command, which + causes the command to be executed, or by hitting "v", "V" or "CTRL-V" + (see |v_v|), which just stops Visual mode without side effects. +* 3 Go from Command-line mode to Normal mode by: + - Hitting or , which causes the entered command to be executed. + - Deleting the complete line (e.g., with CTRL-U) and giving a final . + - Hitting CTRL-C or , which quits the command-line without executing + the command. + In the last case may be the character defined with the 'wildchar' + option, in which case it will start command-line completion. You can + ignore that and type again. +* 4 Go from Normal to Select mode by: + - use the mouse to select text while 'selectmode' contains "mouse" + - use a non-printable command to move the cursor while keeping the Shift + key pressed, and the 'selectmode' option contains "key" + - use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd" + - use "gh", "gH" or "g CTRL-H" |g_CTRL-H| +* 5 Go from Select mode to Normal mode by using a non-printable command to move + the cursor, without keeping the Shift key pressed. +* 6 Go from Select mode to Insert mode by typing a printable character. The + selection is deleted and the character is inserted. *CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* *v_CTRL-\_CTRL-N* *t_CTRL-\_CTRL-N* diff --git a/runtime/doc/luaref.txt b/runtime/doc/luaref.txt index 9ce3637563..5387900d16 100644 --- a/runtime/doc/luaref.txt +++ b/runtime/doc/luaref.txt @@ -24,7 +24,6 @@ Type |gO| to see the table of contents. ============================================================================== 1 INTRODUCTION *luaref-intro* -============================================================================== Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good @@ -1504,7 +1503,6 @@ When you run it, it produces the following output: ============================================================================== 3 THE APPLICATION PROGRAM INTERFACE *luaref-API* -============================================================================== This section describes the C API for Lua, that is, the set of C functions available to the host program to communicate with Lua. All API functions and @@ -2979,7 +2977,6 @@ lua_setupvalue *lua_setupvalue()* ============================================================================== 4 THE AUXILIARY LIBRARY *luaref-aux* -============================================================================== The auxiliary library provides several convenient functions to interface C with Lua. While the basic API provides the primitive functions for all @@ -3511,7 +3508,6 @@ luaL_where *luaL_where()* ============================================================================== 5 STANDARD LIBRARIES *luaref-Lib* -============================================================================== The standard libraries provide useful functions that are implemented directly through the C API. Some of these functions provide essential services to the @@ -4064,7 +4060,7 @@ string.gmatch({s}, {pattern}) *string.gmatch()* end < -string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsu{b}()* +string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsub()* Returns a copy of {s} in which all occurrences of the {pattern} have been replaced by a replacement string specified by {repl}, which may be a string, a table, or a function. `gsub` also returns, as its @@ -4831,7 +4827,6 @@ debug.traceback([{thread},] [{message}] [,{level}]) *debug.traceback()* ============================================================================== A BIBLIOGRAPHY *luaref-bibliography* -============================================================================== This help file is a minor adaptation from this main reference: @@ -4858,7 +4853,6 @@ Lua is discussed in these references: ============================================================================== B COPYRIGHT & LICENSES *luaref-copyright* -============================================================================== This help file has the same copyright and license as Lua 5.1 and the Lua 5.1 manual: @@ -4885,7 +4879,6 @@ SOFTWARE. ============================================================================== C LUAREF DOC *luarefvim* *luarefvimdoc* *luaref-help* *luaref-doc* -============================================================================== This is a Vim help file containing a reference for Lua 5.1, and it is -- with a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 7a76c57fc2..dd2c99669c 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -334,8 +334,8 @@ Vim will automatically convert from one to another encoding in several places: "utf-8" (requires a gettext version that supports this). - When reading a Vim script where |:scriptencoding| is different from "utf-8". -Most of these require the |+iconv| feature. Conversion for reading and -writing files may also be specified with the 'charconvert' option. +Most of these require iconv. Conversion for reading and writing files may +also be specified with the 'charconvert' option. Useful utilities for converting the charset: All: iconv diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 8a629e0c05..837c3e7652 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3920,9 +3920,9 @@ A jump table for the options with a short description can be found at |Q_op|. `:lgrepadd`, `:cfile`, `:cgetfile`, `:caddfile`, `:lfile`, `:lgetfile`, and `:laddfile`. - This would be mostly useful when you use MS-Windows. If |+iconv| is - enabled and GNU libiconv is used, setting 'makeencoding' to "char" has - the same effect as setting to the system locale encoding. Example: > + This would be mostly useful when you use MS-Windows. If iconv is + enabled, setting 'makeencoding' to "char" has the same effect as + setting to the system locale encoding. Example: > :set makeencoding=char " system locale is used < *'makeprg'* *'mp'* diff --git a/runtime/doc/pi_msgpack.txt b/runtime/doc/pi_msgpack.txt index 801c56e49f..24a31f1de7 100644 --- a/runtime/doc/pi_msgpack.txt +++ b/runtime/doc/pi_msgpack.txt @@ -63,16 +63,16 @@ msgpack#is_uint({msgpack-value}) *msgpack#is_uint()* *msgpack#strftime* msgpack#strftime({format}, {msgpack-integer}) *msgpack#strftime()* Same as |strftime()|, but second argument may be - |msgpack-special-dict|. Requires |+python| or |+python3| to really - work with |msgpack-special-dict|s. + |msgpack-special-dict|. Requires |Python| to really work with + |msgpack-special-dict|s. *msgpack#strptime* msgpack#strptime({format}, {time}) *msgpack#strptime()* Reverse of |msgpack#strftime()|: for any time and format |msgpack#equal|( |msgpack#strptime|(format, |msgpack#strftime|(format, - time)), time) be true. Requires |+python| or |+python3|, without it - only supports non-|msgpack-special-dict| nonnegative times and format - equal to `%Y-%m-%dT%H:%M:%S`. + time)), time) be true. Requires ||Python|, without it only supports + non-|msgpack-special-dict| nonnegative times and format equal to + `%Y-%m-%dT%H:%M:%S`. msgpack#int_dict_to_str({msgpack-special-int}) *msgpack#int_dict_to_str()* Function which converts |msgpack-special-dict| integer value to diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 4ac076027c..2c18398598 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -35,7 +35,7 @@ filename One or more file names. The first one will be the current no other options or "+command" argument can follow. *--* -- Alias for stdin (standard input). +`-` Alias for stdin (standard input). Example: > echo text | nvim - file < "text" is read into buffer 1, "file" is opened as buffer 2. @@ -1182,7 +1182,7 @@ exactly four MessagePack objects: encoding Binary, effective 'encoding' value. max_kbyte Integer, effective |shada-s| limit value. pid Integer, instance process ID. - * It is allowed to have any number of + `*` It is allowed to have any number of additional keys with any data. 2 (SearchPattern) Map containing data describing last used search or substitute pattern. Normally ShaDa file contains two @@ -1213,7 +1213,7 @@ exactly four MessagePack objects: sp Binary N/A Actual pattern. Required. sb Boolean false True if search direction is backward. - * any none Other keys are allowed for + `*` any none Other keys are allowed for compatibility reasons, see |shada-compatibility|. 3 (SubString) Array containing last |:substitute| replacement string. @@ -1284,7 +1284,7 @@ exactly four MessagePack objects: GlobalMark and LocalMark entries. f Binary N/A File name. Required. - * any none Other keys are allowed for + `*` any none Other keys are allowed for compatibility reasons, see |shada-compatibility|. 9 (BufferList) Array containing maps. Each map in the array @@ -1294,10 +1294,10 @@ exactly four MessagePack objects: greater then zero. c UInteger 0 Position column number. f Binary N/A File name. Required. - * any none Other keys are allowed for + `*` any none Other keys are allowed for compatibility reasons, see |shada-compatibility|. - * (Unknown) Any other entry type is allowed for compatibility + `*` (Unknown) Any other entry type is allowed for compatibility reasons, see |shada-compatibility|. *E575* *E576* diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 4e4a908d0f..f4375c3363 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -134,7 +134,7 @@ assert_match({pattern}, {actual} [, {msg}]) When {pattern} does not match {actual} an error message is added to |v:errors|. Also see |assert-return|. - {pattern} is used as with |=~|: The matching is always done + {pattern} is used as with |expr-=~|: The matching is always done like 'magic' was set and 'cpoptions' is empty, no matter what the actual value of 'magic' or 'cpoptions' is. diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index fb9d59f885..6690dad4a7 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1074,8 +1074,8 @@ Various: *various-functions* wordcount() get byte/word/char count of buffer luaeval() evaluate |Lua| expression - py3eval() evaluate Python expression (|+python3|) - pyeval() evaluate Python expression (|+python|) + py3eval() evaluate |Python| expression + pyeval() evaluate |Python| expression pyxeval() evaluate |python_x| expression rubyeval() evaluate |Ruby| expression diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt index bf9c02882c..c61bb55c26 100644 --- a/runtime/doc/usr_toc.txt +++ b/runtime/doc/usr_toc.txt @@ -5,7 +5,7 @@ Table Of Contents *user-manual* ============================================================================== -Overview ~ +Overview Getting Started |usr_01.txt| About the manuals @@ -52,7 +52,7 @@ The user manual is online: https://neovim.io/doc/user ============================================================================== -Getting Started ~ +Getting Started Read this from start to end to learn the essential commands. @@ -167,7 +167,7 @@ Read this from start to end to learn the essential commands. |12.8| Find where a word is used ============================================================================== -Editing Effectively ~ +Editing Effectively Subjects that can be read independently. @@ -275,7 +275,7 @@ Subjects that can be read independently. |32.4| Time travelling ============================================================================== -Tuning Vim ~ +Tuning Vim Make Vim work as you like it. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 7c1658df76..8c6585a941 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -82,27 +82,24 @@ centralized reference of the differences. Default Mouse ~ *default-mouse* *disable-mouse* -By default the mouse is enabled. The right button click opens |popup-menu| -with standard actions, such as "Cut", "Copy" and "Paste". - -If you don't like this you can add to your |config| any of the following: - -- ignore mouse completely > +By default the mouse is enabled, and opens a |popup-menu| with +standard actions ("Cut", "Copy", "Paste", …). Mouse is NOT enabled in +|command-mode| or the |more-prompt|, so you can temporarily disable it just by +typing ":". + +If you don't like this you can disable the mouse in your |config| using any of +the following: +- Disable mouse completely by unsetting the 'mouse' option: > set mouse= -< -- no |popup-menu| but the right button extends selection > +- Pressing extends selection instead of showing popup-menu: > set mousemodel=extend -> -- pressing ALT+LeftMouse releases mouse until main cursor moves > - nnoremap +- Pressing releases mouse until the cursor moves: > + nnoremap \ set mouse= \ echo 'mouse OFF until next cursor-move' \ autocmd CursorMoved * ++once set mouse& \ echo 'mouse ON' < -Also, mouse is not in use in |command-mode| or at |more-prompt|. So if you -need to copy/paste with your terminal then just pressing ':' makes Nvim to -release the mouse cursor temporarily. Default Mappings ~ *default-mappings* -- cgit From c8d1b9a2d6ef910a9c1993875723387d522e6c4a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 27 Sep 2022 22:44:01 +0200 Subject: docs: added proper annotations to functions in shared.lua --- runtime/doc/lua.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 8e2270bc58..a70677cb66 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1641,7 +1641,7 @@ gsplit({s}, {sep}, {plain}) *vim.gsplit()* string.find) Return: ~ - (function) Iterator over the split components + fun():string Iterator over the split components See also: ~ |vim.split()| @@ -1684,7 +1684,7 @@ list_slice({list}, {start}, {finish}) *vim.list_slice()* • {finish} (number) End range of slice Return: ~ - (table) Copy of table sliced from start to finish (inclusive) + any[] Copy of table sliced from start to finish (inclusive) pesc({s}) *vim.pesc()* Escapes magic chars in |lua-patterns|. @@ -1724,7 +1724,7 @@ split({s}, {sep}, {kwargs}) *vim.split()* front and back of the list Return: ~ - (table) List of split components + string[] List of split components startswith({s}, {prefix}) *vim.startswith()* Tests if `s` starts with `prefix`. @@ -1787,7 +1787,7 @@ tbl_deep_extend({behavior}, {...}) *vim.tbl_deep_extend()* • {...} (table) Two or more map-like tables Return: ~ - (table) Merged table + table|table Merged table See also: ~ |vim.tbl_extend()| @@ -1817,7 +1817,7 @@ tbl_filter({func}, {t}) *vim.tbl_filter()* • {t} (table) Table Return: ~ - (table) Table of filtered values + any[] Table of filtered values tbl_flatten({t}) *vim.tbl_flatten()* Creates a copy of a list-like table such that any nested tables are @@ -1883,7 +1883,7 @@ tbl_keys({t}) *vim.tbl_keys()* • {t} (table) Table Return: ~ - (table) List of keys + table[] List of keys See also: ~ From https://github.com/premake/premake-core/blob/master/src/base/table.lua @@ -1906,7 +1906,7 @@ tbl_values({t}) *vim.tbl_values()* • {t} (table) Table Return: ~ - (table) List of values + any[] List of values trim({s}) *vim.trim()* Trim whitespace (Lua pattern "%s") from both sides of a string. -- cgit From 1da7b4eb699fb04cc97dec389470fd0fbd64091d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 28 Sep 2022 13:22:08 +0200 Subject: feat: added support for specifying types for lua2dox --- runtime/doc/lsp.txt | 18 +++++++++--------- runtime/doc/lua.txt | 26 +++++++++++++------------- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 6d5c51c210..ae969491f7 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -723,7 +723,7 @@ get_buffers_by_client_id({client_id}) • {client_id} (number) client id Return: ~ - list of buffer ids + (list) of buffer ids get_client_by_id({client_id}) *vim.lsp.get_client_by_id()* Gets a client by id, or nil if the id is invalid. The returned client may @@ -1372,8 +1372,8 @@ apply_text_document_edit({text_document_edit}, {index}, {offset_encoding}) document. Parameters: ~ - • {text_document_edit} table: a `TextDocumentEdit` object - • {index} number: Optional index of the edit, if from a + • {text_document_edit} (table) a `TextDocumentEdit` object + • {index} (number) Optional index of the edit, if from a list of edits (or nil, if not from a list) See also: ~ @@ -1463,7 +1463,7 @@ convert_signature_help_to_markdown_lines({signature_help}, {ft}, {triggers}) server. used to better determine parameter offsets Return: ~ - list of lines of converted markdown. + (list) of lines of converted markdown. See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_signatureHelp @@ -1485,7 +1485,7 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()* Returns indentation size. Parameters: ~ - • {bufnr} (number|nil): Buffer handle, defaults to current + • {bufnr} (number|nil) Buffer handle, defaults to current Return: ~ (number) indentation size @@ -1589,7 +1589,7 @@ make_position_params({window}, {offset_encoding}) cursor position. Parameters: ~ - • {window} number|nil: window handle or 0 for current, + • {window} (number|nil) window handle or 0 for current, defaults to current • {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to `offset_encoding` of first client of buffer of @@ -1609,7 +1609,7 @@ make_range_params({window}, {offset_encoding}) `textDocument/rangeFormatting`. Parameters: ~ - • {window} number|nil: window handle or 0 for current, + • {window} (number|nil) window handle or 0 for current, defaults to current • {offset_encoding} "utf-8"|"utf-16"|"utf-32"|nil defaults to `offset_encoding` of first client of buffer of @@ -1624,7 +1624,7 @@ make_text_document_params({bufnr}) Creates a `TextDocumentIdentifier` object for the current buffer. Parameters: ~ - • {bufnr} number|nil: Buffer handle, defaults to current + • {bufnr} (number|nil) Buffer handle, defaults to current Return: ~ `TextDocumentIdentifier` @@ -1854,7 +1854,7 @@ notify({method}, {params}) *vim.lsp.rpc.notify()* Parameters: ~ • {method} (string) The invoked LSP method - • {params} (table|nil): Parameters for the invoked LSP method + • {params} (table|nil) Parameters for the invoked LSP method Return: ~ (bool) `true` if notification could be sent, `false` if not diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index a70677cb66..801664a670 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1482,7 +1482,7 @@ on_key({fn}, {ns_id}) *vim.on_key()* {fn} will receive the keys after mappings have been evaluated Parameters: ~ - • {fn} function: Callback function. It should take one string + • {fn} (function) Callback function. It should take one string argument. On each key press, Nvim passes the key char to fn(). |i_CTRL-V| If {fn} is nil, it removes the callback for the associated {ns_id} @@ -1641,7 +1641,7 @@ gsplit({s}, {sep}, {plain}) *vim.gsplit()* string.find) Return: ~ - fun():string Iterator over the split components + (function) Iterator over the split components See also: ~ |vim.split()| @@ -1665,8 +1665,8 @@ list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()* Parameters: ~ • {dst} (table) List which will be modified and appended to • {src} (table) List from which values will be inserted - • {start} (number) Start index on src. Defaults to 1 - • {finish} (number) Final index on src. Defaults to `#src` + • {start} (number|nil) Start index on src. Defaults to 1 + • {finish} (number|nil) Final index on src. Defaults to `#src` Return: ~ (table) dst @@ -1679,12 +1679,12 @@ list_slice({list}, {start}, {finish}) *vim.list_slice()* (inclusive) Parameters: ~ - • {list} (table) Table + • {list} (list) Table • {start} (number) Start range of slice • {finish} (number) End range of slice Return: ~ - any[] Copy of table sliced from start to finish (inclusive) + (list) Copy of table sliced from start to finish (inclusive) pesc({s}) *vim.pesc()* Escapes magic chars in |lua-patterns|. @@ -1717,7 +1717,7 @@ split({s}, {sep}, {kwargs}) *vim.split()* Parameters: ~ • {s} (string) String to split • {sep} (string) Separator or pattern - • {kwargs} split_kwargs Keyword arguments: + • {kwargs} (table|nil) Keyword arguments: • plain: (boolean) If `true` use `sep` literally (passed to string.find) • trimempty: (boolean) If `true` remove empty items from the @@ -1787,7 +1787,7 @@ tbl_deep_extend({behavior}, {...}) *vim.tbl_deep_extend()* • {...} (table) Two or more map-like tables Return: ~ - table|table Merged table + (table) Merged table See also: ~ |vim.tbl_extend()| @@ -1813,11 +1813,11 @@ tbl_filter({func}, {t}) *vim.tbl_filter()* Filter a table using a predicate function Parameters: ~ - • {func} function|table Function or callable table + • {func} (function) Function • {t} (table) Table Return: ~ - any[] Table of filtered values + (table) Table of filtered values tbl_flatten({t}) *vim.tbl_flatten()* Creates a copy of a list-like table such that any nested tables are @@ -1883,7 +1883,7 @@ tbl_keys({t}) *vim.tbl_keys()* • {t} (table) Table Return: ~ - table[] List of keys + (list) List of keys See also: ~ From https://github.com/premake/premake-core/blob/master/src/base/table.lua @@ -1892,7 +1892,7 @@ tbl_map({func}, {t}) *vim.tbl_map()* Apply a function to all values of a table. Parameters: ~ - • {func} function|table Function or callable table + • {func} (function) Function • {t} (table) Table Return: ~ @@ -1906,7 +1906,7 @@ tbl_values({t}) *vim.tbl_values()* • {t} (table) Table Return: ~ - any[] List of values + (list) List of values trim({s}) *vim.trim()* Trim whitespace (Lua pattern "%s") from both sides of a string. -- cgit From 0773a9ee3a21db54cd6b2376dd2e087bc09d5ea1 Mon Sep 17 00:00:00 2001 From: lvimuser <109605931+lvimuser@users.noreply.github.com> Date: Sat, 8 Oct 2022 05:22:25 -0300 Subject: feat(lsp): support window/showDocument (#19977) --- runtime/doc/lsp.txt | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index ae969491f7..139f4c6bc5 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -190,6 +190,7 @@ specification. These LSP requests/notifications are defined by default: textDocument/typeDefinition* window/logMessage window/showMessage + window/showDocument window/showMessageRequest workspace/applyEdit workspace/symbol @@ -1499,12 +1500,12 @@ jump_to_location({location}, {offset_encoding}, {reuse_win}) Parameters: ~ • {location} (table) (`Location`|`LocationLink`) - • {offset_encoding} (string) utf-8|utf-16|utf-32 (required) + • {offset_encoding} "utf-8" | "utf-16" | "utf-32" • {reuse_win} (boolean) Jump to existing window if buffer is - already opened. + already open. Return: ~ - `true` if the jump succeeded + (boolean) `true` if the jump succeeded *vim.lsp.util.locations_to_items()* locations_to_items({locations}, {offset_encoding}) @@ -1715,6 +1716,22 @@ set_lines({lines}, {A}, {B}, {new_lines}) *vim.lsp.util.set_lines()* Return: ~ (table) The modified {lines} object + *vim.lsp.util.show_document()* +show_document({location}, {offset_encoding}, {opts}) + Shows document and optionally jumps to the location. + + Parameters: ~ + • {location} (table) (`Location`|`LocationLink`) + • {offset_encoding} "utf-8" | "utf-16" | "utf-32" + • {opts} (table) options + • reuse_win (boolean) Jump to existing window if + buffer is already open. + • focus (boolean) Whether to focus/jump to location + if possible. Defaults to true. + + Return: ~ + (boolean) `true` if succeeded + *vim.lsp.util.stylize_markdown()* stylize_markdown({bufnr}, {contents}, {opts}) Converts markdown into syntax highlighted regions by stripping the code -- cgit From 93117b358778487d85665035b6a95976eee70d9c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 8 Oct 2022 17:49:09 +0200 Subject: docs(news): add news.txt and link from README (#20426) --- runtime/doc/news.txt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 runtime/doc/news.txt (limited to 'runtime/doc') diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt new file mode 100644 index 0000000000..0fdd7aaaf9 --- /dev/null +++ b/runtime/doc/news.txt @@ -0,0 +1,39 @@ +*news.txt* Nvim + + + NVIM REFERENCE MANUAL + + +Notable changes in Nvim 0.9 from 0.8 *news* + + Type |gO| to see the table of contents. + +============================================================================== +BREAKING CHANGES *news-breaking* + +The following changes may require adaptations in user config or plugins. + +============================================================================== +NEW FEATURES *news-features* + +The following new APIs or features were added. + +============================================================================== +CHANGED FEATURES *news-changes* + +The following changes to existing APIs or features add new behavior. + +============================================================================== +REMOVED FEATURES *news-removed* + +The following deprecated functions or APIs were removed. + +============================================================================== +DEPRECATIONS *news-deprecations* + +The following functions are now deprecated and will be removed in the next +release. + + + + vim:tw=78:ts=8:sw=2:et:ft=help:norl: -- cgit From 09dffb9db7d16496e55e86f78ab60241533d86f6 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 9 Oct 2022 08:21:52 -0400 Subject: docs: various #12823 - increase python line-length limit from 88 => 100. - gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains) ref #15632 fix #18215 fix #18479 fix #20527 fix #20532 Co-authored-by: Ben Weedon --- runtime/doc/api.txt | 27 ++++- runtime/doc/builtin.txt | 20 ++-- runtime/doc/deprecated.txt | 248 +++++++++++++++++++------------------- runtime/doc/develop.txt | 91 ++++++++------ runtime/doc/index.txt | 2 +- runtime/doc/lua.txt | 290 ++++++++++++++++++--------------------------- runtime/doc/luaref.txt | 16 +-- runtime/doc/nvim.txt | 39 +++--- runtime/doc/options.txt | 87 +++++++------- runtime/doc/provider.txt | 16 +++ runtime/doc/repeat.txt | 68 +++++------ runtime/doc/starting.txt | 26 ++-- runtime/doc/vim_diff.txt | 3 + 13 files changed, 460 insertions(+), 473 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 6ffef22ec3..f92ef26399 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -231,6 +231,15 @@ As Nvim evolves the API may change in compliance with this CONTRACT: - Existing items will not be removed (after release). - Deprecated functions will not be removed until Nvim version 2.0 +"Private" interfaces are NOT covered by this contract: + +- Undocumented (not in :help) functions or events of any kind +- nvim__x ("double underscore") functions + +The idea is "versionless evolution", in the words of Rich Hickey: +- Relaxing a requirement should be a compatible change. +- Strengthening a promise should be a compatible change. + ============================================================================== Global events *api-global-events* @@ -649,7 +658,7 @@ nvim_chan_send({chan}, {data}) *nvim_chan_send()* Attributes: ~ |RPC| only - |vim.api| only + Lua |vim.api| only Parameters: ~ • {chan} id of the channel @@ -2097,7 +2106,7 @@ nvim_buf_call({buffer}, {fun}) *nvim_buf_call()* buffer/window currently, like |termopen()|. Attributes: ~ - |vim.api| only + Lua |vim.api| only Parameters: ~ • {buffer} Buffer handle, or 0 for current buffer @@ -2356,6 +2365,9 @@ nvim_buf_set_lines({buffer}, {start}, {end}, {strict_indexing}, {replacement}) • {strict_indexing} Whether out-of-bounds should be an error. • {replacement} Array of lines to use as replacement + See also: ~ + |nvim_buf_set_text()| + *nvim_buf_set_mark()* nvim_buf_set_mark({buffer}, {name}, {line}, {col}, {opts}) Sets a named mark in the given buffer, all marks are allowed @@ -2414,6 +2426,9 @@ nvim_buf_set_text({buffer}, {start_row}, {start_col}, {end_row}, {end_col}, • {end_col} Ending column (byte offset) on last line, exclusive • {replacement} Array of lines to use as replacement + See also: ~ + |nvim_buf_set_lines()| + nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()* Sets a buffer-scoped (b:) variable @@ -2714,7 +2729,7 @@ nvim_set_decoration_provider({ns_id}, {*opts}) quite dubious for the moment. Attributes: ~ - |vim.api| only + Lua |vim.api| only Parameters: ~ • {ns_id} Namespace id from |nvim_create_namespace()| @@ -2738,7 +2753,7 @@ nvim_win_call({window}, {fun}) *nvim_win_call()* Calls a function with window as temporary current window. Attributes: ~ - |vim.api| only + Lua |vim.api| only Parameters: ~ • {window} Window handle, or 0 for current window @@ -2782,7 +2797,9 @@ nvim_win_get_buf({window}) *nvim_win_get_buf()* Buffer handle nvim_win_get_cursor({window}) *nvim_win_get_cursor()* - Gets the (1,0)-indexed cursor position in the window. |api-indexing| + Gets the (1,0)-indexed, buffer-relative cursor position for a given window + (different windows showing the same buffer have independent cursor + positions). |api-indexing| Parameters: ~ • {window} Window handle, or 0 for current window diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index ad757981b0..344abe557c 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -3806,15 +3806,15 @@ has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The {feature} argument is a feature name like "nvim-0.2.1" or "win32", see below. See also |exists()|. - If the code has a syntax error, then Nvim may skip the rest - of the line and miss |:endif|. > - if has('feature') | let x = this->breaks->without->the->feature | endif -< - Put |:if| and |:endif| on separate lines to avoid the - syntax error. > - if has('feature') - let x = this->breaks->without->the->feature - endif + To get the system name use |vim.loop|.os_uname() in Lua: > + :lua print(vim.loop.os_uname().sysname) + +< If the code has a syntax error then Vimscript may skip the + rest of the line. Put |:if| and |:endif| on separate lines to + avoid the syntax error: > + if has('feature') + let x = this->breaks->without->the->feature + endif < Vim's compile-time feature-names (prefixed with "+") are not recognized because Nvim is always compiled with all possible @@ -7783,7 +7783,7 @@ stdpath({what}) *stdpath()* *E6100* run String Run directory: temporary, local storage for sockets, named pipes, etc. state String Session state directory: storage for file - drafts, undo, |shada|, etc. + drafts, swap, undo, |shada|. Example: > :echo stdpath("config") diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index bb8b24f5bf..8fcd0fc1d0 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -10,159 +10,149 @@ The items listed below are deprecated: they will be removed in the future. They should not be used in new scripts, and old scripts should be updated. ============================================================================== - -API ~ -*nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead. -*nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead. -*nvim_command_output()* Use |nvim_exec()| instead. -*nvim_execute_lua()* Use |nvim_exec_lua()| instead. - -Commands ~ -*:rv* -*:rviminfo* Deprecated alias to |:rshada| command. -*:wv* -*:wviminfo* Deprecated alias to |:wshada| command. - -Environment Variables ~ -*$NVIM_LISTEN_ADDRESS* Deprecated way to - * set the server name (use |--listen| instead) - * get the server name (use |v:servername| instead) - * detect a parent Nvim (use |$NVIM| instead) - Unset by |terminal| and |jobstart()| (unless explicitly - given by the "env" option). Ignored if --listen is given. - -Events ~ -*BufCreate* Use |BufAdd| instead. -*EncodingChanged* Never fired; 'encoding' is always "utf-8". -*FileEncoding* Never fired; equivalent to |EncodingChanged|. -*GUIEnter* Never fired; use |UIEnter| instead. -*GUIFailed* Never fired. - -Keycodes ~ -** Use instead. -** Use instead. - -Functions ~ -*buffer_exists()* Obsolete name for |bufexists()|. -*buffer_name()* Obsolete name for |bufname()|. -*buffer_number()* Obsolete name for |bufnr()|. -*file_readable()* Obsolete name for |filereadable()|. -*health#report_error* Use Lua |vim.health.report_error()| instead. -*health#report_info* Use Lua |vim.health.report_info()| instead. -*health#report_ok* Use Lua |vim.health.report_ok()| instead. -*health#report_start* Use Lua |vim.health.report_start()| instead. -*health#report_warn* Use Lua |vim.health.report_warn()| instead. -*highlight_exists()* Obsolete name for |hlexists()|. -*highlightID()* Obsolete name for |hlID()|. -*inputdialog()* Use |input()| instead. -*jobclose()* Obsolete name for |chanclose()| -*jobsend()* Obsolete name for |chansend()| -*last_buffer_nr()* Obsolete name for bufnr("$"). -*rpcstop()* Deprecated. Instead use |jobstop()| to stop any job, - or chanclose(id, "rpc") to close RPC communication +Deprecated features + +API +- *nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead. +- *nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead. +- *nvim_command_output()* Use |nvim_exec()| instead. +- *nvim_execute_lua()* Use |nvim_exec_lua()| instead. + +COMMANDS +- *:rv* *:rviminfo* Deprecated alias to |:rshada| command. +- *:wv* *:wviminfo* Deprecated alias to |:wshada| command. + +ENVIRONMENT VARIABLES +- *$NVIM_LISTEN_ADDRESS* + - Deprecated way to: + - set the server name (use |--listen| or |serverstart()| instead) + - get the server name (use |v:servername| instead) + - detect a parent Nvim (use |$NVIM| instead) + - Ignored if --listen is given. + - Unset by |terminal| and |jobstart()| unless explicitly given by the "env" + option. Example: > + call jobstart(['foo'], { 'env': { 'NVIM_LISTEN_ADDRESS': v:servername } }) +< + +EVENTS +- *BufCreate* Use |BufAdd| instead. +- *EncodingChanged* Never fired; 'encoding' is always "utf-8". +- *FileEncoding* Never fired; equivalent to |EncodingChanged|. +- *GUIEnter* Never fired; use |UIEnter| instead. +- *GUIFailed* Never fired. + +KEYCODES +- ** Use instead. +- ** Use instead. + +FUNCTIONS +- *buffer_exists()* Obsolete name for |bufexists()|. +- *buffer_name()* Obsolete name for |bufname()|. +- *buffer_number()* Obsolete name for |bufnr()|. +- *file_readable()* Obsolete name for |filereadable()|. +- *health#report_error* Use Lua |vim.health.report_error()| instead. +- *health#report_info* Use Lua |vim.health.report_info()| instead. +- *health#report_ok* Use Lua |vim.health.report_ok()| instead. +- *health#report_start* Use Lua |vim.health.report_start()| instead. +- *health#report_warn* Use Lua |vim.health.report_warn()| instead. +- *highlight_exists()* Obsolete name for |hlexists()|. +- *highlightID()* Obsolete name for |hlID()|. +- *inputdialog()* Use |input()| instead. +- *jobclose()* Obsolete name for |chanclose()| +- *jobsend()* Obsolete name for |chansend()| +- *last_buffer_nr()* Obsolete name for bufnr("$"). +- *rpcstop()* Use |jobstop()| instead to stop any job, or + `chanclose(id, "rpc")` to close RPC communication without stopping the job. Use chanclose(id) to close any socket. -Highlights ~ - -*hl-VertSplit* Use |hl-WinSeparator| instead. - -LSP Diagnostics ~ +HIGHLIGHTS +- *hl-VertSplit* Use |hl-WinSeparator| instead. +LSP DIAGNOSTICS For each of the functions below, use the corresponding function in |vim.diagnostic| instead (unless otherwise noted). For example, use |vim.diagnostic.get()| instead of |vim.lsp.diagnostic.get()|. -*vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead. -*vim.lsp.diagnostic.disable()* -*vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead. -*vim.lsp.diagnostic.enable()* -*vim.lsp.diagnostic.get()* -*vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead. -*vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead. -*vim.lsp.diagnostic.get_line_diagnostics()* - Use |vim.diagnostic.get()| instead. -*vim.lsp.diagnostic.get_next()* -*vim.lsp.diagnostic.get_next_pos()* -*vim.lsp.diagnostic.get_prev()* -*vim.lsp.diagnostic.get_prev_pos()* -*vim.lsp.diagnostic.get_virtual_text_chunks_for_line()* - No replacement. Use options provided by - |vim.diagnostic.config()| to customize - virtual text. -*vim.lsp.diagnostic.goto_next()* -*vim.lsp.diagnostic.goto_prev()* -*vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead. -*vim.lsp.diagnostic.reset()* -*vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead. -*vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead. -*vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead. - -The following have been replaced by |vim.diagnostic.open_float()|. - -*vim.lsp.diagnostic.show_line_diagnostics()* -*vim.lsp.diagnostic.show_position_diagnostics()* +- *vim.lsp.diagnostic.clear()* Use |vim.diagnostic.hide()| instead. +- *vim.lsp.diagnostic.disable()* +- *vim.lsp.diagnostic.display()* Use |vim.diagnostic.show()| instead. +- *vim.lsp.diagnostic.enable()* +- *vim.lsp.diagnostic.get()* +- *vim.lsp.diagnostic.get_all()* Use |vim.diagnostic.get()| instead. +- *vim.lsp.diagnostic.get_count()* Use |vim.diagnostic.get()| instead. +- *vim.lsp.diagnostic.get_line_diagnostics()* Use |vim.diagnostic.get()| instead. +- *vim.lsp.diagnostic.get_next()* +- *vim.lsp.diagnostic.get_next_pos()* +- *vim.lsp.diagnostic.get_prev()* +- *vim.lsp.diagnostic.get_prev_pos()* +- *vim.lsp.diagnostic.get_virtual_text_chunks_for_line()* No replacement. Use + options provided by |vim.diagnostic.config()| to customize virtual text. +- *vim.lsp.diagnostic.goto_next()* +- *vim.lsp.diagnostic.goto_prev()* +- *vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead. +- *vim.lsp.diagnostic.reset()* +- *vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead. +- *vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead. +- *vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead. +- *vim.lsp.diagnostic.show_line_diagnostics()* Use |vim.diagnostic.open_float()| instead. +- *vim.lsp.diagnostic.show_position_diagnostics()* Use |vim.diagnostic.open_float()| instead. The following are deprecated without replacement. These functions are moved internally and are no longer exposed as part of the API. Instead, use |vim.diagnostic.config()| and |vim.diagnostic.show()|. -*vim.lsp.diagnostic.set_signs()* -*vim.lsp.diagnostic.set_underline()* -*vim.lsp.diagnostic.set_virtual_text()* - -LSP Functions ~ - -*vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead. -*vim.lsp.util.set_qflist()* Use |setqflist()| instead. -*vim.lsp.util.set_loclist()* Use |setloclist()| instead. -*vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with +- *vim.lsp.diagnostic.set_signs()* +- *vim.lsp.diagnostic.set_underline()* +- *vim.lsp.diagnostic.set_virtual_text()* + +LSP FUNCTIONS +- *vim.lsp.range_code_action* Use |vim.lsp.buf.code_action()| with + the `range` parameter. +- *vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead. +- *vim.lsp.util.set_qflist()* Use |setqflist()| instead. +- *vim.lsp.util.set_loclist()* Use |setloclist()| instead. +- *vim.lsp.buf_get_clients()* Use |vim.lsp.get_active_clients()| with {buffer = bufnr} instead. -*vim.lsp.buf.formatting()* Use |vim.lsp.buf.format()| with +- *vim.lsp.buf.formatting()* Use |vim.lsp.buf.format()| with {async = true} instead. -*vim.lsp.buf.range_formatting()* Use |vim.lsp.formatexpr()| +- *vim.lsp.buf.range_formatting()* Use |vim.lsp.formatexpr()| or |vim.lsp.buf.format()| instead. -Lua ~ -*vim.register_keystroke_callback()* Use |vim.on_key()| instead. - -Modifiers ~ -*cpo-<* -*:menu-* -*:menu-special* <> notation is always enabled. -*:map-* -*:map-special* <> notation is always enabled. +LUA +- *vim.register_keystroke_callback()* Use |vim.on_key()| instead. -Normal commands ~ -*]f* -*[f* Same as "gf". +NORMAL COMMANDS +- *]f* *[f* Same as "gf". -Options ~ -*'cscopeverbose'* Enabled by default. Use |:silent| instead. -*'exrc'* *'ex'* Security risk: downloaded files could include +OPTIONS +- *cpo-<* *:menu-* *:menu-special* *:map-* *:map-special* + `<>` notation is always enabled. +- *'cscopeverbose'* Enabled by default. Use |:silent| instead. +- *'exrc'* *'ex'* Security risk: downloaded files could include a malicious .nvimrc or .exrc file. See 'secure'. Recommended alternative: define an autocommand in your |vimrc| to set options for a matching directory. -'gd' -'gdefault' Enables the |:substitute| flag 'g' by default. -*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used. -*'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed. -*'langnoremap'* Deprecated alias to 'nolangremap'. -'sessionoptions' Flags "unix", "slash" are ignored and always enabled. -*'vi'* -'viewoptions' Flags "unix", "slash" are ignored and always enabled. -*'viminfo'* Deprecated alias to 'shada' option. -*'viminfofile'* Deprecated alias to 'shadafile' option. - -UI extensions~ -*ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled +- 'gdefault' Enables the |:substitute| flag 'g' by default. +- *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used. +- *'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed. +- *'langnoremap'* Deprecated alias to 'nolangremap'. +- 'sessionoptions' Flags "unix", "slash" are ignored and always enabled. +- *'vi'* +- 'viewoptions' Flags "unix", "slash" are ignored and always enabled. +- *'viminfo'* Deprecated alias to 'shada' option. +- *'viminfofile'* Deprecated alias to 'shadafile' option. + +UI EXTENSIONS +- *ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled by the `ext_wildmenu` |ui-option|. Emits these events: - ["wildmenu_show", items] - ["wildmenu_select", selected] - ["wildmenu_hide"] + - `["wildmenu_show", items]` + - `["wildmenu_select", selected]` + - `["wildmenu_hide"]` -Variables~ -*b:terminal_job_pid* PID of the top-level process in a |:terminal|. +VARIABLES +- *b:terminal_job_pid* PID of the top-level process in a |:terminal|. Use `jobpid(&channel)` instead. + vim:noet:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index ebb0dfeb4e..14b66a0736 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -131,6 +131,7 @@ DOCUMENTATION *dev-doc* (docstrings, user manual, website materials, newsletters, …). Don't mince words. Personality and flavor, used sparingly, are welcome--but in general, optimize for the reader's time and energy: be "precise yet concise". + - See https://developers.google.com/style/tone - Prefer the active voice: "Foo does X", not "X is done by Foo". - Vim differences: - Do not prefix help tags with "nvim-". Use |vim_diff.txt| to catalog @@ -144,11 +145,11 @@ DOCUMENTATION *dev-doc* - Use "tui-" to prefix help tags related to the host terminal, and "TUI" in prose if possible. - Docstrings: do not start parameter descriptions with "The" or "A" unless it - is critical to avoid ambiguity. - GOOD: > - /// @param dirname Path fragment before `pend` -< BAD: > - /// @param dirname The path fragment before `pend` + is critical to avoid ambiguity. > + GOOD: + /// @param dirname Path fragment before `pend` + BAD: + /// @param dirname The path fragment before `pend` < Documentation format ~ @@ -180,7 +181,7 @@ Docstring format: `@note`, `@param`, `@returns` - Limited markdown is supported. - List-items start with `-` (useful to nest or "indent") -- Use `
`  for code samples.
+- Use `
` for code samples.
 
 Example: the help for |nvim_open_win()| is generated from a docstring defined
 in src/nvim/api/win_config.c like this: >
@@ -218,7 +219,7 @@ Docstring format:
   `---@see`, `---@param`, `---@returns`
 - Limited markdown is supported.
   - List-items start with `-` (useful to nest or "indent")
-- Use `
`  for code samples.
+- Use `
` for code samples.
 
 Example: the help for |vim.paste()| is generated from a docstring decorating
 vim.paste in runtime/lua/vim/_editor.lua like this: >
@@ -251,7 +252,8 @@ LUA							*dev-lua*
 
 API							*dev-api*
 
-Use this template to name new RPC |API| functions:
+Use this format to name new RPC |API| functions:
+
     nvim_{thing}_{action}_{arbitrary-qualifiers}
 
 If the function acts on an object then {thing} is the name of that object
@@ -260,37 +262,50 @@ If the function acts on an object then {thing} is the name of that object
 with a {thing} that groups functions under a common concept).
 
 Use existing common {action} names if possible:
-    add     Append to, or insert into, a collection
-    create  Create a new thing
-    del     Delete a thing (or group of things)
-    exec    Execute code
-    get     Get a thing (or group of things by query)
-    list    Get all things
-    set     Set a thing (or group of things)
-
-Use existing common {thing} names if possible:
-    buf     Buffer
-    pos     Position
-    tab     Tabpage
-    win     Window
-
-Use consistent names for {thing} in all API functions. E.g. a buffer is called
+    - add       Append to, or insert into, a collection
+    - call      Call a function
+    - create    Create a new (non-trivial) thing
+    - del       Delete a thing (or group of things)
+    - eval      Evaluate an expression
+    - exec      Execute code
+    - fmt       Format
+    - get       Get things (often by a query)
+    - open      Open
+    - parse     Parse something into a structured form
+    - set       Set a thing (or group of things)
+
+Do NOT use these deprecated verbs:
+    - list      Redundant with "get"
+
+Use consistent names for {thing} (nouns) in API functions: buffer is called
 "buf" everywhere, not "buffer" in some places and "buf" in others.
+    - buf       Buffer
+    - chan      |channel|
+    - cmd       Command
+    - cmdline   Command-line UI or input
+    - fn        Function
+    - hl        Highlight
+    - pos       Position
+    - proc      System process
+    - tabpage   Tabpage
+    - win       Window
+
+Do NOT use these deprecated nouns:
+    - buffer
+    - command
+    - window
 
 Example:
-    `nvim_get_current_line` acts on the global editor state; the common
-    {action} "get" is used but {thing} is omitted.
-
-Example:
-    `nvim_buf_add_highlight` acts on a `Buffer` object (the first parameter)
-    and uses the common {action} "add".
+    `nvim_get_keymap('v')` operates in a global context (first parameter is not
+    a Buffer). The "get" {action} indicates that it gets anything matching the
+    given filter parameter. There is no need for a "list" action because
+    `nvim_get_keymap('')` (i.e., empty filter) returns all items.
 
 Example:
-    `nvim_list_bufs` operates in a global context (first parameter is not
-    a Buffer). The common {action} "list" indicates that it lists all bufs
-    (plural) in the global context.
+    `nvim_buf_del_mark` acts on a `Buffer` object (the first parameter)
+    and uses the "del" {action}.
 
-Use this template to name new API events:
+Use this format to name new API events:
     nvim_{thing}_{event}_event
 
 Example:
@@ -332,10 +347,10 @@ a good name: it's idiomatic and unambiguous. If the package is named "neovim",
 it confuses users, and complicates documentation and discussions.
 
 Examples of API-client package names:
-        GOOD: nvim-racket
-        GOOD: pynvim
-        BAD:  python-client
-        BAD:  neovim
+- GOOD: nvim-racket
+- GOOD: pynvim
+- BAD:  python-client
+- BAD:  neovim
 
 API client implementation guidelines ~
 
@@ -401,4 +416,4 @@ Use the "on_" prefix to name event handlers and also the interface for
 a confused collection of naming conventions for these related concepts.
 
 
- vim:tw=78:ts=8:noet:ft=help:norl:
+ vim:tw=78:ts=8:sw=4:et:ft=help:norl:
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 8dd3d708a3..7318bc7f34 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1120,7 +1120,7 @@ to terminal mode.
 You found it, Arthur!				*holy-grail*
 
 ==============================================================================
-6. EX commands					*ex-cmd-index* *:index*
+6. EX commands				*ex-commands* *ex-cmd-index* *:index*
 
 This is a brief but complete listing of all the ":" commands, without
 mentioning any arguments.  The optional part of the command name is inside [].
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 801664a670..29e0508f60 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -11,30 +11,126 @@ Lua engine                                                           *lua* *Lua*
 ==============================================================================
 INTRODUCTION                                                       *lua-intro*
 
-The Lua 5.1 language is builtin and always available. Try this command to get
-an idea of what lurks beneath: >
+The Lua 5.1 script engine is builtin and always available. Try this command to
+get an idea of what lurks beneath: >
 
     :lua print(vim.inspect(package.loaded))
+
+Nvim includes a "standard library" |lua-stdlib| for Lua.  It complements the
+"editor stdlib" (|builtin-functions| and |Ex-commands|) and the |API|, all of
+which can be used from Lua code (|lua-vimscript| |vim.api|). Together these
+"namespaces" form the Nvim programming interface.
+
+The |:source| and |:runtime| commands can run Lua scripts. Lua modules can be
+loaded with `require('name')`, which by convention usually returns a table.
+See |lua-require| for how Nvim finds and loads Lua modules.
+
+See this page for more insight into Nvim Lua:
+    https://github.com/nanotee/nvim-lua-guide
+
+                                                                  *lua-compat*
+Lua 5.1 is the permanent interface for Nvim Lua.  Plugins need only consider
+Lua 5.1, not worry about forward-compatibility with future Lua versions.  If
+Nvim ever ships with Lua 5.4+, a Lua 5.1 compatibility shim will be provided
+so that old plugins continue to work transparently.
+
+------------------------------------------------------------------------------
+LUA CONCEPTS AND IDIOMS                                         *lua-concepts*
+
+Lua is very simple: this means that, while there are some quirks, once you
+internalize those quirks, everything works the same everywhere. Scopes
+(closures) in particular are very consistent, unlike JavaScript or most other
+languages.
+
+Lua has three fundamental mechanisms—one for "each major aspect of
+programming": tables, closures, and coroutines.
+https://www.lua.org/doc/cacm2018.pdf
+- Tables are the "object" or container datastructure: they represent both
+  lists and maps, you can extend them to represent your own datatypes and
+  change their behavior using |luaref-metatable| (like Python's "datamodel").
+- EVERY scope in Lua is a closure: a function is a closure, a module is
+  a closure, a `do` block (|luaref-do|) is a closure--and they all work the
+  same. A Lua module is literally just a big closure discovered on the "path"
+  (where your modules are found: |package.cpath|).
+- Stackful coroutines enable cooperative multithreading, generators, and
+  versatile control for both Lua and its host (Nvim).
+
+                                                           *lua-call-function*
+Lua functions can be called in multiple ways. Consider the function: >
+    local foo = function(a, b)
+        print("A: ", a)
+        print("B: ", b)
+    end
+
+The first way to call this function is: >
+    foo(1, 2)
+    -- ==== Result ====
+    -- A: 1
+    -- B: 2
+
+This way of calling a function is familiar from most scripting languages.
+In Lua, any missing arguments are passed as `nil`. Example: >
+    foo(1)
+    -- ==== Result ====
+    -- A: 1
+    -- B: nil
+
+Furthermore it is not an error if extra parameters are passed, they are just
+discarded.
+
+It is also allowed to omit the parentheses (only) if the function takes
+exactly one string (`"foo"`) or table literal (`{1,2,3}`). The latter is often
+used to approximate the "named parameters" feature of languages like Python
+("kwargs" or "keyword args"). Example: >
+    local func_with_opts = function(opts)
+        local will_do_foo = opts.foo
+        local filename = opts.filename
+
+        ...
+    end
+
+    func_with_opts { foo = true, filename = "hello.world" }
 <
-Nvim includes a "standard library" |lua-stdlib| for Lua. It complements the
-"editor stdlib" (|builtin-functions| and Ex commands) and the |API|, all of
-which can be used from Lua code. A good overview of using Lua in neovim is
-given by https://github.com/nanotee/nvim-lua-guide.
+There is nothing special going on here except that parentheses are treated as
+whitespace. But visually, this small bit of sugar gets reasonably close to
+a "keyword args" interface.
 
-The |:source| and |:runtime| commands can run Lua scripts as well as Vim
-scripts. Lua modules can be loaded with `require('name')`, which
-conventionally returns a table but can return any value.
+It is of course also valid to call the function with parentheses: >
 
-See |lua-require| for details on how Nvim finds and loads Lua modules.
-See |lua-require-example| for an example of how to write and use a module.
+    func_with_opts({ foo = true, filename = "hello.world" })
+<
+Nvim tends to prefer the keyword args style.
+
+------------------------------------------------------------------------------
+LUA PATTERNS                                                    *lua-patterns*
+
+Lua intentionally does not support regular expressions, instead it has limited
+"patterns" which avoid the performance pitfalls of extended regex.
+|luaref-patterns|
+
+Examples using |string.match()|: >
+
+    print(string.match("foo123bar123", "%d+"))
+    -- 123
+
+    print(string.match("foo123bar123", "[^%d]+"))
+    -- foo
+
+    print(string.match("foo123bar123", "[abc]+"))
+    -- ba
+
+    print(string.match("foo.bar", "%.bar"))
+    -- .bar
+
+For more complex matching you can use Vim regex from Lua via |vim.regex()|.
 
 ==============================================================================
 IMPORTING LUA MODULES                                            *lua-require*
 
 Modules are searched for under the directories specified in 'runtimepath', in
-the order they appear. Any `.` in the module name is treated as a directory
-separator when searching. For a module `foo.bar`, each directory is searched
-for `lua/foo/bar.lua`, then `lua/foo/bar/init.lua`. If no files are found,
+the order they appear.  Any "." in the module name is treated as a directory
+separator when searching.  For a module `foo.bar`, each directory is searched
+for `lua/foo/bar.lua`, then `lua/foo/bar/init.lua`.  If no files are found,
 the directories are searched again for a shared library with a name matching
 `lua/foo/bar.?`, where `?` is a list of suffixes (such as `so` or `dll`) derived from
 the initial value of |package.cpath|. If still no files are found, Nvim falls
@@ -48,8 +144,7 @@ documentation at https://www.lua.org/manual/5.1/manual.html#pdf-require.
 
 For example, if 'runtimepath' is `foo,bar` and |package.cpath| was
 `./?.so;./?.dll` at startup, `require('mod')` searches these paths in order
-and loads the first module found:
-
+and loads the first module found ("first wins"):
     foo/lua/mod.lua
     foo/lua/mod/init.lua
     bar/lua/mod.lua
@@ -59,9 +154,10 @@ and loads the first module found:
     bar/lua/mod.so
     bar/lua/mod.dll
 
+                                                        *lua-package-path*
 Nvim automatically adjusts |package.path| and |package.cpath| according to the
 effective 'runtimepath' value. Adjustment happens whenever 'runtimepath' is
-changed. |package.path| is adjusted by simply appending `/lua/?.lua` and
+changed. `package.path` is adjusted by simply appending `/lua/?.lua` and
 `/lua/?/init.lua` to each directory from 'runtimepath' (`/` is actually the
 first character of `package.config`).
 
@@ -121,163 +217,6 @@ Note:
   plugins using shell, which will not work with paths containing semicolons,
   it is better to not have them in 'runtimepath' at all.
 
-==============================================================================
-Lua Syntax Information                                       *lua-syntax-help*
-
-While Lua has a simple syntax, there are a few things to understand,
-particularly when looking at the documentation above.
-
-                                                    *lua-syntax-call-function*
-
-Lua functions can be called in multiple ways. Consider the function: >
-
-    local example_func = function(a, b)
-        print("A is: ", a)
-        print("B is: ", b)
-    end
-<
-The first way to call this function is: >
-
-    example_func(1, 2)
-    -- ==== Result ====
-    -- A is: 1
-    -- B is: 2
-<
-This way of calling a function is familiar from most scripting languages.
-In Lua, it's important to understand that any function arguments that are
-not supplied are automatically set to `nil`. For example: >
-
-    example_func(1)
-    -- ==== Result ====
-    -- A is: 1
-    -- B is: nil
-<
-Additionally, if any extra parameters are passed, they are discarded
-completely.
-
-In Lua, it is also possible to omit the parentheses (only) if the function
-takes a single string or table literal (`"foo"` or "`{1,2,3}`", respectively).
-The latter is most often used to approximate "keyword-style" arguments with a
-single dictionary, for example: >
-
-    local func_with_opts = function(opts)
-        local will_do_foo = opts.foo
-        local filename = opts.filename
-
-        ...
-    end
-
-    func_with_opts { foo = true, filename = "hello.world" }
-<
-In this style, each "parameter" is passed via keyword. It is still valid
-to call the function in the standard style: >
-
-    func_with_opts({ foo = true, filename = "hello.world" })
-<
-But often in the documentation, you will see the former rather than the
-latter style due to its brevity.
-
-==============================================================================
-Lua Patterns                                                    *lua-patterns*
-
-For performance reasons, Lua does not support regular expressions natively.
-Instead, the Lua `string` standard library allows manipulations using a
-restricted set of "patterns", see |luaref-patterns|.
-
-Examples (`string.match` extracts the first match): >
-
-    print(string.match("foo123bar123", "%d+"))
-    -- -> 123
-
-    print(string.match("foo123bar123", "[^%d]+"))
-    -- -> foo
-
-    print(string.match("foo123bar123", "[abc]+"))
-    -- -> ba
-
-    print(string.match("foo.bar", "%.bar"))
-    -- -> .bar
-
-For more complex matching, Vim regular expressions can be used from Lua
-through |vim.regex()|.
-
-------------------------------------------------------------------------------
-LUA PLUGIN EXAMPLE                                       *lua-require-example*
-
-The following example plugin adds a command `:MakeCharBlob` which transforms
-current buffer into a long `unsigned char` array. Lua contains transformation
-function in a module `lua/charblob.lua` which is imported in
-`autoload/charblob.vim` (`require("charblob")`). Example plugin is supposed
-to be put into any directory from 'runtimepath', e.g. `~/.config/nvim` (in
-this case `lua/charblob.lua` means `~/.config/nvim/lua/charblob.lua`).
-
-autoload/charblob.vim: >
-
-    function charblob#encode_buffer()
-      call setline(1, luaeval(
-      \    'require("charblob").encode(unpack(_A))',
-      \    [getline(1, '$'), &textwidth, '  ']))
-    endfunction
-<
-plugin/charblob.vim: >
-
-    if exists('g:charblob_loaded')
-      finish
-    endif
-    let g:charblob_loaded = 1
-
-    command MakeCharBlob :call charblob#encode_buffer()
-<
-lua/charblob.lua: >
-
-    local function charblob_bytes_iter(lines)
-      local init_s = {
-        next_line_idx = 1,
-        next_byte_idx = 1,
-        lines = lines,
-      }
-      local function next(s, _)
-        if lines[s.next_line_idx] == nil then
-          return nil
-        end
-        if s.next_byte_idx > #(lines[s.next_line_idx]) then
-          s.next_line_idx = s.next_line_idx + 1
-          s.next_byte_idx = 1
-          return ('\n'):byte()
-        end
-        local ret = lines[s.next_line_idx]:byte(s.next_byte_idx)
-        if ret == ('\n'):byte() then
-          ret = 0  -- See :h NL-used-for-NUL.
-        end
-        s.next_byte_idx = s.next_byte_idx + 1
-        return ret
-      end
-      return next, init_s, nil
-    end
-
-    local function charblob_encode(lines, textwidth, indent)
-      local ret = {
-        'const unsigned char blob[] = {',
-        indent,
-      }
-      for byte in charblob_bytes_iter(lines) do
-        --                .- space + number (width 3) + comma
-        if #(ret[#ret]) + 5 > textwidth then
-          ret[#ret + 1] = indent
-        else
-          ret[#ret] = ret[#ret] .. ' '
-        end
-        ret[#ret] = ret[#ret] .. (('%3u,'):format(byte))
-      end
-      ret[#ret + 1] = '};'
-      return ret
-    end
-
-    return {
-      bytes_iter = charblob_bytes_iter,
-      encode = charblob_encode,
-    }
-<
 ==============================================================================
 COMMANDS                                                        *lua-commands*
 
@@ -1053,6 +992,7 @@ LUA-VIMSCRIPT BRIDGE                                           *lua-vimscript*
 
 Nvim Lua provides an interface to Vimscript variables and functions, and
 editor commands and options.
+
 See also https://github.com/nanotee/nvim-lua-guide.
 
 vim.call({func}, {...})                                           *vim.call()*
@@ -1436,7 +1376,7 @@ deprecate({name}, {alternative}, {version}, {plugin}, {backtrace})
       • {backtrace}    boolean|nil Prints backtrace. Defaults to true.
 
 inspect({object}, {options})                                   *vim.inspect()*
-    Return a human-readable representation of the given object.
+    Gets a human-readable representation of the given object.
 
     See also: ~
         https://github.com/kikito/inspect.lua
diff --git a/runtime/doc/luaref.txt b/runtime/doc/luaref.txt
index 5387900d16..ffbb405804 100644
--- a/runtime/doc/luaref.txt
+++ b/runtime/doc/luaref.txt
@@ -4852,7 +4852,7 @@ Lua is discussed in these references:
    "Proc. of V Brazilian Symposium on Programming Languages" (2001) B-14-B-28.
 
 ==============================================================================
-B  COPYRIGHT & LICENSES                                       *luaref-copyright*
+B  COPYRIGHT AND LICENSES                                     *luaref-copyright*
 
 This help file has the same copyright and license as Lua 5.1 and the Lua 5.1
  manual:
@@ -4869,13 +4869,13 @@ furnished to do so, subject to the following conditions:
 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
 
 ==============================================================================
 C  LUAREF DOC                 *luarefvim* *luarefvimdoc* *luaref-help* *luaref-doc*
diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt
index 513d27ccad..203f57024c 100644
--- a/runtime/doc/nvim.txt
+++ b/runtime/doc/nvim.txt
@@ -1,10 +1,10 @@
 *nvim.txt*	Nvim
 
 
-			    NVIM REFERENCE MANUAL
+                            NVIM REFERENCE MANUAL
 
 
-Nvim							   *nvim* *nvim-intro*
+Nvim                                                       *nvim* *nvim-intro*
 
 Nvim is based on Vim by Bram Moolenaar.
 
@@ -14,13 +14,13 @@ If you are new to Vim, try the 30-minute tutorial: >
     :Tutor
 
 Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim
-(especially editor and VimL features) is maintained where possible. See
+(especially editor and Vimscript features) is maintained where possible. See
 |vim-differences| for the complete reference of differences from Vim.
 
-				      Type |gO| to see the table of contents.
+                                      Type |gO| to see the table of contents.
 
 ==============================================================================
-Transitioning from Vim				*nvim-from-vim*
+Transitioning from Vim                          *nvim-from-vim*
 
 1. To start the transition, create your |init.vim| (user config) file: >
 
@@ -38,32 +38,37 @@ Transitioning from Vim				*nvim-from-vim*
 See |provider-python| and |provider-clipboard| for additional software you
 might need to use some features.
 
-Your Vim configuration might not be entirely Nvim-compatible.
-See |vim-differences| for the full list of changes.
-
-The |'ttymouse'| option, for example, was removed from Nvim (mouse support
-should work without it). If you use the same |vimrc| for Vim and Nvim,
-consider guarding |'ttymouse'| in your configuration like so:
+Your Vim configuration might not be entirely Nvim-compatible (see
+|vim-differences|). For example the |'ttymouse'| option was removed from Nvim,
+because mouse support is always enabled if possible. If you use the same
+|vimrc| for Vim and Nvim you could guard |'ttymouse'| in your configuration
+like so:
 >
     if !has('nvim')
         set ttymouse=xterm2
     endif
-<
-Conversely, if you have Nvim specific configuration items, you could do
-this:
+
+And for Nvim-specific configuration, you can do this:
 >
     if has('nvim')
         tnoremap  
     endif
-<
+
 For a more granular approach use |exists()|:
 >
     if exists(':tnoremap')
         tnoremap  
     endif
-<
+
 Now you should be able to explore Nvim more comfortably. Check |nvim-features|
 for more information.
 
+                                                        *portable-config*
+Because Nvim follows the XDG |base-directories| standard, configuration on
+Windows is stored in ~/AppData instead of ~/.config. But you can still share
+the same Nvim configuration on all of your machines, by creating
+~/AppData/Local/nvim/init.vim containing just this line: >
+    source ~/.config/nvim/init.vim
+
 ==============================================================================
- vim:tw=78:ts=8:noet:ft=help:norl:
+ vim:tw=78:ts=8:et:ft=help:norl:
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 837c3e7652..522819a320 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4948,10 +4948,13 @@ A jump table for the options with a short description can be found at |Q_op|.
 	  indent/	indent scripts |indent-expression|
 	  keymap/	key mapping files |mbyte-keymap|
 	  lang/		menu translations |:menutrans|
+	  lua/		|Lua| plugins
 	  menu.vim	GUI menus |menu.vim|
 	  pack/		packages |:packadd|
+	  parser/	|treesitter| syntax parsers
 	  plugin/	plugin scripts |write-plugin|
 	  print/	files for printing |postscript-print-encoding|
+	  query/	|treesitter| queries
 	  rplugin/	|remote-plugin| scripts
 	  spell/	spell checking files |spell|
 	  syntax/	syntax files |mysyntaxfile|
@@ -4972,20 +4975,20 @@ A jump table for the options with a short description can be found at |Q_op|.
 	   but are not part of the Nvim distribution. XDG_DATA_DIRS defaults
 	   to /usr/local/share/:/usr/share/, so system administrators are
 	   expected to install site plugins to /usr/share/nvim/site.
-	5. Applications state home directory, for files that contain your
-	   session state (eg. backupdir, viewdir, undodir, etc).
+	5. Session state directory, for state data such as swap, backupdir,
+	   viewdir, undodir, etc.
 	   Given by `stdpath("state")`.  |$XDG_STATE_HOME|
-	6. $VIMRUNTIME, for files distributed with Neovim.
+	6. $VIMRUNTIME, for files distributed with Nvim.
 							*after-directory*
 	7, 8, 9, 10. In after/ subdirectories of 1, 2, 3 and 4, with reverse
-	   ordering.  This is for preferences to overrule or add to the 
+	   ordering.  This is for preferences to overrule or add to the
 	   distributed defaults or system-wide settings (rarely needed).
 
-							*rtp-packages*
-	"start" packages will additionally be used to search for runtime files
-	after these, but package entries are not visible in `:set rtp`.
-	See |runtime-search-path| for more information. "opt" packages
-	will be explicitly added to &rtp when |:packadd| is used.
+							*packages-runtimepath*
+	"start" packages will also be searched (|runtime-search-path|) for
+	runtime files after these, though such packages are not explicitly
+	reported in &runtimepath. But "opt" packages are explicitly added to
+	&runtimepath by |:packadd|.
 
 	Note that, unlike 'path', no wildcards like "**" are allowed.  Normal
 	wildcards are allowed, but can significantly slow down searching for
@@ -4995,18 +4998,13 @@ A jump table for the options with a short description can be found at |Q_op|.
 	Example: >
 		:set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME
 <	This will use the directory "~/vimruntime" first (containing your
-	personal Vim runtime files), then "/mygroup/vim" (shared between a
-	group of people) and finally "$VIMRUNTIME" (the distributed runtime
-	files).
-	You probably should always include $VIMRUNTIME somewhere, to use the
-	distributed runtime files.  You can put a directory before $VIMRUNTIME
-	to find files which replace a distributed runtime files.  You can put
-	a directory after $VIMRUNTIME to find files which add to distributed
-	runtime files.
-	When Vim is started with |--clean| the home directory entries are not
-	included.
-	This option cannot be set from a |modeline| or in the |sandbox|, for
-	security reasons.
+	personal Nvim runtime files), then "/mygroup/vim", and finally
+	"$VIMRUNTIME" (the default runtime files).
+	You can put a directory before $VIMRUNTIME to find files which replace
+	distributed runtime files.  You can put a directory after $VIMRUNTIME
+	to find files which add to distributed runtime files.
+
+	With |--clean| the home directory entries are not included.
 
 						*'scroll'* *'scr'*
 'scroll' 'scr'		number	(default: half the window height)
@@ -6795,28 +6793,31 @@ A jump table for the options with a short description can be found at |Q_op|.
 						*'verbose'* *'vbs'*
 'verbose' 'vbs'		number	(default 0)
 			global
-	When bigger than zero, Vim will give messages about what it is doing.
-	Currently, these messages are given:
-	>= 1	Lua assignments to options, mappings, etc.
-	>= 2	When a file is ":source"'ed and when the shada file is read or written..
-	>= 3	UI info, terminal capabilities
-	>= 4	Shell commands.
-	>= 5	Every searched tags file and include file.
-	>= 8	Files for which a group of autocommands is executed.
-	>= 9	Every executed autocommand.
-	>= 11	Finding items in a path
-	>= 12	Every executed function.
-	>= 13	When an exception is thrown, caught, finished, or discarded.
-	>= 14	Anything pending in a ":finally" clause.
-	>= 15	Every executed Ex command from a script (truncated at 200
-		characters).
-	>= 16	Every executed Ex command.
-
-	This option can also be set with the "-V" argument.  See |-V|.
-	This option is also set by the |:verbose| command.
-
-	When the 'verbosefile' option is set then the verbose messages are not
-	displayed.
+	Sets the verbosity level.  Also set by |-V| and |:verbose|.
+
+	Tracing of options in Lua scripts is activated at level 1; Lua scripts
+	are not traced with verbose=0, for performance.
+
+	If greater than or equal to a given level, Nvim produces the following
+	messages:
+
+	Level   Messages ~
+	----------------------------------------------------------------------
+	1	Lua assignments to options, mappings, etc.
+	2	When a file is ":source"'ed, or |shada| file is read or written.
+	3	UI info, terminal capabilities.
+	4	Shell commands.
+	5	Every searched tags file and include file.
+	8	Files for which a group of autocommands is executed.
+	9	Executed autocommands.
+	11	Finding items in a path.
+	12	Vimscript function calls.
+	13	When an exception is thrown, caught, finished, or discarded.
+	14	Anything pending in a ":finally" clause.
+	15	Ex commands from a script (truncated at 200 characters).
+	16	Ex commands.
+
+	If 'verbosefile' is set then the verbose messages are not displayed.
 
 						*'verbosefile'* *'vfile'*
 'verbosefile' 'vfile'	string	(default empty)
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 782bd19441..99ec84c625 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -236,6 +236,22 @@ The "copy" function stores a list of lines and the register type. The "paste"
 function returns the clipboard as a `[lines, regtype]` list, where `lines` is
 a list of lines and `regtype` is a register type conforming to |setreg()|.
 
+							      *clipboard-wsl*
+For Windows WSL, try this g:clipboard definition:
+>
+    let g:clipboard = {
+                \   'name': 'WslClipboard',
+                \   'copy': {
+                \      '+': 'clip.exe',
+                \      '*': 'clip.exe',
+                \    },
+                \   'paste': {
+                \      '+': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
+                \      '*': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
+                \   },
+                \   'cache_enabled': 0,
+                \ }
+
 ==============================================================================
 Paste 							*provider-paste* *paste*
 
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index b84274cc9e..21945dc499 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -498,22 +498,33 @@ Rationale:
 ==============================================================================
 Using Vim packages					*packages*
 
-A Vim package is a directory that contains one or more plugins.  The
-advantages over normal plugins:
-- A package can be downloaded as an archive and unpacked in its own directory.
-  Thus the files are not mixed with files of other plugins.  That makes it
-  easy to update and remove.
-- A package can be a git, mercurial, etc. repository.  That makes it really
-  easy to update.
-- A package can contain multiple plugins that depend on each other.
-- A package can contain plugins that are automatically loaded on startup and
-  ones that are only loaded when needed with `:packadd`.
+A Vim "package" is a directory that contains |plugin|s.  Compared to normal
+plugins, a package can...
+- be downloaded as an archive and unpacked in its own directory, so the files
+  are not mixed with files of other plugins.
+- be a git, mercurial, etc. repository, thus easy to update.
+- contain multiple plugins that depend on each other.
+- contain plugins that are automatically loaded on startup ("start" packages,
+  located in "pack/*/start/*") and ones that are only loaded when needed with
+  |:packadd| ("opt" packages, located in "pack/*/opt/*").
 
+							*runtime-search-path*
+Nvim searches for |:runtime| files in:
+	1. all paths in 'runtimepath'
+	2. all "pack/*/start/*" dirs
+
+Note that the "pack/*/start/*" paths are not explicitly included in
+'runtimepath', so they will not be reported by ":set rtp" or "echo &rtp".
+Scripts can use |nvim_list_runtime_paths()| to list all used directories, and
+|nvim_get_runtime_file()| to query for specific files or sub-folders within
+the runtime path. Example: >
+	" List all runtime dirs and packages with Lua paths.
+	:echo nvim_get_runtime_file("lua/", v:true)
 
 Using a package and loading automatically ~
 
-Let's assume your Vim files are in the "~/.local/share/nvim/site" directory
-and you want to add a package from a zip archive "/tmp/foopack.zip":
+Let's assume your Nvim files are in "~/.local/share/nvim/site" and you want to
+add a package from a zip archive "/tmp/foopack.zip":
 	% mkdir -p ~/.local/share/nvim/site/pack/foo
 	% cd ~/.local/share/nvim/site/pack/foo
 	% unzip /tmp/foopack.zip
@@ -526,28 +537,17 @@ You would now have these files under ~/.local/share/nvim/site:
 	pack/foo/start/foobar/syntax/some.vim
 	pack/foo/opt/foodebug/plugin/debugger.vim
 
-							*runtime-search-path*
-When runtime files are searched for, first all paths in 'runtimepath' are
-searched, then all "pack/*/start/*" dirs are searched. However, package entries
-are not visible in `:set rtp` or `echo &rtp`, as the final concatenated path
-would be too long and get truncated. To list all used directories, use
-|nvim_list_runtime_paths()|. In addition |nvim_get_runtime_file()| can be used
-to query for specific files or sub-folders within the runtime path. For
-instance to list all runtime dirs and packages with lua paths, use >
-
-    :echo nvim_get_runtime_file("lua/", v:true)
+On startup after processing your |config|, Nvim scans all directories in
+'packpath' for plugins in "pack/*/start/*", then loads the plugins.
 
-
 	:packadd! foodebug
-The extra "!" is so that the plugin isn't loaded if Vim was started with
+The extra "!" is so that the plugin isn't loaded if Nvim was started with
 |--noplugin|.
 
 It is perfectly normal for a package to only have files in the "opt"
@@ -606,7 +606,7 @@ Where to put what ~
 Since color schemes, loaded with `:colorscheme`, are found below
 "pack/*/start" and "pack/*/opt", you could put them anywhere.  We recommend
 you put them below "pack/*/opt", for example
-".vim/pack/mycolors/opt/dark/colors/very_dark.vim".
+"~/.config/nvim/pack/mycolors/opt/dark/colors/very_dark.vim".
 
 Filetype plugins should go under "pack/*/start", so that they are always
 found.  Unless you have more than one plugin for a file type and want to
@@ -684,8 +684,8 @@ found automatically.  Your package would have these files:
 <	pack/foo/start/lib/autoload/foolib.vim >
 		func foolib#getit()
 
-This works, because start packages will be used to look for autoload files,
-when sourcing the plugins.
+This works, because start packages will be searchd for autoload files, when
+sourcing the plugins.
 
 ==============================================================================
 Debugging scripts					*debug-scripts*
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 2c18398598..baa60f431f 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -143,12 +143,11 @@ argument.
 		these commands, independently from "-c" commands.
 
 							*-S*
--S {file}	The {file} will be sourced after the first file has been read.
-		This is an easy way to do the equivalent of: >
+-S {file}	Vimscript or Lua (".lua") {file} will be |:source|d after the
+		first file has been read. Equivalent to: >
 			-c "source {file}"
-<		It can be mixed with "-c" arguments and repeated like "-c".
-		The limit of 10 "-c" arguments applies here as well.
-		{file} cannot start with a "-".
+<		Can be repeated like "-c", subject to the same limit of 10
+		"-c" arguments. {file} cannot start with a "-".
 
 -S		Works like "-S Session.vim".  Only when used as the last
 		argument or when another "-" option follows.
@@ -203,13 +202,14 @@ argument.
 		send commands. >
 			printf "foo\n" | nvim -Es +"%print"
 
-<		Output of these commands is displayed (to stdout):
-			:print
+<		These commands display on stdout:
 			:list
 			:number
-			:set      (to display option values)
-		When 'verbose' is set messages are printed to stderr. >
-			echo foo | nvim -V1 -es
+			:print
+			:set
+		With |:verbose| or 'verbose', other commands display on stderr: >
+			nvim -es +":verbose echo 'foo'"
+			nvim -V1 -es +foo
 
 <		User |config| is skipped (unless given with |-u|).
 		Swap file is skipped (like |-n|).
@@ -443,9 +443,9 @@ accordingly, proceeding as follows:
 						*VIMINIT* *EXINIT* *$MYVIMRC*
      b. Locations searched for initializations, in order of preference:
 	-  $VIMINIT environment variable (Ex command line).
-	-  User |config|: $XDG_CONFIG_HOME/nvim/init.vim.
-	-  Other config: {dir}/nvim/init.vim where {dir} is any directory
-	   in $XDG_CONFIG_DIRS.
+	-  User |config|: $XDG_CONFIG_HOME/nvim/init.vim (or init.lua).
+	-  Other config: {dir}/nvim/init.vim (or init.lua) where {dir} is any
+	   directory in $XDG_CONFIG_DIRS.
 	-  $EXINIT environment variable (Ex command line).
 	|$MYVIMRC| is set to the first valid location unless it was already
 	set or when using $VIMINIT.
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 8c6585a941..62b755d64b 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -643,6 +643,9 @@ Options:
   *'ttytype'* *'tty'*
   weirdinvert
 
+Performance:
+  Folds are not updated during insert-mode.
+
 Startup:
   --literal (file args are always literal; to expand wildcards on Windows, use
     |:n| e.g. `nvim +"n *"`)
-- 
cgit 


From a7a83bc4c25d63f3ae0a7a56e5211df1444699c4 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Sun, 9 Oct 2022 18:19:43 +0200
Subject: fix(docs-html): update parser

- Improve generated HTML by updating parser which includes fixes for
  single "'" and single "|":
  https://github.com/neovim/tree-sitter-vimdoc/pull/31
- Updated parser also fixes the conceal issue for "help" highlight
  queries https://github.com/neovim/tree-sitter-vimdoc/issues/23 by
  NOT including whitespace in nodes.
  - But this means we need to restore the getws() function which scrapes
    leading whitespace from the original input (buffer).
---
 runtime/doc/develop.txt |   3 ++
 runtime/doc/lua.txt     | 116 +++++++++++++++++++++++-------------------------
 2 files changed, 59 insertions(+), 60 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index 14b66a0736..1ba6ae757b 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -164,6 +164,9 @@ Strict "vimdoc" subset:
   that you don't want auto-wrapped. Lists are always rendered with "flow"
   (soft-wrapped) layout instead of preformatted (hard-wrapped) layout common
   in legacy :help docs.
+  - Limitation: currently the parser https://github.com/neovim/tree-sitter-vimdoc
+    does not understand numbered listitems, so use a bullet symbol (- or •)
+    before numbered items, e.g. "- 1." instead of "1.".
 - Separate blocks (paragraphs) of content by a blank line(s).
 - Do not use indentation in random places—that prevents the page from using
   "flow" layout. If you need a preformatted section, put it in
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 29e0508f60..7330453778 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -144,7 +144,7 @@ documentation at https://www.lua.org/manual/5.1/manual.html#pdf-require.
 
 For example, if 'runtimepath' is `foo,bar` and |package.cpath| was
 `./?.so;./?.dll` at startup, `require('mod')` searches these paths in order
-and loads the first module found ("first wins"):
+and loads the first module found ("first wins"): >
     foo/lua/mod.lua
     foo/lua/mod/init.lua
     bar/lua/mod.lua
@@ -153,7 +153,7 @@ and loads the first module found ("first wins"):
     foo/lua/mod.dll
     bar/lua/mod.so
     bar/lua/mod.dll
-
+<
                                                         *lua-package-path*
 Nvim automatically adjusts |package.path| and |package.cpath| according to the
 effective 'runtimepath' value. Adjustment happens whenever 'runtimepath' is
@@ -166,37 +166,33 @@ added to |package.cpath|. In this case, instead of appending `/lua/?.lua` and
 `/lua/?/init.lua` to each runtimepath, all unique `?`-containing suffixes of
 the existing |package.cpath| are used. Example:
 
-1. Given that
+- 1. Given that
    - 'runtimepath' contains `/foo/bar,/xxx;yyy/baz,/abc`;
-   - initial (defined at compile-time or derived from
-     `$LUA_CPATH`/`$LUA_INIT`) |package.cpath| contains
-     `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`.
-2. It finds `?`-containing suffixes `/?.so`, `/a?d/j/g.elf` and `/?.so`, in
-   order: parts of the path starting from the first path component containing
-   question mark and preceding path separator.
-3. The suffix of `/def/?.so`, namely `/?.so` is not unique, as it’s the same
-   as the suffix of the first path from |package.path| (i.e. `./?.so`). Which
-   leaves `/?.so` and `/a?d/j/g.elf`, in this order.
-4. 'runtimepath' has three paths: `/foo/bar`, `/xxx;yyy/baz` and `/abc`. The
-   second one contains a semicolon which is a paths separator so it is out,
-   leaving only `/foo/bar` and `/abc`, in order.
-5. The cartesian product of paths from 4. and suffixes from 3. is taken,
-   giving four variants. In each variant, a `/lua` path segment is inserted
-   between path and suffix, leaving:
-
-   - `/foo/bar/lua/?.so`
-   - `/foo/bar/lua/a?d/j/g.elf`
-   - `/abc/lua/?.so`
-   - `/abc/lua/a?d/j/g.elf`
-
-6. New paths are prepended to the original |package.cpath|.
-
-The result will look like this:
-
-    `/foo/bar,/xxx;yyy/baz,/abc` ('runtimepath')
-    × `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so` (`package.cpath`)
-
-    = `/foo/bar/lua/?.so;/foo/bar/lua/a?d/j/g.elf;/abc/lua/?.so;/abc/lua/a?d/j/g.elf;./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`
+   - initial |package.cpath| (defined at compile-time or derived from
+     `$LUA_CPATH` / `$LUA_INIT`) contains `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`.
+- 2. It finds `?`-containing suffixes `/?.so`, `/a?d/j/g.elf` and `/?.so`, in
+     order: parts of the path starting from the first path component containing
+     question mark and preceding path separator.
+- 3. The suffix of `/def/?.so`, namely `/?.so` is not unique, as it’s the same
+     as the suffix of the first path from |package.path| (i.e. `./?.so`). Which
+     leaves `/?.so` and `/a?d/j/g.elf`, in this order.
+- 4. 'runtimepath' has three paths: `/foo/bar`, `/xxx;yyy/baz` and `/abc`. The
+     second one contains a semicolon which is a paths separator so it is out,
+     leaving only `/foo/bar` and `/abc`, in order.
+- 5. The cartesian product of paths from 4. and suffixes from 3. is taken,
+     giving four variants. In each variant a `/lua` path segment is inserted
+     between path and suffix, leaving:
+     - `/foo/bar/lua/?.so`
+     - `/foo/bar/lua/a?d/j/g.elf`
+     - `/abc/lua/?.so`
+     - `/abc/lua/a?d/j/g.elf`
+- 6. New paths are prepended to the original |package.cpath|.
+
+The result will look like this: >
+
+    /foo/bar,/xxx;yyy/baz,/abc ('runtimepath')
+    × ./?.so;/def/ghi/a?d/j/g.elf;/def/?.so (package.cpath)
+    = /foo/bar/lua/?.so;/foo/bar/lua/a?d/j/g.elf;/abc/lua/?.so;/abc/lua/a?d/j/g.elf;./?.so;/def/ghi/a?d/j/g.elf;/def/?.so
 
 Note:
 
@@ -278,7 +274,7 @@ arguments separated by " " (space) instead of "\t" (tab).
         :lua require"lpeg"
         :lua -- balanced parenthesis grammar:
         :lua bp = lpeg.P{ "(" * ((1 - lpeg.S"()") + lpeg.V(1))^0 * ")" }
-        :luado if bp:match(line) then return "-->\t" .. line end
+        :luado if bp:match(line) then return "=>\t" .. line end
 <
                                                                     *:luafile*
 :luafile {file}
@@ -595,12 +591,12 @@ vim.highlight.range({bufnr}, {ns}, {hlgroup}, {start}, {finish}, {opts})
     Apply highlight group to range of text.
 
             Parameters: ~
-                {bufnr}   buffer number
-                {ns}      namespace for highlights
-                {hlgroup} highlight group name
-                {start}   starting position (tuple {line,col})
-                {finish}  finish position (tuple {line,col})
-                {opts}    optional parameters:
+              • {bufnr}   buffer number
+              • {ns}      namespace for highlights
+              • {hlgroup} highlight group name
+              • {start}   starting position (tuple {line,col})
+              • {finish}  finish position (tuple {line,col})
+              • {opts}    optional parameters:
                           • `regtype`: type of range (characterwise, linewise,
                             or blockwise, see |setreg()|), default `'v'`
                           • `inclusive`: range includes end position,
@@ -653,22 +649,22 @@ vim.diff({a}, {b}, {opts})                                        *vim.diff()*
     Examples: >
 
         vim.diff('a\n', 'b\nc\n')
-        -->
+        =>
         @@ -1 +1,2 @@
         -a
         +b
         +c
 
         vim.diff('a\n', 'b\nc\n', {result_type = 'indices'})
-        -->
+        =>
         {
             {1, 1, 1, 2}
         }
 <
     Parameters: ~
-        {a}      First string to compare
-        {b}      Second string to compare
-        {opts}   Optional parameters:
+      • {a}      First string to compare
+      • {b}      Second string to compare
+      • {opts}   Optional parameters:
                  • `on_hunk` (callback):
                    Invoked for each hunk in the diff. Return a negative number
                    to cancel the callback for any remaining hunks.
@@ -734,13 +730,13 @@ vim.spell.check({str})                                     *vim.spell.check()*
     Example: >
 
         vim.spell.check("the quik brown fox")
-        -->
+        =>
         {
             {'quik', 'bad', 4}
         }
 <
     Parameters: ~
-        {str}    String to spell check.
+      • {str}    String to spell check.
 
     Return: ~
       List of tuples with three items:
@@ -829,9 +825,9 @@ vim.iconv({str}, {from}, {to}[, {opts}])                        *vim.iconv()*
         can accept, see ":Man 3 iconv".
 
         Parameters: ~
-            {str}   (string) Text to convert
-            {from}  (string) Encoding of {str}
-            {to}    (string) Target encoding
+          • {str}   (string) Text to convert
+          • {from}  (string) Encoding of {str}
+          • {to}    (string) Target encoding
 
         Returns: ~
             Converted string if conversion succeeds, `nil` otherwise.
@@ -849,8 +845,8 @@ vim.defer_fn({fn}, {timeout})                                   *vim.defer_fn*
     safe to call.
 
     Parameters: ~
-        {fn}        Callback to call once {timeout} expires
-        {timeout}   Time in ms to wait before calling {fn}
+      • {fn}        Callback to call once {timeout} expires
+      • {timeout}   Time in ms to wait before calling {fn}
 
     Returns: ~
         |vim.loop|.new_timer() object
@@ -863,10 +859,10 @@ vim.wait({time} [, {callback}, {interval}, {fast_only}])          *vim.wait()*
     this time.
 
     Parameters: ~
-        {time}      Number of milliseconds to wait
-        {callback}  Optional callback. Waits until {callback} returns true
-        {interval}  (Approximate) number of milliseconds to wait between polls
-        {fast_only} If true, only |api-fast| events will be processed.
+      • {time}      Number of milliseconds to wait
+      • {callback}  Optional callback. Waits until {callback} returns true
+      • {interval}  (Approximate) number of milliseconds to wait between polls
+      • {fast_only} If true, only |api-fast| events will be processed.
                         If called from while in an |api-fast| event, will
                         automatically be set to `true`.
 
@@ -1254,7 +1250,7 @@ Option:get()
         --  { space = "_", tab = ">~", }
 
         for char, representation in pairs(vim.opt.listchars:get()) do
-            print(char, "->", representation)
+            print(char, "=>", representation)
         end
 <
     For values that are lists of flags, a set will be returned with the flags
@@ -1643,10 +1639,10 @@ split({s}, {sep}, {kwargs})                                      *vim.split()*
 
     Examples: >
 
-      split(":aa::b:", ":")     --> {'','aa','','b',''}
-      split("axaby", "ab?")     --> {'','x','y'}
-      split("x*yz*o", "*", {plain=true})  --> {'x','yz','o'}
-      split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'}
+      split(":aa::b:", ":")     => {'','aa','','b',''}
+      split("axaby", "ab?")     => {'','x','y'}
+      split("x*yz*o", "*", {plain=true})  => {'x','yz','o'}
+      split("|x|y|z|", "|", {trimempty=true}) => {'x', 'y', 'z'}
 <
 
     @alias split_kwargs {plain: boolean, trimempty: boolean} | boolean | nil
-- 
cgit 


From 34c7007c32cd78b5589d72701c6669a2c378dd17 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 13 Oct 2022 07:49:48 +0800
Subject: vim-patch:9.0.0727: help in the repository differs from patched
 version too much (#20627)

Problem:    Help in the repository differs from patched version too much.
Solution:   Make a patch for a few help files.
https://github.com/vim/vim/commit/7c6cd443757348aa987eed87506549ab6b2079fe
---
 runtime/doc/builtin.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 344abe557c..89f3dafa85 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1519,9 +1519,10 @@ cursor({list})
 		|setcursorcharpos()|.
 
 		Does not change the jumplist.
+		{lnum} is used like with |getline()|, except that if {lnum} is
+		zero, the cursor will stay in the current line.
 		If {lnum} is greater than the number of lines in the buffer,
 		the cursor will be positioned at the last line in the buffer.
-		If {lnum} is zero, the cursor will stay in the current line.
 		If {col} is greater than the number of bytes in the line,
 		the cursor will be positioned at the last character in the
 		line.
-- 
cgit 


From 06dfedc87ab4cc575a503195a1358b2984e248c4 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 13 Oct 2022 20:46:23 +0800
Subject: vim-patch:9.0.0738: cannot suppress completion "scanning" messages
 (#20633)

Problem:    Cannot suppress completion "scanning" messages.
Solution:   Add the "C" flag in 'shortmess'. (Bjorn Linse, closes vim/vim#11354)
https://github.com/vim/vim/commit/91ccbad5ded8bcf2cc93a873ff2c3179b0c548c7
---
 runtime/doc/options.txt | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 522819a320..e9dda06df9 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5557,6 +5557,8 @@ A jump table for the options with a short description can be found at |Q_op|.
 	  c	don't give |ins-completion-menu| messages.  For example,
 		"-- XXX completion (YYY)", "match 1 of 2", "The only match",
 		"Pattern not found", "Back at original", etc.
+	  C	don't give messages while scanning for ins-completion items,
+		for instance "scanning tags"
 	  q	use "recording" instead of "recording @a"
 	  F	don't give the file info when editing a file, like `:silent`
 		was used for the command
-- 
cgit 


From eb123b565e201418dd135d2602dc20eea3cead39 Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Thu, 13 Oct 2022 15:18:48 +0200
Subject: docs: fix typos (#20509)

Co-authored-by: zeertzjq 
---
 runtime/doc/deprecated.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt
index 8fcd0fc1d0..d00f309826 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -107,7 +107,7 @@ internally and are no longer exposed as part of the API. Instead, use
 - *vim.lsp.diagnostic.set_virtual_text()*
 
 LSP FUNCTIONS
-- *vim.lsp.range_code_action*		Use |vim.lsp.buf.code_action()| with
+- *vim.lsp.buf.range_code_action()*	Use |vim.lsp.buf.code_action()| with
 					the `range` parameter.
 - *vim.lsp.util.diagnostics_to_items()*	Use |vim.diagnostic.toqflist()| instead.
 - *vim.lsp.util.set_qflist()*		Use |setqflist()| instead.
-- 
cgit 


From 288208257c8d6b3c8dcce7ee6c7b6c7bb7bafb27 Mon Sep 17 00:00:00 2001
From: Lewis Russell 
Date: Sat, 8 Oct 2022 15:48:07 +0100
Subject: feat(cscope)!: remove

---
 runtime/doc/autocmd.txt    |   2 +-
 runtime/doc/builtin.txt    |  44 ------
 runtime/doc/cmdline.txt    |   4 -
 runtime/doc/deprecated.txt |   1 -
 runtime/doc/help.txt       |   1 -
 runtime/doc/if_cscop.txt   | 374 ---------------------------------------------
 runtime/doc/index.txt      |   4 -
 runtime/doc/map.txt        |   1 -
 runtime/doc/news.txt       |  21 +++
 runtime/doc/options.txt    |  37 -----
 runtime/doc/quickref.txt   |   6 -
 runtime/doc/usr_29.txt     |   3 -
 runtime/doc/usr_41.txt     |   1 -
 runtime/doc/vim_diff.txt   |  17 ++-
 14 files changed, 38 insertions(+), 478 deletions(-)
 delete mode 100644 runtime/doc/if_cscop.txt

(limited to 'runtime/doc')

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index e27f191e0d..da41c92df6 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -806,7 +806,7 @@ OptionSet			After setting an option (except during
 QuickFixCmdPre			Before a quickfix command is run (|:make|,
 				|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
 				|:lgrepadd|, |:vimgrep|, |:lvimgrep|,
-				|:vimgrepadd|, |:lvimgrepadd|, |:cscope|,
+				|:vimgrepadd|, |:lvimgrepadd|,
 				|:cfile|, |:cgetfile|, |:caddfile|, |:lfile|,
 				|:lgetfile|, |:laddfile|, |:helpgrep|,
 				|:lhelpgrep|, |:cexpr|, |:cgetexpr|,
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 89f3dafa85..b0484b7ffe 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -96,8 +96,6 @@ cos({expr})			Float	cosine of {expr}
 cosh({expr})			Float	hyperbolic cosine of {expr}
 count({comp}, {expr} [, {ic} [, {start}]])
 				Number	count how many {expr} are in {comp}
-cscope_connection([{num}, {dbpath} [, {prepend}]])
-				Number	checks existence of cscope connection
 ctxget([{index}])		Dict	return the |context| dict at {index}
 ctxpop()			none	pop and restore |context| from the
 					|context-stack|
@@ -1436,47 +1434,6 @@ count({comp}, {expr} [, {ic} [, {start}]])			*count()*
 		Can also be used as a |method|: >
 			mylist->count(val)
 <
-							*cscope_connection()*
-cscope_connection([{num} , {dbpath} [, {prepend}]])
-		Checks for the existence of a |cscope| connection.  If no
-		parameters are specified, then the function returns:
-			0, if there are no cscope connections;
-			1, if there is at least one cscope connection.
-
-		If parameters are specified, then the value of {num}
-		determines how existence of a cscope connection is checked:
-
-		{num}	Description of existence check
-		-----	------------------------------
-		0	Same as no parameters (e.g., "cscope_connection()").
-		1	Ignore {prepend}, and use partial string matches for
-			{dbpath}.
-		2	Ignore {prepend}, and use exact string matches for
-			{dbpath}.
-		3	Use {prepend}, use partial string matches for both
-			{dbpath} and {prepend}.
-		4	Use {prepend}, use exact string matches for both
-			{dbpath} and {prepend}.
-
-		Note: All string comparisons are case sensitive!
-
-		Examples.  Suppose we had the following (from ":cs show"): >
-
-  # pid    database name			prepend path
-  0 27664  cscope.out				/usr/local
-<
-		Invocation					Return Val ~
-		----------					---------- >
-		cscope_connection()					1
-		cscope_connection(1, "out")				1
-		cscope_connection(2, "out")				0
-		cscope_connection(3, "out")				0
-		cscope_connection(3, "out", "local")			1
-		cscope_connection(4, "out")				0
-		cscope_connection(4, "out", "local")			0
-		cscope_connection(4, "cscope.out", "/usr/local")	1
-<
-
 ctxget([{index}])					*ctxget()*
 		Returns a |Dictionary| representing the |context| at {index}
 		from the top of the |context-stack| (see |context-dict|).
@@ -2981,7 +2938,6 @@ getcompletion({pat}, {type} [, {filtered}])		*getcompletion()*
 		color		color schemes
 		command		Ex command
 		compiler	compilers
-		cscope		|:cscope| suboptions
 		diff_buffer     |:diffget| and |:diffput| completion
 		dir		directory names
 		environment	environment variable names
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index b1013420fa..a6458adb77 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -524,7 +524,6 @@ that see the '"' as part of their argument:
     :cexpr (and the like)
     :cdo (and the like)
     :command
-    :cscope (and the like)
     :debug
     :display
     :echo (and the like)
@@ -566,7 +565,6 @@ followed by another Vim command:
     :cdo
     :cfdo
     :command
-    :cscope
     :debug
     :eval
     :folddoopen
@@ -575,7 +573,6 @@ followed by another Vim command:
     :global
     :help
     :helpgrep
-    :lcscope
     :ldo
     :lfdo
     :lhelpgrep
@@ -586,7 +583,6 @@ followed by another Vim command:
     :python
     :registers
     :read !
-    :scscope
     :sign
     :terminal
     :vglobal
diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt
index d00f309826..5e6bc957a1 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -128,7 +128,6 @@ NORMAL COMMANDS
 OPTIONS
 - *cpo-<* *:menu-* *:menu-special* *:map-* *:map-special*
   `<>` notation is always enabled.
-- *'cscopeverbose'*	Enabled by default. Use |:silent| instead.
 - *'exrc'* *'ex'*	Security risk: downloaded files could include
 			a malicious .nvimrc or .exrc file. See 'secure'.
 			Recommended alternative: define an autocommand in your
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index a1bedfa500..21bee24171 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -168,7 +168,6 @@ GUI ~
 |gui.txt|	Graphical User Interface (GUI)
 
 Interfaces ~
-|if_cscop.txt|	using Cscope with Vim
 |if_perl.txt|	Perl interface
 |if_pyth.txt|	Python interface
 |if_ruby.txt|	Ruby interface
diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt
deleted file mode 100644
index 8947aefc1b..0000000000
--- a/runtime/doc/if_cscop.txt
+++ /dev/null
@@ -1,374 +0,0 @@
-*if_cscop.txt*  Nvim
-
-
-		  VIM REFERENCE MANUAL    by Andy Kahn
-
-							*cscope* *Cscope*
-Cscope is a "code intelligence" tool that helps you navigate C programs. It
-can also perform some refactoring tasks, such as renaming a global variable in
-all source files.  Think of it as "ctags on steroids".
-
-See |cscope-usage| for a quickstart.
-
-                                      Type |gO| to see the table of contents.
-
-==============================================================================
-Cscope introduction					*cscope-intro*
-
-
-Cscope is designed to answer questions like:
-       Where is this symbol used?
-       Where is it defined?
-       Where did this variable get its value?
-       What is this global symbol's definition?
-       Where is this function in the source files?
-       What functions call this function?
-       What functions are called by this function?
-       Where does the message "out of space" come from?
-       Where is this source file in the directory structure?
-       What files include this header file?
-
-Cscope answers these questions from a symbol database that it builds the first
-time it is used on the source files.  On a subsequent call, cscope rebuilds
-the database only if a source file has changed or the list of source files is
-different.  When the database is rebuilt the data for the unchanged files is
-copied from the old database, which makes rebuilding much faster than the
-initial build.
-
-See |cscope-usage| to get started.
-
-==============================================================================
-Cscope commands						*cscope-commands*
-
-		*:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E560* *E561*
-All cscope commands are accessed through suboptions to the cscope commands.
-	`:cscope` or `:cs` is the main command
-	`:scscope` or `:scs` does the same and splits the window
-	`:lcscope` or `:lcs` uses the location list, see |:lcscope|
-
-The available subcommands are:
-
-			*E563* *E564* *E566* *E568* *E622* *E623* *E625*
-			*E626* *E609*
-    add   : Add a new cscope database/connection.
-
-	USAGE	:cs add {file|dir} [pre-path] [flags]
-
-	    [pre-path] is the pathname used with the -P command to cscope.
-
-	    [flags] are any additional flags you want to pass to cscope.
-
-	EXAMPLES >
-	    :cscope add /usr/local/cdb/cscope.out
-	    :cscope add /projects/vim/cscope.out /usr/local/vim
-	    :cscope add cscope.out /usr/local/vim -C
-<
-				      *cscope-find* *cs-find* *E567*
-    find  : Query cscope.  All cscope query options are available
-	    except option #5 ("Change this grep pattern").
-
-	USAGE	:cs find {querytype} {name}
-
-	    {querytype} corresponds to the actual cscope line
-	    interface numbers as well as default nvi commands:
-
-		0 or s: Find this C symbol
-		1 or g: Find this definition
-		2 or d: Find functions called by this function
-		3 or c: Find functions calling this function
-		4 or t: Find this text string
-		6 or e: Find this egrep pattern
-		7 or f: Find this file
-		8 or i: Find files #including this file
-		9 or a: Find places where this symbol is assigned a value
-
-	For all types, except 4 and 6, leading white space for {name} is
-	removed.  For 4 and 6 there is exactly one space between {querytype}
-	and {name}.  Further white space is included in {name}.
-
-	EXAMPLES >
-	    :cscope find c vim_free
-	    :cscope find 3  vim_free
-<
-	    These two examples perform the same query: functions calling
-	    "vim_free". >
-
-	    :cscope find t initOnce
-	    :cscope find t  initOnce
-<
-	    The first one searches for the text "initOnce", the second one for
-	    " initOnce". >
-
-	    :cscope find 0 DEFAULT_TERM
-<
-	    Executing this example on the source code for Vim 5.1 produces the
-	    following output:
-
-	    Cscope tag: DEFAULT_TERM
-	       #   line  filename / context / line
-	       1   1009  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"amiga"
-	       2   1013  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"win32"
-	       3   1017  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"pcterm"
-	       4   1021  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"ansi"
-	       5   1025  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"vt52"
-	       6   1029  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"os2ansi"
-	       7   1033  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"ansi"
-	       8   1037  vim-5.1-gtk/src/term.c <>
-			 # undef DEFAULT_TERM
-	       9   1038  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"beos-ansi"
-	      10   1042  vim-5.1-gtk/src/term.c <>
-			 #define DEFAULT_TERM (char_u *)"mac-ansi"
-	      11   1335  vim-5.1-gtk/src/term.c <>
-			 term = DEFAULT_TERM;
-	      12   1459  vim-5.1-gtk/src/term.c <>
-			 if (STRCMP(term, DEFAULT_TERM))
-	      13   1826  vim-5.1-gtk/src/term.c <>
-			 term = DEFAULT_TERM;
-	      14   1833  vim-5.1-gtk/src/term.c <>
-			 term = DEFAULT_TERM;
-	      15   3635  vim-5.1-gtk/src/term.c <>
-			 p = find_builtin_term(DEFAULT_TERM);
-	    Enter nr of choice ( to abort):
-
-	    The output shows several pieces of information:
-	    1. The tag number (there are 15 in this example).
-	    2. The line number where the tag occurs.
-	    3. The filename where the tag occurs.
-	    4. The context of the tag (e.g., global, or the function name).
-	    5. The line from the file itself.
-
-    help  : Show a brief synopsis.
-
-	    USAGE   :cs help
-
-							*E261*
-    kill  : Kill a cscope connection (or kill all cscope connections).
-
-	    USAGE   :cs kill {num|partial_name}
-
-	    To kill a cscope connection, the connection number or a partial
-	    name must be specified.  The partial name is simply any part of
-	    the pathname of the cscope database.  Kill a cscope connection
-	    using the partial name with caution!
-
-	    If the specified connection number is -1, then _ALL_ cscope
-	    connections will be killed.
-
-    reset : Reinit all cscope connections.
-
-	    USAGE   :cs reset
-
-    show  : Show cscope connections.
-
-	    USAGE   :cs show
-
-							*:lcscope* *:lcs*
-This command is same as the ":cscope" command, except when the
-'cscopequickfix' option is set, the location list for the current window is
-used instead of the quickfix list to show the cscope results.
-
-							*:cstag* *E257* *E562*
-If you use cscope as well as ctags, |:cstag| allows you to search one or
-the other before making a jump.  For example, you can choose to first
-search your cscope database(s) for a match, and if one is not found, then
-your tags file(s) will be searched.  The order in which this happens
-is determined by the value of |csto|.  See |cscope-options| for more
-details.
-
-|:cstag| performs the equivalent of ":cs find g" on the identifier when
-searching through the cscope database(s).
-
-|:cstag| performs the equivalent of |:tjump| on the identifier when searching
-through your tags file(s).
-
-
-==============================================================================
-Cscope options						*cscope-options*
-
-Use the |:set| command to set all cscope options.  Ideally, you would do
-this in one of your startup files (e.g., vimrc).  Some cscope related
-variables are only valid within |init.vim|.  Setting them after vim has
-started will have no effect!
-
-							*cscopeprg* *csprg*
-'cscopeprg' specifies the command to execute cscope.  The default is
-"cscope".  For example: >
-	:set csprg=/usr/local/bin/cscope
-<
-					    *cscopequickfix* *csqf* *E469*
-'cscopequickfix' specifies whether to use quickfix window to show cscope
-results.  This is a list of comma-separated values. Each item consists of
-|cscope-find| command (s, g, d, c, t, e, f, i or a) and flag (+, - or 0).
-'+' indicates that results must be appended to quickfix window,
-'-' implies previous results clearance, '0' or command absence - don't use
-quickfix.  Search is performed from start until first command occurrence.
-The default value is "" (don't use quickfix anyway).  The following value
-seems to be useful: >
-	:set cscopequickfix=s-,c-,d-,i-,t-,e-,a-
-<
-							*cscopetag* *cst*
-If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t"
-will always use |:cstag| instead of the default :tag behavior.  Effectively,
-by setting 'cst', you will always search your cscope databases as well as
-your tag files.  The default is off.
-
-							*cscoperelative* *csre*
-If 'cscoperelative' is set, then in absence of a prefix given to cscope
-(prefix is the argument of -P option of cscope), basename of cscope.out
-location (usually the project root directory) will be used as the prefix
-to construct an absolute path.  The default is off.  Note: This option is
-only effective when cscope (cscopeprg) is initialized without a prefix
-path (-P).
-
-							*cscopetagorder* *csto*
-The value of 'csto' determines the order in which |:cstag| performs a search.
-If 'csto' is set to zero, cscope database(s) are searched first, followed
-by tag file(s) if cscope did not return any matches.  If 'csto' is set to
-one, tag file(s) are searched before cscope database(s).  The default is zero.
-
-						      *cscopepathcomp* *cspc*
-'cscopepathcomp' determines how many components of a file's path to display.
-With the default value of zero the entire path will be displayed.
-The value one will display only the filename with no path.  Other values
-display that many components.  For example: >
-	:set cscopepathcomp=3
-will display the last 3 components of the file's path, including the file
-name itself.
-
-==============================================================================
-Using cscope in Nvim			*cscope-usage* *cscope-howtouse*
-
-To get started, build the cscope database in your project root directory: >
-	cscope -bcqR
-
-See the cscope manpage for details: >
-	:Man cscope
-
-By default the cscope database file is named "cscope.out". After building the
-database, connect to it from Nvim: >
-	:cscope add cscope.out
-
-That establishes a cscope connection for Nvim to use.  You can check the
-result with ":cs show".  It will show something like:
-
- # pid	  database name			      prepend path
- 0 28806  cscope.out			      
-
-Once a cscope connection is established, you can make queries to cscope and
-the results will be printed.  Queries are made using the command ":cs find".
-For example: >
-	:cs find g ALIGN_SIZE
-
-To make this easier you can configure mappings, see |cscope-suggestions|.
-
-If the results return only one match, you will automatically be taken to it.
-If there is more than one match, you will be given a selection screen to pick
-the match you want to go to.  After you have jumped to the new location,
-simply hit Ctrl-T to get back to the previous one.
-
-
-==============================================================================
-Limitations						*cscope-limitations*
-
-Hard-coded limitation: doing a |:tjump| when |:cstag| searches the tag files
-is not configurable (e.g., you can't do a tselect instead).
-
-
-==============================================================================
-Sample config						*cscope-suggestions*
-
-Copy this into your init.vim (adjust paths for your system): >
-
-	if has("cscope")
-		set csprg=/usr/local/bin/cscope
-		set csto=0
-		set cst
-		" add any database in current directory
-		if filereadable("cscope.out")
-		    silent cs add cscope.out
-		" else add database pointed to by environment
-		elseif $CSCOPE_DB != ""
-		    silent cs add $CSCOPE_DB
-		endif
-	endif
-
-By setting 'cscopetag', we have effectively replaced all instances of the :tag
-command with :cstag.  This includes :tag, Ctrl-], and "vim -t".  In doing
-this, the regular tag command not only searches your ctags generated tag
-files, but your cscope databases as well.
-
-Some users may want to keep the regular tag behavior and have a different
-shortcut to access :cstag.  For example, one could map Ctrl-_  (underscore)
-to :cstag with the following command: >
-
-	map  :cstag =expand("")
-
-A couple of very commonly used cscope queries (using ":cs find") is to
-find all functions calling a certain function and to find all occurrences
-of a particular C symbol.  To do this, you can use these mappings as an
-example: >
-
-	map g :cs find 3 =expand("")
-	map g :cs find 0 =expand("")
-
-These mappings for Ctrl-] (right bracket) and Ctrl-\ (backslash) allow you to
-place your cursor over the function name or C symbol and quickly query cscope
-for any matches.
-
-Or you may use the following scheme, inspired by Vim/Cscope tutorial from
-Cscope Home Page (http://cscope.sourceforge.net/): >
-
-	nmap s :cs find s =expand("")
-	nmap g :cs find g =expand("")
-	nmap c :cs find c =expand("")
-	nmap t :cs find t =expand("")
-	nmap e :cs find e =expand("")
-	nmap f :cs find f =expand("")
-	nmap i :cs find i ^=expand("")$
-	nmap d :cs find d =expand("")
-	nmap a :cs find a =expand("")
-
-	" Using 'CTRL-spacebar' then a search type makes the vim window
-	" split horizontally, with search result displayed in
-	" the new window.
-
-	nmap s :scs find s =expand("")
-	nmap g :scs find g =expand("")
-	nmap c :scs find c =expand("")
-	nmap t :scs find t =expand("")
-	nmap e :scs find e =expand("")
-	nmap f :scs find f =expand("")
-	nmap i :scs find i ^=expand("")$
-	nmap d :scs find d =expand("")
-	nmap a :scs find a =expand("")
-
-	" Hitting CTRL-space *twice* before the search type does a vertical
-	" split instead of a horizontal one
-
-	nmap s
-		\:vert scs find s =expand("")
-	nmap g
-		\:vert scs find g =expand("")
-	nmap c
-		\:vert scs find c =expand("")
-	nmap t
-		\:vert scs find t =expand("")
-	nmap e
-		\:vert scs find e =expand("")
-	nmap i
-		\:vert scs find i ^=expand("")$
-	nmap d
-		\:vert scs find d =expand("")
-	nmap a
-		\:vert scs find a =expand("")
-<
-
- vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 7318bc7f34..e7c4c37f7d 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1250,8 +1250,6 @@ tag		command		action ~
 |:cpfile|	:cpf[ile]	go to last error in previous file
 |:cquit|	:cq[uit]	quit Vim with an error code
 |:crewind|	:cr[ewind]	go to the specified error, default first one
-|:cscope|	:cs[cope]	execute cscope command
-|:cstag|	:cst[ag]	use cscope to jump to a tag
 |:cunmap|	:cu[nmap]	like ":unmap" but for Command-line mode
 |:cunabbrev|	:cuna[bbrev]	like ":unabbrev" but for Command-line mode
 |:cunmenu|	:cunme[nu]	remove menu for Command-line mode
@@ -1375,7 +1373,6 @@ tag		command		action ~
 |:lcd|		:lc[d]		change directory locally
 |:lchdir|	:lch[dir]	change directory locally
 |:lclose|	:lcl[ose]	close location window
-|:lcscope|	:lcs[cope]	like ":cscope" but uses location list
 |:ldo|		:ld[o]		execute command in valid location list entries
 |:lfdo|		:lfd[o]		execute command in each file in location list
 |:left|		:le[ft]		left align lines
@@ -1556,7 +1553,6 @@ tag		command		action ~
 				buffer list
 |:scriptnames|	:scr[iptnames]	list names of all sourced Vim scripts
 |:scriptencoding| :scripte[ncoding]  encoding used in sourced Vim script
-|:scscope|	:scs[cope]	split window and execute cscope command
 |:set|		:se[t]		show or set options
 |:setfiletype|	:setf[iletype]	set 'filetype', unless it was set already
 |:setglobal|	:setg[lobal]	show global values of options
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index cbc92a8cb5..60cc915a4a 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1336,7 +1336,6 @@ completion can be enabled:
 	-complete=color		color schemes
 	-complete=command	Ex command (and arguments)
 	-complete=compiler	compilers
-	-complete=cscope	|:cscope| suboptions
 	-complete=dir		directory names
 	-complete=environment	environment variable names
 	-complete=event		autocommand events
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 0fdd7aaaf9..41d47f7a90 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -13,6 +13,27 @@ BREAKING CHANGES                                                *news-breaking*
 
 The following changes may require adaptations in user config or plugins.
 
+Cscope is now removed (see |cscope| and |nvim-features-removed|):
+  - Commands removed:
+    - `:cscope`
+    - `:lcscope`
+    - `:scscope`
+    - `:cstag`
+  - Options removed:
+    - `cscopepathcomp`
+    - `cscopeprg`
+    - `cscopequickfix`
+    - `cscoperelative`
+    - `cscopetag`
+    - `cscopetagorder`
+    - `cscopeverbose`
+  - Eval functions removed:
+    - `cscope_connection()`
+
+Note: support for |ctags| remains with no plans to remove.
+
+See https://github.com/neovim/neovim/pull/20545 for more information.
+
 ==============================================================================
 NEW FEATURES                                                    *news-features*
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index e9dda06df9..4f07b78264 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1792,43 +1792,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 		_	When using |cw| on a word, do not include the
 			whitespace following the word in the motion.
 
-						*'cscopepathcomp'* *'cspc'*
-'cscopepathcomp' 'cspc'	number	(default 0)
-			global
-	Determines how many components of the path to show in a list of tags.
-	See |cscopepathcomp|.
-
-						*'cscopeprg'* *'csprg'*
-'cscopeprg' 'csprg'	string	(default "cscope")
-			global
-	Specifies the command to execute cscope.  See |cscopeprg|.
-	This option cannot be set from a |modeline| or in the |sandbox|, for
-	security reasons.
-
-						*'cscopequickfix'* *'csqf'*
-'cscopequickfix' 'csqf' string	(default "")
-			global
-	Specifies whether to use quickfix window to show cscope results.
-	See |cscopequickfix|.
-
-		*'cscoperelative'* *'csre'* *'nocscoperelative'* *'nocsre'*
-'cscoperelative' 'csre' boolean (default off)
-			global
-	In the absence of a prefix (-P) for cscope. setting this option enables
-	to use the basename of cscope.out path as the prefix.
-	See |cscoperelative|.
-
-				*'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'*
-'cscopetag' 'cst'	boolean (default off)
-			global
-	Use cscope for tag commands.  See |cscope-options|.
-
-						*'cscopetagorder'* *'csto'*
-'cscopetagorder' 'csto'	number	(default 0)
-			global
-	Determines the order in which ":cstag" performs a search.  See
-	|cscopetagorder|.
-
 			*'cursorbind'* *'crb'* *'nocursorbind'* *'nocrb'*
 'cursorbind' 'crb'	boolean  (default off)
 			local to window
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 5b100c73a9..f1261b18ff 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -673,12 +673,6 @@ Short explanation of each option:		*option-list*
 'confirm'	  'cf'	    ask what to do about unsaved/read-only files
 'copyindent'	  'ci'	    make 'autoindent' use existing indent structure
 'cpoptions'	  'cpo'     flags for Vi-compatible behavior
-'cscopepathcomp'  'cspc'    how many components of the path to show
-'cscopeprg'       'csprg'   command to execute cscope
-'cscopequickfix'  'csqf'    use quickfix window for cscope results
-'cscoperelative'  'csre'    Use cscope.out path basename as prefix
-'cscopetag'       'cst'     use cscope for tag commands
-'cscopetagorder'  'csto'    determines ":cstag" search order
 'cursorbind'	  'crb'     move cursor in window as it moves in other windows
 'cursorcolumn'	  'cuc'	    highlight the screen column of the cursor
 'cursorline'	  'cul'	    highlight the screen line of the cursor
diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt
index d8c556c281..3b7b0d0ea1 100644
--- a/runtime/doc/usr_29.txt
+++ b/runtime/doc/usr_29.txt
@@ -268,9 +268,6 @@ doesn't work if the tags file isn't sorted.
 The 'taglength' option can be used to tell Vim the number of significant
 characters in a tag.
 
-Cscope is a free program.  It does not only find places where an identifier is
-declared, but also where it is used.  See |cscope|.
-
 ==============================================================================
 *29.2*	The preview window
 
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 6690dad4a7..808e3a6378 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1051,7 +1051,6 @@ Various:					*various-functions*
 	exists()		check if a variable, function, etc. exists
 	has()			check if a feature is supported in Vim
 	changenr()		return number of most recent change
-	cscope_connection()	check if a cscope connection exists
 	did_filetype()		check if a FileType autocommand was used
 	eventhandler()		check if invoked by an event handler
 	getpid()		get process ID of Vim
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 62b755d64b..76a45166a1 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -36,7 +36,6 @@ centralized reference of the differences.
 - 'belloff' defaults to "all"
 - 'compatible' is always disabled
 - 'complete' excludes "i"
-- 'cscopeverbose' is enabled
 - 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
 - 'display' defaults to "lastline"
 - 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding)
@@ -541,6 +540,10 @@ Commands:
   :sleep! (does not hide the cursor; same as :sleep)
   :smile
   :tearoff
+  :cstag
+  :cscope
+  :lcscope
+  :scscope
 
 Compile-time features:
   Emacs tags support
@@ -548,6 +551,7 @@ Compile-time features:
 
 Eval:
   Vim9script
+  *cscope_connection()*
   *js_encode()*
   *js_decode()*
   *v:none* (used by Vim to represent JavaScript "undefined"); use |v:null| instead.
@@ -579,6 +583,13 @@ Options:
   *'cp'* *'nocompatible'* *'nocp'* *'compatible'* (Nvim is always "nocompatible".)
   'cpoptions' (gjkHw<*- and all POSIX flags were removed)
   *'cryptmethod'* *'cm'* *'key'* (Vim encryption implementation)
+  cscopepathcomp
+  cscopeprg
+  cscopequickfix
+  cscoperelative
+  cscopetag
+  cscopetagorder
+  cscopeverbose
   *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
   'encoding' ("utf-8" is always used)
   esckeys
@@ -694,5 +705,9 @@ TUI:
   at how the terminal is sending CSI.  Nvim does not issue such a sequence and
   always uses 7-bit control sequences.
 
+Cscope:
+                                                                      *cscope*
+  Cscope has been removed in favour of LSP based solutions.
+
 ==============================================================================
  vim:tw=78:ts=8:sw=2:et:ft=help:norl:
-- 
cgit 


From e5cb3104d07228de4f2614c425355e8f2f99507d Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Fri, 14 Oct 2022 11:01:13 -0400
Subject: docs: fix/remove invalid URLs #20647

---
 runtime/doc/dev_style.txt |   2 +-
 runtime/doc/diff.txt      |   2 +-
 runtime/doc/ft_ada.txt    |  10 ++---
 runtime/doc/ft_sql.txt    |   8 ++--
 runtime/doc/helphelp.txt  |   2 +-
 runtime/doc/if_ruby.txt   |   2 +-
 runtime/doc/indent.txt    |   2 +-
 runtime/doc/insert.txt    |  17 ++------
 runtime/doc/lsp.txt       |  29 ++++++-------
 runtime/doc/luaref.txt    |   6 +--
 runtime/doc/luvref.txt    |   4 +-
 runtime/doc/mbyte.txt     |  40 +-----------------
 runtime/doc/message.txt   |   4 +-
 runtime/doc/mlang.txt     |  23 ++--------
 runtime/doc/options.txt   |   4 +-
 runtime/doc/print.txt     | 105 ++--------------------------------------------
 runtime/doc/provider.txt  |   2 +-
 runtime/doc/quickfix.txt  |   6 +--
 runtime/doc/russian.txt   |   2 +-
 runtime/doc/spell.txt     |   8 ++--
 runtime/doc/syntax.txt    |  27 ++++++------
 runtime/doc/tagsrch.txt   |  13 ++----
 runtime/doc/term.txt      |   2 +-
 runtime/doc/tips.txt      |   2 +-
 runtime/doc/uganda.txt    |   8 ++--
 runtime/doc/ui.txt        |   8 +++-
 runtime/doc/usr_01.txt    |   2 +-
 runtime/doc/usr_05.txt    |   2 +-
 runtime/doc/usr_29.txt    |   5 +--
 runtime/doc/usr_41.txt    |   2 +-
 runtime/doc/usr_45.txt    |  14 ++-----
 runtime/doc/vim_diff.txt  |   2 +-
 32 files changed, 94 insertions(+), 271 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/dev_style.txt b/runtime/doc/dev_style.txt
index 77253e7831..6d832219f6 100644
--- a/runtime/doc/dev_style.txt
+++ b/runtime/doc/dev_style.txt
@@ -8,7 +8,7 @@ Nvim style guide                                        *dev-style*
 
 This is style guide for developers working on Nvim's source code.
 
-License: CC-By 3.0 http://creativecommons.org/licenses/by/3.0/
+License: CC-By 3.0 https://creativecommons.org/licenses/by/3.0/
 
                                       Type |gO| to see the table of contents.
 
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 9c5792dd43..b5a3891d3f 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -401,7 +401,7 @@ to see more messages.
 
 The self-installing Vim for MS-Windows includes a diff program.  If you don't
 have it you might want to download a diff.exe.  For example from
-http://gnuwin32.sourceforge.net/packages/diffutils.htm.
+https://gnuwin32.sourceforge.net/packages/diffutils.htm.
 
 
 USING PATCHES					*diff-patchexpr*
diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt
index e4ac37a86e..3321228009 100644
--- a/runtime/doc/ft_ada.txt
+++ b/runtime/doc/ft_ada.txt
@@ -486,25 +486,25 @@ You can optionally install the following extra plug-ins. They work well with
 Ada and enhance the ability of the Ada mode:
 
 backup.vim
-	http://www.vim.org/scripts/script.php?script_id=1537
+	https://www.vim.org/scripts/script.php?script_id=1537
 	Keeps as many backups as you like so you don't have to.
 
 rainbow_parenthesis.vim
-	http://www.vim.org/scripts/script.php?script_id=1561
+	https://www.vim.org/scripts/script.php?script_id=1561
 	Very helpful since Ada uses only '(' and ')'.
 
 nerd_comments.vim
-	http://www.vim.org/scripts/script.php?script_id=1218
+	https://www.vim.org/scripts/script.php?script_id=1218
 	Excellent commenting and uncommenting support for almost any
 	programming language.
 
 matchit.vim
-	http://www.vim.org/scripts/script.php?script_id=39
+	https://www.vim.org/scripts/script.php?script_id=39
 	'%' jumping for any language. The normal '%' jump only works for '{}'
 	style languages. The Ada mode will set the needed search patterns.
 
 taglist.vim
-	http://www.vim.org/scripts/script.php?script_id=273
+	https://www.vim.org/scripts/script.php?script_id=273
 	Source code explorer sidebar. There is a patch for Ada available.
 
 The GNU Ada Project distribution (http://gnuada.sourceforge.net) of Vim
diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt
index 03d9082aab..ccb1499371 100644
--- a/runtime/doc/ft_sql.txt
+++ b/runtime/doc/ft_sql.txt
@@ -39,7 +39,7 @@ navigation.
 
 1.1 Matchit					*sql-matchit*
 -----------
-The matchit plugin (http://www.vim.org/scripts/script.php?script_id=39)
+The matchit plugin (https://www.vim.org/scripts/script.php?script_id=39)
 provides many additional features and can be customized for different
 languages.  The matchit plugin is configured by defining a local
 buffer variable, b:match_words.  Pressing the % key while on various
@@ -296,7 +296,7 @@ exist.
 3. Adding new SQL Dialects			*sql-adding-dialects*
 
 If you begin working with a SQL dialect which does not have any customizations
-available with the default Vim distribution you can check http://www.vim.org
+available with the default Vim distribution you can check https://www.vim.org
 to see if any customization currently exist.  If not, you can begin by cloning
 an existing script.  Read |filetype-plugins| for more details.
 
@@ -403,7 +403,7 @@ Here are some examples of the entries which are pulled from the syntax files: >
 ----------------
 Dynamic mode populates the popups with data directly from a database.  In
 order for the dynamic feature to be enabled you must have the dbext.vim
-plugin installed, (http://vim.sourceforge.net/script.php?script_id=356).
+plugin installed, (https://vim.sourceforge.net/script.php?script_id=356).
 
 Dynamic mode is used by several features of the SQL completion plugin.
 After installing the dbext plugin see the dbext-tutorial for additional
@@ -487,7 +487,7 @@ depending on the syntax file you are using.  The SQL Anywhere syntax file
 Dynamic features
 ----------------
 To take advantage of the dynamic features you must first install the
-dbext.vim plugin (http://vim.sourceforge.net/script.php?script_id=356).  It
+dbext.vim plugin (https://vim.sourceforge.net/script.php?script_id=356).  It
 also comes with a tutorial.  From the SQL completion plugin's perspective,
 the main feature dbext provides is a connection to a database.  dbext
 connection profiles are the most efficient mechanism to define connection
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 4758cd37c6..4773059586 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -251,7 +251,7 @@ At this moment translations are available for:
 	Japanese - multiple authors
 	Polish   - translated by Mikolaj Machowski
 	Russian  - translated by Vassily Ragosin
-See the Vim website to find them: http://www.vim.org/translations.php
+See the Vim website to find them: https://www.vim.org/translations.php
 
 A set of translated help files consists of these files:
 
diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt
index 47305c65fb..d88f59eb73 100644
--- a/runtime/doc/if_ruby.txt
+++ b/runtime/doc/if_ruby.txt
@@ -7,7 +7,7 @@ The Ruby Interface to Vim				*if_ruby* *ruby* *Ruby*
 
 			*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
 
-The home page for ruby is http://www.ruby-lang.org/.  You can find links for
+The home page for ruby is https://www.ruby-lang.org/.  You can find links for
 downloading Ruby there.
 
                                       Type |gO| to see the table of contents.
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index c5411b5f16..5473c7566c 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -724,7 +724,7 @@ Fortran with (possibly multiple) loops ending on a labelled executable
 statement of almost arbitrary type.  Correct indentation requires
 compiler-quality parsing.  Old code with do loops ending on labelled statements
 of arbitrary type can be indented with elaborate programs such as Tidy
-(http://www.unb.ca/chem/ajit/f_tidy.htm).  Structured do/continue loops are
+(https://www.unb.ca/chem/ajit/f_tidy.htm).  Structured do/continue loops are
 also left unindented because continue statements are also used for purposes
 other than ending a do loop.  Programs such as Tidy can convert structured
 do/continue loops to the do/enddo form.  Do loops of the do/enddo variety can
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 792c6ee6f4..0133824e76 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1350,16 +1350,8 @@ Completion of C code requires a tags file.  You should use Universal/
 Exuberant ctags, because it adds extra information that is needed for
 completion.  You can find it here:
 	Universal Ctags: https://ctags.io
-	Exuberant Ctags: http://ctags.sourceforge.net
 
-Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
-
-For Exuberant ctags, version 5.6 or later is recommended.  For version 5.5.4
-you should add a patch that adds the "typename:" field:
-	ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
-A compiled .exe for MS-Windows can be found at:
-	http://ctags.sourceforge.net/
-	https://github.com/universal-ctags/ctags-win32
+Universal Ctags is preferred, Exuberant Ctags is no longer maintained.
 
 If you want to complete system functions you can do something like this.  Use
 ctags to generate a tags file for all the system header files: >
@@ -1459,7 +1451,7 @@ DOM compatibility
 At the moment (beginning of 2006) there are two main browsers - MS Internet
 Explorer and Mozilla Firefox. These two applications are covering over 90% of
 market. Theoretically standards are created by W3C organisation
-(http://www.w3c.org) but they are not always followed/implemented.
+(https://www.w3.org/) but they are not always followed/implemented.
 
 		IE	FF	W3C  Omni completion ~
 		+/-	+/-	+    +		     ~
@@ -1480,7 +1472,6 @@ external files and for class aware completion. You should use Universal/
 Exuberant ctags version 5.5.4 or newer. You can find it here:
 
 	Universal Ctags: https://ctags.io
-	Exuberant Ctags: http://ctags.sourceforge.net
 
 Script completes:
 
@@ -1779,12 +1770,12 @@ DTD -> Vim							*dtd2vim*
 On |www| is the script |dtd2vim| which parses DTD and creates an XML data file
 for Vim XML omni completion.
 
-    dtd2vim: http://www.vim.org/scripts/script.php?script_id=1462
+    dtd2vim: https://www.vim.org/scripts/script.php?script_id=1462
 
 Check the beginning of that file for usage details.
 The script requires perl and:
 
-    perlSGML: http://savannah.nongnu.org/projects/perlsgml
+    perlSGML: https://savannah.nongnu.org/projects/perlsgml
 
 
 Commands
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 139f4c6bc5..036b0bbc6f 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -792,22 +792,19 @@ start({config}, {opts})                                      *vim.lsp.start()*
     See |vim.lsp.start_client()| for all available options. The most important
     are:
 
-    `name` is an arbitrary name for the LSP client. It should be unique per
-    language server.
-
-    `cmd` the command as list - used to start the language server. The command must
-    be present in the `$PATH` environment variable or an absolute path to the executable. Shell
-    constructs like `~` are NOT expanded.
-
-    `root_dir` path to the project root. By default this is used to decide if
-    an existing client should be re-used. The example above uses
-    |vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
-    the file system upwards starting from the current directory until either a
-    `pyproject.toml` or `setup.py` file is found.
-
-    `workspace_folders` a list of { uri:string, name: string } tables. The
-    project root folders used by the language server. If `nil` the property is
-    derived from the `root_dir` for convenience.
+    • `name` arbitrary name for the LSP client. Should be unique per language
+      server.
+    • `cmd` command (in list form) used to start the language server. Must be
+      absolute, or found on `$PATH`. Shell constructs like `~` are not
+      expanded.
+    • `root_dir` path to the project root. By default this is used to decide
+      if an existing client should be re-used. The example above uses
+      |vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
+      the file system upwards starting from the current directory until either
+      a `pyproject.toml` or `setup.py` file is found.
+    • `workspace_folders` list of `{ uri:string, name: string }` tables
+      specifying the project root folders used by the language server. If
+      `nil` the property is derived from `root_dir` for convenience.
 
     Language servers use this information to discover metadata like the
     dependencies of your project and they tend to index the contents within
diff --git a/runtime/doc/luaref.txt b/runtime/doc/luaref.txt
index ffbb405804..259f2ba681 100644
--- a/runtime/doc/luaref.txt
+++ b/runtime/doc/luaref.txt
@@ -4831,7 +4831,7 @@ A  BIBLIOGRAPHY                                            *luaref-bibliography*
 This help file is a minor adaptation from this main reference:
 
  - R. Ierusalimschy, L. H. de Figueiredo, and W. Celes.,
-   "Lua: 5.1 reference manual", http://www.lua.org/manual/5.1/manual.html
+   "Lua: 5.1 reference manual", https://www.lua.org/manual/5.1/manual.html
 
 Lua is discussed in these references:
 
@@ -4887,10 +4887,10 @@ a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual
 
 The main ideas and concepts on how to implement this reference were taken from
 Christian Habermann's CRefVim project
-(http://www.vim.org/scripts/script.php?script_id=614).
+(https://www.vim.org/scripts/script.php?script_id=614).
 
 Adapted for bundled Nvim documentation; the original plugin can be found at
-http://www.vim.org/scripts/script.php?script_id=1291
+https://www.vim.org/scripts/script.php?script_id=1291
 
 ------------------------------------------------------------------------------
  vi:tw=78:ts=4:ft=help:norl:et
diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt
index 6b77ee89a8..3ed3ef03c4 100644
--- a/runtime/doc/luvref.txt
+++ b/runtime/doc/luvref.txt
@@ -97,7 +97,7 @@ used here to facilitate documenting consistent behavior:
 CONTENTS                                                          *luv-contents*
 
 This documentation is mostly a retelling of the libuv API documentation
-(http://docs.libuv.org/en/v1.x/api.html) within the context of luv's Lua API.
+(https://docs.libuv.org/en/v1.x/api.html) within the context of luv's Lua API.
 Low-level implementation details and unexposed C functions and types are not
 documented here except for when they are relevant to behavior seen in the Lua
 module.
@@ -933,7 +933,7 @@ uv.async_send({async}, {...})                                  *uv.async_send()*
 
 Poll handles are used to watch file descriptors for readability and
 writability, similar to the purpose of poll(2)
-(http://linux.die.net/man/2/poll).
+(https://linux.die.net/man/2/poll).
 
 The purpose of poll handles is to enable integrating external libraries that
 rely on the event loop to signal it about the socket status changes, like
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index dd2c99669c..72adbe6023 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -341,34 +341,7 @@ Useful utilities for converting the charset:
     All:	    iconv
 	GNU iconv can convert most encodings.  Unicode is used as the
 	intermediate encoding, which allows conversion from and to all other
-	encodings.  See http://www.gnu.org/directory/libiconv.html.
-
-    Japanese:	    nkf
-	Nkf is "Network Kanji code conversion Filter".  One of the most unique
-	facility of nkf is the guess of the input Kanji code.  So, you don't
-	need to know what the inputting file's |charset| is.  When convert to
-	EUC-JP from ISO-2022-JP or Shift_JIS, simply do the following command
-	in Vim:
-	    :%!nkf -e
-	Nkf can be found at:
-	http://www.sfc.wide.ad.jp/~max/FreeBSD/ports/distfiles/nkf-1.62.tar.gz
-
-    Chinese:	    hc
-	Hc is "Hanzi Converter".  Hc convert a GB file to a Big5 file, or Big5
-	file to GB file.  Hc can be found at:
-	ftp://ftp.cuhk.hk/pub/chinese/ifcss/software/unix/convert/hc-30.tar.gz
-
-    Korean:	    hmconv
-	Hmconv is Korean code conversion utility especially for E-mail.  It can
-	convert between EUC-KR and ISO-2022-KR.  Hmconv can be found at:
-	ftp://ftp.kaist.ac.kr/pub/hangul/code/hmconv/
-
-    Multilingual:   lv
-	Lv is a Powerful Multilingual File Viewer.  And it can be worked as
-	|charset| converter.  Supported |charset|: ISO-2022-CN, ISO-2022-JP,
-	ISO-2022-KR, EUC-CN, EUC-JP, EUC-KR, EUC-TW, UTF-7, UTF-8, ISO-8859
-	series, Shift_JIS, Big5 and HZ.  Lv can be found at:
-	http://www.ff.iij4u.or.jp/~nrt/lv/index.html
+	encodings.  See https://directory.fsf.org/wiki/Libiconv.
 
 
 							*mbyte-conversion*
@@ -404,17 +377,6 @@ is suitable for complex input, such as CJK.
   large overhead in communication, but it provides safe synchronization with
   no restrictions on applications.
 
-  For example, there are xwnmo and kinput2 Japanese |IM-server|, both are
-  FrontEnd system.  Xwnmo is distributed with Wnn (see below), kinput2 can be
-  found at: ftp://ftp.sra.co.jp/pub/x11/kinput2/
-
-  For Chinese, there's a great XIM server named "xcin", you can input both
-  Traditional and Simplified Chinese characters.  And it can accept other
-  locale if you make a correct input table.  Xcin can be found at:
-  http://cle.linux.org.tw/xcin/
-  Others are scim: http://scim.freedesktop.org/ and fcitx:
-  http://www.fcitx.org/
-
 - Conversion Server
 							*conversion-server*
   Some system needs additional server: conversion server.  Most of Japanese
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index dac4df5ee9..74ceb08994 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -573,9 +573,7 @@ when using ":w"), therefore Vim requires using a !  after the command, e.g.:
   VirtualBinding
 
 Messages like this appear when starting up.  This is not a Vim problem, your
-X11 configuration is wrong.  You can find a hint on how to solve this here:
-http://groups.yahoo.com/group/solarisonintel/message/12179.
-[this URL is no longer valid]
+X11 configuration is wrong.
 
 							*W10*  >
   Warning: Changing a readonly file
diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt
index 9d3a51302d..84b8498d39 100644
--- a/runtime/doc/mlang.txt
+++ b/runtime/doc/mlang.txt
@@ -92,27 +92,10 @@ use of "-" and "_".
 				:lang mes en
 <
 
-MS-WINDOWS MESSAGE TRANSLATIONS				*win32-gettext*
-
-If you used the self-installing .exe file, message translations should work
-already.  Otherwise get the libintl.dll file if you don't have it yet:
-
-	http://sourceforge.net/projects/gettext
-Or:
-	https://mlocati.github.io/gettext-iconv-windows/
-
-This also contains tools xgettext, msgformat and others.
-
-libintl.dll should be placed in same directory as (g)vim.exe, or one of the
-directories listed in the PATH environment value.  Vim also looks for the
-alternate names "libintl-8.dll" and "intl.dll".
-
 Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",
-where "xx" is the abbreviation of the language (mostly two letters).
-
-If you write your own translations you need to generate the .po file and
-convert it to a .mo file.  You need to get the source distribution and read
-the file "src/po/README.txt".
+where "xx" is the abbreviation of the language (mostly two letters). If you
+write your own translations you need to generate the .po file and convert it
+to a .mo file.
 
 To overrule the automatic choice of the language, set the $LANG variable to
 the language of your choice.  use "en" to disable translations. >
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 4f07b78264..a846f49781 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -621,7 +621,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	by Vim with the width of glyphs in the font.  Perhaps it also has
 	to be set to "double" under CJK MS-Windows when the system locale is
 	set to one of CJK locales.  See Unicode Standard Annex #11
-	(http://www.unicode.org/reports/tr11).
+	(https://www.unicode.org/reports/tr11).
 
 			*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
 'autochdir' 'acd'	boolean (default off)
@@ -4536,7 +4536,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 <	- A directory name may end in a ':' or '/'.
 	- Environment variables are expanded |:set_env|.
 	- When using |netrw.vim| URLs can be used.  For example, adding
-	  "http://www.vim.org" will make ":find index.html" work.
+	  "https://www.vim.org" will make ":find index.html" work.
 	- Search upwards and downwards in a directory tree using "*", "**" and
 	  ";".  See |file-searching| for info and syntax.
 	- Careful with '\' characters, type two to get one in the option: >
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index 0e02c7d42d..e24b6b0347 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -413,7 +413,7 @@ you need to define your own PostScript font encoding vector.  Details on how
 to define a font encoding vector is beyond the scope of this help file, but
 you can find details in the PostScript Language Reference Manual, 3rd Edition,
 published by Addison-Wesley and available in PDF form at
-http://www.adobe.com/.  The following describes what you need to do for Vim to
+https://www.adobe.com/.  The following describes what you need to do for Vim to
 locate and use your print character encoding.
 
 i.   Decide on a unique name for your encoding vector, one that does not clash
@@ -462,15 +462,6 @@ option allows you to specify different fonts to use when printing characters
 which are syntax highlighted with the font styles normal, italic, bold and
 bold-italic.
 
-No CJK fonts are supplied with Vim.  There are some free Korean, Japanese, and
-Traditional Chinese fonts available at:
-
-  http://examples.oreilly.com/cjkvinfo/adobe/samples/
-
-You can find descriptions of the various fonts in the read me file at
-
-  http://examples.oreilly.de/english_examples/cjkvinfo/adobe/00README
-
 Please read your printer documentation on how to install new fonts.
 
 CJK fonts can be large containing several thousand glyphs, and it is not
@@ -491,7 +482,7 @@ It is possible to define your own multibyte character set although this
 should not be attempted lightly.  A discussion on the process if beyond the
 scope of these help files.  You can find details on CMap (character map) files
 in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0',
-available from http://www.adobe.com as a PDF file.
+available from https://www.adobe.com as a PDF file.
 
 ==============================================================================
 6. PostScript Printing Troubleshooting		*postscript-print-trouble*
@@ -548,23 +539,8 @@ Ghostscript is a PostScript and PDF interpreter that can be used to display
 and print on non-PostScript printers PostScript and PDF files.  It can also
 generate PDF files from PostScript.
 
-Ghostscript will run on a wide variety of platforms.
-
-There are three available versions:
-
-- AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
-  non-commercial use.  It can be obtained from:
-
-    http://www.cs.wisc.edu/~ghost/
-
-- GNU Ghostscript which is available under the GNU General Public License.  It
-  can be obtained from:
-
-    ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
-
-- A commercial version for inclusion in commercial products.
-
-Additional information on Ghostscript can also be found at:
+Ghostscript will run on a wide variety of platforms. Information on
+Ghostscript can be found at:
 
   http://www.ghostscript.com/
 
@@ -580,79 +556,6 @@ ends have been created.  These allow easier PostScript file selection,
 previewing at different zoom levels, and printing.  Check supplied
 documentation for full details.
 
-X11
-
-- Ghostview.  Obtainable from:
-
-    http://www.cs.wisc.edu/~ghost/gv/
-
-- gv.  Derived from Ghostview.  Obtainable from:
-
-    http://wwwthep.physik.uni-mainz.de/~plass/gv/
-
-  Copies (possibly not the most recent) can be found at:
-
-    http://www.cs.wisc.edu/~ghost/gv/
-
-MS-Windows
-
-- GSview.  Obtainable from:
-
-    http://www.cs.wisc.edu/~ghost/gsview/
-
-Linux
-
-- GSview.  Linux version of the popular MS-Windows previewer.
-  Obtainable from:
-
-    http://www.cs.wisc.edu/~ghost/gsview/
-
-- BMV.  Different from Ghostview and gv in that it doesn't use X but svgalib.
-  Obtainable from:
-
-    ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
-
-
-7.3 PSUtils
-
-PSUtils is a collection of utility programs for manipulating PostScript
-documents.  Binary distributions are available for many platforms, as well as
-the full source.  PSUtils can be found at:
-
-  http://knackered.org/angus/psutils
-
-The utilities of interest include:
-
-- psnup.     Convert PS files for N-up printing.
-- psselect.  Select page range and order of printing.
-- psresize.  Change the page size.
-- psbook.    Reorder and lay out pages ready for making a book.
-
-The output of one program can be used as the input to the next, allowing for
-complex print document creation.
-
-
-N-UP PRINTING
-
-The psnup utility takes an existing PostScript file generated from Vim and
-convert it to an n-up version.  The simplest way to create a 2-up printout is
-to first create a PostScript file with: >
-
-	:hardcopy > test.ps
-
-Then on your command line execute: >
-
-	psnup -n 2 test.ps final.ps
-
-Note: You may get warnings from some Ghostscript previewers for files produced
-by psnup - these may safely be ignored.
-
-Finally print the file final.ps to your PostScript printer with your
-platform's print command.  (You will need to delete the two PostScript files
-afterwards yourself.)  'printexpr' could be modified to perform this extra
-step before printing.
-
-
 ALTERNATE DUPLEX PRINTING
 
 It is possible to achieve a poor man's version of duplex printing using the PS
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 99ec84c625..a7b5b1d492 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -191,7 +191,7 @@ registers. Nvim looks for these clipboard tools, in order of priority:
   - xclip (if $DISPLAY is set)
   - xsel (if $DISPLAY is set)
   - lemonade (for SSH) https://github.com/pocke/lemonade
-  - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
+  - doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/
   - win32yank (Windows)
   - termux (via termux-clipboard-set, termux-clipboard-set)
   - tmux (if $TMUX is set)
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 924a6d4743..904d3581bb 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1287,7 +1287,7 @@ PYUNIT COMPILER						*compiler-pyunit*
 This is not actually a compiler, but a unit testing framework for the
 Python language.  It is included into standard Python distribution
 starting from version 2.0.  For older versions, you can get it from
-http://pyunit.sourceforge.net.
+https://pyunit.sourceforge.net.
 
 When you run your tests with the help of the framework, possible errors
 are parsed by Vim and presented for you in quick-fix mode.
@@ -1298,8 +1298,6 @@ Useful values for the 'makeprg' options therefore are:
  setlocal makeprg=./alltests.py " Run a testsuite
  setlocal makeprg=python\ %:S   " Run a single testcase
 
-Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
-
 
 TEX COMPILER						*compiler-tex*
 
@@ -1823,7 +1821,7 @@ In English, that sed script:
   it as a "continuation of a multi-line message."
 
 						*errorformat-ant*
-For ant (http://jakarta.apache.org/) the above errorformat has to be modified
+For ant (https://jakarta.apache.org/) the above errorformat has to be modified
 to honour the leading [javac] in front of each javac output line: >
   :set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
 
diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt
index a2bc9f3b5e..8d3ed360c8 100644
--- a/runtime/doc/russian.txt
+++ b/runtime/doc/russian.txt
@@ -45,7 +45,7 @@ If you wish to use messages, help files, menus and other items translated to
 Russian, you will need to install the RuVim Language Pack, available in
 different codepages from
 
-    http://www.sourceforge.net/projects/ruvim/
+    https://www.sourceforge.net/projects/ruvim/
 
 After downloading an archive from RuVim project, unpack it into your
 $VIMRUNTIME directory.  We recommend using UTF-8 archive.
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 15aa0117ec..74ec035316 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -482,7 +482,7 @@ You can create a Vim spell file from the .aff and .dic files that Myspell
 uses.  Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
 files are zip files which contain the .aff and .dic files. You should be able
 to find them here:
-	http://extensions.services.openoffice.org/dictionary
+	https://extensions.services.openoffice.org/dictionary
 The older, OpenOffice 2 files may be used if this doesn't work:
 	http://wiki.services.openoffice.org/wiki/Dictionaries
 You can also use a plain word list.  The results are the same, the choice
@@ -764,13 +764,13 @@ them before the Vim word list is made.  The tools for this can be found in the
 The format for the affix and word list files is based on what Myspell uses
 (the spell checker of Mozilla and OpenOffice.org).  A description can be found
 here:
-	http://lingucomponent.openoffice.org/affix.readme ~
+	https://lingucomponent.openoffice.org/affix.readme ~
 Note that affixes are case sensitive, this isn't obvious from the description.
 
 Vim supports quite a few extras.  They are described below |spell-affix-vim|.
 Attempts have been made to keep this compatible with other spell checkers, so
 that the same files can often be used.  One other project that offers more
-than Myspell is Hunspell ( http://hunspell.sf.net ).
+than Myspell is Hunspell ( https://hunspell.github.io ).
 
 
 WORD LIST FORMAT				*spell-dic-format*
@@ -886,7 +886,7 @@ right encoding.
 				*spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT*
 	NAME		Name of the language
 	VERSION		1.0.1  with fixes
-	HOME		http://www.myhome.eu
+	HOME		https://www.example.com
 	AUTHOR		John Doe
 	EMAIL		john AT Doe DOT net
 	COPYRIGHT	LGPL
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 74778addc7..95c838d541 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -687,13 +687,13 @@ Automatic detection works for the encodings mentioned specifically by name in
 |encoding-names|, but TOhtml will only automatically use those encodings with
 wide browser support. However, you can override this to support specific
 encodings that may not be automatically detected by default (see options
-below). See http://www.iana.org/assignments/character-sets for the IANA names.
+below). See https://www.iana.org/assignments/character-sets for the IANA names.
 
 Note: By default all Unicode encodings are converted to UTF-8 with no BOM in
 the generated HTML, as recommended by W3C:
 
-	http://www.w3.org/International/questions/qa-choosing-encodings
-	http://www.w3.org/International/questions/qa-byte-order-mark
+	https://www.w3.org/International/questions/qa-choosing-encodings
+	https://www.w3.org/International/questions/qa-byte-order-mark
 
 							 *g:html_use_encoding*
 Default: none, uses IANA name for current 'fileencoding' as above.
@@ -832,7 +832,7 @@ files are included:
 	asm68k		Motorola 680x0 assembly
 	asmh8300	Hitachi H-8300 version of GNU assembly
 	ia64		Intel Itanium 64
-	fasm		Flat assembly (http://flatassembler.net)
+	fasm		Flat assembly (https://flatassembler.net)
 	masm		Microsoft assembly (probably works for any 80x86)
 	nasm		Netwide assembly
 	tasm		Turbo Assembly (with opcodes 80x86 up to Pentium, and
@@ -1393,9 +1393,9 @@ Two syntax highlighting files exist for Euphoria. One for Euphoria
 version 3.1.1, which is the default syntax highlighting file, and one for
 Euphoria version 4.0.5 or later.
 
-Euphoria version 3.1.1 (http://www.rapideuphoria.com/) is still necessary
+Euphoria version 3.1.1 (https://www.rapideuphoria.com/) is still necessary
 for developing applications for the DOS platform, which Euphoria version 4
-(http://www.openeuphoria.org/) does not support.
+(https://www.openeuphoria.org/) does not support.
 
 The following file extensions are auto-detected as Euphoria file type:
 
@@ -1452,7 +1452,7 @@ Elixir.
 
 FLEXWIKI				*flexwiki.vim* *ft-flexwiki-syntax*
 
-FlexWiki is an ASP.NET-based wiki package available at http://www.flexwiki.com
+FlexWiki is an ASP.NET-based wiki package available at https://www.flexwiki.com
 NOTE: This site currently doesn't work, on Wikipedia is mentioned that
 development stopped in 2009.
 
@@ -1808,7 +1808,7 @@ are read during initialization) >
 	:let html_my_rendering=1
 
 If you'd like to see an example download mysyntax.vim at
-http://www.fleiner.com/vim/download.html
+https://www.fleiner.com/vim/download.html
 
 You can also disable this rendering by adding the following line to your
 vimrc file: >
@@ -1936,7 +1936,7 @@ highlight them use: >
 	:let java_highlight_java_lang_ids=1
 
 You can also highlight identifiers of most standard Java packages if you
-download the javaid.vim script at http://www.fleiner.com/vim/download.html.
+download the javaid.vim script at https://www.fleiner.com/vim/download.html.
 If you prefer to only highlight identifiers of a certain package, say java.io
 use the following: >
 	:let java_highlight_java_io=1
@@ -3353,13 +3353,11 @@ of specialized LaTeX commands, syntax, and fonts.  If you're using such a
 package you'll often wish that the distributed syntax/tex.vim would support
 it.  However, clearly this is impractical.  So please consider using the
 techniques in |mysyntaxfile-add| to extend or modify the highlighting provided
-by syntax/tex.vim.  Please consider uploading any extensions that you write,
-which typically would go in $HOME/after/syntax/tex/[pkgname].vim, to
-http://vim.sf.net/.
+by syntax/tex.vim.
 
 I've included some support for various popular packages on my website: >
 
-	http://www.drchip.org/astronaut/vim/index.html#LATEXPKGS
+	https://www.drchip.org/astronaut/vim/index.html#LATEXPKGS
 <
 The syntax files there go into your .../after/syntax/tex/ directory.
 
@@ -5397,8 +5395,7 @@ WARNING: The longer the tags file, the slower this will be, and the more
 memory Vim will consume.
 
 Only highlighting typedefs, unions and structs can be done too.  For this you
-must use Universal Ctags (found at https://ctags.io) or Exuberant ctags (found
-at http://ctags.sf.net).
+must use Universal Ctags (https://ctags.io) or Exuberant ctags.
 
 Put these lines in your Makefile:
 
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index 82deb0fa0c..143930c48a 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -514,18 +514,13 @@ ctags			As found on most Unix systems.  Only supports C.  Only
 universal ctags		A maintained version of ctags based on exuberant
 			ctags. See https://ctags.io.
 							*Exuberant_ctags*
-exuberant ctags		This is a very good one.  It works for C, C++, Java,
-			Fortran, Eiffel and others.  It can generate tags for
-			many items.  See http://ctags.sourceforge.net.
-			No new version since 2009.
+exuberant ctags		Works for C, C++, Java, Fortran, Eiffel and others.
+			See https://ctags.sourceforge.net. No new version
+			since 2009.
 JTags			For Java, in Java.  It can be found at
-			http://www.fleiner.com/jtags/.
+			https://www.fleiner.com/jtags/.
 ptags.py		For Python, in Python.  Found in your Python source
 			directory at Tools/scripts/ptags.py.
-ptags			For Perl, in Perl.  It can be found at
-			http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
-gnatxref		For Ada.  See http://www.gnuada.org/.  gnatxref is
-			part of the gnat package.
 
 
 The lines in the tags file must have one of these two formats:
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index cd6798a5de..46e0371daa 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -29,7 +29,7 @@ whole.
 Building your own terminfo is usually as simple as running this as
 a non-superuser:
 >
-  curl -LO http://invisible-island.net/datafiles/current/terminfo.src.gz
+  curl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz
   gunzip terminfo.src.gz
   tic terminfo.src
 <
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index d913b53c6b..5416ba5d89 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -8,7 +8,7 @@ Tips and ideas for using Vim				*tips*
 
 These are just a few that we thought would be helpful for many users.
 You can find many more tips on the wiki.  The URL can be found on
-http://www.vim.org
+https://www.vim.org
 
 Don't forget to browse the user manual, it also contains lots of useful tips
 |usr_toc.txt|.
diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt
index 23dfa082a0..ae0a2e4eeb 100644
--- a/runtime/doc/uganda.txt
+++ b/runtime/doc/uganda.txt
@@ -11,9 +11,9 @@ Vim is Charityware.  You can use and copy it as much as you like, but you are
 encouraged to make a donation for needy children in Uganda.  Please see |kcc|
 below or visit the ICCF web site, available at these URLs:
 
-	http://iccf-holland.org/
-	http://www.vim.org/iccf/
-	http://www.iccf.nl/
+	https://iccf-holland.org/
+	https://www.vim.org/iccf/
+	https://www.iccf.nl/
 
 You can also sponsor the development of Vim.  Vim sponsors can vote for
 features.  See |sponsor|.  The money goes to Uganda anyway.
@@ -239,7 +239,7 @@ Holland:	Transfer to the account of "Stichting ICCF Holland" in Lisse.
 
 Germany:	It is possible to make donations that allow for a tax return.
 		Check the ICCF web site for the latest information:
-			http://iccf-holland.org/germany.html
+			https://iccf-holland.org/germany.html
 
 World:		Use a postal money order.  That should be possible from any
 		country, mostly from the post office.  Use this name (which is
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index 5685979c82..5d1788be1b 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -28,12 +28,14 @@ with these (optional) keys:
 - `rgb`			Decides the color format.
 			- true:	(default) 24-bit RGB colors
 			- false:	Terminal colors (8-bit, max 256)
+
 							*ui-override*
 - `override`		Decides how UI capabilities are resolved.
 			- true:	Enable requested UI capabilities, even if not
 			  supported by all connected UIs (including |TUI|).
 			- false: (default) Disable UI capabilities not
 			  supported by all connected UIs (including TUI).
+
 							*ui-ext-options*
 - `ext_cmdline`		Externalize the cmdline. |ui-cmdline|
 - `ext_hlstate`		Detailed highlight state. |ui-hlstate|
@@ -130,14 +132,18 @@ procedure:
 
 1. Invoke |nvim_get_api_info()|, if needed to setup the client library and/or
    to get the list of supported UI extensions.
+
 2. Do any configuration that should be happen before user config is loaded.
    Buffers and windows are not available at this point, but this could be used
    to set |g:| variables visible to init.vim
+
 3. If the UI wants to do additional setup after user config is loaded,
    register a VimEnter autocmd: >
       nvim_command("autocmd VimEnter * call rpcrequest(1, 'vimenter')")
-<4. Now invoke |nvim_ui_attach()|. The UI must handle user input by now:
+
+4. Now invoke |nvim_ui_attach()|. The UI must handle user input by now:
    sourcing init.vim and loading buffers might lead to blocking prompts.
+
 5. If step 3 was used, Nvim will send a blocking "vimenter" request to the UI.
    Inside this request handler, the UI can safely do any initialization before
    entering normal mode, for example reading variables set by init.vim.
diff --git a/runtime/doc/usr_01.txt b/runtime/doc/usr_01.txt
index 52fbf06ec4..f0e2462fae 100644
--- a/runtime/doc/usr_01.txt
+++ b/runtime/doc/usr_01.txt
@@ -85,7 +85,7 @@ The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
 Moolenaar.  This material may be distributed only subject to the terms and
 conditions set forth in the Open Publication License, v1.0 or later.  The
 latest version is presently available at:
-	     http://www.opencontent.org/openpub/
+	     https://www.opencontent.org/openpub/
 
 People who contribute to the manuals must agree with the above copyright
 notice.
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index 0e94d9a1b1..63714595eb 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -320,7 +320,7 @@ Where can you find plugins?
 - Some are always loaded, you can see them in the directory $VIMRUNTIME/plugin.
 - Some come with Vim.  You can find them in the directory $VIMRUNTIME/macros
   and its sub-directories and under $VIM/vimfiles/pack/dist/opt/.
-- Download from the net.  There is a large collection on http://www.vim.org.
+- Download from the net.  There is a large collection on https://www.vim.org.
 - They are sometimes posted in a Vim maillist.
 - You could write one yourself, see |write-plugin|.
 
diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt
index 3b7b0d0ea1..87981a8ce0 100644
--- a/runtime/doc/usr_29.txt
+++ b/runtime/doc/usr_29.txt
@@ -33,9 +33,8 @@ following command: >
 	ctags *.c
 
 "ctags" is a separate program.  Most Unix systems already have it installed.
-If you do not have it yet, you can find Universal/Exuberant ctags at:
-	http://ctags.io ~
-	http://ctags.sf.net ~
+If you do not have it yet, you can find Universal ctags at:
+	https://ctags.io ~
 
 Universal ctags is preferred, Exuberant ctags is no longer being developed.
 
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 808e3a6378..d2db967c97 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -2623,7 +2623,7 @@ Further reading: |autoload|.
 ==============================================================================
 *41.16*	Distributing Vim scripts			*distribute-script*
 
-Vim users will look for scripts on the Vim website: http://www.vim.org.
+Vim users will look for scripts on the Vim website: https://www.vim.org.
 If you made something that is useful for others, share it!
 
 Vim scripts can be used on any system.  There might not be a tar or gzip
diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt
index 0d23ef50fd..95a2bc8f79 100644
--- a/runtime/doc/usr_45.txt
+++ b/runtime/doc/usr_45.txt
@@ -71,8 +71,8 @@ directory src/po/README.txt.
 programmer.  You must know both English and the language you are translating
 to, of course.
    When you are satisfied with the translation, consider making it available
-to others.  Upload it at vim-online (http://vim.sf.net) or e-mail it to
-the Vim maintainer .  Or both.
+to others.  Upload it to https://github.com/vim/vim or e-mail it to the Vim
+maintainer .  Or both.
 
 ==============================================================================
 *45.2*	Language for Menus
@@ -166,10 +166,7 @@ script files, etc.  You can regard 'encoding' as the setting for the internals
 of Vim.
    This example assumes you have this font on your system.  The name in the
 example is for the X Window System.  This font is in a package that is used to
-enhance xterm with Unicode support.  If you don't have this font, you might
-find it here:
-
-	http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz ~
+enhance xterm with Unicode support.
 
 For MS-Windows, some fonts have a limited number of Unicode characters.  Try
 using the "Courier New" font.  You can use the Edit/Select Font... menu to
@@ -178,10 +175,7 @@ though.  Example: >
 
 	:set guifont=courier_new:h12
 
-If it doesn't work well, try getting a fontpack.  If Microsoft didn't move it,
-you can find it here:
-
-	http://www.microsoft.com/typography/fonts/default.aspx ~
+If it doesn't work well, try getting a fontpack.
 
 Now you have told Vim to use Unicode internally and display text with a
 Unicode font.
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 76a45166a1..5a00cb6c89 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -158,7 +158,7 @@ Working intuitively and consistently is a major goal of Nvim.
 - Nvim avoids features that cannot be provided on all platforms; instead that
   is delegated to external plugins/extensions. E.g. the `-X` platform-specific
   option is "sometimes" available in Vim (with potential surprises:
-  http://stackoverflow.com/q/14635295).
+  https://stackoverflow.com/q/14635295).
 
 - Vim's internal test functions (test_autochdir(), test_settime(), etc.) are
   not exposed (nor implemented); instead Nvim has a robust API.
-- 
cgit 


From 3e5e12482c10a9cdf40a3992cd3113ac5466a310 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 15 Oct 2022 17:36:24 +0800
Subject: vim-patch:partial:3e79c97c18c5

Update runtime files; use compiled functions
https://github.com/vim/vim/commit/3e79c97c18c50f97797ab13ed81c4011eba9aba0

Only port uganda.txt.
---
 runtime/doc/uganda.txt | 84 ++++++++++++++++----------------------------------
 1 file changed, 27 insertions(+), 57 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt
index ae0a2e4eeb..8ad69901ae 100644
--- a/runtime/doc/uganda.txt
+++ b/runtime/doc/uganda.txt
@@ -166,10 +166,11 @@ households are stimulated to build a proper latrine.  I helped setting up a
 production site for cement slabs.  These are used to build a good latrine.
 They are sold below cost price.
 
-There is a small clinic at the project, which provides children and their
-family with medical help.  When needed, transport to a hospital is offered.
-Immunization programs are carried out and help is provided when an epidemic is
-breaking out (measles and cholera have been a problem).
+There is a clinic at the project, which provides children and their family
+medical help.  Since 2020 a maternity ward was added and 24/7 service is
+available.  When needed, transport to a hospital is offered.  Immunization
+programs are carried out and help is provided when an epidemic is breaking out
+(measles and cholera have been a problem).
 							*donate*
 Summer 1994 to summer 1995 I spent a whole year at the centre, working as a
 volunteer.  I have helped to expand the centre and worked in the area of water
@@ -211,44 +212,29 @@ Check the ICCF web site for the latest information!  See |iccf| for the URL.
 
 
 USA:		The methods mentioned below can be used.
-		Sending a check to the Nehemiah Group Outreach Society (NGOS)
-		is no longer possible, unfortunately. We are looking for
-		another way to get you an IRS tax receipt.
-		For sponsoring a child contact KCF in Canada (see below). US
-		checks can be sent to them to lower banking costs.
-
-Canada:		Contact Kibaale Children's Fund (KCF) in Surrey, Canada.  They
-		take care of the Canadian sponsors for the children in
-		Kibaale.  KCF forwards 100% of the money to the project in
-		Uganda.  You can send them a one time donation directly.
+		If you must send a check send it to our Canadian partner:
+		https://www.kuwasha.net/
+
+Canada:		Contact Kuwasha in Surrey, Canada.  They take care of the
+		Canadian sponsors for the children in Kibaale.  Kuwasha
+		forwards 100% of the money to the project in Uganda.  You can
+		send them a one time donation directly.
 		Please send me a note so that I know what has been donated
-		because of Vim.  Ask KCF for information about sponsorship.
-			Kibaale Children's Fund c/o Pacific Academy
-			10238-168 Street
-			Surrey, B.C. V4N 1Z4
-			Canada
-			Phone: 604-581-5353
-		If you make a donation to Kibaale Children's Fund (KCF) you
-		will receive a tax receipt which can be submitted with your
-		tax return.
-
-Holland:	Transfer to the account of "Stichting ICCF Holland" in Lisse.
-		This will allow for tax deduction if you live in Holland.
-			Postbank, nr. 4548774
-			IBAN: NL95 INGB 0004 5487 74
+		because of Vim.  Look on their for information about
+		sponsorship: https://www.kuwasha.net/
+		If you make a donation to Kuwasha you will receive a tax
+		receipt which can be submitted with your tax return.
+
+Holland:	Transfer to the account of "Stichting ICCF Holland" in
+		Amersfoort.  This will allow for tax deduction if you live in
+		Holland.  ING bank, IBAN: NL95 INGB 0004 5487 74
 
 Germany:	It is possible to make donations that allow for a tax return.
 		Check the ICCF web site for the latest information:
 			https://iccf-holland.org/germany.html
 
-World:		Use a postal money order.  That should be possible from any
-		country, mostly from the post office.  Use this name (which is
-		in my passport): "Abraham Moolenaar".  Use Euro for the
-		currency if possible.
-
-Europe:		Use a bank transfer if possible.  Your bank should have a form
-		that you can use for this.  See "Others" below for the swift
-		code and IBAN number.
+Europe:		Use a bank transfer if possible.  See "Others" below for the
+		swift code and IBAN number.
 		Any other method should work.  Ask for information about
 		sponsorship.
 
@@ -258,28 +244,12 @@ Credit Card:	You can use PayPal to send money with a Credit card.  This is
 		    https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q
 		The e-mail address for sending the money to is:
 		    Bram@iccf-holland.org
-		For amounts above 400 Euro ($500) sending a check is
-		preferred.
 
 Others:		Transfer to one of these accounts if possible:
-		    Postbank, account 4548774
-				Swift code: INGB NL 2A
-				IBAN: NL95 INGB 0004 5487 74
-			under the name "stichting ICCF Holland", Lisse
-		    If that doesn't work:
-		    Rabobank Lisse, account 3765.05.117
-				Swift code: RABO NL 2U
-			under the name "Bram Moolenaar", Lisse
-		Otherwise, send a check in euro or US dollars to the address
-		below.  Minimal amount: $70 (my bank does not accept smaller
-		amounts for foreign check, sorry)
-
-Address to send checks to:
-			Bram Moolenaar
-			Finsterruetihof 1
-			8134 Adliswil
-			Switzerland
-
-This address is expected to be valid for a long time.
+		    ING bank: 	IBAN: NL95 INGB 0004 5487 74
+				Swift code: INGBNL2A
+		    under the name "stichting ICCF Holland", Amersfoort
+		Checks are not accepted.
+
 
  vim:tw=78:ts=8:noet:ft=help:norl:
-- 
cgit 


From 6f5426edf690db2c31823ff7435116dbc837656b Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 15 Oct 2022 17:32:46 +0800
Subject: vim-patch:partial:9da17d7c5707

Update runtime files
https://github.com/vim/vim/commit/9da17d7c57071c306565da6a35c3704db1916b78

Only port index.txt, syntax.txt and uganda.txt.
---
 runtime/doc/index.txt  |  2 +-
 runtime/doc/syntax.txt | 18 +++++++++++-------
 runtime/doc/uganda.txt |  4 ++--
 3 files changed, 14 insertions(+), 10 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index e7c4c37f7d..c96f50e6dd 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1137,7 +1137,7 @@ tag		command		action ~
 |:&|		:&		repeat last ":substitute"
 |:star|		:*		execute contents of a register
 |:<|		:<		shift lines one 'shiftwidth' left
-|:=|		:=		print the cursor line number
+|:=|		:=		print the last line number
 |:>|		:>		shift lines one 'shiftwidth' right
 |:@|		:@		execute contents of a register
 |:@@|		:@@		repeat the previous ":@"
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 95c838d541..f9ca919ddb 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -3688,12 +3688,13 @@ DEFINING CASE						*:syn-case* *E390*
 	items until the next ":syntax case" command are affected.
 
 :sy[ntax] case
-	Show either "syntax case match" or "syntax case ignore" (translated).
+	Show either "syntax case match" or "syntax case ignore".
 
 
 DEFINING FOLDLEVEL					*:syn-foldlevel*
 
-:sy[ntax] foldlevel [start | minimum]
+:sy[ntax] foldlevel start
+:sy[ntax] foldlevel minimum
 	This defines how the foldlevel of a line is computed when using
 	foldmethod=syntax (see |fold-syntax| and |:syn-fold|):
 
@@ -3706,11 +3707,14 @@ DEFINING FOLDLEVEL					*:syn-foldlevel*
 	may close and open horizontally within a line.
 
 :sy[ntax] foldlevel
-	Show either "syntax foldlevel start" or "syntax foldlevel minimum".
+	Show the current foldlevel method, either "syntax foldlevel start" or
+	"syntax foldlevel minimum".
 
 SPELL CHECKING						*:syn-spell*
 
-:sy[ntax] spell [toplevel | notoplevel | default]
+:sy[ntax] spell toplevel
+:sy[ntax] spell notoplevel
+:sy[ntax] spell default
 	This defines where spell checking is to be done for text that is not
 	in a syntax item:
 
@@ -3725,8 +3729,8 @@ SPELL CHECKING						*:syn-spell*
 	To activate spell checking the 'spell' option must be set.
 
 :sy[ntax] spell
-	Show either "syntax spell toplevel", "syntax spell notoplevel" or
-	"syntax spell default" (translated).
+	Show the current syntax spell checking method, either "syntax spell
+	toplevel", "syntax spell notoplevel" or "syntax spell default".
 
 
 SYNTAX ISKEYWORD SETTING				*:syn-iskeyword*
@@ -4324,7 +4328,7 @@ IMPLICIT CONCEAL					*:syn-conceal-implicit*
 	given explicitly.
 
 :sy[ntax] conceal
-	Show either "syntax conceal on" or "syntax conceal off" (translated).
+	Show either "syntax conceal on" or "syntax conceal off".
 
 ==============================================================================
 8. Syntax patterns				*:syn-pattern* *E401* *E402*
diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt
index 8ad69901ae..d8fc26ad17 100644
--- a/runtime/doc/uganda.txt
+++ b/runtime/doc/uganda.txt
@@ -220,7 +220,7 @@ Canada:		Contact Kuwasha in Surrey, Canada.  They take care of the
 		forwards 100% of the money to the project in Uganda.  You can
 		send them a one time donation directly.
 		Please send me a note so that I know what has been donated
-		because of Vim.  Look on their for information about
+		because of Vim.  Look on their site for information about
 		sponsorship: https://www.kuwasha.net/
 		If you make a donation to Kuwasha you will receive a tax
 		receipt which can be submitted with your tax return.
@@ -245,7 +245,7 @@ Credit Card:	You can use PayPal to send money with a Credit card.  This is
 		The e-mail address for sending the money to is:
 		    Bram@iccf-holland.org
 
-Others:		Transfer to one of these accounts if possible:
+Others:		Transfer to this account if possible:
 		    ING bank: 	IBAN: NL95 INGB 0004 5487 74
 				Swift code: INGBNL2A
 		    under the name "stichting ICCF Holland", Amersfoort
-- 
cgit 


From 09b0f7cd08634a45fc277017324d4b18d10bef06 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 15 Oct 2022 17:28:23 +0800
Subject: vim-patch:partial:9.0.0753: some Ex commands are not in the help
 index

Problem:    Some Ex commands are not in the help index.
Solution:   Add the missing commands.  Add a script to check all Ex commands
            are in the help index. (Yee Cheng Chin, closes vim/vim#11371)
https://github.com/vim/vim/commit/b77bdce120d7e140d0d0bd535ec9febdef78993d

Only port index.txt docs for :star and :horizontal.
---
 runtime/doc/index.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index c96f50e6dd..df1695b43b 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1135,7 +1135,7 @@ tag		command		action ~
 |:!!|		:!!		repeat last ":!" command
 |:#|		:#		same as ":number"
 |:&|		:&		repeat last ":substitute"
-|:star|		:*		execute contents of a register
+|:star|		:*		use the last Visual area, like :'<,'>
 |:<|		:<		shift lines one 'shiftwidth' left
 |:=|		:=		print the last line number
 |:>|		:>		shift lines one 'shiftwidth' right
@@ -1329,6 +1329,7 @@ tag		command		action ~
 |:highlight|	:hi[ghlight]	specify highlighting methods
 |:hide|		:hid[e]		hide current buffer for a command
 |:history|	:his[tory]	print a history list
+|:horizontal|	:hor[izontal]	following window command work horizontally
 |:insert|	:i[nsert]	insert text
 |:iabbrev|	:ia[bbrev]	like ":abbrev" but for Insert mode
 |:iabclear|	:iabc[lear]	like ":abclear" but for Insert mode
-- 
cgit 


From 9cb2a690394c8f8000bee28cd00c8a220de0bf88 Mon Sep 17 00:00:00 2001
From: kylo252 <59826753+kylo252@users.noreply.github.com>
Date: Sat, 15 Oct 2022 11:55:55 +0200
Subject: docs(dev-style): remove rule about variable declarations (#20446)

The other style rules such as "initialize variables in the declaration" should already take care of this rule automatically.
---
 runtime/doc/dev_style.txt | 7 -------
 1 file changed, 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/dev_style.txt b/runtime/doc/dev_style.txt
index 6d832219f6..733b9c50c3 100644
--- a/runtime/doc/dev_style.txt
+++ b/runtime/doc/dev_style.txt
@@ -181,13 +181,6 @@ Use `bool` to represent boolean values. >
     int loaded = 1;  // BAD: loaded should have type bool.
 
 
-Variable declarations ~
-
-Declare only one variable per line. >
-
-    int i, j = 1
-
-
 Conditions ~
 
 Don't use "yoda-conditions". Use at most one assignment per condition. >
-- 
cgit 


From 19eb7054ff7b1fbc78e56e7f9ed6537b085147bc Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sun, 16 Oct 2022 08:06:07 +0800
Subject: vim-patch:9.0.0761: cannot use 'indentexpr' for Lisp indenting

Problem:    Cannot use 'indentexpr' for Lisp indenting.
Solution:   Add the 'lispoptions' option.
https://github.com/vim/vim/commit/49846fb1a31de99f49d6a7e70efe685197423c84

vim-patch:9.0.0762: build failure

Problem:    Build failure.
Solution:   Add missing change.
https://github.com/vim/vim/commit/4b082c4bd05f504fda1acaa9d28fca55a2d04857
---
 runtime/doc/options.txt | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index a846f49781..3e056ffc28 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3352,7 +3352,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	in Insert mode as specified with the 'indentkeys' option.
 	When this option is not empty, it overrules the 'cindent' and
 	'smartindent' indenting.  When 'lisp' is set, this option is
-	overridden by the Lisp indentation algorithm.
+	is only used when 'lispoptions' contains "expr:1".
 	When 'paste' is set this option is not used for indenting.
 	The expression is evaluated with |v:lnum| set to the line number for
 	which the indent is to be computed.  The cursor is also in this line
@@ -3719,6 +3719,17 @@ A jump table for the options with a short description can be found at |Q_op|.
 	calling an external program if 'equalprg' is empty.
 	This option is not used when 'paste' is set.
 
+						*'lispoptions'* *'lop'*
+'lispoptions' 'lop'	string	(default "")
+			local to buffer
+	Comma-separated list of items that influence the Lisp indenting when
+	enabled with the |'lisp'| option.  Currently only one item is
+	supported:
+		expr:1	use 'indentexpr' for Lisp indenting when it is set
+		expr:0	do not use 'indentexpr' for Lisp indenting (default)
+	Note that when using 'indentexpr' the `=` operator indents all the
+	lines, otherwise the first line is not indented (Vi-compatible).
+
 						*'lispwords'* *'lw'*
 'lispwords' 'lw'	string	(default is very long)
 			global or local to buffer |global-local|
-- 
cgit 


From 8617101b6bf21bf27ba5194db5fb42c73ff67160 Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Mon, 17 Oct 2022 00:31:51 +0200
Subject: docs: "supported platforms" matrix #19615

Inspired by libuv's own SUPPORTED_PLATFORMS.md:
https://github.com/libuv/libuv/blob/v1.x/

https://neovim.io/doc/user/support.html
---
 runtime/doc/help.txt    |  2 ++
 runtime/doc/support.txt | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 runtime/doc/support.txt

(limited to 'runtime/doc')

diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 21bee24171..88b1aa4055 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -179,6 +179,7 @@ Versions ~
 |deprecated.txt|  Deprecated items that have been or will be removed
 
 Other ~
+|news.txt|		News and notable changes in the latest release
 |terminal_emulator.txt|	Terminal buffers
 |term.txt|		Terminal UI
 |ui.txt|		Nvim UI protocol
@@ -187,6 +188,7 @@ Other ~
 |job_control.txt|	Spawn and control multiple processes
 |luaref.txt|		Lua reference manual
 |luvref.txt|		Luv (|vim.loop|) reference manual
+|support.txt|		Supported platforms
 
 						*standard-plugin-list*
 Standard plugins ~
diff --git a/runtime/doc/support.txt b/runtime/doc/support.txt
new file mode 100644
index 0000000000..82e20c7b9f
--- /dev/null
+++ b/runtime/doc/support.txt
@@ -0,0 +1,52 @@
+*support.txt*			    Nvim
+
+
+                            NVIM REFERENCE MANUAL
+
+
+Support
+
+                                      Type |gO| to see the table of contents.
+
+==============================================================================
+Supported platforms					 *supported-platforms*
+
+`System`          `Tier`      `Versions`                  `Tested versions`
+Linux            1      >= 2.6.32, glibc >= 2.12     Ubuntu 20.04
+macOS (Intel)    1      >= 10.15                     macOS 11
+Windows 64-bit   1      >= 8                         Windows Server 2019
+FreeBSD          1      >= 10                        FreeBSD 13
+macOS (M1)       2      >= 10.15
+OpenBSD          2      >= 7
+MinGW            2      MinGW-w64
+
+Support types ~
+
+* Tier 1: Officially supported and tested with CI. Any contributed patch
+  MUST NOT break such systems.
+
+* Tier 2: Officially supported, but not necessarily tested with CI. These
+  systems are maintained to the best of our ability, without being a top
+  priority.
+
+* Tier 3: Not tested and no guarantees, but may work.
+
+Adding support for a new platform ~
+
+IMPORTANT: Before attempting to add support for a new platform please open
+an issue about it for discussion.
+
+
+==============================================================================
+Common
+
+Some common notes when adding support for new platforms:
+
+Cmake is the only supported build system. The platform must be buildable with cmake.
+
+All functionality related to the new platform must be implemented in its own
+file inside `src/nvim/os` unless it's already done in a common file, in which
+case adding an `#ifdef` is fine.
+
+
+ vim:tw=78:ts=8:et:ft=help:norl:
-- 
cgit 


From 9701c9dc9f157c4d09d1783aab9913d05b0d73b1 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Mon, 17 Oct 2022 08:19:48 +0200
Subject: vim-patch:3c053a1a5ad2 (#20679)

Update runtime files
https://github.com/vim/vim/commit/3c053a1a5ad2a3c924929e11f2b9af20a8b901e2
---
 runtime/doc/indent.txt   |  9 ++++++---
 runtime/doc/options.txt  |  2 +-
 runtime/doc/quickref.txt |  1 +
 runtime/doc/repeat.txt   |  7 ++++++-
 runtime/doc/syntax.txt   | 15 ++++++++++++---
 runtime/doc/userfunc.txt |  4 ++++
 6 files changed, 30 insertions(+), 8 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 5473c7566c..2b86300e7f 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -978,9 +978,12 @@ indentation: >
 
 PYTHON							*ft-python-indent*
 
-The amount of indent can be set for the following situations.  The examples
-given are the defaults.  Note that the dictionary values are set to an
-expression, so that you can change the value of 'shiftwidth' later.
+The amount of indent can be set with the `g:python_indent` |Dictionary|, which
+needs to be created before adding the items: >
+	let g:python_indent = {}
+The examples given are the defaults.  Note that the dictionary values are set
+to an expression, so that you can change the value of 'shiftwidth' later
+without having to update these values.
 
 Indent after an open paren: >
 	let g:python_indent.open_paren = 'shiftwidth() * 2'
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 3e056ffc28..184a9aeea4 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5949,7 +5949,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	For the "screen" and "topline" values, the cursor position will be
 	changed when necessary. In this case, the jumplist will be populated
 	with the previous cursor position. For "screen", the text cannot always
-	be kept on the same screen line	when 'wrap' is enabled.
+	be kept on the same screen line when 'wrap' is enabled.
 
 			*'splitright'* *'spr'* *'nosplitright'* *'nospr'*
 'splitright' 'spr'	boolean	(default off)
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index f1261b18ff..f1294a18ba 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -772,6 +772,7 @@ Short explanation of each option:		*option-list*
 'lines'			    number of lines in the display
 'linespace'	  'lsp'     number of pixel lines to use between characters
 'lisp'			    automatic indenting for Lisp
+'lispoptions'	  'lop'     changes how Lisp indenting is done
 'lispwords'	  'lw'	    words that change how lisp indenting works
 'list'			    show  and 
 'listchars'	  'lcs'     characters for displaying in list mode
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 21945dc499..6a1b8b05a7 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -289,7 +289,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
 			how this can be useful.
 
 			This is normally done automatically during startup,
-			after loading your .vimrc file.  With this command it
+			after loading your |vimrc| file.  With this command it
 			can be done earlier.
 
 			Packages will be loaded only once.  Using
@@ -540,6 +540,11 @@ You would now have these files under ~/.local/share/nvim/site:
 On startup after processing your |config|, Nvim scans all directories in
 'packpath' for plugins in "pack/*/start/*", then loads the plugins.
 
+To allow for calling into package functionality while parsing your |vimrc|,
+|:colorscheme| and |autoload| will both automatically search under 'packpath'
+as well in addition to 'runtimepath'.  See the documentation for each for
+details.
+
 In the example Nvim will find "pack/foo/start/foobar/plugin/foo.vim" and load
 it.
 
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index f9ca919ddb..48301f3083 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -2986,16 +2986,25 @@ satisfied with it for my own projects.
 SED						*sed.vim* *ft-sed-syntax*
 
 To make tabs stand out from regular blanks (accomplished by using Todo
-highlighting on the tabs), define "highlight_sedtabs" by putting >
-
-	:let highlight_sedtabs = 1
+highlighting on the tabs), define "g:sed_highlight_tabs" by putting >
 
+	:let g:sed_highlight_tabs = 1
+<
 in the vimrc file.  (This special highlighting only applies for tabs
 inside search patterns, replacement texts, addresses or text included
 by an Append/Change/Insert command.)  If you enable this option, it is
 also a good idea to set the tab width to one character; by doing that,
 you can easily count the number of tabs in a string.
 
+GNU sed allows comments after text on the same line.  BSD sed only allows
+comments where "#" is the first character of the line.  To enforce BSD-style
+comments, i.e. mark end-of-line comments as errors, use: >
+
+	:let g:sed_dialect = "bsd"
+<
+Note that there are other differences between GNU sed and BSD sed which are
+not (yet) affected by this setting.
+
 Bugs:
 
   The transform command (y) is treated exactly like the substitute
diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt
index 5462fa952c..641c95b06e 100644
--- a/runtime/doc/userfunc.txt
+++ b/runtime/doc/userfunc.txt
@@ -388,6 +388,10 @@ file should then define the function like this: >
 	   echo "Done!"
 	endfunction
 
+If the file doesn't exist, Vim will also search in 'packpath' (under "start")
+to allow calling packages' functions from your |vimrc| when the packages have
+not been added to 'runtimepath' yet (see |packages|).
+
 The file name and the name used before the # in the function must match
 exactly, and the defined function must have the name exactly as it will be
 called.
-- 
cgit 


From 042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Mon, 17 Oct 2022 08:52:40 +0200
Subject: feat(runtime)!: remove filetype.vim (#20428)

Made obsolete by now graduated `filetype.lua` (enabled by default).

Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.
---
 runtime/doc/filetype.txt | 38 +++++++++++---------------------------
 runtime/doc/lua.txt      |  5 +----
 runtime/doc/news.txt     | 11 ++++++++---
 runtime/doc/options.txt  |  3 +--
 runtime/doc/starting.txt |  2 +-
 5 files changed, 22 insertions(+), 37 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index ac54a6b6ca..9952ef6415 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -175,15 +175,13 @@ This means that the contents of compressed files are not inspected.
 
 							*new-filetype*
 If a file type that you want to use is not detected yet, there are a few ways
-to add it.  In any way, it's better not to modify the $VIMRUNTIME/filetype.lua
-or $VIMRUNTIME/filetype.vim files.  They will be overwritten when installing a
-new version of Nvim. The following explains the legacy Vim mechanism (enabled
-if |g:do_legacy_filetype| is set). For Nvim's default mechanism, see
-|vim.filetype.add()|.
+to add it.  The recommended way is to use |vim.filetype.add()| to add it to
+Nvim's builtin filetype detection mechanism.  If you want to handle the
+detection manually, proceed as follows:
 
 A. If you want to overrule all default file type checks.
    This works by writing one file for each filetype.  The disadvantage is that
-   there can be many files.  The advantage is that you can simply drop this 
+   there can be many files.  The advantage is that you can simply drop this
    file in the right directory to make it work.
 							*ftdetect*
    1. Create your user runtime directory.  You would normally use the first
@@ -273,28 +271,14 @@ D. If your filetype can only be detected by inspecting the contents of the
    means that your rules override the default rules in
    $VIMRUNTIME/scripts.vim.
 
-						*remove-filetype*
-If a file type is detected that is wrong for you, install a filetype.lua,
-filetype.vim or scripts.vim to catch it (see above).  You can set 'filetype' to
-a non-existing name to avoid that it will be set later anyway: >
-	:set filetype=ignored
-
-If you are setting up a system with many users, and you don't want each user
-to add/remove the same filetypes, consider writing the filetype.vim and
-scripts.vim files in a runtime directory that is used for everybody.  Check
-the 'runtimepath' for a directory to use.  If there isn't one, set
-'runtimepath' in the |system-vimrc|.  Be careful to keep the default
-directories!
-
-						     *g:do_legacy_filetype*
-To disable Nvim's default filetype detection and revert to Vim's legacy
-filetype detection, add the following to your |init.vim|: >
-  let g:do_legacy_filetype = 1
-<						     *g:did_load_filetypes*
+							*remove-filetype*
+If a file type is detected that is wrong for you, you can set 'filetype' to
+a non-existing name such as `ignored` to avoid that it will be set later anyway.
+
+						     *g:did_load_filetypes*
 The builtin filetype detection provided by Nvim can be disabled by setting
-the `did_load_filetypes` global variable. If this variable exists, neither
-the default `$VIMRUNTIME/filetype.lua` nor the legacy `$VIMRUNTIME/filetype.vim`
-will run.
+the `did_load_filetypes` global variable. If this variable exists, the default
+`$VIMRUNTIME/filetype.lua` will not run.
 
 							*plugin-details*
 The "plugin" directory can be in any of the directories in the 'runtimepath'
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 7330453778..ce16c208cd 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2045,9 +2045,6 @@ add({filetypes})                                          *vim.filetype.add()*
 
     See $VIMRUNTIME/lua/vim/filetype.lua for more examples.
 
-    Note that Lua filetype detection is disabled when |g:do_legacy_filetype|
-    is set.
-
     Example: >
 
       vim.filetype.add({
@@ -2084,7 +2081,7 @@ add({filetypes})                                          *vim.filetype.add()*
       })
 <
 
-    To add a fallback match on contents (see |new-filetype-scripts|), use >
+    To add a fallback match on contents, use >
 
      vim.filetype.add {
        pattern = {
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 41d47f7a90..1dc9adcab1 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -13,7 +13,7 @@ BREAKING CHANGES                                                *news-breaking*
 
 The following changes may require adaptations in user config or plugins.
 
-Cscope is now removed (see |cscope| and |nvim-features-removed|):
+• Cscope is now removed (see |cscope| and |nvim-features-removed|):
   - Commands removed:
     - `:cscope`
     - `:lcscope`
@@ -30,9 +30,9 @@ Cscope is now removed (see |cscope| and |nvim-features-removed|):
   - Eval functions removed:
     - `cscope_connection()`
 
-Note: support for |ctags| remains with no plans to remove.
+  Note: support for |ctags| remains with no plans to remove.
 
-See https://github.com/neovim/neovim/pull/20545 for more information.
+  See https://github.com/neovim/neovim/pull/20545 for more information.
 
 ==============================================================================
 NEW FEATURES                                                    *news-features*
@@ -49,6 +49,11 @@ REMOVED FEATURES                                                 *news-removed*
 
 The following deprecated functions or APIs were removed.
 
+• `filetype.vim` is removed in favor of |lua-filetype|
+  (Note that filetype logic and tests still align with Vim, so additions or
+  changes need to be contributed there first.)
+  See https://github.com/neovim/neovim/pull/20674.
+
 ==============================================================================
 DEPRECATIONS                                                *news-deprecations*
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 184a9aeea4..5a828ba249 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4912,8 +4912,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 					       $XDG_CONFIG_HOME/nvim/after")
 			global
 	List of directories to be searched for these runtime files:
-	  filetype.vim	filetypes by file name |new-filetype|
-	  scripts.vim	filetypes by file contents |new-filetype-scripts|
+	  filetype.lua	filetypes |new-filetype|
 	  autoload/	automatically loaded scripts |autoload-functions|
 	  colors/	color scheme files |:colorscheme|
 	  compiler/	compiler files |:compiler|
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index baa60f431f..e45df9eb73 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -458,7 +458,7 @@ accordingly, proceeding as follows:
 
 7. Enable filetype detection.
 	This does the same as the command: >
-		:runtime! filetype.lua filetype.vim
+		:runtime! filetype.lua
 <	Skipped if ":filetype off" was called or if the "-u NONE" command line
 	argument was given.
 
-- 
cgit 


From 637ab296cba9e37e7374a8c076342487398605ee Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Mon, 17 Oct 2022 21:00:50 +0800
Subject: feat(api): nvim_select_popupmenu_item support cmdline pum (#20652)

---
 runtime/doc/api.txt  | 18 ++++++++++--------
 runtime/doc/news.txt |  2 ++
 2 files changed, 12 insertions(+), 8 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index f92ef26399..b949f3016e 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -1251,19 +1251,21 @@ nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special})
 
                                                 *nvim_select_popupmenu_item()*
 nvim_select_popupmenu_item({item}, {insert}, {finish}, {opts})
-    Selects an item in the completion popupmenu.
+    Selects an item in the completion popup menu.
 
-    If |ins-completion| is not active this API call is silently ignored.
-    Useful for an external UI using |ui-popupmenu| to control the popupmenu
-    with the mouse. Can also be used in a mapping; use  |:map-cmd| to
-    ensure the mapping doesn't end completion mode.
+    If neither |ins-completion| nor |cmdline-completion| popup menu is active
+    this API call is silently ignored. Useful for an external UI using
+    |ui-popupmenu| to control the popup menu with the mouse. Can also be used
+    in a mapping; use  |:map-cmd| or a Lua mapping to ensure the mapping
+    doesn't end completion mode.
 
     Parameters: ~
       • {item}    Index (zero-based) of the item to select. Value of -1
                   selects nothing and restores the original text.
-      • {insert}  Whether the selection should be inserted in the buffer.
-      • {finish}  Finish the completion and dismiss the popupmenu. Implies
-                  `insert`.
+      • {insert}  For |ins-completion|, whether the selection should be
+                  inserted in the buffer. Ignored for |cmdline-completion|.
+      • {finish}  Finish the completion and dismiss the popup menu. Implies
+                  {insert}.
       • {opts}    Optional parameters. Reserved for future use.
 
                                                       *nvim_set_client_info()*
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 1dc9adcab1..f0632c022a 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,8 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+|nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
+
 ==============================================================================
 CHANGED FEATURES                                                 *news-changes*
 
-- 
cgit 


From ef4c339fb9de87f7534303e006c281e40327f803 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Tue, 18 Oct 2022 10:18:44 -0400
Subject: feat(docs): update parser, HTML gen #20720

Note: although the tolerance in help_spec.lua increased, the actual
error count with the new parser decreased by about 20%. The difference
is that the old ignore_parse_error() ignored many more errors with the
old parser.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/37
fix https://github.com/neovim/tree-sitter-vimdoc/issues/44
fix https://github.com/neovim/tree-sitter-vimdoc/issues/47
---
 runtime/doc/arabic.txt   | 22 +++++++++++++---------
 runtime/doc/builtin.txt  | 30 ++++++++++++++++++------------
 runtime/doc/eval.txt     |  8 +++++---
 runtime/doc/intro.txt    |  2 +-
 runtime/doc/motion.txt   |  2 +-
 runtime/doc/starting.txt | 30 ++++++++++++++++--------------
 6 files changed, 54 insertions(+), 40 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt
index 0df861111c..0a80edb981 100644
--- a/runtime/doc/arabic.txt
+++ b/runtime/doc/arabic.txt
@@ -14,8 +14,9 @@ It is best to view this file with these settings within VIM's GUI: >
 	:set arabicshape
 
 
+------------------------------------------------------------------------------
 Introduction
-------------
+
 Arabic is a rather demanding language in which a number of special
 features are required.	Characters are right-to-left oriented and
 ought to appear as such on the screen (i.e. from right to left).
@@ -34,8 +35,9 @@ The commands, prompts and help files are not in Arabic, therefore
 the user interface remains the standard Vi interface.
 
 
+------------------------------------------------------------------------------
 Highlights
-----------
+
 o  Editing left-to-right files as in the original Vim hasn't changed.
 
 o  Viewing and editing files in right-to-left windows.	 File
@@ -64,8 +66,8 @@ o  Proper Bidirectional functionality is possible given Vim is
    started within a Bidi capable terminal emulator.
 
 
+------------------------------------------------------------------------------
 Arabic Fonts						*arabicfonts*
-------------
 
 Vim requires monospaced fonts of which there are many out there.
 Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
@@ -75,8 +77,8 @@ Do an Internet search or check www.arabeyes.org for further
 info on where to obtain the necessary Arabic fonts.
 
 
+------------------------------------------------------------------------------
 Font Installation
------------------
 
 o  Installation of fonts for X Window systems (Unix/Linux)
 
@@ -88,8 +90,9 @@ o  Installation of fonts for X Window systems (Unix/Linux)
      %	xset +fp path_name_of_arabic_fonts_directory
 
 
+------------------------------------------------------------------------------
 Usage
------
+
 Prior to the actual usage of Arabic within Vim, a number of settings
 need to be accounted for and invoked.
 
@@ -259,8 +262,8 @@ o  Enable Arabic settings [short-cut]
       ':set arabicshape' to your vimrc file.
 
 
+------------------------------------------------------------------------------
 Keymap/Keyboard						*arabickeymap*
----------------
 
 The character/letter encoding used in Vim is the standard UTF-8.
 It is widely discouraged that any other encoding be used or even
@@ -276,7 +279,7 @@ o  Keyboard
    +  CTRL-^ in insert/replace mode toggles between Arabic/Latin mode
 
    +  Keyboard mapping is based on the Microsoft's Arabic keymap (the
-      de facto standard in the Arab world):
+      de facto standard in the Arab world): >
 
   +---------------------------------------------------------------------+
   |!   |@   |#   |$   |%   |^   |&   |*   |(   |)   |_   |+   ||   |~  ّ |
@@ -291,17 +294,18 @@ o  Keyboard
 	   |Z ~ |X  ْ |C { |V } |B لآ |N آ |M ' |< , |> . |? ؟ |
 	   |z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ |
 	   +-------------------------------------------------+
+<
 
+------------------------------------------------------------------------------
 Restrictions
-------------
 
 o  Vim in its GUI form does not currently support Bi-directionality
    (i.e. the ability to see both Arabic and Latin intermixed within
    the same line).
 
 
+------------------------------------------------------------------------------
 Known Bugs
-----------
 
 There is one known minor bug,
 
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index b0484b7ffe..3ff8cedc9d 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -6790,18 +6790,24 @@ serverstart([{address}])				*serverstart()*
 		|RPC| messages. Clients can send |API| commands to the
 		returned address to control Nvim.
 
-		Returns the address string (may differ from the requested
-		{address}).
-		 
-		- If {address} contains a colon ":" it is interpreted as
-		  a TCP/IPv4/IPv6 address where the last ":" separates host
-		  and port (empty or zero assigns a random port).
-		- Else it is interpreted as a named pipe or Unix domain socket
-		  path. If there are no slashes it is treated as a name and
-		  appended to a generated path.
-		- If {address} is empty it generates a path.
-
-		Example named pipe: >
+		Returns the address string (which may differ from the
+		{address} argument, see below).
+
+		- If {address} has a colon (":") it is a TCP/IPv4/IPv6 address
+		  where the last ":" separates host and port (empty or zero
+		  assigns a random port).
+		- Else {address} is the path to a named pipe (except on Windows).
+		  - If {address} has no slashes ("/") it is treated as the
+		    "name" part of a generated path in this format: >
+			stdpath("run").."/{name}.{pid}.{counter}"
+<		  - If {address} is omitted the name is "nvim". >
+			:echo serverstart()
+			=> /tmp/nvim.bram/oknANW/nvim.15430.5
+
+<		Example bash command to list all Nvim servers: >
+			ls ${XDG_RUNTIME_DIR:-${TMPDIR}nvim.${USER}}/*/nvim.*.0
+
+<		Example named pipe: >
 			if has('win32')
 			  echo serverstart('\\.\pipe\nvim-pipe-1234')
 			else
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 6a9fb6d03c..30401c31f2 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2141,9 +2141,11 @@ v:scrollstart	String describing the script or function that caused the
 		hit-enter prompt.
 
 					*v:servername* *servername-variable*
-v:servername	Primary listen-address of the current Nvim instance, the first
-		item returned by |serverlist()|.  Can be set by |--listen| or
-		|$NVIM_LISTEN_ADDRESS| (deprecated) at startup.
+v:servername	Primary listen-address of Nvim, the first item returned by
+		|serverlist()|. Usually this is the named pipe created by Nvim
+		at |startup| or given by |--listen| (or the deprecated
+		|$NVIM_LISTEN_ADDRESS| env var).
+
 		See also |serverstart()| |serverstop()|.
 		Read-only.
 
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 60c2b4c5dd..348c56ba70 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -373,7 +373,7 @@ notation	meaning		    equivalent	decimal value(s)	~
 		alt-key or meta-key		*META* *ALT* *		same as 			*		command-key or "super" key	*			[count] display lines downward.  |exclusive| motion.
 			an operator, because it's not linewise.
 
 							*-*
--  		[count] lines upward, on the first non-blank
+`-`  		[count] lines upward, on the first non-blank
 			character |linewise|.
 
 +		or					*+*
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index e45df9eb73..14543b0a27 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -401,18 +401,20 @@ accordingly, proceeding as follows:
 	The |-V| argument can be used to display or log what happens next,
 	useful for debugging the initializations.
 
-3. Wait for UI to connect.
+3. Start a server (unless |--listen| was given) and set |v:servername|.
+
+4. Wait for UI to connect.
 	Nvim started with |--embed| waits for the UI to connect before
 	proceeding to load user configuration.
 
-4. Setup |default-mappings| and |default-autocmds|.  Create |popup-menu|.
+5. Setup |default-mappings| and |default-autocmds|.  Create |popup-menu|.
 
-5. Enable filetype and indent plugins.
+6. Enable filetype and indent plugins.
 	This does the same as the command: >
 		:runtime! ftplugin.vim indent.vim
 <	Skipped if the "-u NONE" command line argument was given.
 
-6. Load user config (execute Ex commands from files, environment, …).
+7. Load user config (execute Ex commands from files, environment, …).
 	$VIMINIT environment variable is read as one Ex command line (separate
 	multiple commands with '|' or ).
 					*config* *init.vim* *init.lua* *vimrc* *exrc*
@@ -456,19 +458,19 @@ accordingly, proceeding as follows:
 	-  The file ".nvimrc"
 	-  The file ".exrc"
 
-7. Enable filetype detection.
+8. Enable filetype detection.
 	This does the same as the command: >
 		:runtime! filetype.lua
 <	Skipped if ":filetype off" was called or if the "-u NONE" command line
 	argument was given.
 
-8. Enable syntax highlighting.
+9. Enable syntax highlighting.
 	This does the same as the command: >
 		:runtime! syntax/syntax.vim
 <	Skipped if ":syntax off" was called or if the "-u NONE" command
 	line argument was given.
 
-9. Load the plugin scripts.					*load-plugins*
+10. Load the plugin scripts.					*load-plugins*
 	This does the same as the command: >
 		:runtime! plugin/**/*.vim
 		:runtime! plugin/**/*.lua
@@ -498,21 +500,21 @@ accordingly, proceeding as follows:
 	if packages have been found, but that should not add a directory
 	ending in "after".
 
-10. Set 'shellpipe' and 'shellredir'
+11. Set 'shellpipe' and 'shellredir'
 	The 'shellpipe' and 'shellredir' options are set according to the
 	value of the 'shell' option, unless they have been set before.
 	This means that Nvim will figure out the values of 'shellpipe' and
 	'shellredir' for you, unless you have set them yourself.
 
-11. Set 'updatecount' to zero, if "-n" command argument used
+12. Set 'updatecount' to zero, if "-n" command argument used
 
-12. Set binary options if the |-b| flag was given.
+13. Set binary options if the |-b| flag was given.
 
-13. Read the |shada-file|.
+14. Read the |shada-file|.
 
-14. Read the quickfix file if the |-q| flag was given, or exit on failure.
+15. Read the quickfix file if the |-q| flag was given, or exit on failure.
 
-15. Open all windows
+16. Open all windows
 	When the |-o| flag was given, windows will be opened (but not
 	displayed yet).
 	When the |-p| flag was given, tab pages will be created (but not
@@ -522,7 +524,7 @@ accordingly, proceeding as follows:
 	Buffers for all windows will be loaded, without triggering |BufAdd|
 	autocommands.
 
-16. Execute startup commands
+17. Execute startup commands
 	If a |-t| flag was given, the tag is jumped to.
 	Commands given with |-c| and |+cmd| are executed.
 	The starting flag is reset, has("vim_starting") will now return zero.
-- 
cgit 


From aa2f08a050682ed6b2ffae521feec88451f2d3c0 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 18 Oct 2022 18:46:09 +0200
Subject: fix(highlight): link more treesitter groups by default (#20711)

Problem: Captures used by bundled parsers are not highlighted by default
Solution: Add links to default groups

A link is added for a capture if
* there is a default group of the same name (e.g., `@tag` -> `Tag`)
* it's used in a bundled query and doesn't have a reasonable fallback
  (e.g., `@text.literal`)

Also add all linked groups to the treesitter docs.
---
 runtime/doc/treesitter.txt | 53 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index c836ccec8c..31ee7c31c8 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -371,6 +371,59 @@ instance, to highlight comments differently per language: >
     hi @comment.c guifg=Blue
     hi @comment.lua @guifg=DarkBlue
     hi link @comment.doc.java String
+<
+The following captures are linked by default to standard |group-name|s:
+>
+    @text.literal      Comment
+    @text.reference    Identifier
+    @text.title        Title
+    @text.uri          Underlined
+    @text.underline    Underlined
+    @text.todo         Todo
+
+    @comment           Comment
+    @punctuation       Delimiter
+
+    @constant          Constant
+    @constant.builtin  Special
+    @constant.macro    Define
+    @define            Define
+    @macro             Macro
+    @string            String
+    @string.escape     SpecialChar
+    @string.special    SpecialChar
+    @character         Character
+    @character.special SpecialChar
+    @number            Number
+    @boolean           Boolean
+    @float             Float
+
+    @function          Function
+    @function.builtin  Special
+    @function.macro    Macro
+    @parameter         Identifier
+    @method            Function
+    @field             Identifier
+    @property          Identifier
+    @constructor       Special
+
+    @conditional       Conditional
+    @repeat            Repeat
+    @label             Label
+    @operator          Operator
+    @keyword           Keyword
+    @exception         Exception
+
+    @variable          Identifier
+    @type              Type
+    @type.definition   Typedef
+    @storageclass      StorageClass
+    @structure         Structure
+    @namespace         Identifier
+    @include           Include
+    @preproc           PreProc
+    @debug             Debug
+    @tag               Tag
 <
                                                   *treesitter-highlight-spell*
 The special `@spell` capture can be used to indicate that a node should be
-- 
cgit 


From 228a04070e94ca31884f304f3a8d34e67654025d Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 18 Oct 2022 20:05:50 +0200
Subject: vim-patch:9.0.0779: lsl and lm3 file extensions are not recognized
 (#20704)

Problem:    lsl and lm3 file extensions are not recognized.
Solution:   Add *.lsl and *.lm3 patterns. (Doug Kearns, closes vim/vim#11384)
https://github.com/vim/vim/commit/4ac8e7948cb3e07bc4598ede8b274891d14dfa7c
---
 runtime/doc/filetype.txt | 1 +
 1 file changed, 1 insertion(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 9952ef6415..8de91ed3ae 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -148,6 +148,7 @@ variables can be used to overrule the filetype used for certain extensions:
 	*.fs		g:filetype_fs	|ft-forth-syntax|
 	*.i		g:filetype_i	|ft-progress-syntax|
 	*.inc		g:filetype_inc
+	*.lsl		g:filetype_lsl
 	*.m		g:filetype_m	|ft-mathematica-syntax|
 	*.mod		g:filetype_mod
 	*.p		g:filetype_p	|ft-pascal-syntax|
-- 
cgit 


From 3b0777cfa5fd9f2e35abeb24cb87b79f76b39934 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 20 Oct 2022 18:04:32 +0800
Subject: docs(news): mention 'splitkeep' #20744

---
 runtime/doc/news.txt     | 5 +++--
 runtime/doc/vim_diff.txt | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index f0632c022a..9bf4b49419 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -13,7 +13,7 @@ BREAKING CHANGES                                                *news-breaking*
 
 The following changes may require adaptations in user config or plugins.
 
-• Cscope is now removed (see |cscope| and |nvim-features-removed|):
+• Cscope support is now removed (see |cscope| and |nvim-features-removed|):
   - Commands removed:
     - `:cscope`
     - `:lcscope`
@@ -39,7 +39,8 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
-|nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
+• 'splitkeep' option to control the scroll behavior of horizontal splits.
+• |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
 
 ==============================================================================
 CHANGED FEATURES                                                 *news-changes*
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 5a00cb6c89..da2b5e2466 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -707,7 +707,7 @@ TUI:
 
 Cscope:
                                                                       *cscope*
-  Cscope has been removed in favour of LSP based solutions.
+  Cscope support has been removed in favour of LSP based solutions.
 
 ==============================================================================
  vim:tw=78:ts=8:sw=2:et:ft=help:norl:
-- 
cgit 


From e6917306f6d3ba99747d14bea3f0b078631c5c0e Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Thu, 20 Oct 2022 09:20:02 -0400
Subject: docs: update vimdoc parser #20747

Remove the user-manual ToC from help.txt, because:
1. it duplicates usr_toc.txt
2. it is not what most readers are looking for in the main help page.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/49
fix https://github.com/neovim/tree-sitter-vimdoc/issues/50
fix https://github.com/neovim/tree-sitter-vimdoc/issues/51
---
 runtime/doc/builtin.txt |   2 +-
 runtime/doc/change.txt  |   4 +-
 runtime/doc/eval.txt    |   2 +-
 runtime/doc/help.txt    | 309 +++++++++++++++++++++++-------------------------
 runtime/doc/index.txt   |  33 ++----
 runtime/doc/luvref.txt  |   2 +-
 runtime/doc/options.txt |  56 ++++-----
 runtime/doc/support.txt |   2 +-
 8 files changed, 191 insertions(+), 219 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 3ff8cedc9d..2c00f755be 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -4,7 +4,7 @@
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
 
 
-Builtin functions				*builtin-functions*
+Builtin functions		*vimscript-functions* *builtin-functions*
 
 For functions grouped by what they are used for see |function-list|.
 
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index bed5cb26d7..7774793c35 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -441,13 +441,13 @@ steps to make a numbered list.
 SHIFTING LINES LEFT OR RIGHT				*shift-left-right*
 
 							*<*
-<{motion}		Shift {motion} lines one 'shiftwidth' leftwards.
+ <{motion}		Shift {motion} lines one 'shiftwidth' leftwards.
 
 			If the 'shiftwidth' option is set to zero, the amount
 			of indent is calculated at the first non-blank
 			character in the line.
 							*<<*
-<<			Shift [count] lines one 'shiftwidth' leftwards.
+ <<			Shift [count] lines one 'shiftwidth' leftwards.
 
 							*v_<*
 {Visual}[count]<	Shift the highlighted lines [count] 'shiftwidth'
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 30401c31f2..a28fa529b9 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4,7 +4,7 @@
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
 
 
-Expression evaluation			*expression* *expr* *E15* *eval*
+Expression evaluation		*vimscript* *expression* *expr* *E15* *eval*
 
 Using expressions is introduced in chapter 41 of the user manual |usr_41.txt|.
 
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 88b1aa4055..63d9d10845 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -1,6 +1,6 @@
 *help.txt*	Nvim
 
-			VIM - main help file
+				 NVIM - help
 									 k
       Move around:  Use the cursor keys, or "h" to go left,	       h   l
 		    "j" to go down, "k" to go up, "l" to go right.	 j
@@ -37,170 +37,153 @@ Get specific help:  It is possible to go directly to whatever you want help
 
 Vim stands for Vi IMproved.  Most of Vim was made by Bram Moolenaar, but only
 through the help of many others.  See |credits|.
+
+==============================================================================
+NVIM DOCUMENTATION
+
+------------------------------------------------------------------------------
+ABOUT NVIM				*reference_toc* *doc-file-list* *Q_ct*
+
+|news|			News since the previous release
+|nvim|			Transitioning from Vim
+|vim-differences|	Nvim compared to Vim
+|user-manual|		User manual: How to accomplish editing tasks.
+|quickref|		Overview of common commands
+|tutor|			30-minute interactive course for beginners
+|copying|		About copyrights
+|iccf|			Helping poor children in Uganda
+|sponsor|		Sponsor Vim development, become a registered Vim user
+|www|			Vim on the World Wide Web
+|bugs|			Where to send bug reports
+|support|		Supported platforms
+
+------------------------------------------------------------------------------
+GENERAL
+
+|intro|			Introduction to Vim; notation used in help files
+|helphelp|		Using the :help files
+|index|			Index of all commands
+|tips|			Various tips on using Vim
+|message.txt|		(Error) messages and explanations
+|uganda.txt|		Vim distribution and what to do with your money
+
+------------------------------------------------------------------------------
+BASIC EDITING
+
+|starting|		Starting Vim, Vim command arguments, initialisation
+|edit-files|		Editing and writing files
+|motion.txt|		Commands for moving around
+|scrolling|		Scrolling the text in the window
+|insert.txt|		Insert and Replace mode
+|change.txt|		Deleting and replacing text
+|undo-redo|		Undo and Redo
+|repeat.txt|		Repeating commands, Vim scripts and debugging
+|visual-mode|		Using Visual mode (selecting text)
+|various|		Various other commands
+|crash-recovery|	Recovering from a crash
+
+------------------------------------------------------------------------------
+ADVANCED EDITING
+
+|cmdline|		Command-line editing
+|options|		Description of all options
+|pattern-searches|	Vim regexp patterns and search commands
+|key-mapping|		Key mapping (shortcuts), abbreviations
+|tags|			Tags and special searches
+|windows|		Commands for using windows and buffers
+|tabpage|		Commands for using tabpages
+|spell|			Spell checking
+|diff|			Comparing files
+|folding|		Hide (fold) ranges of lines
+|terminal|		Embedded terminal emulator
+
+------------------------------------------------------------------------------
+API (EXTENSIBILITY/SCRIPTING/PLUGINS)
+
+|api|			Nvim API via RPC, Lua and VimL
+|ui|			Nvim UI protocol
+|lua|			Lua API
+|luaref|		Lua reference manual
+|luvref|		Luv (|vim.loop|) reference manual
+|autocmd|		Event handlers
+|job-control|		Spawn and control multiple processes
+|channel|		Nvim asynchronous IO
+|vimscript|		Vimscript reference
+|vimscript-functions|	Vimscript functions
+|testing.txt|		Vimscript testing functions
+|remote-plugin|		Nvim remote plugins
+
+------------------------------------------------------------------------------
+PROGRAMMING LANGUAGE SUPPORT
+
+|lsp|			Language Server Protocol (LSP)
+|diagnostic-api|	Diagnostic framework
+|treesitter|		Incremental syntax parsing
+|indent.txt|      	automatic indenting for C and other languages
+|syntax|		syntax highlighting
+|filetype|		Settings for specific types of files
+|quickfix|		Commands for a quick edit-compile-fix cycle
+|ft_ada.txt|      	Ada filetype plugin
+|ft_ps1.txt|      	PowerShell filetype plugin
+|ft_raku.txt|     	Raku filetype plugin
+|ft_rust.txt|     	Rust filetype plugin
+|ft_sql.txt|      	SQL filetype plugin
+
 ------------------------------------------------------------------------------
-						*doc-file-list* *Q_ct*
-BASIC:
-|quickref|	Overview of the most common commands you will use
-|tutor|		30-minute interactive course for beginners
-|copying|	About copyrights
-|iccf|		Helping poor children in Uganda
-|sponsor|	Sponsor Vim development, become a registered Vim user
-|www|		Vim on the World Wide Web
-|bugs|		Where to send bug reports
-
-USER MANUAL: These files explain how to accomplish an editing task.
-
-|usr_toc.txt|	Table Of Contents
-
-Getting Started ~
-|usr_01.txt|  About the manuals
-|usr_02.txt|  The first steps in Vim
-|usr_03.txt|  Moving around
-|usr_04.txt|  Making small changes
-|usr_05.txt|  Set your settings
-|usr_06.txt|  Using syntax highlighting
-|usr_07.txt|  Editing more than one file
-|usr_08.txt|  Splitting windows
-|usr_09.txt|  Using the GUI
-|usr_10.txt|  Making big changes
-|usr_11.txt|  Recovering from a crash
-|usr_12.txt|  Clever tricks
-
-Editing Effectively ~
-|usr_20.txt|  Typing command-line commands quickly
-|usr_21.txt|  Go away and come back
-|usr_22.txt|  Finding the file to edit
-|usr_23.txt|  Editing other files
-|usr_24.txt|  Inserting quickly
-|usr_25.txt|  Editing formatted text
-|usr_26.txt|  Repeating
-|usr_27.txt|  Search commands and patterns
-|usr_28.txt|  Folding
-|usr_29.txt|  Moving through programs
-|usr_30.txt|  Editing programs
-|usr_31.txt|  Exploiting the GUI
-|usr_32.txt|  The undo tree
-
-Tuning Vim ~
-|usr_40.txt|  Make new commands
-|usr_41.txt|  Write a Vim script
-|usr_42.txt|  Add new menus
-|usr_43.txt|  Using filetypes
-|usr_44.txt|  Your own syntax highlighted
-|usr_45.txt|  Select your language
-
-
-REFERENCE MANUAL: These files explain every detail of Vim.	*reference_toc*
-
-General subjects ~
-|intro.txt|	general introduction to Vim; notation used in help files
-|nvim.txt|	Transitioning from Vim
-|help.txt|	overview and quick reference (this file)
-|helphelp.txt|	about using the help files
-|index.txt|	alphabetical index of all commands
-|tips.txt|	various tips on using Vim
-|message.txt|	(error) messages and explanations
-|develop.txt|	development of Nvim
-|debug.txt|	debugging Vim itself
-|uganda.txt|	Vim distribution conditions and what to do with your money
-
-Basic editing ~
-|starting.txt|	starting Vim, Vim command arguments, initialisation
-|editing.txt|	editing and writing files
-|motion.txt|	commands for moving around
-|scroll.txt|	scrolling the text in the window
-|insert.txt|	Insert and Replace mode
-|change.txt|	deleting and replacing text
-|undo.txt|	Undo and Redo
-|repeat.txt|	repeating commands, Vim scripts and debugging
-|visual.txt|	using the Visual mode (selecting a text area)
-|various.txt|	various remaining commands
-|recover.txt|	recovering from a crash
-
-Advanced editing ~
-|cmdline.txt|	Command-line editing
-|options.txt|	description of all options
-|pattern.txt|	regexp patterns and search commands
-|map.txt|	key mapping and abbreviations
-|tagsrch.txt|	tags and special searches
-|windows.txt|	commands for using multiple windows and buffers
-|tabpage.txt|	commands for using multiple tab pages
-|spell.txt|	spell checking
-|diff.txt|	working with two to eight versions of the same file
-|autocmd.txt|	automatically executing commands on an event
-|eval.txt|	expression evaluation, conditional commands
-|builtin.txt|	builtin functions
-|userfunc.txt|	defining user functions
-|fold.txt|	hide (fold) ranges of lines
-|lua.txt|	Lua API
-|api.txt|	Nvim API via RPC, Lua and VimL
-
-Special issues ~
-|testing.txt|	    testing Vim and Vim scripts
-|print.txt|	    printing
-|remote_plugin.txt|   Nvim support for remote plugins
-
-Programming language support ~
-|indent.txt|       automatic indenting for C and other languages
-|lsp.txt|          Language Server Protocol (LSP)
-|treesitter.txt|   tree-sitter library for incremental parsing of buffers
-|diagnostic.txt|   Diagnostic framework
-|syntax.txt|       syntax highlighting
-|filetype.txt|     settings done specifically for a type of file
-|quickfix.txt|     commands for a quick edit-compile-fix cycle
-|provider.txt|     Built-in remote plugin hosts
-|ft_ada.txt|       Ada (the programming language) support
-|ft_ps1.txt|       Filetype plugin for Windows PowerShell
-|ft_raku.txt|      Filetype plugin for Raku
-|ft_rust.txt|      Filetype plugin for Rust
-|ft_sql.txt|       about the SQL filetype plugin
-
-Language support ~
-|digraph.txt|	list of available digraphs
-|mbyte.txt|	multibyte text support
-|mlang.txt|	non-English language support
-|rileft.txt|	right-to-left editing mode
-|arabic.txt|	Arabic language support and editing
-|hebrew.txt|	Hebrew language support and editing
-|russian.txt|	Russian language support and editing
-
-GUI ~
-|gui.txt|	Graphical User Interface (GUI)
-
-Interfaces ~
-|if_perl.txt|	Perl interface
-|if_pyth.txt|	Python interface
-|if_ruby.txt|	Ruby interface
-|sign.txt|	debugging signs
-
-Versions ~
-|vim_diff.txt|	Main differences between Nvim and Vim
-|vi_diff.txt|	Main differences between Vim and Vi
-|deprecated.txt|  Deprecated items that have been or will be removed
-
-Other ~
-|news.txt|		News and notable changes in the latest release
-|terminal_emulator.txt|	Terminal buffers
-|term.txt|		Terminal UI
-|ui.txt|		Nvim UI protocol
-|channel.txt|		Nvim asynchronous IO
-|dev_style.txt|		Nvim style guide
-|job_control.txt|	Spawn and control multiple processes
-|luaref.txt|		Lua reference manual
-|luvref.txt|		Luv (|vim.loop|) reference manual
-|support.txt|		Supported platforms
+UI
+
+|tui|			Builtin UI
+|gui|			External (graphical) UIs
+|signs|			Signs displayed as window decorations (the "gutter")
+
+------------------------------------------------------------------------------
+LANGUAGE SUPPORT
+
+|digraph|		List of available digraphs
+|mbyte.txt|		Multibyte text support
+|mlang.txt|		Non-English language support
+|rileft.txt|		Right-to-left editing mode
+|arabic.txt|		Arabic language support and editing
+|hebrew.txt|		Hebrew language support and editing
+|russian.txt|		Russian language support and editing
+
+------------------------------------------------------------------------------
+INTEROP
+
+|provider|		Builtin remote plugin hosts
+|if_perl|		Perl interface
+|if_pyth|		Python interface
+|if_ruby|		Ruby interface
+
+------------------------------------------------------------------------------
+VERSIONS
+
+|deprecated|		Deprecated features that will be removed
+|vi-differences|	Differences between Vim and Vi
+
+------------------------------------------------------------------------------
+DEVELOPING NVIM
+
+|dev|			Development of Nvim
+|dev-style|		Development style guidelines
+|debug.txt|		Debugging Vim itself
+
+------------------------------------------------------------------------------
+OTHER
+
+|print.txt|		For your briefcase and fax machine
 
 						*standard-plugin-list*
 Standard plugins ~
-|matchit.txt|      Extended |%| matching
-|pi_gzip.txt|      Reading and writing compressed files
-|pi_health.txt|    Healthcheck framework
-|pi_msgpack.txt|   msgpack utilities
-|pi_netrw.txt|     Reading and writing files over a network
-|pi_paren.txt|     Highlight matching parens
-|pi_spec.txt|      Filetype plugin to work with rpm spec files
-|pi_tar.txt|       Tar file explorer
-|pi_zip.txt|       Zip archive explorer
+|matchit.txt|		Extended |%| matching
+|pi_gzip.txt|      	Reading and writing compressed files
+|pi_health.txt|    	Healthcheck framework
+|pi_msgpack.txt|   	msgpack utilities
+|pi_netrw.txt|     	Reading and writing files over a network
+|pi_paren.txt|     	Highlight matching parens
+|pi_spec.txt|      	Filetype plugin to work with rpm spec files
+|pi_tar.txt|       	Tar file explorer
+|pi_zip.txt|       	Zip archive explorer
 
 LOCAL ADDITIONS:				*local-additions*
 
@@ -213,8 +196,8 @@ CTRL-T, CTRL-O, g, or  to go back to where you were.
 Note that tags are within | characters, but when highlighting is enabled these
 characters are hidden.  That makes it easier to read a command.
 
-Anyway, you can use CTRL-] on any word, also when it is not within |, and Vim
-will try to find help for it.  Especially for options in single quotes, e.g.
+You can use CTRL-] on any word (even if it is not within "|") and Nvim will
+try to find help for it.  Especially for options in single quotes, e.g.
 'hlsearch'.
 
 ------------------------------------------------------------------------------
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index df1695b43b..9eed5a8966 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -20,8 +20,7 @@ For a list of Vim variables see |vim-variable|.
 1. Insert mode						*insert-index*
 
 tag		char		action in Insert mode	~
------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |i_CTRL-@|	CTRL-@		insert previously inserted text and stop
 				insert
 |i_CTRL-A|	CTRL-A		insert previously inserted text
@@ -184,8 +183,7 @@ SECTION	 a section that possibly starts with '}' instead of '{'
 note: 1 = cursor movement command; 2 = can be undone/redone
 
 tag		char	      note action in Normal mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 		CTRL-@		   not used
 |CTRL-A|	CTRL-A		2  add N to number at/after cursor
 |CTRL-B|	CTRL-B		1  scroll N screens Backwards
@@ -470,8 +468,7 @@ tag		char	      note action in Normal mode	~
 These can be used after an operator or in Visual mode to select an object.
 
 tag		command		   action in op-pending and Visual mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |v_aquote|	a"		   double quoted string
 |v_a'|		a'		   single quoted string
 |v_a(|		a(		   same as ab
@@ -513,8 +510,7 @@ tag		command		   action in op-pending and Visual mode	~
 2.2 Window commands						*CTRL-W*
 
 tag		command		   action in Normal mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |CTRL-W_CTRL-B|	CTRL-W CTRL-B	   same as "CTRL-W b"
 |CTRL-W_CTRL-C|	CTRL-W CTRL-C	   same as "CTRL-W c"
 |CTRL-W_CTRL-D|	CTRL-W CTRL-D	   same as "CTRL-W d"
@@ -612,8 +608,7 @@ tag		command		   action in Normal mode	~
 2.3 Square bracket commands					*[* *]*
 
 tag		char	      note action in Normal mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |[_CTRL-D|	[ CTRL-D	   jump to first #define found in current and
 				   included files matching the word under the
 				   cursor, start searching at beginning of
@@ -703,8 +698,7 @@ tag		char	      note action in Normal mode	~
 2.4 Commands starting with 'g'						*g*
 
 tag		char	      note action in Normal mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 g_CTRL-A	g CTRL-A	   dump a memory profile
 |g_CTRL-G|	g CTRL-G	   show information about current cursor
 				   position
@@ -807,8 +801,7 @@ g_CTRL-A	g CTRL-A	   dump a memory profile
 2.5 Commands starting with 'z'						*z*
 
 tag		char	      note action in Normal mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |z|		z		   redraw, cursor line to top of window,
 				   cursor on first non-blank
 |zN|	z{height}	   redraw, make window {height} lines high
@@ -882,8 +875,7 @@ tag		char	      note action in Normal mode	~
 These can be used after an operator, but before a {motion} has been entered.
 
 tag		char		action in Operator-pending mode	~
------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |o_v|		v		force operator to work charwise
 |o_V|		V		force operator to work linewise
 |o_CTRL-V|	CTRL-V		force operator to work blockwise
@@ -895,8 +887,7 @@ Most commands in Visual mode are the same as in Normal mode.  The ones listed
 here are those that are different.
 
 tag		command	      note action in Visual mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |v_CTRL-\_CTRL-N| CTRL-\ CTRL-N	   stop Visual mode
 |v_CTRL-\_CTRL-G| CTRL-\ CTRL-G	   go to Normal mode
 |v_CTRL-A|	CTRL-A		2  add N to number in highlighted text
@@ -1016,8 +1007,7 @@ Normal characters are inserted at the current cursor position.
 file names, tags, commands etc. as appropriate.
 
 tag		command		action in Command-line editing mode	~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 		CTRL-@		not used
 |c_CTRL-A|	CTRL-A		do completion on the pattern in front of the
 				cursor and insert all matches
@@ -1127,8 +1117,7 @@ mentioning any arguments.  The optional part of the command name is inside [].
 The commands are sorted on the non-optional part of their name.
 
 tag		command		action ~
-------------------------------------------------------------------------------
-
+------------------------------------------------------------------------------ ~
 |:|		:		nothing
 |:range|	:{range}	go to last line in {range}
 |:!|		:!		filter lines or execute an external command
diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt
index 3ed3ef03c4..dd4162c179 100644
--- a/runtime/doc/luvref.txt
+++ b/runtime/doc/luvref.txt
@@ -3,7 +3,7 @@
 
                     LUV REFERENCE MANUAL
 
-
+								      *luvref*
 This file documents the Lua bindings for the LibUV library which is used for
 Nvim's event-loop and is accessible from Lua via |vim.loop| (e.g., |uv.version()|
 is exposed as `vim.loop.version()`).
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 5a828ba249..a04d02946d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -440,9 +440,9 @@ se[t]			the string "set " or "se " (note the space); When
 :			a colon
 [text]			any text or empty
 
-Examples:
-   /* vim: set ai tw=75: */ ~
-   /* Vim: set ai tw=75: */ ~
+Examples: >
+   /* vim: set ai tw=75: */
+   /* Vim: set ai tw=75: */
 
 The white space before {vi:|vim:|Vim:|ex:} is required.  This minimizes the
 chance that a normal word like "lex:" is caught.  There is one exception:
@@ -479,10 +479,10 @@ number can be specified where "vim:" or "Vim:" is used:
 	vim={vers}:	version {vers}
 	vim>{vers}:	version after {vers}
 {vers} is 700 for Vim 7.0 (hundred times the major version plus minor).
-For example, to use a modeline only for Vim 7.0:
-	/* vim700: set foldmethod=marker */ ~
-To use a modeline for Vim after version 7.2:
-	/* vim>702: set cole=2: */ ~
+For example, to use a modeline only for Vim 7.0: >
+	/* vim700: set foldmethod=marker */
+To use a modeline for Vim after version 7.2: >
+	/* vim>702: set cole=2: */
 There can be no blanks between "vim" and the ":".
 The modeline is ignored if {vers} does not fit in an integer.
 
@@ -491,16 +491,16 @@ The number of lines that are checked can be set with the 'modelines' option.
 If 'modeline' is off or 'modelines' is 0 no lines are checked.
 
 Note that for the first form all of the rest of the line is used, thus a line
-like:
-   /* vi:ts=4: */ ~
-will give an error message for the trailing "*/".  This line is OK:
-   /* vi:set ts=4: */ ~
+like: >
+   /* vi:ts=4: */
+will give an error message for the trailing "*/".  This line is OK: >
+   /* vi:set ts=4: */
 
 If an error is detected the rest of the line is skipped.
 
 If you want to include a ':' in a set command precede it with a '\'.  The
-backslash in front of the ':' will be removed.  Example:
-   /* vi:set fillchars=stl\:^,vert\:\|: */ ~
+backslash in front of the ':' will be removed.  Example: >
+   /* vi:set fillchars=stl\:^,vert\:\|: */
 This sets the 'fillchars' option to "stl:^,vert:\|".  Only a single backslash
 before the ':' is removed.  Thus to include "\:" you have to specify "\\:".
 							*E992*
@@ -1872,9 +1872,9 @@ A jump table for the options with a short description can be found at |Q_op|.
 		^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\)
 <	You can also use "\ze" just before the name and continue the pattern
 	to check what is following.  E.g. for Javascript, if a function is
-	defined with "func_name = function(args)": >
+	defined with `func_name = function(args)`: >
 		^\s*\ze\i\+\s*=\s*function(
-<	If the function is defined with "func_name : function() {...": >
+<	If the function is defined with `func_name : function() {...`: >
 	        ^\s*\ze\i\+\s*[:]\s*(*function\s*(
 <	When using the ":set" command, you need to double the backslashes!
 	To avoid that use `:let` with a single quote string: >
@@ -2406,13 +2406,13 @@ A jump table for the options with a short description can be found at |Q_op|.
 	this use the ":filetype on" command. |:filetype|
 	Setting this option to a different value is most useful in a modeline,
 	for a file for which the file type is not automatically recognized.
-	Example, for in an IDL file:
-		/* vim: set filetype=idl : */ ~
-	|FileType| |filetypes|
+	Example, for in an IDL file: >
+		/* vim: set filetype=idl : */
+<	|FileType| |filetypes|
 	When a dot appears in the value then this separates two filetype
-	names.  Example:
-		/* vim: set filetype=c.doxygen : */ ~
-	This will use the "c" filetype first, then the "doxygen" filetype.
+	names.  Example: >
+		/* vim: set filetype=c.doxygen : */
+<	This will use the "c" filetype first, then the "doxygen" filetype.
 	This works both for filetype plugins and for syntax files.  More than
 	one dot may appear.
 	This option is not copied to another buffer, independent of the 's' or
@@ -5685,7 +5685,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	   "number"	display signs in the 'number' column. If the number
 			column is not present, then behaves like "auto".
 
-	Note regarding 'orphaned signs': with signcolumn numbers higher than
+	Note regarding "orphaned signs": with signcolumn numbers higher than
 	1, deleting lines will also remove the associated signs automatically,
 	in contrast to the default Vim behavior of keeping and grouping them.
 	This is done in order for the signcolumn appearance not appear weird
@@ -6263,12 +6263,12 @@ A jump table for the options with a short description can be found at |Q_op|.
 	Otherwise this option does not always reflect the current syntax (the
 	b:current_syntax variable does).
 	This option is most useful in a modeline, for a file which syntax is
-	not automatically recognized.  Example, in an IDL file:
-		/* vim: set syntax=idl : */ ~
-	When a dot appears in the value then this separates two filetype
-	names.  Example:
-		/* vim: set syntax=c.doxygen : */ ~
-	This will use the "c" syntax first, then the "doxygen" syntax.
+	not automatically recognized.  Example, in an IDL file: >
+		/* vim: set syntax=idl : */
+<	When a dot appears in the value then this separates two filetype
+	names.  Example: >
+		/* vim: set syntax=c.doxygen : */
+<	This will use the "c" syntax first, then the "doxygen" syntax.
 	Note that the second one must be prepared to be loaded as an addition,
 	otherwise it will be skipped.  More than one dot may appear.
 	To switch off syntax highlighting for the current file, use: >
diff --git a/runtime/doc/support.txt b/runtime/doc/support.txt
index 82e20c7b9f..a0fc6e9f2c 100644
--- a/runtime/doc/support.txt
+++ b/runtime/doc/support.txt
@@ -4,7 +4,7 @@
                             NVIM REFERENCE MANUAL
 
 
-Support
+Support                                                              *support*
 
                                       Type |gO| to see the table of contents.
 
-- 
cgit 


From a11e96edfc2dec57be5773b6ce64a1323ce8431d Mon Sep 17 00:00:00 2001
From: dundargoc 
Date: Fri, 14 Oct 2022 18:22:34 +0200
Subject: docs(dev-style): remove rules covered by uncrustify

There's no reason for contributors to learn rules that can be automated
away.
---
 runtime/doc/dev_style.txt | 96 -----------------------------------------------
 1 file changed, 96 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/dev_style.txt b/runtime/doc/dev_style.txt
index 733b9c50c3..6afe2f7ee7 100644
--- a/runtime/doc/dev_style.txt
+++ b/runtime/doc/dev_style.txt
@@ -782,55 +782,6 @@ example, `"\uFEFF"`, is the Unicode zero-width no-break space character, which
 would be invisible if included in the source as straight UTF-8.
 
 
-Function Declarations and Definitions ~
-
-Return type on the same line as function name, parameters on the same line if
-they fit.
-
-Functions look like this: >
-
-    ReturnType function_name(Type par_name1, Type par_name2)
-    {
-      do_something();
-      ...
-    }
-
-If you have too much text to fit on one line: >
-
-    ReturnType really_long_function_name(Type par_name1, Type par_name2,
-                                         Type par_name3)
-    {
-      do_something();
-      ...
-    }
-
-or if you cannot fit even the first parameter (but only then): >
-
-    ReturnType really_really_really_long_function_name(
-        Type par_name1,  // 4 space indent
-        Type par_name2,
-        Type par_name3)
-    {
-      do_something();  // 2 space indent
-      ...
-    }
-
-Some points to note:
-
-- The open parenthesis is always on the same line as the function name.
-- There is never a space between the function name and the open parenthesis.
-- There is never a space between the parentheses and the parameters.
-- The open curly brace is always on the next line.
-- The close curly brace is always on the last line by itself.
-- There should be a space between the close parenthesis and the open curly
-  brace.
-- All parameters should be named, with identical names in the declaration and
-  implementation.
-- All parameters should be aligned if possible.
-- Default indentation is 2 spaces.
-- Wrapped parameters have a 4 space indent.
-
-
 Function Calls ~
 
 On one line if it fits; otherwise, wrap arguments at the parenthesis.
@@ -889,18 +840,6 @@ no name, assume a zero-length name. >
           interiorwrappinglist2 } };
 
 
-Conditionals ~
-
-Don't use spaces inside parentheses. >
-
-    if (condition) {  // no spaces inside parentheses
-      ...  // 2 space indent.
-    } else if (...) {  // The else goes on the same line as the closing brace.
-      ...
-    } else {
-      ...
-    }
-
 Loops and Switch Statements ~
 
 Annotate non-trivial fall-through between cases.
@@ -921,39 +860,6 @@ execute, simply `assert`: >
         assert(false);
     }
 
-Pointer Expressions ~
-
-No spaces around period or arrow. Pointer operators do not have trailing
-spaces.
-
-The following are examples of correctly-formatted pointer and reference
-expressions: >
-
-    x = *p;
-    p = &x;
-    x = r.y;
-    x = r->y;
-
-Note that:
-
-    - There are no spaces around the period or arrow when accessing a member.
-    - Pointer operators have no space after the * or &.
-
-Boolean Expressions ~
-
-When you have a boolean expression that is longer than the standard line
-length, keep operators at the start of the line. >
-
-    if (this_one_thing > this_other_thing
-        && a_third_thing == a_fourth_thing
-        && yet_another && last_one) {
-      ...
-    }
-
-Also note that you should always use the punctuation operators, such as `&&`
-and `~`, rather than the word operators, such as `and` and `compl`.
-
-
 Return Values ~
 
 Do not needlessly surround the `return` expression with parentheses.
@@ -1001,8 +907,6 @@ Use of horizontal whitespace depends on location.
         x = -5;           // No spaces separating unary operators and their
         x++;              // arguments.
         if (x && !y)
-          ...
-        i = (int)d;       // No spaces after a cast operator.
 <
 
 Vertical Whitespace ~
-- 
cgit 


From 1887d8d7d0dd619fa90fe11182c436bc3c71c9d5 Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Sun, 23 Oct 2022 03:45:39 +0200
Subject: docs: fix typos (#20724)

Co-authored-by: Marco Lehmann 
---
 runtime/doc/quickref.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index f1294a18ba..2f91498857 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -827,7 +827,7 @@ Short explanation of each option:		*option-list*
 'printmbcharset'  'pmbcs'   CJK character set to be used for :hardcopy
 'printmbfont'	  'pmbfn'   font names to be used for CJK output of :hardcopy
 'printoptions'	  'popt'    controls the format of :hardcopy output
-'pumheight'	  'ph'	    maximum height of the popup menu
+'pumheight'	  'ph'	    maximum number of items to show in the popup menu
 'pumwidth'	  'pw'	    minimum width of the popup menu
 'pyxversion'	  'pyx'	    Python version used for pyx* commands
 'quoteescape'	  'qe'	    escape characters used in a string
-- 
cgit 


From 7718241286315a8099427d42cb83c6532d87a390 Mon Sep 17 00:00:00 2001
From: ii14 <59243201+ii14@users.noreply.github.com>
Date: Sun, 23 Oct 2022 13:04:23 +0200
Subject: docs: ":che" is ":checkhealth" #20147

---
 runtime/doc/index.txt     | 4 ++--
 runtime/doc/pi_health.txt | 6 +++---
 runtime/doc/tagsrch.txt   | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 9eed5a8966..376487ad1d 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1208,8 +1208,8 @@ tag		command		action ~
 |:cgetfile|	:cg[etfile]	read file with error messages
 |:changes|	:changes	print the change list
 |:chdir|	:chd[ir]	change directory
-|:checkhealth|	:checkh[ealth]	run healthchecks
-|:checkpath|	:che[ckpath]	list included files
+|:checkhealth|	:che[ckhealth]	run healthchecks
+|:checkpath|	:checkp[ath]	list included files
 |:checktime|	:checkt[ime]	check timestamp of loaded buffers
 |:chistory|	:chi[story]	list the error lists
 |:clast|	:cla[st]	go to the specified error, default last one
diff --git a/runtime/doc/pi_health.txt b/runtime/doc/pi_health.txt
index 8a6437fdc8..5ba5d1beef 100644
--- a/runtime/doc/pi_health.txt
+++ b/runtime/doc/pi_health.txt
@@ -21,8 +21,8 @@ Plugin authors are encouraged to write new healthchecks. |health-dev|
 ==============================================================================
 Commands                                *health-commands*
 
-                                        *:checkhealth* *:CheckHealth*
-:checkhealth    Run all healthchecks.
+                                        *:che* *:checkhealth* *:CheckHealth*
+:che[ckhealth]  Run all healthchecks.
                                         *E5009*
                 Nvim depends on |$VIMRUNTIME|, 'runtimepath' and 'packpath' to
                 find the standard "runtime files" for syntax highlighting,
@@ -30,7 +30,7 @@ Commands                                *health-commands*
                 :checkhealth).  If the runtime files cannot be found then
                 those features will not work.
 
-:checkhealth {plugins}
+:che[ckhealth] {plugins}
                 Run healthcheck(s) for one or more plugins. E.g. to run only
                 the standard Nvim healthcheck: >
                         :checkhealth nvim
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index 143930c48a..d079db0717 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -829,10 +829,10 @@ CTRL-W d		Open a new window, with the cursor on the first
 			(default: whole file).
 			See |:search-args| for [/] and [!].
 
-					*:che* *:chec* *:check* *:checkpath*
-:che[ckpath]		List all the included files that could not be found.
+							*:checkp* *:checkpath*
+:checkp[ath]		List all the included files that could not be found.
 
-:che[ckpath]!		List all the included files.
+:checkp[ath]!		List all the included files.
 
 								*:search-args*
 Common arguments for the commands above:
-- 
cgit 


From 4573cfa3adac3a7dbf1b6b032471a1c14adc7427 Mon Sep 17 00:00:00 2001
From: NAKAI Tsuyoshi <82267684+uga-rosa@users.noreply.github.com>
Date: Mon, 24 Oct 2022 21:53:53 +0900
Subject: fix(lua): pesc, tbl_islist result types #20751

Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first

Solution:
Constrain docstring annotations.
Fix return types.

Co-authored-by: Justin M. Keyes 
---
 runtime/doc/lua.txt | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index ce16c208cd..70a28a7519 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1573,7 +1573,7 @@ gsplit({s}, {sep}, {plain})                                     *vim.gsplit()*
     Parameters: ~
       • {s}      (string) String to split
       • {sep}    (string) Separator or pattern
-      • {plain}  (boolean) If `true` use `sep` literally (passed to
+      • {plain}  (boolean|nil) If `true` use `sep` literally (passed to
                  string.find)
 
     Return: ~
@@ -1645,15 +1645,11 @@ split({s}, {sep}, {kwargs})                                      *vim.split()*
       split("|x|y|z|", "|", {trimempty=true}) => {'x', 'y', 'z'}
 <
 
-    @alias split_kwargs {plain: boolean, trimempty: boolean} | boolean | nil
-
-    See also: ~
-        |vim.gsplit()|
-
     Parameters: ~
       • {s}       (string) String to split
       • {sep}     (string) Separator or pattern
-      • {kwargs}  (table|nil) Keyword arguments:
+      • {kwargs}  ({plain: boolean, trimempty: boolean}|nil) Keyword
+                  arguments:
                   • plain: (boolean) If `true` use `sep` literally (passed to
                     string.find)
                   • trimempty: (boolean) If `true` remove empty items from the
@@ -1662,6 +1658,9 @@ split({s}, {sep}, {kwargs})                                      *vim.split()*
     Return: ~
         string[] List of split components
 
+    See also: ~
+        |vim.gsplit()|
+
 startswith({s}, {prefix})                                   *vim.startswith()*
     Tests if `s` starts with `prefix`.
 
-- 
cgit 


From c86371258cb10a015cf151b84e04df4480569aff Mon Sep 17 00:00:00 2001
From: Raffaele Mancuso <54762742+raffaem@users.noreply.github.com>
Date: Thu, 27 Oct 2022 01:43:50 +0200
Subject: docs(usr_05): update sentence about Nvim default behavior of Q
 (#20817)

While the user guide correctly describes the mapping in Vim, the default
behaviour in NeoVim seems to be the one described here.
---
 runtime/doc/usr_05.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index 63714595eb..944eb1fc80 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -127,8 +127,8 @@ Display matches for a search pattern while you type.
 
 This defines a key mapping.  More about that in the next section.  This
 defines the "Q" command to do formatting with the "gq" operator.  This is how
-it worked before Vim 5.0.  Otherwise the "Q" command starts Ex mode, but you
-will not need it.
+it worked before Vim 5.0.  Otherwise the "Q" command repeats the last recorded
+register.
 
 >
 	vnoremap _g y:exe "grep /" .. escape(@", '\\/') .. "/ *.c *.h"
-- 
cgit 


From f44ad753801d881f5352c9182167ced18e79e456 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Thu, 27 Oct 2022 22:31:58 +0200
Subject: docs(api): pattern is not expanded for autocommands (#20812)

Problem: Unlike `:autocmd`, `nvim_create_autocommand()` does not expand
environment variables in the `pattern`, which is unexpected.

Solution: Add a note to the documentation explaining this and suggesting
using `expand()` explicitly.
---
 runtime/doc/api.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index b949f3016e..8928650a39 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3267,6 +3267,12 @@ nvim_create_autocmd({event}, {*opts})                  *nvim_create_autocmd()*
       pattern = { "*.py", "*.pyi" }
 <
 
+    Note: The `pattern` is passed to callbacks and commands as a literal string; environment
+    variables like `$HOME` and `~` are not automatically expanded as they are by |:autocmd|. Instead,
+    |expand()| such variables explicitly: >
+      pattern = vim.fn.expand("~") .. "/some/path/*.py"
+<
+
     Example values for event: >
       "BufWritePre"
       {"CursorHold", "BufWritePre", "BufWritePost"}
@@ -3279,7 +3285,7 @@ nvim_create_autocmd({event}, {*opts})                  *nvim_create_autocmd()*
                  • group (string|integer) optional: the autocommand group name
                    or id to match against.
                  • pattern (string|array) optional: pattern or patterns to
-                   match against |autocmd-pattern|.
+                   match literally against |autocmd-pattern|.
                  • buffer (integer) optional: buffer number for buffer local
                    autocommands |autocmd-buflocal|. Cannot be used with
                    {pattern}.
-- 
cgit 


From 5568267ccb94924b9dcf7bfa5d52da0f16d161e4 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 27 Oct 2022 18:08:06 +0800
Subject: vim-patch:8.2.1544: cannot translate messages in a Vim script

Problem:    Cannot translate messages in a Vim script.
Solution:   Add gettext().  Try it out for a few messages in the options
            window.

https://github.com/vim/vim/commit/0b39c3fd4c5d1c8ebd2efa85fced7df5e17efd3b

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt | 14 ++++++++++++++
 runtime/doc/usr_41.txt  |  1 +
 2 files changed, 15 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 2c00f755be..8c9c14ffde 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -220,6 +220,7 @@ gettabvar({nr}, {varname} [, {def}])
 gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
 				any	{name} in {winnr} in tab page {tabnr}
 gettagstack([{nr}])		Dict	get the tag stack of window {nr}
+gettext({text})			String	lookup translation of {text}
 getwininfo([{winid}])		List	list of info about each window
 getwinpos([{timeout}])		List	X and Y coord in pixels of the Vim window
 getwinposx()			Number	X coord in pixels of Vim window
@@ -3584,6 +3585,19 @@ gettagstack([{winnr}])					*gettagstack()*
 		Can also be used as a |method|: >
 			GetWinnr()->gettagstack()
 
+
+gettext({text})						*gettext()*
+		Translate {text} if possible.
+		This is mainly for use in the distributed Vim scripts.  When
+		generating message translations the {text} is extracted by
+		xgettext, the translator can add the translated message in the
+		.po file and Vim will lookup the translation when gettext() is
+		called.
+		For {text} double quoted strings are preferred, because
+		xgettext does not understand escaping in single quoted
+		strings.
+
+
 getwininfo([{winid}])					*getwininfo()*
 		Returns information about windows as a |List| with Dictionaries.
 
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index d2db967c97..6d139643d6 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -639,6 +639,7 @@ String manipulation:					*string-functions*
 	execute()		execute an Ex command and get the output
 	win_execute()		like execute() but in a specified window
 	trim()			trim characters from a string
+	gettext()		lookup message translation
 
 List manipulation:					*list-functions*
 	get()			get an item without error for wrong index
-- 
cgit 


From bbbcd5393dc1ad02effc87d55665412ffaa19cc8 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 27 Oct 2022 22:07:30 +0800
Subject: vim-patch:8.2.1585: messages in globals.h not translated

Problem:    Messages in globals.h not translated, xgettext on MS-Windows not
            fully supported.
Solution:   Add globals.h to list of input files.  Update MS-Windows makefiles
            to improve message translations. (Ken Takata, closes vim/vim#6858)

https://github.com/vim/vim/commit/fa57335e532e505ce9229ddb2354a593fb057561

Also update gettext() docs to match latest Vim.
---
 runtime/doc/builtin.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 8c9c14ffde..cf12ec7568 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -3587,7 +3587,7 @@ gettagstack([{winnr}])					*gettagstack()*
 
 
 gettext({text})						*gettext()*
-		Translate {text} if possible.
+		Translate String {text} if possible.
 		This is mainly for use in the distributed Vim scripts.  When
 		generating message translations the {text} is extracted by
 		xgettext, the translator can add the translated message in the
-- 
cgit 


From 356244d50ba01c63b3ac33057a69462c4029612c Mon Sep 17 00:00:00 2001
From: Martin Kunz 
Date: Sat, 29 Oct 2022 01:13:27 +0200
Subject: fix(docs): nil as viable argument for goto_prev (#20852)

Added `nil` as a possible option to `vim.diagnostics.goto_prev` in the
docs
---
 runtime/doc/diagnostic.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 828093ddd4..d30d6c28a0 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -519,7 +519,7 @@ goto_prev({opts})                                 *vim.diagnostic.goto_prev()*
     Move to the previous diagnostic in the current buffer.
 
     Parameters: ~
-      • {opts}  (table) See |vim.diagnostic.goto_next()|
+      • {opts}  (table|nil) See |vim.diagnostic.goto_next()|
 
 hide({namespace}, {bufnr})                             *vim.diagnostic.hide()*
     Hide currently displayed diagnostics.
-- 
cgit 


From 6884f017b53369d6c9b06ddd3aedeb642dbd24a8 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 29 Oct 2022 17:41:22 +0200
Subject: vim-patch:partial:6ebe4f970b8b (#20860)

Update runtime files

https://github.com/vim/vim/commit/6ebe4f970b8b398087076a72a7aae6e680fb92da

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt |  8 +++---
 runtime/doc/ft_rust.txt | 70 ++++++++++++++++++++++++-------------------------
 runtime/doc/message.txt |  1 +
 runtime/doc/pi_tar.txt  | 14 +++++-----
 runtime/doc/pi_zip.txt  | 16 +++++------
 runtime/doc/syntax.txt  | 42 ++++++++++++++++++++---------
 runtime/doc/term.txt    |  2 ++
 7 files changed, 85 insertions(+), 68 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index cf12ec7568..226ae80599 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1198,11 +1198,9 @@ col({expr})	The result is a Number, which is the byte index of the column
 		buffer.
 		For the cursor position, when 'virtualedit' is active, the
 		column is one higher if the cursor is after the end of the
-		line.  This can be used to obtain the column in Insert mode: >
-			:imap  :let save_ve = &ve
-				\:set ve=all
-				\:echo col(".") .. "\n" 
-				\let &ve = save_ve
+		line.  Also, when using a  mapping the cursor isn't
+		moved, this can be used to obtain the column in Insert mode: >
+			:imap  echo col(".")
 
 <		Can also be used as a |method|: >
 			GetPos()->col()
diff --git a/runtime/doc/ft_rust.txt b/runtime/doc/ft_rust.txt
index 3a0bf2293e..a5d5b558dc 100644
--- a/runtime/doc/ft_rust.txt
+++ b/runtime/doc/ft_rust.txt
@@ -1,70 +1,70 @@
-*ft_rust.txt*	For Vim version 8.1.  Last change: 2017 Nov 02
+*ft_rust.txt*	Nvim
 
 This is documentation for the Rust filetype plugin.
 
 ==============================================================================
-CONTENTS                                                      *rust*
+CONTENTS						      *rust*
 
-1. Introduction                                                   |rust-intro|
-2. Settings                                                    |rust-settings|
-3. Commands                                                    |rust-commands|
-4. Mappings                                                    |rust-mappings|
+1. Introduction							  |rust-intro|
+2. Settings						       |rust-settings|
+3. Commands						       |rust-commands|
+4. Mappings						       |rust-mappings|
 
 ==============================================================================
-INTRODUCTION                                                      *rust-intro*
+INTRODUCTION							  *rust-intro*
 
 This plugin provides syntax and supporting functionality for the Rust
 filetype.
 
 ==============================================================================
-SETTINGS                                                       *rust-settings*
+SETTINGS						       *rust-settings*
 
 This plugin has a few variables you can define in your vimrc that change the
 behavior of the plugin.
 
-                                                                *g:rustc_path*
+								*g:rustc_path*
 g:rustc_path~
 	Set this option to the path to rustc for use in the |:RustRun| and
 	|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
 	    let g:rustc_path = $HOME .. "/bin/rustc"
 <
 
-                                                  *g:rustc_makeprg_no_percent*
+						  *g:rustc_makeprg_no_percent*
 g:rustc_makeprg_no_percent~
 	Set this option to 1 to have 'makeprg' default to "rustc" instead of
 	"rustc %": >
 	    let g:rustc_makeprg_no_percent = 1
 <
 
-                                                              *g:rust_conceal*
+							      *g:rust_conceal*
 g:rust_conceal~
 	Set this option to turn on the basic |conceal| support: >
 	    let g:rust_conceal = 1
 <
 
-                                                     *g:rust_conceal_mod_path*
+						     *g:rust_conceal_mod_path*
 g:rust_conceal_mod_path~
 	Set this option to turn on |conceal| for the path connecting token
 	"::": >
 	    let g:rust_conceal_mod_path = 1
 <
 
-                                                          *g:rust_conceal_pub*
+							  *g:rust_conceal_pub*
 g:rust_conceal_pub~
 	Set this option to turn on |conceal| for the "pub" token: >
 	    let g:rust_conceal_pub = 1
 <
 
-                                                     *g:rust_recommended_style*
+						     *g:rust_recommended_style*
 g:rust_recommended_style~
-        Set this option to enable vim indentation and textwidth settings to
-        conform to style conventions of the rust standard library (i.e. use 4
-        spaces for indents and sets 'textwidth' to 99). This option is enabled
+	Set this option to enable vim indentation and textwidth settings to
+	conform to style conventions of the rust standard library (i.e. use 4
+	spaces for indents and sets 'textwidth' to 99). This option is enabled
 	by default. To disable it: >
 	    let g:rust_recommended_style = 0
 <
 
-                                                                 *g:rust_fold*
+								 *g:rust_fold*
 g:rust_fold~
 	Set this option to turn on |folding|: >
 	    let g:rust_fold = 1
@@ -76,39 +76,39 @@ g:rust_fold~
 	2		Braced blocks are folded. 'foldlevel' is left at the
 			global value (all folds are closed by default).
 
-                                                  *g:rust_bang_comment_leader*
+						  *g:rust_bang_comment_leader*
 g:rust_bang_comment_leader~
 	Set this option to 1 to preserve the leader on multi-line doc comments
 	using the /*! syntax: >
 	    let g:rust_bang_comment_leader = 1
 <
 
-                                                 *g:ftplugin_rust_source_path*
+						 *g:ftplugin_rust_source_path*
 g:ftplugin_rust_source_path~
 	Set this option to a path that should be prepended to 'path' for Rust
 	source files: >
 	    let g:ftplugin_rust_source_path = $HOME .. '/dev/rust'
 <
 
-                                                       *g:rustfmt_command*
+						       *g:rustfmt_command*
 g:rustfmt_command~
 	Set this option to the name of the "rustfmt" executable in your $PATH. If
 	not specified it defaults to "rustfmt" : >
 	    let g:rustfmt_command = 'rustfmt'
 <
-                                                       *g:rustfmt_autosave*
+						       *g:rustfmt_autosave*
 g:rustfmt_autosave~
 	Set this option to 1 to run |:RustFmt| automatically when saving a
 	buffer. If not specified it defaults to 0 : >
 	    let g:rustfmt_autosave = 0
 <
-                                                       *g:rustfmt_fail_silently*
+						       *g:rustfmt_fail_silently*
 g:rustfmt_fail_silently~
 	Set this option to 1 to prevent "rustfmt" from populating the
 	|location-list| with errors. If not specified it defaults to 0: >
 	    let g:rustfmt_fail_silently = 0
 <
-                                                       *g:rustfmt_options*
+						       *g:rustfmt_options*
 g:rustfmt_options~
 	Set this option to a string of options to pass to "rustfmt". The
 	write-mode is already set to "overwrite". If not specified it
@@ -116,13 +116,13 @@ g:rustfmt_options~
 	    let g:rustfmt_options = ''
 <
 
-                                                          *g:rust_playpen_url*
+							  *g:rust_playpen_url*
 g:rust_playpen_url~
 	Set this option to override the URL for the playpen to use: >
 	    let g:rust_playpen_url = 'https://play.rust-lang.org/'
 <
 
-                                                        *g:rust_shortener_url*
+							*g:rust_shortener_url*
 g:rust_shortener_url~
 	Set this option to override the URL for the URL shortener: >
 	    let g:rust_shortener_url = 'https://is.gd/'
@@ -130,9 +130,9 @@ g:rust_shortener_url~
 
 
 ==============================================================================
-COMMANDS                                                       *rust-commands*
+COMMANDS						       *rust-commands*
 
-:RustRun  [args]                                                    *:RustRun*
+:RustRun  [args]						    *:RustRun*
 :RustRun! [rustc-args] [--] [args]
 		Compiles and runs the current file. If it has unsaved changes,
 		it will be saved first using |:update|. If the current file is
@@ -150,7 +150,7 @@ COMMANDS                                                       *rust-commands*
 		If |g:rustc_path| is defined, it is used as the path to rustc.
 		Otherwise it is assumed rustc can be found in $PATH.
 
-:RustExpand  [args]                                              *:RustExpand*
+:RustExpand  [args]						 *:RustExpand*
 :RustExpand! [TYPE] [args]
 		Expands the current file using --pretty and displays the
 		results in a new split. If the current file has unsaved
@@ -169,7 +169,7 @@ COMMANDS                                                       *rust-commands*
 		If |g:rustc_path| is defined, it is used as the path to rustc.
 		Otherwise it is assumed rustc can be found in $PATH.
 
-:RustEmitIr [args]                                               *:RustEmitIr*
+:RustEmitIr [args]						 *:RustEmitIr*
 		Compiles the current file to LLVM IR and displays the results
 		in a new split. If the current file has unsaved changes, it
 		will be saved first using |:update|. If the current file is an
@@ -180,7 +180,7 @@ COMMANDS                                                       *rust-commands*
 		If |g:rustc_path| is defined, it is used as the path to rustc.
 		Otherwise it is assumed rustc can be found in $PATH.
 
-:RustEmitAsm [args]                                             *:RustEmitAsm*
+:RustEmitAsm [args]						*:RustEmitAsm*
 		Compiles the current file to assembly and displays the results
 		in a new split. If the current file has unsaved changes, it
 		will be saved first using |:update|. If the current file is an
@@ -191,7 +191,7 @@ COMMANDS                                                       *rust-commands*
 		If |g:rustc_path| is defined, it is used as the path to rustc.
 		Otherwise it is assumed rustc can be found in $PATH.
 
-:RustPlay                                                          *:RustPlay*
+:RustPlay							   *:RustPlay*
 		This command will only work if you have web-api.vim installed
 		(available at https://github.com/mattn/webapi-vim).  It sends the
 		current selection, or if nothing is selected, the entirety of the
@@ -204,7 +204,7 @@ COMMANDS                                                       *rust-commands*
 		|g:rust_shortener_url| is the base URL for the shortener, by
 		default "https://is.gd/"
 
-:RustFmt                                                       *:RustFmt*
+:RustFmt						       *:RustFmt*
 		Runs |g:rustfmt_command| on the current buffer. If
 		|g:rustfmt_options| is set then those will be passed to the
 		executable.
@@ -214,12 +214,12 @@ COMMANDS                                                       *rust-commands*
 		|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
 		then it will not populate the |location-list|.
 
-:RustFmtRange                                                  *:RustFmtRange*
+:RustFmtRange						       *:RustFmtRange*
 		Runs |g:rustfmt_command| with selected range. See
 		|:RustFmt| for any other information.
 
 ==============================================================================
-MAPPINGS                                                       *rust-mappings*
+MAPPINGS						       *rust-mappings*
 
 This plugin defines mappings for |[[| and |]]| to support hanging indents.
 
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index 74ceb08994..d06a970340 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -601,6 +601,7 @@ probably means that some other program changed the file.  You will have to
 find out what happened, and decide which version of the file you want to keep.
 Set the 'autoread' option if you want to do this automatically.
 This message is not given when 'buftype' is not empty.
+Also see the |FileChangedShell| autocommand.
 
 There is one situation where you get this message even though there is nothing
 wrong: If you save a file in Windows on the day the daylight saving time
diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt
index c6c0596ea0..0b2ab1690b 100644
--- a/runtime/doc/pi_tar.txt
+++ b/runtime/doc/pi_tar.txt
@@ -80,20 +80,20 @@ Copyright 2005-2017:					*tar-copyright*
 
    These options are variables that one may change, typically in one's
    <.vimrc> file.
-                         Default
-   Variable               Value   Explanation
+			 Default
+   Variable		  Value   Explanation
    *g:tar_browseoptions*  "Ptf"   used to get a list of contents
-   *g:tar_readoptions*    "OPxf"  used to extract a file from a tarball
-   *g:tar_cmd*            "tar"   the name of the tar program
-   *g:tar_nomax*            0     if true, file window will not be maximized
-   *g:tar_secure*         undef   if exists:
+   *g:tar_readoptions*	  "OPxf"  used to extract a file from a tarball
+   *g:tar_cmd*		  "tar"   the name of the tar program
+   *g:tar_nomax*	    0	  if true, file window will not be maximized
+   *g:tar_secure*	  undef   if exists:
 					"--"s will be used to prevent unwanted
 					option expansion in tar commands.
 					Please be sure that your tar command
 					accepts "--"; Posix compliant tar
 					utilities do accept them.
 				  if not exists:
-				  	The tar plugin will reject any tar
+					The tar plugin will reject any tar
 					files or member files that begin with
 					"-"
 				  Not all tar's support the "--" which is why
diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt
index 2bbd6eea06..9b531d78b4 100644
--- a/runtime/doc/pi_zip.txt
+++ b/runtime/doc/pi_zip.txt
@@ -39,7 +39,7 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell	 *zip-copyright*
 
    OPTIONS~
 
-   							*g:zip_nomax*
+							*g:zip_nomax*
 
    If this variable exists and is true, the file window will not be
    automatically maximized when opened.
@@ -54,21 +54,21 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell	 *zip-copyright*
    under Windows (").  If you'd rather have no quotes, simply set
    g:zip_shq to the empty string (let g:zip_shq= "") in your <.vimrc>.
 
-   							*g:zip_unzipcmd*
+							*g:zip_unzipcmd*
    Use this option to specify the program which does the duty of "unzip".
    It's used during browsing. By default: >
-   	let g:zip_unzipcmd= "unzip"
+	let g:zip_unzipcmd= "unzip"
 <
 							*g:zip_zipcmd*
    Use this option to specify the program which does the duty of "zip".
    It's used during the writing (updating) of a file already in a zip
    file; by default: >
-   	let g:zip_zipcmd= "zip"
+	let g:zip_zipcmd= "zip"
 <
 							*g:zip_extractcmd*
    This option specifies the program (and any options needed) used to
    extract a file from a zip archive.  By default, >
-   	let g:zip_extractcmd= g:zip_unzipcmd
+	let g:zip_extractcmd= g:zip_unzipcmd
 <
    PREVENTING LOADING~
 
@@ -103,14 +103,14 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell	 *zip-copyright*
 ==============================================================================
 4. History							*zip-history* {{{1
    v32 Oct 22, 2021 * to avoid an issue with a vim 8.2 patch, zipfile: has
-   		      been changed to zipfile:// . This often shows up
+		      been changed to zipfile:// . This often shows up
 		      as zipfile:/// with zipped files that are root-based.
    v29 Apr 02, 2017 * (Klartext) reported that an encrypted zip file could
-   		      opened but the swapfile held unencrypted contents.
+		      opened but the swapfile held unencrypted contents.
 		      The solution is to edit the contents of a zip file
 		      using the |:noswapfile| modifier.
    v28 Oct 08, 2014 * changed the sanity checks for executables to reflect
-   		      the command actually to be attempted in zip#Read()
+		      the command actually to be attempted in zip#Read()
 		      and zip#Write()
 		    * added the extraction of a file capability
        Nov 30, 2015 * added *.epub to the |g:zipPlugin_ext| list
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 48301f3083..693e78cf9c 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -464,7 +464,7 @@ Force to omit the line numbers: >
 Go back to the default to use 'number' by deleting the variable: >
    :unlet g:html_number_lines
 <
-                                                             *g:html_line_ids*
+							*g:html_line_ids*
 Default: 1 if |g:html_number_lines| is set, 0 otherwise.
 When 1, adds an HTML id attribute to each line number, or to an empty 
 inserted for that purpose if no line numbers are shown. This ID attribute
@@ -656,6 +656,22 @@ the rendered page generated by 2html.vim.
 >
    :let g:html_no_pre = 1
 <
+							       *g:html_no_doc*
+Default: 0.
+When 1 it doesn't generate a full HTML document with a DOCTYPE, ,
+, etc. If |g:html_use_css| is enabled (the default) you'll have to
+define the CSS manually. The |g:html_dynamic_folds| and |g:html_line_ids|
+settings (off by default) also insert some JavaScript.
+
+
+							     *g:html_no_links*
+Default: 0.
+Don't generate  tags for text that looks like an URL.
+
+							  *g:html_no_modeline*
+Default: 0.
+Don't generate a modeline disabling folding.
+
 							  *g:html_expand_tabs*
 Default: 0 if 'tabstop' is 8, 'expandtab' is 0, 'vartabstop' is not in use,
 	       and no fold column or line numbers occur in the generated HTML;
@@ -2897,7 +2913,7 @@ Default folding is rather detailed, i.e., small syntax units like "if", "do",
 
 You can set "ruby_foldable_groups" to restrict which groups are foldable: >
 
-        :let ruby_foldable_groups = 'if case %'
+	:let ruby_foldable_groups = 'if case %'
 <
 The value is a space-separated list of keywords:
 
@@ -2905,22 +2921,22 @@ The value is a space-separated list of keywords:
     --------  ------------------------------------- ~
     ALL        Most block syntax (default)
     NONE       Nothing
-    if         "if" or "unless" block
+    if	       "if" or "unless" block
     def        "def" block
     class      "class" block
     module     "module" block
-    do         "do" block
+    do	       "do" block
     begin      "begin" block
     case       "case" block
     for        "for", "while", "until" loops
-    {          Curly bracket block or hash literal
-    [          Array literal
-    %          Literal with "%" notation, e.g.: %w(STRING), %!STRING!
-    /          Regexp
+    {	       Curly bracket block or hash literal
+    [	       Array literal
+    %	       Literal with "%" notation, e.g.: %w(STRING), %!STRING!
+    /	       Regexp
     string     String and shell command output (surrounded by ', ", `)
-    :          Symbol
-    #          Multiline comment
-    <<         Here documents
+    :	       Symbol
+    #	       Multiline comment
+    <<	       Here documents
     __END__    Source code after "__END__" directive
 
 						*ruby_no_expensive*
@@ -3750,7 +3766,7 @@ SYNTAX ISKEYWORD SETTING				*:syn-iskeyword*
 
 	clear:		Syntax specific iskeyword setting is disabled and the
 			buffer-local 'iskeyword' setting is used.
-	{option}        Set the syntax 'iskeyword' option to a new value.
+	{option}       	Set the syntax 'iskeyword' option to a new value.
 
 	Example: >
   :syntax iskeyword @,48-57,192-255,$,_
@@ -5110,7 +5126,7 @@ guisp={color-name}					*guisp*
 		"gg"	is the Green value
 		"bb"	is the Blue value
 	All values are hexadecimal, range from "00" to "ff".  Examples: >
-  :highlight Comment guifg=#11f0c3 guibg=#ff00ff
+	    :highlight Comment guifg=#11f0c3 guibg=#ff00ff
 <
 blend={integer}					*highlight-blend*
 	Override the blend level for a highlight group within the popupmenu
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 46e0371daa..2a131a34dd 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -380,6 +380,8 @@ and then drag) will result in whole words to be selected.  This continues
 until the button is released, at which point the selection is per character
 again.
 
+For scrolling with the mouse see |scroll-mouse-wheel|.
+
 In Insert mode, when a selection is started, Vim goes into Normal mode
 temporarily.  When Visual or Select mode ends, it returns to Insert mode.
 This is like using CTRL-O in Insert mode.  Select mode is used when the
-- 
cgit 


From feabc1c98cb077f60fde1a14e8540f2cf99eb8d2 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 29 Oct 2022 09:03:15 +0800
Subject: vim-patch:9.0.0816: CTRL-Z at end of file is always dropped

Problem:    CTRL-Z at end of file is always dropped.
Solution:   Add the 'endoffile' option, like the 'endofline' option.
            (closes vim/vim#11408, closes vim/vim#11397)

Cherry-pick test_fixeol.vim changes from patch 8.2.1432.
Cherry-pick 'endoffile' changes from latest Vim runtime update.

https://github.com/vim/vim/commit/fb0cf2357e0c85bbfd9f9178705ad8d77b6b3b4e

vim-patch:f0b567e32a46

Revert unintended Makefile change

https://github.com/vim/vim/commit/f0b567e32a462fe838170a202919d18b53eff987

vim-patch:72c8e3c070b3

Fix wrong struct access for member.

https://github.com/vim/vim/commit/72c8e3c070b30f82bc0d203a62c168e43a13e99b

vim-patch:3f68a4136eb9

Add missing entry for the 'endoffile' option.

https://github.com/vim/vim/commit/3f68a4136eb99840d739af5133ab31948f273f63

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/options.txt  | 11 ++++++++++-
 runtime/doc/quickref.txt |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index a04d02946d..4718876b29 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2135,6 +2135,15 @@ A jump table for the options with a short description can be found at |Q_op|.
 
 	See 'fileencoding' to control file-content encoding.
 
+			*'endoffile'* *'eof'* *'noendoffile'* *'noeof'*
+'endoffile' 'eof'	boolean	(default on)
+			local to buffer
+	Indicates that a CTRL-Z character was found at the end of the file
+	when reading it.  Normally only happens when 'fileformat' is "dos".
+	When writing a file and this option is off and the 'binary' option
+	is on, or 'fixeol' option is off, no CTRL-Z will be written at the
+	end of the file.
+
 			*'endofline'* *'eol'* *'noendofline'* *'noeol'*
 'endofline' 'eol'	boolean	(default on)
 			local to buffer
@@ -2490,7 +2499,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 'fixendofline' 'fixeol'	boolean	(default on)
 			local to buffer
 	When writing a file and this option is on,  at the end of file
-	will be restored if missing. Turn this option off if you want to
+	will be restored if missing.  Turn this option off if you want to
 	preserve the situation from the original file.
 	When the 'binary' option is set the value of this option doesn't
 	matter.
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 2f91498857..e4a3dae08b 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -689,6 +689,7 @@ Short explanation of each option:		*option-list*
 'display'	  'dy'	    list of flags for how to display text
 'eadirection'	  'ead'     in which direction 'equalalways' works
 'encoding'	  'enc'     encoding used internally
+'endoffile'	  'eof'     write CTRL-Z at end of the file
 'endofline'	  'eol'     write  for last line in file
 'equalalways'	  'ea'	    windows are automatically made the same size
 'equalprg'	  'ep'	    external program to use for "=" command
-- 
cgit 


From c46d46e9f11a9960fcf9c498ecc72be4c416cfa5 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 1 Nov 2022 20:21:48 +0800
Subject: vim-patch:8.2.2343: Vim9: return type of readfile() is any (#20896)

Problem:    Vim9: return type of readfile() is any.
Solution:   Add readblob() so that readfile() can be expected to always
            return a list of strings. (closes vim/vim#7671)

https://github.com/vim/vim/commit/c423ad77ed763c11ba67729bbf63c1cf0915231f

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt | 22 +++++++++++++++++++---
 runtime/doc/usr_41.txt  |  1 +
 2 files changed, 20 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 226ae80599..8ffe9d54a4 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -349,6 +349,7 @@ pyxeval({expr})			any	evaluate |python_x| expression
 rand([{expr}])			Number	get pseudo-random number
 range({expr} [, {max} [, {stride}]])
 				List	items from {expr} to {max}
+readblob({fname})		Blob	read a |Blob| from {fname}
 readdir({dir} [, {expr}])	List	file names in {dir} selected by {expr}
 readfile({fname} [, {type} [, {max}]])
 				List	get list of lines from file {fname}
@@ -6036,6 +6037,14 @@ rand([{expr}])						*rand()*
 		Can also be used as a |method|: >
 			seed->rand()
 <
+
+readblob({fname})					*readblob()*
+		Read file {fname} in binary mode and return a |Blob|.
+		When the file can't be opened an error message is given and
+		the result is an empty |Blob|.
+		Also see |readfile()| and |writefile()|.
+
+
 							*readdir()*
 readdir({directory} [, {expr}])
 		Return a list with file and directory names in {directory}.
@@ -6070,6 +6079,7 @@ readdir({directory} [, {expr}])
 		Can also be used as a |method|: >
 			GetDirName()->readdir()
 <
+
 							*readfile()*
 readfile({fname} [, {type} [, {max}]])
 		Read file {fname} and return a |List|, each line of the file
@@ -6081,8 +6091,6 @@ readfile({fname} [, {type} [, {max}]])
 		- When the last line ends in a NL an extra empty list item is
 		  added.
 		- No CR characters are removed.
-		When {type} contains "B" a |Blob| is returned with the binary
-		data of the file unmodified.
 		Otherwise:
 		- CR characters that appear before a NL are removed.
 		- Whether the last line ends in a NL or not does not matter.
@@ -6099,6 +6107,9 @@ readfile({fname} [, {type} [, {max}]])
 		Note that without {max} the whole file is read into memory.
 		Also note that there is no recognition of encoding.  Read a
 		file into a buffer if you need to.
+		Deprecated (use |readblob()| instead): When {type} contains
+		"B" a |Blob| is returned with the binary data of the file
+		unmodified.
 		When the file can't be opened an error message is given and
 		the result is an empty list.
 		Also see |writefile()|.
@@ -8907,7 +8918,12 @@ win_execute({id}, {command} [, {silent}])		*win_execute()*
 		have unexpected side effects.  Use |:noautocmd| if needed.
 		Example: >
 			call win_execute(winid, 'syntax enable')
-<
+<		Doing the same with `setwinvar()` would not trigger
+		autocommands and not actually show syntax highlighting.
+
+		When window {id} does not exist then no error is given and
+		an empty string is returned.
+
 		Can also be used as a |method|, the base is passed as the
 		second argument: >
 			GetCommand()->win_execute(winid)
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 6d139643d6..8abc5bdf06 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -818,6 +818,7 @@ System functions and manipulation of files:
 	setenv()		set an environment variable
 	hostname()		name of the system
 	readfile()		read a file into a List of lines
+	readblob()		read a file into a Blob
 	readdir()		get a List of file names in a directory
 	writefile()		write a List of lines or Blob into a file
 
-- 
cgit 


From 41f308feab35007534f0c213947701174d60c548 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Wed, 2 Nov 2022 08:02:52 +0800
Subject: vim-patch:9.0.0826: if 'endofline' is set CTRL-Z may be written in a
 wrong place (#20903)

Problem:    If 'endofline' is set the CTRL-Z may be written in the wrong
            place.
Solution:   Write CTRL-Z at the end of the file.  Update the help to explain
            the possibilities better. (Ken Takata, closes vim/vim#11486)

https://github.com/vim/vim/commit/3af982196b1b973e953c35351961f2a96fe34172

Co-authored-by: K.Takata 
---
 runtime/doc/editing.txt | 38 ++++++++++++++++++++++++++++++++++++++
 runtime/doc/options.txt |  3 +++
 2 files changed, 41 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 21a30ca429..58a5cbc60c 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -545,6 +545,44 @@ Before editing binary, executable or Vim script files you should set the
 option.  This will avoid the use of 'fileformat'.  Without this you risk that
 single  characters are unexpectedly replaced with .
 
+END OF LINE AND END OF FILE				*eol-and-eof*
+
+Vim has several options to control the file format:
+	'fileformat'	the  style: Unix, DOS, Mac
+	'endofline'	whether the last line ends with a 
+	'endoffile'	whether the file ends with a CTRL-Z
+	'fixendofline'	whether to fix eol and eof
+
+The first three values are normally detected automatically when reading the
+file and are used when writing the text to a file.  While editing the buffer
+it looks like every line has a line ending and the CTRL-Z isn't there (an
+exception is when 'binary' is set, it works differently then).
+
+The 'fixendofline' option can be used to choose what to write.  You can also
+change the option values to write the file differently than how it was read.
+
+Here are some examples how to use them.
+
+If you want files in Unix format (every line NL terminated): >
+	setl ff=unix fixeol
+You should probably do this on any Unix-like system.  Also modern MS-Windows
+systems tend to work well with this.  It is recommended to always use this
+format for Vim scripts.
+
+If you want to use an old MS-DOS file in a modern environment, fixing line
+endings and dropping CTRL-Z, but keeping the  style : >
+	setl ff=dos fixeol
+This is useful for many MS-Windows programs, they regularly expect the
+ line endings.
+
+If you want to drop the final  and add a final CTRL-Z (e.g. for an old
+system like CP/M): >
+	setl ff=dos nofixeol noeol eof
+
+If you want to preserve the fileformat exactly as-is, including any final
+ and final CTRL-Z: >
+	setl nofixeol
+
 ==============================================================================
 3. The argument list				*argument-list* *arglist*
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 4718876b29..2c0b33425c 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2143,6 +2143,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	When writing a file and this option is off and the 'binary' option
 	is on, or 'fixeol' option is off, no CTRL-Z will be written at the
 	end of the file.
+	See |eol-and-eof| for example settings.
 
 			*'endofline'* *'eol'* *'noendofline'* *'noeol'*
 'endofline' 'eol'	boolean	(default on)
@@ -2158,6 +2159,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	to remember the presence of a  for the last line in the file, so
 	that when you write the file the situation from the original file can
 	be kept.  But you can change it if you want to.
+	See |eol-and-eof| for example settings.
 
 			     *'equalalways'* *'ea'* *'noequalalways'* *'noea'*
 'equalalways' 'ea'	boolean	(default on)
@@ -2504,6 +2506,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	When the 'binary' option is set the value of this option doesn't
 	matter.
 	See the 'endofline' option.
+	See |eol-and-eof| for example settings.
 
 						*'foldclose'* *'fcl'*
 'foldclose' 'fcl'	string (default "")
-- 
cgit 


From 4716a578ae0c3516d685495bb55e40c939a4ac87 Mon Sep 17 00:00:00 2001
From: dundargoc 
Date: Sun, 23 Oct 2022 10:17:45 +0200
Subject: docs: fix typos

---
 runtime/doc/repeat.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 6a1b8b05a7..1bbd20702b 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -689,7 +689,7 @@ found automatically.  Your package would have these files:
 <	pack/foo/start/lib/autoload/foolib.vim >
 		func foolib#getit()
 
-This works, because start packages will be searchd for autoload files, when
+This works, because start packages will be searched for autoload files, when
 sourcing the plugins.
 
 ==============================================================================
-- 
cgit 


From 04fbb1de4488852c3ba332898b17180500f8984e Mon Sep 17 00:00:00 2001
From: Jonathon <32371757+jwhite510@users.noreply.github.com>
Date: Fri, 4 Nov 2022 05:07:22 -0400
Subject: Enable new diff option linematch (#14537)

Co-authored-by: Lewis Russell 
---
 runtime/doc/lua.txt     |  3 +++
 runtime/doc/options.txt | 10 ++++++++++
 2 files changed, 13 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 70a28a7519..c4e139bca7 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -677,6 +677,9 @@ vim.diff({a}, {b}, {opts})                                        *vim.diff()*
                    • "unified": (default) String in unified format.
                    • "indices": Array of hunk locations.
                    Note: This option is ignored if `on_hunk` is used.
+                 • `linematch` (boolean): Run linematch on the resulting hunks
+                   from xdiff. Requires `result_type = indices`, ignored
+                   otherwise.
                  • `algorithm` (string):
                    Diff algorithm to use. Values:
                    • "myers"      the default algorithm
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 2c0b33425c..285e596152 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2017,6 +2017,16 @@ A jump table for the options with a short description can be found at |Q_op|.
 				Use the indent heuristic for the internal
 				diff library.
 
+		linematch:{n}   Enable a second stage diff on each generated
+				hunk in order to align lines. When the total
+				number of lines in a hunk exceeds {n}, the
+				second stage diff will not be performed as
+				very large hunks can cause noticeable lag. A
+				recommended setting is "linematch:60", as this
+				will enable alignment for a 2 buffer diff with
+				hunks of up to 30 lines each, or a 3 buffer
+				diff with hunks of up to 20 lines each.
+
                 algorithm:{text} Use the specified diff algorithm with the
 				internal diff engine. Currently supported
 				algorithms are:
-- 
cgit 


From 24fa5f70edd4cc3b613237283ee7d63af1948c16 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Fri, 4 Nov 2022 18:17:26 +0800
Subject: vim-patch:8.2.0448: various functions not properly tested (#20926)

Problem:    Various functions not properly tested.
Solution:   Add more tests, especially for failures. (Yegappan Lakshmanan,
            closes vim/vim#5843)

https://github.com/vim/vim/commit/0e05de46226eb4e5ea580beefa71831f92d613d3

Cherry-pick test changes from patch 8.2.0427 and skip Test_has().
Cherry-pick Test_complete_wildmenu() change from patch 8.2.4339.
---
 runtime/doc/builtin.txt | 1 +
 1 file changed, 1 insertion(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 8ffe9d54a4..9cc3f94816 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -7261,6 +7261,7 @@ setqflist({list} [, {action} [, {what}]])		*setqflist()*
 							*setreg()*
 setreg({regname}, {value} [, {options}])
 		Set the register {regname} to {value}.
+		If {regname} is "" or "@", the unnamed register '"' is used.
 		The {regname} argument is a string.
 
 		{value} may be any value returned by |getreg()| or
-- 
cgit 


From e30929cda5cad8afb384cdb5b1ce62758dca6bde Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 07:34:06 +0800
Subject: vim-patch:8.2.0644: insufficient testing for invalid function
 arguments

Problem:    Insufficient testing for invalid function arguments.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5988)

https://github.com/vim/vim/commit/99fa721944dda9d07c53c907c33466728df5c271

Omit test_listener.vim: changed again in patch 8.2.1183.
Omit test_textprop.vim: changed again in patch 8.2.1183.
Cherry-pick quickfix feature checks from patch 8.1.2373.
Omit Test_saveas() change: duplicate and removed in patch 8.2.0866.
---
 runtime/doc/builtin.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 9cc3f94816..2cd2eed3a1 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -7080,8 +7080,8 @@ setloclist({nr}, {list} [, {action} [, {what}]])		*setloclist()*
 			GetLoclist()->setloclist(winnr)
 
 setmatches({list} [, {win}])				*setmatches()*
-		Restores a list of matches saved by |getmatches() for the
-		current window|.  Returns 0 if successful, otherwise -1.  All
+		Restores a list of matches saved by |getmatches()| for the
+		current window.  Returns 0 if successful, otherwise -1.  All
 		current matches are cleared before the list is restored.  See
 		example for |getmatches()|.
 		If {win} is specified, use the window with this number or
-- 
cgit 


From 8b0c5de4e0964109326a0befb1b3bff6aac4d0db Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 07:24:06 +0800
Subject: vim-patch:partial:8.2.1183: assert_fails() checks the last error
 message

Problem:    assert_fails() checks the last error message.
Solution:   Check the first error, it is more relevant.  Fix all the tests
            that rely on the old behavior.

https://github.com/vim/vim/commit/9b7bf9e98f06ece595fed7a3ff53ecce89797a53

Skip test_listener.vim, test_textprop.vim, test_viminfo.vim.
Skip test_python2.vim: affected line fails and hasn't been ported.
Skip test_python3.vim: affected lines fail and haven't been ported.
Skip CHECK_LIST_MATERIALIZE.

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/testing.txt | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index f4375c3363..eda4ae1a5e 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -101,8 +101,23 @@ assert_exception({error} [, {msg}])			*assert_exception()*
 
 assert_fails({cmd} [, {error} [, {msg}]])			*assert_fails()*
 		Run {cmd} and add an error message to |v:errors| if it does
-		NOT produce an error.  Also see |assert-return|.
-		When {error} is given it must match in |v:errmsg|.
+		NOT produce an error or when {error} is not found in the
+		error message.  Also see |assert-return|.
+
+		When {error} is a string it must be found literally in the
+		first reported error. Most often this will be the error code,
+		including the colon, e.g. "E123:". >
+			assert_fails('bad cmd', 'E987:')
+<
+		When {error} is a |List| with one or two strings, these are
+		used as patterns.  The first pattern is matched against the
+		first reported error: >
+			assert_fails('cmd', ['E987:.*expected bool'])
+<		The second pattern, if present, is matched against the last
+		reported error.  To only match the last error use an empty
+		string for the first error: >
+			assert_fails('cmd', ['', 'E987:'])
+<
 		Note that beeping is not considered an error, and some failing
 		commands only beep.  Use |assert_beeps()| for those.
 
-- 
cgit 


From 0d8293364f78237afb83d4822611d6fd8add66f8 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 12:37:28 +0800
Subject: vim-patch:8.2.1479: Vim9: error for list index uses wrong line number

Problem:    Vim9: error for list index uses wrong line number.
Solution:   Set source line number. (closes vim/vim#6724)  Add a way to assert the
            line number of the error with assert_fails().

https://github.com/vim/vim/commit/1d634542cf5ebcd1d5d83bd124b3e1d5e7c96c58

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/testing.txt | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index eda4ae1a5e..6d138de6c0 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -98,8 +98,9 @@ assert_exception({error} [, {msg}])			*assert_exception()*
 			catch
 			  call assert_exception('E492:')
 			endtry
-
-assert_fails({cmd} [, {error} [, {msg}]])			*assert_fails()*
+<
+							*assert_fails()*
+assert_fails({cmd} [, {error} [, {msg} [, {lnum}]]])
 		Run {cmd} and add an error message to |v:errors| if it does
 		NOT produce an error or when {error} is not found in the
 		error message.  Also see |assert-return|.
@@ -118,13 +119,21 @@ assert_fails({cmd} [, {error} [, {msg}]])			*assert_fails()*
 		string for the first error: >
 			assert_fails('cmd', ['', 'E987:'])
 <
+		If {msg} is empty then it is not used.  Do this to get the
+		default message when passing the {lnum} argument.
+
+		When {lnum} is present and not negative, and the {error}
+		argument is present and matches, then this is compared with
+		the line number at which the error was reported. That can be
+		the line number in a function or in a script.
+
 		Note that beeping is not considered an error, and some failing
 		commands only beep.  Use |assert_beeps()| for those.
 
 		Can also be used as a |method|: >
 			GetCmd()->assert_fails('E99:')
 
-assert_false({actual} [, {msg}])				*assert_false()*
+assert_false({actual} [, {msg}])			*assert_false()*
 		When {actual} is not false an error message is added to
 		|v:errors|, like with |assert_equal()|.
 		Also see |assert-return|.
-- 
cgit 


From 02f80d9a8a560a93142bcebf324ba14cde4dd1b5 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 12:41:36 +0800
Subject: vim-patch:8.2.1631: test_fails() does not check the context of the
 line number

Problem:    test_fails() does not check the context of the line number.
Solution:   Use another argument to specify the context of the line number.

https://github.com/vim/vim/commit/9bd5d879c2ecfbdbb168b090e12f4b89724a302e

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/testing.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 6d138de6c0..56e0dad656 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -100,7 +100,7 @@ assert_exception({error} [, {msg}])			*assert_exception()*
 			endtry
 <
 							*assert_fails()*
-assert_fails({cmd} [, {error} [, {msg} [, {lnum}]]])
+assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]])
 		Run {cmd} and add an error message to |v:errors| if it does
 		NOT produce an error or when {error} is not found in the
 		error message.  Also see |assert-return|.
@@ -127,6 +127,10 @@ assert_fails({cmd} [, {error} [, {msg} [, {lnum}]]])
 		the line number at which the error was reported. That can be
 		the line number in a function or in a script.
 
+		When {context} is present it is used as a pattern and matched
+		against the context (script name or function name) where
+		{lnum} is located in.
+
 		Note that beeping is not considered an error, and some failing
 		commands only beep.  Use |assert_beeps()| for those.
 
-- 
cgit 


From 48405df046e6d15c26aeea429fa44950ccc1a8ac Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 14:31:40 +0800
Subject: vim-patch:8.2.3919: Vim9: wrong argument for append() results in two
 errors

Problem:    Vim9: wrong argument for append() results in two errors.
Solution:   Check did_emsg.  Also for setline().  Adjust the help for
            appendbufline().

https://github.com/vim/vim/commit/8b6256f6ec075cca40341e61ebc9f538b4902dd1

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 2cd2eed3a1..e7e44374c6 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -654,9 +654,10 @@ appendbufline({buf}, {lnum}, {text})			*appendbufline()*
 
 		For the use of {buf}, see |bufname()|.
 
-		{lnum} is used like with |append()|.  Note that using |line()|
-		would use the current buffer, not the one appending to.
-		Use "$" to append at the end of the buffer.
+		{lnum} is the line number to append below.  Note that using
+		|line()| would use the current buffer, not the one appending
+		to.  Use "$" to append at the end of the buffer.  Other string
+		values are not supported.
 
 		On success 0 is returned, on failure 1 is returned.
 
-- 
cgit 


From b84666d2a0dc4a7585ef6aa5a8f9060046ff9082 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 15:59:17 +0800
Subject: vim-patch:8.2.4978: no error if engine selection atom is not at the
 start

Problem:    No error if engine selection atom is not at the start.
Solution:   Give an error. (Christian Brabandt, closes vim/vim#10439)

https://github.com/vim/vim/commit/360da40b47a84ee8586c3b5d062f8c64a2ac9cc6

Co-authored-by: Christian Brabandt 
---
 runtime/doc/pattern.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 371a210847..5357aaa3f1 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -372,7 +372,7 @@ Vim includes two regexp engines:
 1. An old, backtracking engine that supports everything.
 2. A new, NFA engine that works much faster on some patterns, possibly slower
    on some patterns.
-
+								 *E1281*
 Vim will automatically select the right engine for you.  However, if you run
 into a problem or want to specifically select one engine or the other, you can
 prepend one of the following to the pattern:
-- 
cgit 


From 781616bee5e319fdfa034484c026222b50926ebf Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 17:16:49 +0800
Subject: vim-patch:8.2.2606: strchars() defaults to counting composing
 characters

Problem:    strchars() defaults to counting composing characters.
Solution:   Add strcharlen() which ignores composing characters.

https://github.com/vim/vim/commit/70ce8a1561c5396e4c4381f76a005cbb97646f80

Use docs from latest Vim instead.

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt | 20 +++++++++++++++++++-
 runtime/doc/usr_41.txt  |  3 ++-
 2 files changed, 21 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index e7e44374c6..3c77d53bb1 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -466,10 +466,11 @@ str2list({expr} [, {utf8}])	List	convert each character of {expr} to
 					ASCII/UTF-8 value
 str2nr({expr} [, {base} [, {quoted}]])
 				Number	convert String to Number
+strcharlen({expr})		Number	character length of the String {expr}
 strcharpart({str}, {start} [, {len}])
 				String	{len} characters of {str} at
 					character {start}
-strchars({expr} [, {skipcc}])	Number	character length of the String {expr}
+strchars({expr} [, {skipcc}])	Number	character count of the String {expr}
 strdisplaywidth({expr} [, {col}]) Number display length of the String {expr}
 strftime({format} [, {time}])	String	format time with a specified format
 strgetchar({str}, {index})	Number	get char {index} from {str}
@@ -7836,6 +7837,21 @@ str2nr({string} [, {base}])			*str2nr()*
 		Can also be used as a |method|: >
 			GetText()->str2nr()
 
+
+strcharlen({string})					*strcharlen()*
+		The result is a Number, which is the number of characters
+		in String {string}.  Composing characters are ignored.
+		|strchars()| can count the number of characters, counting
+		composing characters separately.
+
+		Returns 0 if {string} is empty or on error.
+
+		Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
+
+		Can also be used as a |method|: >
+			GetText()->strcharlen()
+
+
 strcharpart({src}, {start} [, {len}])			*strcharpart()*
 		Like |strpart()| but using character index and length instead
 		of byte index and length.  Composing characters are counted
@@ -7850,12 +7866,14 @@ strcharpart({src}, {start} [, {len}])			*strcharpart()*
 		Can also be used as a |method|: >
 			GetText()->strcharpart(5)
 
+
 strchars({string} [, {skipcc}])					*strchars()*
 		The result is a Number, which is the number of characters
 		in String {string}.
 		When {skipcc} is omitted or zero, composing characters are
 		counted separately.
 		When {skipcc} set to 1, Composing characters are ignored.
+		|strcharlen()| always does this.
 
 		Returns zero on error.
 
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 8abc5bdf06..067ad6648c 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -619,7 +619,8 @@ String manipulation:					*string-functions*
 	stridx()		first index of a short string in a long string
 	strridx()		last index of a short string in a long string
 	strlen()		length of a string in bytes
-	strchars()		length of a string in characters
+	strcharlen()		length of a string in characters
+	strchars()		number of characters in a string
 	strwidth()		size of string when displayed
 	strdisplaywidth()	size of string when displayed, deals with tabs
 	setcellwidths()		set character cell width overrides
-- 
cgit 


From 8e868d699a9d0b68342d8d460a8f6dd9c075d7a8 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 22 Oct 2022 09:32:01 +0800
Subject: vim-patch:8.2.4679: cannot have expandcmd() give an error message for
 mistakes

Problem:    Cannot have expandcmd() give an error message for mistakes.
Solution:   Add an optional argument to give errors. Fix memory leak when
            expanding files fails. (Yegappan Lakshmanan, closes vim/vim#10071)
https://github.com/vim/vim/commit/2b74b6805b5c8c4836b66df5d949f5ff6a77f8c7

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/builtin.txt | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 3c77d53bb1..11352bb0c8 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -134,7 +134,8 @@ exists({expr})			Number	|TRUE| if {expr} exists
 exp({expr})			Float	exponential of {expr}
 expand({expr} [, {nosuf} [, {list}]])
 				any	expand special keywords in {expr}
-expandcmd({expr})		String	expand {expr} like with `:edit`
+expandcmd({string} [, {options}])
+				String	expand {string} like with `:edit`
 extend({expr1}, {expr2} [, {expr3}])
 				List/Dict insert items of {expr2} into {expr1}
 feedkeys({string} [, {mode}])	Number	add key sequence to typeahead buffer
@@ -2044,18 +2045,27 @@ expand({string} [, {nosuf} [, {list}]])				*expand()*
 		Can also be used as a |method|: >
 			Getpattern()->expand()
 
-expandcmd({string})					*expandcmd()*
+expandcmd({string} [, {options}])			*expandcmd()*
 		Expand special items in String {string} like what is done for
 		an Ex command such as `:edit`.  This expands special keywords,
 		like with |expand()|, and environment variables, anywhere in
 		{string}.  "~user" and "~/path" are only expanded at the
 		start.
+
+		The following items are supported in the {options} Dict
+		argument:
+		    errmsg	If set to TRUE, error messages are displayed
+				if an error is encountered during expansion.
+				By default, error messages are not displayed.
+
 		Returns the expanded string.  If an error is encountered
 		during expansion, the unmodified {string} is returned.
+
 		Example: >
 			:echo expandcmd('make %<.o')
-<			make /path/runtime/doc/builtin.o ~
-
+			make /path/runtime/doc/builtin.o
+			:echo expandcmd('make %<.o', {'errmsg': v:true})
+<
 		Can also be used as a |method|: >
 			GetCommand()->expandcmd()
 <
-- 
cgit 


From b92ed35a0bb873589bba9b51fdb92ffd00dc3e57 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Fri, 1 Apr 2022 18:12:55 +0800
Subject: vim-patch:8.2.4093: cached breakindent values not initialized
 properly

Problem:    Cached breakindent values not initialized properly.
Solution:   Initialize and cache formatlistpat. (Christian Brabandt,
            closes vim/vim#9526, closes vim/vim#9512)
https://github.com/vim/vim/commit/c53b467473160b5cfce77277fbae414bf43e66ce

Co-authored-by: Christian Brabandt 
---
 runtime/doc/options.txt | 1 +
 1 file changed, 1 insertion(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 285e596152..d14bb275d2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1053,6 +1053,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 			    text should normally be narrower. This prevents
 			    text indented almost to the right window border
 			    occupying lot of vertical space when broken.
+			    (default: 20)
 		shift:{n}   After applying 'breakindent', the wrapped line's
 			    beginning will be shifted by the given number of
 			    characters.  It permits dynamic French paragraph
-- 
cgit 


From e0ec83a9701ffd9b30a41763ad2e2326d85d8480 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 19:19:55 +0800
Subject: vim-patch:8.2.4882: cannot make 'breakindent' use a specific column

Problem:    Cannot make 'breakindent' use a specific column.
Solution:   Add the "column" entry in 'breakindentopt'. (Christian Brabandt,
            closes vim/vim#10362, closes vim/vim#10325)

https://github.com/vim/vim/commit/e7d6dbc5721342e3d6b04cf285e4510b5569e707

Co-authored-by: Christian Brabandt 
---
 runtime/doc/options.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index d14bb275d2..818c6d0115 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1059,14 +1059,20 @@ A jump table for the options with a short description can be found at |Q_op|.
 			    characters.  It permits dynamic French paragraph
 			    indentation (negative) or emphasizing the line
 			    continuation (positive).
+			    (default: 0)
 		sbr	    Display the 'showbreak' value before applying the
 			    additional indent.
+			    (default: off)
 		list:{n}    Adds an additional indent for lines that match a
 			    numbered or bulleted list (using the
 			    'formatlistpat' setting).
 		list:-1	    Uses the length of a match with 'formatlistpat'
 			    for indentation.
-	The default value for min is 20, shift and list is 0.
+			    (default: 0)
+		column:{n}  Indent at column {n}. Will overrule the other
+			    sub-options. Note: an additional indent may be
+			    added for the 'showbreak' setting.
+			    (default: off)
 
 						*'browsedir'* *'bsdir'*
 'browsedir' 'bsdir'	string	(default: "last")
-- 
cgit 


From 5b8d8a4c9925526fd34d2187b1bd3efe18792792 Mon Sep 17 00:00:00 2001
From: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date: Sat, 5 Nov 2022 16:48:13 -0600
Subject: docs(news): add news blurb for tmux clipboard change (#20950)

---
 runtime/doc/news.txt | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 9bf4b49419..5f29fa8da9 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,8 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• When using Nvim inside tmux 3.2 or later, the default clipboard provider
+  will now copy to the system clipboard. |provider-clipboard|
 • 'splitkeep' option to control the scroll behavior of horizontal splits.
 • |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
 
-- 
cgit 


From 1af4bd04f9ad157edbfea30642250e854c5cb5d2 Mon Sep 17 00:00:00 2001
From: Raphael 
Date: Sun, 6 Nov 2022 18:59:43 +0800
Subject: feat(ui): add support to display a title in the border of a float
 (#20184)

add "title" and "title_pos" keys to win config dict.
---
 runtime/doc/api.txt | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 8928650a39..e2a5291f7f 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3068,6 +3068,11 @@ nvim_open_win({buffer}, {enter}, {*config})                  *nvim_open_win()*
                       specified by character: [ {"+", "MyCorner"}, {"x",
                       "MyBorder"} ].
 
+                  • title: Title (optional) in window border, String or list.
+                    List is [text, highlight] tuples. if is string the default
+                    highlight group is `FloatBorderTitle`.
+                  • title_pos: Title position must set with title option.
+                    value can be of `left` `center` `right` default is left.
                   • noautocmd: If true then no buffer-related autocommand
                     events such as |BufEnter|, |BufLeave| or |BufWinEnter| may
                     fire from calling this function.
-- 
cgit 


From 900dd2bdab85b25237cec638265d44c2174154ed Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 20 Aug 2022 08:27:10 +0800
Subject: vim-patch:8.2.3665: cannot use a lambda for 'tagfunc'

Problem:    Cannot use a lambda for 'tagfunc'.
Solution:   Use 'tagfunc' like 'opfunc'. (Yegappan Lakshmanan, closes vim/vim#9204)
https://github.com/vim/vim/commit/19916a8c8920b6a1fd737ffa6d4e363fc7a96319

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/options.txt | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 818c6d0115..883585116d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -318,9 +318,9 @@ Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
 or a function reference or a lambda function.  Examples:
 >
 	set opfunc=MyOpFunc
-	set opfunc=function("MyOpFunc")
-	set opfunc=funcref("MyOpFunc")
-	set opfunc={t\ ->\ MyOpFunc(t)}
+	set opfunc=function('MyOpFunc')
+	set opfunc=funcref('MyOpFunc')
+	let &opfunc = "{t -> MyOpFunc(t)}"
 <
 
 Setting the filetype
@@ -6443,7 +6443,9 @@ A jump table for the options with a short description can be found at |Q_op|.
 	This option specifies a function to be used to perform tag searches.
 	The function gets the tag pattern and should return a List of matching
 	tags.  See |tag-function| for an explanation of how to write the
-	function and an example.
+	function and an example.  The value can be the name of a function, a
+	|lambda| or a |Funcref|. See |option-value-function| for more
+	information.
 
 						*'taglength'* *'tl'*
 'taglength' 'tl'	number	(default 0)
-- 
cgit 


From 1508618d4c35dafee2b82726d2d27fae4e314386 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 20 Aug 2022 09:35:09 +0800
Subject: vim-patch:8.2.3712: cannot use Vim9 lambda for 'tagfunc'

Problem:    Cannot use Vim9 lambda for 'tagfunc'.
Solution:   Make it work, add more tests. (Yegappan Lakshmanan, closes vim/vim#9250)
https://github.com/vim/vim/commit/05e59e3a9ffddbf93c7af02cd2ba1d0f822d4625

Omit Vim9 script in code and comment out in tests.

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/options.txt | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 883585116d..a14dc1b99e 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -320,7 +320,15 @@ or a function reference or a lambda function.  Examples:
 	set opfunc=MyOpFunc
 	set opfunc=function('MyOpFunc')
 	set opfunc=funcref('MyOpFunc')
-	let &opfunc = "{t -> MyOpFunc(t)}"
+	set opfunc={a\ ->\ MyOpFunc(a)}
+	" set using a funcref variable
+	let Fn = function('MyTagFunc')
+	let &tagfunc = string(Fn)
+	" set using a lambda expression
+	let &tagfunc = "{t -> MyTagFunc(t)}"
+	" set using a variable with lambda expression
+	let L = {a, b, c -> MyTagFunc(a, b , c)}
+	let &tagfunc = string(L)
 <
 
 Setting the filetype
-- 
cgit 


From 1e4adf4b56cb7a360d16c4d04290c50ae7e80fbc Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 20 Aug 2022 08:45:15 +0800
Subject: vim-patch:8.2.3725: cannot use a lambda for 'completefunc' and
 'omnifunc'

Problem:    Cannot use a lambda for 'completefunc' and 'omnifunc'.
Solution:   Implement lambda support. (Yegappan Lakshmanan, closes vim/vim#9257)
https://github.com/vim/vim/commit/8658c759f05b317707d56e3b65a5ef63930c7498

Comment out Vim9 script in tests.

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/options.txt | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index a14dc1b99e..37f8ea4b20 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -314,8 +314,8 @@ Note: In the future more global options can be made |global-local|.  Using
 
 						*option-value-function*
 Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
-'operatorfunc', 'quickfixtextfunc' and 'tagfunc') are set to a function name
-or a function reference or a lambda function.  Examples:
+'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to
+a function name or a function reference or a lambda function.  Examples:
 >
 	set opfunc=MyOpFunc
 	set opfunc=function('MyOpFunc')
@@ -1454,7 +1454,9 @@ A jump table for the options with a short description can be found at |Q_op|.
 	This option specifies a function to be used for Insert mode completion
 	with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U|
 	See |complete-functions| for an explanation of how the function is
-	invoked and what it should return.
+	invoked and what it should return.  The value can be the name of a
+	function, a |lambda| or a |Funcref|. See |option-value-function| for
+	more information.
 	This option cannot be set from a |modeline| or in the |sandbox|, for
 	security reasons.
 
@@ -4421,7 +4423,9 @@ A jump table for the options with a short description can be found at |Q_op|.
 	This option specifies a function to be used for Insert mode omni
 	completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
 	See |complete-functions| for an explanation of how the function is
-	invoked and what it should return.
+	invoked and what it should return.  The value can be the name of a
+	function, a |lambda| or a |Funcref|. See |option-value-function| for
+	more information.
 	This option is usually set by a filetype plugin:
 	|:filetype-plugin-on|
 	This option cannot be set from a |modeline| or in the |sandbox|, for
@@ -6576,6 +6580,8 @@ A jump table for the options with a short description can be found at |Q_op|.
 			global or local to buffer |global-local|
 	This option specifies a function to be used for thesaurus completion
 	with CTRL-X CTRL-T. |i_CTRL-X_CTRL-T| See |compl-thesaurusfunc|.
+	The value can be the name of a function, a |lambda| or a |Funcref|.
+	See |option-value-function| for more information.
 
 	This option cannot be set from a |modeline| or in the |sandbox|, for
 	security reasons.
-- 
cgit 


From 84881674fd702cad5b7572ac868f6d40965a2806 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 5 Nov 2022 17:01:39 +0800
Subject: vim-patch:9.0.0389: crash when 'tagfunc' closes the window

Problem:    Crash when 'tagfunc' closes the window.
Solution:   Bail out when the window was closed.

https://github.com/vim/vim/commit/ccfde4d028e891a41e3548323c3d47b06fb0b83e

Add docs for E1299 from Vim runtime.

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/tagsrch.txt | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index d079db0717..aab6f78315 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -909,6 +909,8 @@ If the function returns |v:null| instead of a List, a standard tag lookup will
 be performed instead.
 
 It is not allowed to change the tagstack from inside 'tagfunc'.  *E986* 
+It is not allowed to close a window or change window from inside 'tagfunc'.
+*E1299*
 
 The following is a hypothetical example of a function used for 'tagfunc'.  It
 uses the output of |taglist()| to generate the result: a list of tags in the
-- 
cgit 


From 4fd876271a8bc3349fccb14d2e0203af1f9e6698 Mon Sep 17 00:00:00 2001
From: Shougo 
Date: Mon, 7 Nov 2022 12:02:29 +0900
Subject: vim-patch:9.0.0756 #20680

Problem:    No autocmd event for changing text in a terminal window.
Solution:   Add TextChangedT. (Shougo Matsushita, closes vim/vim#11366)

https://github.com/vim/vim/commit/4ccaedfcd7526983f4b6b3b06b0bfb54f333f1f3
---
 runtime/doc/autocmd.txt | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index da41c92df6..c30c190301 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -996,6 +996,10 @@ TextChangedP			After a change was made to the text in the
 				current buffer in Insert mode, only when the
 				popup menu is visible.  Otherwise the same as
 				TextChanged.
+							*TextChangedT*
+TextChangedT			After a change was made to the text in the
+				current buffer in |Terminal-mode|.  Otherwise
+				the same as TextChanged.
 							*TextYankPost*
 TextYankPost			Just after a |yank| or |deleting| command, but not
 				if the black hole register |quote_| is used nor
-- 
cgit 


From d337814906b1377e34aa2c2dfd8aa16285328692 Mon Sep 17 00:00:00 2001
From: Victor Blanchard <48864055+Viblanc@users.noreply.github.com>
Date: Mon, 7 Nov 2022 04:31:50 +0100
Subject: feat: ":write ++p" creates parent dirs #20835
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if
   they do not exist
    - Note: `:foo ++…` is usually for options. No existing options have
      a single-char abbreviation (presumably by design), so it's safe to
      special-case `++p` here.
- Same for `writefile(…, 'foo/bar/baz.txt', 'p')`
- `BufWriteCmd` can see the ++p flag via `v:cmdarg`.

closes #19884
---
 runtime/doc/editing.txt | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 58a5cbc60c..76c528ef3c 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -438,6 +438,8 @@ Where {optname} is one of:	    *++ff* *++enc* *++bin* *++nobin* *++edit*
     bad			    specifies behavior for bad characters
     edit		    for |:read| only: keep option values as if editing
 			    a file
+    p			    creates the parent directory (or directories) of
+			    a filename if they do not exist
 
 {value} cannot contain white space.  It can be any valid value for these
 options.  Examples: >
-- 
cgit 


From 42e44d6d334bda8b97afe9e34a819ab293e5e10a Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Mon, 7 Nov 2022 10:26:54 +0800
Subject: vim-patch:8.2.3751: cannot assign a lambda to an option that takes a
 function

Problem:    Cannot assign a lambda to an option that takes a function.
Solution:   Automatically convert the lambda to a string. (Yegappan
            Lakshmanan, closes vim/vim#9286)

https://github.com/vim/vim/commit/6409553b6e3b4de4e1d72b8ee5445595214581ff

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/options.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 37f8ea4b20..b18d40e56f 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -315,7 +315,8 @@ Note: In the future more global options can be made |global-local|.  Using
 						*option-value-function*
 Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
 'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to
-a function name or a function reference or a lambda function.  Examples:
+a function name or a function reference or a lambda function.  When using a
+lambda it will be converted to the name, e.g. "123".  Examples:
 >
 	set opfunc=MyOpFunc
 	set opfunc=function('MyOpFunc')
@@ -325,10 +326,10 @@ a function name or a function reference or a lambda function.  Examples:
 	let Fn = function('MyTagFunc')
 	let &tagfunc = string(Fn)
 	" set using a lambda expression
-	let &tagfunc = "{t -> MyTagFunc(t)}"
+	let &tagfunc = {t -> MyTagFunc(t)}
 	" set using a variable with lambda expression
 	let L = {a, b, c -> MyTagFunc(a, b , c)}
-	let &tagfunc = string(L)
+	let &tagfunc = L
 <
 
 Setting the filetype
-- 
cgit 


From 2ed2c04aa518fb2591497e9a5ebe9cc32d8894a8 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Mon, 7 Nov 2022 12:12:04 +0800
Subject: docs(options): remove mentions of 'imactivatefunc' and 'imstatusfunc'

---
 runtime/doc/options.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index b18d40e56f..4a277c146f 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -313,10 +313,10 @@ Note: In the future more global options can be made |global-local|.  Using
 
 
 						*option-value-function*
-Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
-'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to
-a function name or a function reference or a lambda function.  When using a
-lambda it will be converted to the name, e.g. "123".  Examples:
+Some options ('completefunc', 'omnifunc', 'operatorfunc', 'quickfixtextfunc',
+'tagfunc' and 'thesaurusfunc') are set to a function name or a function
+reference or a lambda function.  When using a lambda it will be converted to
+the name, e.g. "123".  Examples:
 >
 	set opfunc=MyOpFunc
 	set opfunc=function('MyOpFunc')
-- 
cgit 


From 31ffc360f2a4aab469a95a55c532f376443bd5fe Mon Sep 17 00:00:00 2001
From: Lewis Russell 
Date: Mon, 7 Nov 2022 10:22:16 +0000
Subject: docs(news): add linematch (#20927)

---
 runtime/doc/news.txt     | 8 ++++++++
 runtime/doc/vim_diff.txt | 1 +
 2 files changed, 9 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 5f29fa8da9..d339df8479 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -41,9 +41,17 @@ The following new APIs or features were added.
 
 • When using Nvim inside tmux 3.2 or later, the default clipboard provider
   will now copy to the system clipboard. |provider-clipboard|
+
 • 'splitkeep' option to control the scroll behavior of horizontal splits.
+
 • |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
 
+• |'diffopt'| now includes a `linematch` option to enable a second-stage diff
+  on individual hunks to provide much more accurate diffs. This option is also
+  available to |vim.diff()|
+
+  See https://github.com/neovim/neovim/pull/14537.
+
 ==============================================================================
 CHANGED FEATURES                                                 *news-changes*
 
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index da2b5e2466..fe6c28c809 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -267,6 +267,7 @@ Options:
   'tabline'     %@Func@foo%X can call any function on mouse-click
   'winblend'    pseudo-transparency in floating windows |api-floatwin|
   'winhighlight' window-local highlights
+  'diffopt'     has the option `linematch`.
 
 Signs:
   Signs are removed if the associated line is deleted.
-- 
cgit 


From 3435cdfb94b6f3c72e7f0f16fef9ff2660377cb2 Mon Sep 17 00:00:00 2001
From: Raphael 
Date: Mon, 7 Nov 2022 20:02:00 +0800
Subject: refactor(highlight): rename FloatBorderTitle #20988

requested in https://github.com/neovim/neovim/pull/20184
---
 runtime/doc/api.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index e2a5291f7f..f95fd0d36c 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3070,7 +3070,7 @@ nvim_open_win({buffer}, {enter}, {*config})                  *nvim_open_win()*
 
                   • title: Title (optional) in window border, String or list.
                     List is [text, highlight] tuples. if is string the default
-                    highlight group is `FloatBorderTitle`.
+                    highlight group is `FloatTitle`.
                   • title_pos: Title position must set with title option.
                     value can be of `left` `center` `right` default is left.
                   • noautocmd: If true then no buffer-related autocommand
-- 
cgit 


From c022140ec6a66402e405152054b6ab0141940419 Mon Sep 17 00:00:00 2001
From: Famiu Haque 
Date: Mon, 7 Nov 2022 22:27:37 +0600
Subject: feat(api): add command name to Lua command callback opts

Adds a `name` key to the opts dict passed to Lua command callbacks
created using `nvim_create_user_command()`. This is useful for when
multiple commands use the same callback.

Note that this kind of behavior is not as strange as one might think,
even some internal Neovim commands reuse the same internal C function,
differing their behavior by checking the command name. `substitute`,
`smagic` and `snomagic` are examples of that.

This will also be useful for generalized Lua command preview functions
that can preview a wide range of commands, in which case knowing the
command name is necessary for the preview function to actually be able
to execute the command that it's supposed to preview.
---
 runtime/doc/api.txt | 1 +
 1 file changed, 1 insertion(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index e2a5291f7f..0587ee25ed 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -1757,6 +1757,7 @@ nvim_create_user_command({name}, {command}, {*opts})
                    executed. When called from Lua, the command can also be a
                    Lua function. The function is called with a single table
                    argument that contains the following keys:
+                   • name: (string) Command name
                    • args: (string) The args passed to the command, if any
                      ||
                    • fargs: (table) The args split by unescaped whitespace
-- 
cgit 


From 59ff4691f67fc1ddd3d1b7240a2f2eb095e58281 Mon Sep 17 00:00:00 2001
From: Jongwook Choi 
Date: Mon, 7 Nov 2022 19:15:15 -0500
Subject: fix(vim.ui.input): return empty string when inputs nothing (#20883)

fix(vim.ui.input): return empty string when inputs nothing

The previous behavior of `vim.ui.input()` when typing  with
no text input (with an intention of having the empty string as input)
was to execute `on_confirm(nil)`, conflicting with its documentation.

Inputting an empty string should now correctly execute `on_confirm('')`.
This should be clearly distinguished from cancelling or aborting the
input UI, in which case `on_confirm(nil)` is executed as before.
---
 runtime/doc/lua.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index c4e139bca7..cab2f49d94 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1979,7 +1979,8 @@ input({opts}, {on_confirm})                                   *vim.ui.input()*
                         highlighting user inputs.
       • {on_confirm}  (function) ((input|nil) -> ()) Called once the user
                       confirms or abort the input. `input` is what the user
-                      typed. `nil` if the user aborted the dialog.
+                      typed (it might be an empty string if nothing was
+                      entered), or `nil` if the user aborted the dialog.
 
 select({items}, {opts}, {on_choice})                         *vim.ui.select()*
     Prompts the user to pick a single item from a collection of entries
-- 
cgit 


From a122406be48a7a9216eb9afd0fe71ca37e340c30 Mon Sep 17 00:00:00 2001
From: Eduard Baturin 
Date: Thu, 10 Nov 2022 01:34:02 +0300
Subject: docs: swap CursorLineFold and CursorLineSign (#20875)

---
 runtime/doc/syntax.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 693e78cf9c..033a01ac98 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -5201,10 +5201,10 @@ LineNrBelow	Line number for when the 'relativenumber'
 							*hl-CursorLineNr*
 CursorLineNr	Like LineNr when 'cursorline' is set and 'cursorlineopt'
 		contains "number" or is "both", for the cursor line.
-							*hl-CursorLineSign*
-CursorLineSign	Like SignColumn when 'cursorline' is set for the cursor line.
 							*hl-CursorLineFold*
 CursorLineFold	Like FoldColumn when 'cursorline' is set for the cursor line.
+							*hl-CursorLineSign*
+CursorLineSign	Like SignColumn when 'cursorline' is set for the cursor line.
 							*hl-MatchParen*
 MatchParen	Character under the cursor or just before it, if it
 		is a paired bracket, and its match. |pi_paren.txt|
-- 
cgit 


From 61d152779d9e84b52fc85d24cea51ad04284054d Mon Sep 17 00:00:00 2001
From: James Trew <66286082+jamestrew@users.noreply.github.com>
Date: Thu, 10 Nov 2022 08:12:28 +0000
Subject: docs(treesitter): fix predicate syntax (#21016)

---
 runtime/doc/treesitter.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 31ee7c31c8..992e5ebe69 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -239,7 +239,7 @@ The following predicates are built in:
     `contains?`                                *treesitter-predicate-contains?*
         Match a string against parts of the text corresponding to a node: >
             ((identifier) @foo (#contains? @foo "foo"))
-            ((identifier) @foo-bar (#contains @foo-bar "foo" "bar"))
+            ((identifier) @foo-bar (#contains? @foo-bar "foo" "bar"))
 <
     `any-of?`                                    *treesitter-predicate-any-of?*
         Match any of the given strings against the text corresponding to
-- 
cgit 


From befae73044fa367c6d0d82bf4b61501010e7545d Mon Sep 17 00:00:00 2001
From: Sean Dewar 
Date: Thu, 10 Nov 2022 09:05:25 +0000
Subject: vim-patch:76db9e076318 (#21013)

Update runtime files

https://github.com/vim/vim/commit/76db9e076318cb0ae846f43b7549ad4f2d234c0b

- `col()`'s example was changed to use `:echowin` so that the message can be
  seen with `showmode`. Use "\n" to force a hit-enter instead as `:echowin`
  isn't ported.
- Replace interpolated string usage in syntax/modula3.vim (not ported).
- Add a space after the `wincmd =` examples in `*CTRL-W_=*` so that the inlined
  code is highlighted properly when followed by a full stop.

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt  | 9 ++++++---
 runtime/doc/cmdline.txt  | 2 +-
 runtime/doc/eval.txt     | 2 +-
 runtime/doc/filetype.txt | 2 +-
 runtime/doc/pi_tar.txt   | 4 ++--
 runtime/doc/spell.txt    | 4 ++--
 runtime/doc/usr_03.txt   | 2 +-
 runtime/doc/visual.txt   | 6 +++---
 runtime/doc/windows.txt  | 4 ++--
 9 files changed, 19 insertions(+), 16 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 11352bb0c8..50faa612b3 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -920,7 +920,8 @@ bufwinid({buf})						*bufwinid()*
 
 	echo "A window containing buffer 1 is " .. (bufwinid(1))
 <
-		Only deals with the current tab page.
+		Only deals with the current tab page.  See |win_findbuf()| for
+		finding more.
 
 		Can also be used as a |method|: >
 			FindBuffer()->bufwinid()
@@ -1204,7 +1205,7 @@ col({expr})	The result is a Number, which is the byte index of the column
 		column is one higher if the cursor is after the end of the
 		line.  Also, when using a  mapping the cursor isn't
 		moved, this can be used to obtain the column in Insert mode: >
-			:imap  echo col(".")
+			:imap  echo col(".").."\n"
 
 <		Can also be used as a |method|: >
 			GetPos()->col()
@@ -2291,7 +2292,7 @@ flatten({list} [, {maxdepth}])					*flatten()*
 float2nr({expr})					*float2nr()*
 		Convert {expr} to a Number by omitting the part after the
 		decimal point.
-		{expr} must evaluate to a |Float| or a Number.
+		{expr} must evaluate to a |Float| or a |Number|.
 		Returns 0 if {expr} is not a |Float| or a |Number|.
 		When the value of {expr} is out of range for a |Number| the
 		result is truncated to 0x7fffffff or -0x7fffffff (or when
@@ -9034,6 +9035,7 @@ win_move_separator({nr}, {offset})			*win_move_separator()*
 		FALSE otherwise.
 		This will fail for the rightmost window and a full-width
 		window, since it has no separator on the right.
+		Only works for the current tab page. *E1308*
 
 		Can also be used as a |method|: >
 			GetWinnr()->win_move_separator(offset)
@@ -9048,6 +9050,7 @@ win_move_statusline({nr}, {offset})			*win_move_statusline()*
 		movement may be smaller than specified (e.g., as a consequence
 		of maintaining 'winminheight'). Returns TRUE if the window can
 		be found and FALSE otherwise.
+		Only works for the current tab page.
 
 		Can also be used as a |method|: >
 			GetWinnr()->win_move_statusline(offset)
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index a6458adb77..c7ffa920b6 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -758,7 +758,7 @@ always be swapped then.
 
 Count and Range						*N:*
 
-When giving a count before entering ":", this is translated into:
+When giving a count before entering ":", this is translated into: >
 		:.,.+(count - 1)
 In words: The "count" lines at and after the cursor.  Example: To delete
 three lines: >
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index a28fa529b9..4446598a2e 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -3177,7 +3177,7 @@ this pending exception or command is discarded.
 For examples see |throw-catch| and |try-finally|.
 
 
-NESTING	OF TRY CONDITIONALS				*try-nesting*
+NESTING OF TRY CONDITIONALS				*try-nesting*
 
 Try conditionals can be nested arbitrarily.  That is, a complete try
 conditional can be put into the try block, a catch clause, or the finally
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 8de91ed3ae..a53c287d48 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -534,7 +534,7 @@ used.
 For example, to set the dialect to a default of "fblite" but still allow for
 any #lang directive overrides, use the following command: >
 
-     let g:freebasic_lang = "fblite"
+	let g:freebasic_lang = "fblite"
 
 
 GIT COMMIT                                              *ft-gitcommit-plugin*
diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt
index 0b2ab1690b..2230b82dec 100644
--- a/runtime/doc/pi_tar.txt
+++ b/runtime/doc/pi_tar.txt
@@ -82,7 +82,7 @@ Copyright 2005-2017:					*tar-copyright*
    <.vimrc> file.
 			 Default
    Variable		  Value   Explanation
-   *g:tar_browseoptions*  "Ptf"   used to get a list of contents
+   *g:tar_browseoptions*    "Ptf"   used to get a list of contents
    *g:tar_readoptions*	  "OPxf"  used to extract a file from a tarball
    *g:tar_cmd*		  "tar"   the name of the tar program
    *g:tar_nomax*	    0	  if true, file window will not be maximized
@@ -98,7 +98,7 @@ Copyright 2005-2017:					*tar-copyright*
 					"-"
 				  Not all tar's support the "--" which is why
 				  it isn't default.
-   *g:tar_writeoptions*   "uf"    used to update/replace a file
+   *g:tar_writeoptions*	  "uf"    used to update/replace a file
 
 
 ==============================================================================
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 74ec035316..98a6af1b8b 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -992,8 +992,8 @@ Note: even when using "num" or "long" the number of flags available to
 compounding and prefixes is limited to about 250.
 
 
-AFFIXES
-					    *spell-PFX* *spell-SFX*
+AFFIXES						*spell-PFX* *spell-SFX*
+
 The usual PFX (prefix) and SFX (suffix) lines are supported (see the Myspell
 documentation or the Aspell manual:
 http://aspell.net/man-html/Affix-Compression.html).
diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt
index 74674fdb42..2b0d40ba32 100644
--- a/runtime/doc/usr_03.txt
+++ b/runtime/doc/usr_03.txt
@@ -224,7 +224,7 @@ you can see?  This figure shows the three commands you can use:
 			+---------------------------+
 
 Hints: "H" stands for Home, "M" for Middle and "L" for Last.  Alternatively,
-"H" for high, "M" for Middle and "L" for low.
+"H" for High, "M" for Middle and "L" for Low.
 
 ==============================================================================
 *03.6*	Telling where you are
diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt
index 5383ea4f72..0c6bd4f3a1 100644
--- a/runtime/doc/visual.txt
+++ b/runtime/doc/visual.txt
@@ -103,7 +103,7 @@ gn			Search forward for the last used search pattern, like
 			E.g., "dgn" deletes the text of the next match.
 			If Visual mode is active, extends the selection
 			until the end of the next match.
-			'wrapscan' applies
+			'wrapscan' applies.
 			Note: Unlike `n` the search direction does not depend
 			on the previous search command.
 
@@ -501,11 +501,11 @@ mode Vim automatically switches to Visual mode, so that the same behavior as
 in Visual mode is effective.  If you don't want this use |:xmap| or |:smap|.
 
 One particular edge case: >
-  	:vnoremap  
+	:vnoremap  
 This ends Visual mode when in Visual mode, but in Select mode it does not
 work, because Select mode is restored after executing the mapped keys.  You
 need to use: >
-  	:snoremap  
+	:snoremap  
 <
 Users will expect printable characters to replace the selected area.
 Therefore avoid mapping printable characters in Select mode.  Or use
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 45cedd2cd8..dfc2fb5abf 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -537,9 +537,9 @@ CTRL-W =	Make all windows (almost) equally high and wide, but use
 		Windows with 'winfixheight' set keep their height and windows
 		with 'winfixwidth' set keep their width.
 		To equalize only vertically (make window equally high) use
-		`vertical wincmd =`
+		`vertical wincmd =` .
 		To equalize only horizontally (make window equally wide) use
-		`horizontal wincmd =`
+		`horizontal wincmd =` .
 
 :res[ize] -N					*:res* *:resize* *CTRL-W_-*
 CTRL-W -	Decrease current window height by N (default 1).
-- 
cgit 


From eee956051637a5dff02ba6c6083fbffc87c0c96e Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 12 Nov 2022 07:43:36 +0800
Subject: vim-patch:9.0.0861: solution for "!!sort" in closed fold is not
 optimal (#21027)

Problem:    Solution for "!!sort" in closed fold is not optimal.
Solution:   Use a different range instead of the subtle difference in handling
            a range with an offset. (issue vim/vim#11487)

https://github.com/vim/vim/commit/9954dc39ea090cee6bf41c888c41e60d9f52c3b8

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/cmdline.txt | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index c7ffa920b6..b4923b0d70 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -690,7 +690,9 @@ Line numbers may be specified with:		*:range* *{address}*
 	'T		position of mark T (uppercase); when the mark is in
 			another file it cannot be used in a range
 	/{pattern}[/]	the next line where {pattern} matches	  *:/*
+				also see |:range-pattern| below
 	?{pattern}[?]	the previous line where {pattern} matches *:?*
+				also see |:range-pattern| below
 	\/		the next line where the previously used search
 			pattern matches
 	\?		the previous line where the previously used search
@@ -698,11 +700,49 @@ Line numbers may be specified with:		*:range* *{address}*
 	\&		the next line where the previously used substitute
 			pattern matches
 
+						*:range-offset*
 Each may be followed (several times) by '+' or '-' and an optional number.
 This number is added or subtracted from the preceding line number.  If the
 number is omitted, 1 is used.  If there is nothing before the '+' or '-' then
 the current line is used.
-
+						*:range-closed-fold*
+When a line number after the comma is in a closed fold it is adjusted to the
+last line of the fold, thus the whole fold is included.
+
+When a number is added this is done after the adjustment to the last line of
+the fold.  This means these lines are additionally included in the range.  For
+example: >
+   :3,4+2print
+On this text:
+	1 one ~
+	2 two ~
+	3 three ~
+	4 four FOLDED ~
+	5 five FOLDED ~
+	6 six ~
+	7 seven ~
+	8 eight ~
+Where lines four and five are a closed fold, ends up printing lines 3 to 7.
+The 7 comes from the "4" in the range, which is adjusted to the end of the
+closed fold, which is 5, and then the offset 2 is added.
+
+An example for subtracting (which isn't very useful): >
+   :2,4-1print
+On this text:
+	1 one ~
+	2 two ~
+	3 three FOLDED~
+	4 four FOLDED ~
+	5 five FOLDED ~
+	6 six FOLDED ~
+	7 seven ~
+	8 eight ~
+Where lines three to six are a closed fold, ends up printing lines 2 to 6.
+The 6 comes from the "4" in the range, which is adjusted to the end of the
+closed fold, which is 6, and then 1 is subtracted, then this is still in the
+closed fold and the last line of that fold is used, which is 6.
+
+							*:range-pattern*
 The "/" and "?" after {pattern} are required to separate the pattern from
 anything that follows.
 
-- 
cgit 


From 07eb4263caa671de63186e9bbd650ec4b1fbce1a Mon Sep 17 00:00:00 2001
From: Lewis Russell 
Date: Fri, 28 Oct 2022 13:09:22 +0100
Subject: feat(spell): support nospell in treesitter queries

---
 runtime/doc/treesitter.txt | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 992e5ebe69..d6cd370ec7 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -432,6 +432,9 @@ capture marks comments as to be checked: >
 
     (comment) @spell
 <
+
+There is also `@nospell` which disables spellchecking regions with `@spell`.
+
                                                 *treesitter-highlight-conceal*
 Treesitter highlighting supports |conceal| via the `conceal` metadata. By
 convention, nodes to be concealed are captured as `@conceal`, but any capture
-- 
cgit 


From 7abe8ef42267db861e84ce12023b296d49de6f25 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 12 Nov 2022 23:31:17 +0800
Subject: vim-patch:9.0.0862: default value of 'endoffile' is wrong (#21032)

Problem:    Default value of 'endoffile' is wrong.
Solution:   The default must be 'noendoffile'.

https://github.com/vim/vim/commit/0aad88f073602849d1623122eb3c323f8e252def

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/options.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 4a277c146f..fd76f11046 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2164,7 +2164,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	See 'fileencoding' to control file-content encoding.
 
 			*'endoffile'* *'eof'* *'noendoffile'* *'noeof'*
-'endoffile' 'eof'	boolean	(default on)
+'endoffile' 'eof'	boolean	(default off)
 			local to buffer
 	Indicates that a CTRL-Z character was found at the end of the file
 	when reading it.  Normally only happens when 'fileformat' is "dos".
-- 
cgit 


From 849394e4e26f487586761a3640475c27ceca30b9 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sun, 13 Nov 2022 08:29:05 +0800
Subject: vim-patch:9.0.0863: col() and charcol() only work for the current
 window (#21038)

Problem:    col() and charcol() only work for the current window.
Solution:   Add an optional winid argument. (Yegappan Lakshmanan,
            closes vim/vim#11466, closes vim/vim#11461)

https://github.com/vim/vim/commit/4c8d2f02b3ce037bbe1d5ee12887e343c6bde88f

Cherry-pick test_functions.vim change from patch 8.2.0633.

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/builtin.txt | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 50faa612b3..fa9fb286ae 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -78,13 +78,13 @@ chanclose({id} [, {stream}])	Number	Closes a channel or one of its streams
 chansend({id}, {data})		Number	Writes {data} to channel
 char2nr({expr} [, {utf8}])	Number	ASCII/UTF-8 value of first char in {expr}
 charclass({string})		Number	character class of {string}
-charcol({expr})			Number	column number of cursor or mark
+charcol({expr} [, {winid}])	Number	column number of cursor or mark
 charidx({string}, {idx} [, {countcc}])
 				Number	char index of byte {idx} in {string}
 chdir({dir})			String	change current working directory
 cindent({lnum})			Number	C indent for line {lnum}
 clearmatches([{win}])		none	clear all matches
-col({expr})			Number	column byte index of cursor or mark
+col({expr} [, {winid}])		Number	column byte index of cursor or mark
 complete({startcol}, {matches}) none	set Insert mode completion
 complete_add({expr})		Number	add completion match
 complete_check()		Number	check for key typed during completion
@@ -1089,8 +1089,8 @@ charclass({string})					*charclass()*
 		Returns 0 if {string} is not a |String|.
 
 
-							*charcol()*
-charcol({expr})	Same as |col()| but returns the character index of the column
+charcol({expr} [, {winid}])				*charcol()*
+		Same as |col()| but returns the character index of the column
 		position given with {expr} instead of the byte position.
 
 		Example:
@@ -1172,8 +1172,8 @@ clearmatches([{win}])					*clearmatches()*
 		Can also be used as a |method|: >
 			GetWin()->clearmatches()
 <
-							*col()*
-col({expr})	The result is a Number, which is the byte index of the column
+col({expr} [, {winid})					*col()*
+		The result is a Number, which is the byte index of the column
 		position given with {expr}.  The accepted positions are:
 		    .	    the cursor position
 		    $	    the end of the cursor line (the result is the
@@ -1188,6 +1188,8 @@ col({expr})	The result is a Number, which is the byte index of the column
 		and column number. Most useful when the column is "$", to get
 		the last column of a specific line.  When "lnum" or "col" is
 		out of range then col() returns zero.
+		With the optional {winid} argument the values are obtained for
+		that window instead of the current window.
 		To get the line number use |line()|.  To get both use
 		|getpos()|.
 		For the screen column position use |virtcol()|.  For the
@@ -1198,7 +1200,8 @@ col({expr})	The result is a Number, which is the byte index of the column
 			col("$")		length of cursor line plus one
 			col("'t")		column of mark t
 			col("'" .. markname)	column of mark markname
-<		The first column is 1.  Returns 0 if {expr} is invalid.
+<		The first column is 1.  Returns 0 if {expr} is invalid or when
+		the window with ID {winid} is not found.
 		For an uppercase mark the column may actually be in another
 		buffer.
 		For the cursor position, when 'virtualedit' is active, the
-- 
cgit 


From 2685d27cd65ea255f9bf1fce44a355e235016212 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 15 Nov 2022 07:23:57 +0800
Subject: vim-patch:9.0.0883: a silent mapping may cause dots on the command
 line (#21061)

Problem:    A silent mapping may cause dots on the command line.
Solution:   Don't show dots for completion if they are not going to be removed
            again. (closes vim/vim#11501)

https://github.com/vim/vim/commit/698a00f55d60043d51b1c98cbbf3f9fd10badd2f

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/map.txt | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 60cc915a4a..c4bacfd632 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -215,6 +215,9 @@ The search string will not be echoed when using this mapping.  Messages from
 the executed command are still given though.  To shut them up too, add a
 ":silent" in the executed command: >
 	:map  ,h :exe ":silent normal /Header\r"
+Note that the effect of a command might also be silenced, e.g., when the
+mapping selects another entry for command line completion it won't be
+displayed.
 Prompts will still be given, e.g., for inputdialog().
 Using "" for an abbreviation is possible, but will cause redrawing of
 the command line to fail.
-- 
cgit 


From 9d2a6cd11e092de838939ce993e8d18f5c9584b7 Mon Sep 17 00:00:00 2001
From: Jlll1 
Date: Tue, 15 Nov 2022 10:23:56 +0100
Subject: docs(treesitter): change links for `eq?` and `set!` to codeblocks 
 (#21047)

---
 runtime/doc/treesitter.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index d6cd370ec7..dfaff672e6 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -212,7 +212,7 @@ treesitter queries from Lua.
 TREESITTER QUERY PREDICATES                            *treesitter-predicates*
 
 Predicates are special scheme nodes that are evaluated to conditionally capture
-nodes. For example, the |eq?| predicate can be used as follows: >
+nodes. For example, the `eq?` predicate can be used as follows: >
 
     ((identifier) @foo (#eq? @foo "foo"))
 <
@@ -261,7 +261,7 @@ predicates.
 TREESITTER QUERY DIRECTIVES                            *treesitter-directives*
 
 Treesitter directives store metadata for a node or match and perform side
-effects. For example, the |set!| predicate sets metadata on the match or node: >
+effects. For example, the `set!` directive sets metadata on the match or node: >
 
         ((identifier) @foo (#set! "type" "parameter"))
 <
-- 
cgit 


From f1922e78a1df1b1d32779769432fb5586edf5fbb Mon Sep 17 00:00:00 2001
From: Gregory Anders 
Date: Sat, 5 Nov 2022 13:37:05 -0600
Subject: feat: add vim.secure.read()

This function accepts a path to a file and prompts the user if the file
is trusted. If the user confirms that the file is trusted, the contents
of the file are returned. The user's decision is stored in a trust
database at $XDG_STATE_HOME/nvim/trust. When this function is invoked
with a path that is already marked as trusted in the trust database, the
user is not prompted for a response.
---
 runtime/doc/lua.txt  | 16 ++++++++++++++++
 runtime/doc/news.txt |  3 +++
 2 files changed, 19 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index cab2f49d94..c5ede97725 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2354,4 +2354,20 @@ parents({start})                                            *vim.fs.parents()*
     Return: ~
         (function) Iterator
 
+
+==============================================================================
+Lua module: secure                                                *lua-secure*
+
+read({path})                                               *vim.secure.read()*
+    Attempt to read the file at {path} prompting the user if the file should
+    be trusted. The user's choice is persisted in a trust database at
+    $XDG_STATE_HOME/nvim/trust.
+
+    Parameters: ~
+      • {path}  (string) Path to a file to read.
+
+    Return: ~
+        (string|nil) The contents of the given file if it exists and is
+        trusted, or nil otherwise.
+
  vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index d339df8479..2aa4bea73b 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,9 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• |vim.secure.read()| reads a file and prompts the user if it should be
+  trusted and, if so, returns the file's contents.
+
 • When using Nvim inside tmux 3.2 or later, the default clipboard provider
   will now copy to the system clipboard. |provider-clipboard|
 
-- 
cgit 


From 294910a1ffd11bea0081c2b92632628ef0462eb1 Mon Sep 17 00:00:00 2001
From: Gregory Anders 
Date: Sat, 5 Nov 2022 19:30:48 -0600
Subject: feat(exrc): use vim.secure.read() for 'exrc' option

---
 runtime/doc/deprecated.txt |  4 ----
 runtime/doc/news.txt       |  2 ++
 runtime/doc/options.txt    | 14 ++++++++++++++
 runtime/doc/vim_diff.txt   |  2 ++
 4 files changed, 18 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt
index 5e6bc957a1..401ac87d90 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -128,10 +128,6 @@ NORMAL COMMANDS
 OPTIONS
 - *cpo-<* *:menu-* *:menu-special* *:map-* *:map-special*
   `<>` notation is always enabled.
-- *'exrc'* *'ex'*	Security risk: downloaded files could include
-			a malicious .nvimrc or .exrc file. See 'secure'.
-			Recommended alternative: define an autocommand in your
-			|vimrc| to set options for a matching directory.
 - 'gdefault'		Enables the |:substitute| flag 'g' by default.
 - *'fe'*		'fenc'+'enc' before Vim 6.0; no longer used.
 - *'highlight'* *'hl'*	Names of builtin |highlight-groups| cannot be changed.
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 2aa4bea73b..42a5d7e7ee 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -60,6 +60,8 @@ CHANGED FEATURES                                                 *news-changes*
 
 The following changes to existing APIs or features add new behavior.
 
+• 'exrc' is no longer marked deprecated.
+
 ==============================================================================
 REMOVED FEATURES                                                 *news-removed*
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index fd76f11046..6c1edb9c69 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2264,6 +2264,20 @@ A jump table for the options with a short description can be found at |Q_op|.
 	This option is reset when the 'paste' option is set and restored when
 	the 'paste' option is reset.
 
+					*'exrc'* *'ex'* *'noexrc'* *'noex'*
+'exrc' 'ex'		boolean (default off)
+			global
+	Enables the reading of .nvimrc and .exrc files in the current
+	directory.
+
+	The file is only sourced if the user indicates the file is trusted. If
+	it is, the SHA256 hash of the file contents and the full path of the
+	file are persisted to a trust database. The user is only prompted
+	again if the file contents change. See |vim.secure.read()|.
+
+	This option cannot be set from a |modeline| or in the |sandbox|, for
+	security reasons.
+
 				*'fileencoding'* *'fenc'* *E213*
 'fileencoding' 'fenc'	string (default: "")
 			local to buffer
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index fe6c28c809..357024aca0 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -417,6 +417,8 @@ Options:
   'jumpoptions' "view" tries to restore the |mark-view| when moving through
   the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|.
   'shortmess' the "F" flag does not affect output from autocommands
+  'exrc' searches for ".nvimrc" or ".exrc" files. The user is prompted whether
+  to trust the file.
 
 Shell:
   Shell output (|:!|, |:make|, …) is always routed through the UI, so it
-- 
cgit 


From 6d9c3d903ecee2d1d21d0a0806f1a2bebe628e8e Mon Sep 17 00:00:00 2001
From: Gregory Anders 
Date: Sun, 6 Nov 2022 19:44:30 -0700
Subject: refactor: deprecate 'secure' option

Now that 'exrc' files must be explicitly marked trusted there is no need
to constrain what can be done in them.
---
 runtime/doc/options.txt  | 13 -------------
 runtime/doc/vim_diff.txt |  3 +++
 2 files changed, 3 insertions(+), 13 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 6c1edb9c69..0895d980f5 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5129,19 +5129,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 	two letters (See |object-motions|).  The default makes a section start
 	at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".
 
-						*'secure'* *'nosecure'* *E523*
-'secure'		boolean	(default off)
-			global
-	When on, ":autocmd", shell and write commands are not allowed in
-	".nvimrc" and ".exrc" in the current directory and map commands are
-	displayed.  Switch it off only if you know that you will not run into
-	problems, or when the 'exrc' option is off.  On Unix this option is
-	only used if the ".nvimrc" or ".exrc" is not owned by you.  This can be
-	dangerous if the systems allows users to do a "chown".  You better set
-	'secure' at the end of your |init.vim| then.
-	This option cannot be set from a |modeline| or in the |sandbox|, for
-	security reasons.
-
 						*'selection'* *'sel'*
 'selection' 'sel'	string	(default "inclusive")
 			global
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 357024aca0..b5222c9ddd 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -641,6 +641,9 @@ Options:
   *'prompt'* *'noprompt'*
   *'remap'* *'noremap'*
   *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
+  *'secure'*
+    Everything is allowed in 'exrc' files since they must be explicitly marked
+    trusted.
   *'shelltype'*
   *'shortname'* *'sn'* *'noshortname'* *'nosn'*
   *'swapsync'* *'sws'*
-- 
cgit 


From db407010facc55c19b5ebdf881225ac39cb29d01 Mon Sep 17 00:00:00 2001
From: XDream8 <62709801+XDream8@users.noreply.github.com>
Date: Fri, 18 Nov 2022 15:39:56 +0000
Subject: feat(clipboard): added wayclip support (#21091)

---
 runtime/doc/provider.txt | 1 +
 1 file changed, 1 insertion(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index a7b5b1d492..3ccff3dc3c 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -188,6 +188,7 @@ registers. Nvim looks for these clipboard tools, in order of priority:
   - |g:clipboard|
   - pbcopy, pbpaste (macOS)
   - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
+  - waycopy, waypaste (if $WAYLAND_DISPLAY is set)
   - xclip (if $DISPLAY is set)
   - xsel (if $DISPLAY is set)
   - lemonade (for SSH) https://github.com/pocke/lemonade
-- 
cgit 


From 7c57f06b63f7c4e3b62a765b7b7814ef017a602d Mon Sep 17 00:00:00 2001
From: Sean Dewar 
Date: Sat, 19 Nov 2022 10:31:51 +0000
Subject: vim-patch:partial:d13166e788fc (#21109)

Update runtime files

https://github.com/vim/vim/commit/d13166e788fcaef59ec65c20b46ca4be16625669

- Skip E1309-1311 (not ported).
- Skip `:echowindow` changes (not ported).
- Skip termdebug winbar doc changes (not fully ported).
- Port missing `g:termdebug_config.{wide,use_prompt}` changes from v8.2.5010.

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/eval.txt                   |  2 ++
 runtime/doc/nvim_terminal_emulator.txt | 40 +++++++++++++++++++---------------
 runtime/doc/syntax.txt                 | 10 +++++++++
 3 files changed, 34 insertions(+), 18 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 4446598a2e..e4f8030f16 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2698,6 +2698,8 @@ text...
 			Unlock the internal variable {name}.  Does the
 			opposite of |:lockvar|.
 
+			No error is given if {name} does not exist.
+
 :if {expr1}			*:if* *:end* *:endif* *:en* *E171* *E579* *E580*
 :en[dif]		Execute the commands until the next matching `:else`
 			or `:endif` if {expr1} evaluates to non-zero.
diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt
index 546f92e92f..3fe86b00bc 100644
--- a/runtime/doc/nvim_terminal_emulator.txt
+++ b/runtime/doc/nvim_terminal_emulator.txt
@@ -355,6 +355,20 @@ TermdebugStopPost		After debugging has ended, gdb-related windows
 				the state before the debugging was restored.
 
 
+Customizing ~
+				*termdebug-customizing* *g:termdebug_config*
+In the past several global variables were used for configuration.  These are
+deprecated and using the g:termdebug_config dictionary is preferred.  When
+g:termdebug_config exists the other global variables will NOT be used.
+The recommended way is to start with an empty dictionary: >
+	let g:termdebug_config = {}
+
+Then you can add entries to the dictionary as mentioned below.  The
+deprecated global variable names are mentioned for completeness.  If you are
+switching over to using g:termdebug_config you can find the old variable name
+and take over the value, then delete the deprecated variable.
+
+
 Prompt mode ~
 						*termdebug-prompt*
 When on MS-Windows, gdb will run in a buffer with 'buftype' set to "prompt".
@@ -368,13 +382,13 @@ This works slightly differently:
 						*termdebug_use_prompt*
 Prompt mode can be used with: >
 	let g:termdebug_config['use_prompt'] = 1
-Or if there is no g:termdebug_config: >
+If there is no g:termdebug_config you can use: >
 	let g:termdebug_use_prompt = 1
 <
 						*termdebug_map_K*
 The K key is normally mapped to :Evaluate. If you do not want this use: >
 	let g:termdebug_config['map_K'] = 0
-Or if there is no g:termdebug_config: >
+If there is no g:termdebug_config you can use: >
 	let g:termdebug_map_K = 0
 <
 						*termdebug_disasm_window*
@@ -382,7 +396,7 @@ If you want the Asm window shown by default, set the flag to 1.
 the "disasm_window_height" entry can be used to set the window height: >
 	let g:termdebug_config['disasm_window'] = 1
 	let g:termdebug_config['disasm_window_height'] = 15
-or, if there is no g:termdebug_config: >
+If there is no g:termdebug_config you can use: >
 	let g:termdebug_disasm_window = 15
 Any value greater than 1 will set the Asm window height to that value.
 
@@ -400,25 +414,18 @@ interrupt the running program.  But after using the MI command
 communication channel.
 
 
-Customizing ~
-				*termdebug-customizing* *g:termdebug_config*
-In the past several global variables were used for configuration.  These are
-deprecated, using the g:termdebug_config dictionary is preferred.  When
-g:termdebug_config exists the other global variables will not be used.
-
-
 GDB command ~
 							*g:termdebugger*
 To change the name of the gdb command, set "debugger" entry in
 g:termdebug_config or the "g:termdebugger" variable before invoking
 `:Termdebug`: >
 	let g:termdebug_config['command'] = "mygdb"
-Or if there is no g:termdebug_config: >
+If there is no g:termdebug_config you can use: >
 	let g:termdebugger = "mygdb"
 
 If the command needs an argument use a List: >
 	let g:termdebug_config['command'] = ['rr', 'replay', '--']
-Or if there is no g:termdebug_config: >
+If there is no g:termdebug_config you can use: >
 	let g:termdebugger = ['rr', 'replay', '--']
 
 To not use neovim floating windows for previewing variable evaluation, set the
@@ -451,7 +458,7 @@ Then your gdb is too old.
 
 
 Colors ~
-						*hl-debugPC* *hl-debugBreakpoint*
+					*hl-debugPC* *hl-debugBreakpoint*
 The color of the signs can be adjusted with these highlight groups:
 - debugPC		the current position
 - debugBreakpoint	a breakpoint
@@ -467,7 +474,6 @@ When 'background' is "dark":
 
 Shortcuts ~
 							*termdebug_shortcuts*
-
 You can define your own shortcuts (mappings) to control gdb, that can work in
 any window, using the TermDebugSendCommand() function.  Example: >
 	map ,w :call TermDebugSendCommand('where')
@@ -476,7 +482,6 @@ The argument is the gdb command.
 
 Popup menu ~
 							*termdebug_popup*
-
 By default the Termdebug plugin sets 'mousemodel' to "popup_setpos" and adds
 these entries to the popup menu:
 	Set breakpoint		`:Break`
@@ -484,17 +489,16 @@ these entries to the popup menu:
 	Evaluate		`:Evaluate`
 If you don't want this then disable it with: >
 	let g:termdebug_config['popup'] = 0
-or if there is no g:termdebug_config: >
+If there is no g:termdebug_config you can use: >
 	let g:termdebug_popup = 0
 
 
 Vim window width ~
 							*termdebug_wide*
-
 To change the width of the Vim window when debugging starts and use a vertical
 split: >
 	let g:termdebug_config['wide'] = 163
-Or if there is no g:termdebug_config: >
+If there is no g:termdebug_config you can use: >
 	let g:termdebug_wide = 163
 
 This will set 'columns' to 163 when `:Termdebug` is used.  The value is
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 033a01ac98..f74a046ee6 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1854,6 +1854,16 @@ following two lines to the syntax coloring file for that language
 Now you just need to make sure that you add all regions that contain
 the preprocessor language to the cluster htmlPreproc.
 
+							*html-folding*
+The HTML syntax file provides syntax |folding| (see |:syn-fold|) between start
+and end tags.  This can be turned on by >
+
+	:let g:html_syntax_folding = 1
+	:set foldmethod=syntax
+
+Note: Syntax folding might slow down syntax highlighting significantly,
+especially for large files.
+
 
 HTML/OS (by Aestiva)				*htmlos.vim* *ft-htmlos-syntax*
 
-- 
cgit 


From 822eabc5e123bca71ba945467c3b01110bb0e003 Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Sun, 20 Nov 2022 11:42:30 +0100
Subject: docs(support): update tested versions (#21126)

---
 runtime/doc/support.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/support.txt b/runtime/doc/support.txt
index a0fc6e9f2c..481959d8f1 100644
--- a/runtime/doc/support.txt
+++ b/runtime/doc/support.txt
@@ -12,8 +12,8 @@ Support                                                              *support*
 Supported platforms					 *supported-platforms*
 
 `System`          `Tier`      `Versions`                  `Tested versions`
-Linux            1      >= 2.6.32, glibc >= 2.12     Ubuntu 20.04
-macOS (Intel)    1      >= 10.15                     macOS 11
+Linux            1      >= 2.6.32, glibc >= 2.12     Ubuntu 22.04
+macOS (Intel)    1      >= 10.15                     macOS 12
 Windows 64-bit   1      >= 8                         Windows Server 2019
 FreeBSD          1      >= 10                        FreeBSD 13
 macOS (M1)       2      >= 10.15
-- 
cgit 


From 035d41ac5e5fcbb49eb64b72a924c4d6f89f0579 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sun, 20 Nov 2022 08:38:46 +0800
Subject: vim-patch:partial:9.0.0913: only change in current window triggers
 the WinScrolled event

Problem:    Only a change in the current window triggers the WinScrolled
            event.
Solution:   Trigger WinScrolled if any window scrolled or changed size.
            (issue vim/vim#11576)

https://github.com/vim/vim/commit/0a60f79fd0c328b47b36279a95282e9f8d9e7512

Skip locking of window layout and E1312.
Copy the latest version of all WinScrolled tests from Vim.
Note: patch 9.0.0915 is needed for the Lua tests to pass.

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/autocmd.txt | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index c30c190301..b6c9253a41 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1096,22 +1096,35 @@ WinNew				When a new window was created.  Not done for
 
 							*WinScrolled*
 WinScrolled			After scrolling the content of a window or
-				resizing a window.
-				The pattern is matched against the
-				|window-ID|.  Both  and  are
-				set to the |window-ID|.
-				Non-recursive (the event cannot trigger
-				itself).  However, if the command causes the
-				window to scroll or change size another
+				resizing a window in the current tab page.
+
+				When more than one window scrolled or resized
+				only one WinScrolled event is triggered.  You
+				can use the `winlayout()` and `getwininfo()`
+				functions to see what changed.
+
+				The pattern is matched against the |window-ID|
+				of the first window that scrolled or resized.
+				Both  and  are set to the
+				|window-ID|.
+
+				Only starts triggering after startup finished
+				and the first screen redraw was done.
+
+				Non-recursive: the event will not trigger
+				while executing commands for the WinScrolled
+				event.  However, if the command causes a
+				window to scroll or change size, then another
 				WinScrolled event will be triggered later.
+
 				Does not trigger when the command is added,
 				only after the first scroll or resize.
 
 ==============================================================================
 6. Patterns					*autocmd-pattern* *{aupat}*
 
-The {aupat} argument of `:autocmd` can be a comma-separated list.  This works
-as if the command was given with each pattern separately.  Thus this command: >
+The {aupat} argument of `:autocmd` can be a comma-separated list.  This works as
+if the command was given with each pattern separately.  Thus this command: >
 	:autocmd BufRead *.txt,*.info set et
 Is equivalent to: >
 	:autocmd BufRead *.txt set et
-- 
cgit 


From fbce9f421ad1ad466126a24524ade9df978486d5 Mon Sep 17 00:00:00 2001
From: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com>
Date: Sun, 20 Nov 2022 20:09:35 +0000
Subject: feat(diagnostic): add `suffix` option to `open_float()` (#21130)

Closes #18687

This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.

It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
---
 runtime/doc/diagnostic.txt | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index d30d6c28a0..53046b399f 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -618,6 +618,9 @@ open_float({opts}, {...})                        *vim.diagnostic.open_float()*
                   {prefix} is a string, it is prepended to each diagnostic in
                   the window with no highlight. Overrides the setting from
                   |vim.diagnostic.config()|.
+                • suffix: Same as {prefix}, but appends the text to the
+                  diagnostic instead of prepending it. Overrides the setting
+                  from |vim.diagnostic.config()|.
 
     Return: ~
         tuple ({float_bufnr}, {win_id})
-- 
cgit 


From 126ef65e5b3ff0da68bfe166be0bb0a33664142b Mon Sep 17 00:00:00 2001
From: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com>
Date: Sun, 20 Nov 2022 23:57:36 +0000
Subject: feat(diagnostic): add `suffix` option to `virt_text` config (#21140)

This introduces a `suffix` option to the `virt_text` config in
`vim.diagnostic.config()`. The suffix can either be a string which is appended
to the diagnostic message or a function returning such. The function receives a
`diagnostic` argument, which is the diagnostic table of the last diagnostic (the
one whose message is rendered as virt text).
---
 runtime/doc/diagnostic.txt | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 53046b399f..a2bacebc72 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -365,6 +365,11 @@ config({opts}, {namespace})                          *vim.diagnostic.config()*
                          the beginning of the virtual text.
                        • prefix: (string) Prepend diagnostic message with
                          prefix.
+                       • suffix: (string or function) Append diagnostic
+                         message with suffix. If a function, it must have the
+                         signature (diagnostic) -> string, where {diagnostic}
+                         is of type |diagnostic-structure|. This can be used
+                         to render an LSP diagnostic error code.
                        • format: (function) A function that takes a diagnostic
                          as input and returns a string. The return value is
                          the text used to display the diagnostic. Example: >
-- 
cgit 


From 2bb244af314e80afbab30b4db4490c8dae894b85 Mon Sep 17 00:00:00 2001
From: Raphael 
Date: Mon, 21 Nov 2022 18:06:14 +0800
Subject: feat(lsp): support set title in lsp relate floatwindow (#21110)

---
 runtime/doc/lsp.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 036b0bbc6f..0255d78c4c 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1330,7 +1330,9 @@ hover({_}, {result}, {ctx}, {config})               *vim.lsp.handlers.hover()*
      vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
        vim.lsp.handlers.hover, {
          -- Use a sharp border with `FloatBorder` highlights
-         border = "single"
+         border = "single",
+         -- add the title in hover float window
+         title = "hover"
        }
      )
 <
-- 
cgit 


From 904d0056d520ef01e2873bbaa91a4693e8dfd226 Mon Sep 17 00:00:00 2001
From: Mathias Fußenegger 
Date: Mon, 21 Nov 2022 22:02:18 +0100
Subject: fix(diagnostic): correct type annotations; add Diagnostic type
 (#21120)

Some functions didn't include the `nil` case in the return type
annotation. This corrects those and also adds a Diagnostic class
definition for the diagnostic.get return type
---
 runtime/doc/diagnostic.txt | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index a2bacebc72..07a7d5190f 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -431,7 +431,7 @@ fromqflist({list})                               *vim.diagnostic.fromqflist()*
                 |getloclist()|.
 
     Return: ~
-        array of diagnostics |diagnostic-structure|
+        Diagnostic [] array of |diagnostic-structure|
 
 get({bufnr}, {opts})                                    *vim.diagnostic.get()*
     Get current diagnostics.
@@ -446,7 +446,7 @@ get({bufnr}, {opts})                                    *vim.diagnostic.get()*
                  • severity: See |diagnostic-severity|.
 
     Return: ~
-        (table) A list of diagnostic items |diagnostic-structure|.
+        Diagnostic [] table A list of diagnostic items |diagnostic-structure|.
 
 get_namespace({namespace})                    *vim.diagnostic.get_namespace()*
     Get namespace metadata.
@@ -467,37 +467,39 @@ get_next({opts})                                   *vim.diagnostic.get_next()*
     Get the next diagnostic closest to the cursor position.
 
     Parameters: ~
-      • {opts}  (table) See |vim.diagnostic.goto_next()|
+      • {opts}  (table|nil) See |vim.diagnostic.goto_next()|
 
     Return: ~
-        (table) Next diagnostic
+        Diagnostic|nil Next diagnostic
 
 get_next_pos({opts})                           *vim.diagnostic.get_next_pos()*
     Return the position of the next diagnostic in the current buffer.
 
     Parameters: ~
-      • {opts}  (table) See |vim.diagnostic.goto_next()|
+      • {opts}  (table|nil) See |vim.diagnostic.goto_next()|
 
     Return: ~
-        (table) Next diagnostic position as a (row, col) tuple.
+        table|false Next diagnostic position as a (row, col) tuple or false if
+        no next diagnostic.
 
 get_prev({opts})                                   *vim.diagnostic.get_prev()*
     Get the previous diagnostic closest to the cursor position.
 
     Parameters: ~
-      • {opts}  (table) See |vim.diagnostic.goto_next()|
+      • {opts}  nil|table See |vim.diagnostic.goto_next()|
 
     Return: ~
-        (table) Previous diagnostic
+        Diagnostic|nil Previous diagnostic
 
 get_prev_pos({opts})                           *vim.diagnostic.get_prev_pos()*
     Return the position of the previous diagnostic in the current buffer.
 
     Parameters: ~
-      • {opts}  (table) See |vim.diagnostic.goto_next()|
+      • {opts}  (table|nil) See |vim.diagnostic.goto_next()|
 
     Return: ~
-        (table) Previous diagnostic position as a (row, col) tuple.
+        table|false Previous diagnostic position as a (row, col) tuple or
+        false if there is no prior diagnostic
 
 goto_next({opts})                                 *vim.diagnostic.goto_next()*
     Move to the next diagnostic.
@@ -537,8 +539,8 @@ hide({namespace}, {bufnr})                             *vim.diagnostic.hide()*
     |vim.diagnostic.disable()|.
 
     Parameters: ~
-      • {namespace}  (number|nil) Diagnostic namespace. When omitted, hide
-                     diagnostics from all namespaces.
+      • {namespace}  (number|nil) Diagnostic namespace. When omitted, hide diagnostics from all
+                     namespaces.
       • {bufnr}      (number|nil) Buffer number, or 0 for current buffer. When
                      omitted, hide diagnostics in all buffers.
 
@@ -571,8 +573,8 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
                         default to 0 and "severity" defaults to ERROR.
 
     Return: ~
-        diagnostic |diagnostic-structure| or `nil` if {pat} fails to match
-        {str}.
+        Diagnostic|nil: |diagnostic-structure| or `nil` if {pat} fails to
+        match {str}.
 
 open_float({opts}, {...})                        *vim.diagnostic.open_float()*
     Show diagnostics in a floating window.
@@ -628,7 +630,7 @@ open_float({opts}, {...})                        *vim.diagnostic.open_float()*
                   from |vim.diagnostic.config()|.
 
     Return: ~
-        tuple ({float_bufnr}, {win_id})
+        number|nil, number|nil: ({float_bufnr}, {win_id})
 
 reset({namespace}, {bufnr})                           *vim.diagnostic.reset()*
     Remove all diagnostics from the given namespace.
@@ -639,8 +641,8 @@ reset({namespace}, {bufnr})                           *vim.diagnostic.reset()*
     re-displayed, use |vim.diagnostic.hide()|.
 
     Parameters: ~
-      • {namespace}  (number|nil) Diagnostic namespace. When omitted, remove
-                     diagnostics from all namespaces.
+      • {namespace}  (number|nil) Diagnostic namespace. When omitted, remove diagnostics from all
+                     namespaces.
       • {bufnr}      (number|nil) Remove diagnostics for the given buffer.
                      When omitted, diagnostics are removed for all buffers.
 
@@ -688,8 +690,8 @@ show({namespace}, {bufnr}, {diagnostics}, {opts})
     Display diagnostics for the given namespace and buffer.
 
     Parameters: ~
-      • {namespace}    (number|nil) Diagnostic namespace. When omitted, show
-                       diagnostics from all namespaces.
+      • {namespace}    (number|nil) Diagnostic namespace. When omitted, show diagnostics from all
+                       namespaces.
       • {bufnr}        (number|nil) Buffer number, or 0 for current buffer.
                        When omitted, show diagnostics in all buffers.
       • {diagnostics}  (table|nil) The diagnostics to display. When omitted,
@@ -709,6 +711,6 @@ toqflist({diagnostics})                            *vim.diagnostic.toqflist()*
       • {diagnostics}  (table) List of diagnostics |diagnostic-structure|.
 
     Return: ~
-        array of quickfix list items |setqflist-what|
+        table[] of quickfix list items |setqflist-what|
 
  vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:
-- 
cgit 


From ef5dfe6c652473a8982b93bceebb470c1cee813e Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 22 Nov 2022 06:56:56 +0800
Subject: vim-patch:8.2.2435: setline() gives an error for some types

Problem:    setline() gives an error for some types.
Solution:   Allow any type, convert each item to a string.

https://github.com/vim/vim/commit/3445320839a38b3b0c253513b125da8298ec27d6

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt | 3 +++
 runtime/doc/eval.txt    | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index fa9fb286ae..a6eafbf2b9 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -638,6 +638,7 @@ append({lnum}, {text})					*append()*
 		text line below line {lnum} in the current buffer.
 		Otherwise append {text} as one text line below line {lnum} in
 		the current buffer.
+		Any type of item is accepted and converted to a String.
 		{lnum} can be zero to insert a line before the first one.
 		{lnum} is used like with |getline()|.
 		Returns 1 for failure ({lnum} out of range or out of memory),
@@ -7054,6 +7055,8 @@ setline({lnum}, {text})					*setline()*
 		{lnum} is used like with |getline()|.
 		When {lnum} is just below the last line the {text} will be
 		added below the last line.
+		{text} can be any type or a List of any type, each item is
+		converted to a String.
 
 		If this succeeds, FALSE is returned.  If this fails (most likely
 		because {lnum} is invalid) TRUE is returned.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e4f8030f16..eb42e10338 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -229,13 +229,13 @@ is not available it returns zero or the default value you specify: >
 
 
 List concatenation ~
-
+							*list-concatenation*
 Two lists can be concatenated with the "+" operator: >
 	:let longlist = mylist + [5, 6]
 	:let mylist += [7, 8]
 
-To prepend or append an item turn the item into a list by putting [] around
-it.  To change a list in-place see |list-modification| below.
+To prepend or append an item, turn the item into a list by putting [] around
+it.  To change a list in-place, refer to |list-modification| below.
 
 
 Sublist ~
-- 
cgit 


From 9b768752353d3cf99c6cb02e6c1f9d70c029ecb6 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 22 Nov 2022 06:52:21 +0800
Subject: vim-patch:9.0.0916: getbufline() is inefficient for getting a single
 line

Problem:    getbufline() is inefficient for getting a single line.
Solution:   Add getbufoneline().

https://github.com/vim/vim/commit/ce30ccc06af7f2c03762e5b18dde37b26ea6ec42

Cherry-pick part of usr_41.txt from patch 8.1.1628.

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/builtin.txt | 13 +++++++++++--
 runtime/doc/usr_41.txt  | 13 +++++++++----
 2 files changed, 20 insertions(+), 6 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index a6eafbf2b9..fdee409639 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -170,6 +170,7 @@ get({func}, {what})		any	get property of funcref/partial {func}
 getbufinfo([{buf}])		List	information about buffers
 getbufline({buf}, {lnum} [, {end}])
 				List	lines {lnum} to {end} of buffer {buf}
+getbufoneline({buf}, {lnum})	String	line {lnum} of buffer {buf}
 getbufvar({buf}, {varname} [, {def}])
 				any	variable {varname} in buffer {buf}
 getchangelist([{buf}])		List	list of change list items
@@ -2685,11 +2686,13 @@ getbufinfo([{dict}])
 		Can also be used as a |method|: >
 			GetBufnr()->getbufinfo()
 <
+
 							*getbufline()*
 getbufline({buf}, {lnum} [, {end}])
 		Return a |List| with the lines starting from {lnum} to {end}
 		(inclusive) in the buffer {buf}.  If {end} is omitted, a
-		|List| with only the line {lnum} is returned.
+		|List| with only the line {lnum} is returned.  See
+		`getbufoneline()` for only getting the line.
 
 		For the use of {buf}, see |bufname()| above.
 
@@ -2712,6 +2715,11 @@ getbufline({buf}, {lnum} [, {end}])
 
 <		Can also be used as a |method|: >
 			GetBufnr()->getbufline(lnum)
+<
+							*getbufoneline()*
+getbufoneline({buf}, {lnum})
+		Just like `getbufline()` but only get one line and return it
+		as a string.
 
 getbufvar({buf}, {varname} [, {def}])				*getbufvar()*
 		The result is the value of option or local buffer variable
@@ -3199,7 +3207,8 @@ getline({lnum} [, {end}])
 <		Can also be used as a |method|: >
 			ComputeLnum()->getline()
 
-<		To get lines from another buffer see |getbufline()|
+<		To get lines from another buffer see |getbufline()| and
+		|getbufoneline()|
 
 getloclist({nr} [, {what}])				*getloclist()*
 		Returns a |List| with all the entries in the location list for
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 067ad6648c..226bd029a3 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -785,6 +785,13 @@ Working with text in the current buffer:		*text-functions*
 	getcharsearch()		return character search information
 	setcharsearch()		set character search information
 
+Working with text in another buffer:
+	getbufline()		get a list of lines from the specified buffer
+	getbufoneline()		get a one line from the specified buffer
+	setbufline()		replace a line in the specified buffer
+	appendbufline()		append a list of lines in the specified buffer
+	deletebufline()		delete lines from a specified buffer
+
 					*system-functions* *file-functions*
 System functions and manipulation of files:
 	glob()			expand wildcards
@@ -838,8 +845,10 @@ Buffers, windows and the argument list:
 	argidx()		current position in the argument list
 	arglistid()		get id of the argument list
 	argv()			get one entry from the argument list
+	bufadd()		add a file to the list of buffers
 	bufexists()		check if a buffer exists
 	buflisted()		check if a buffer exists and is listed
+	bufload()		ensure a buffer is loaded
 	bufloaded()		check if a buffer exists and is loaded
 	bufname()		get the name of a specific buffer
 	bufnr()			get the buffer number of a specific buffer
@@ -850,10 +859,6 @@ Buffers, windows and the argument list:
 	bufwinid()		get the window ID of a specific buffer
 	bufwinnr()		get the window number of a specific buffer
 	winbufnr()		get the buffer number of a specific window
-	getbufline()		get a list of lines from the specified buffer
-	setbufline()		replace a line in the specified buffer
-	appendbufline()		append a list of lines in the specified buffer
-	deletebufline()		delete lines from a specified buffer
 	win_findbuf()		find windows containing a buffer
 	win_getid()		get window ID of a window
 	win_gettype()		get type of window
-- 
cgit 


From 4571ba4d0a5234408e544c3a98f107688a792f0d Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Wed, 23 Nov 2022 09:54:48 +0800
Subject: vim-patch:partial:9.0.0917: the WinScrolled autocommand event is not
 enough (#21161)

Problem:    The WinScrolled autocommand event is not enough.
Solution:   Add WinResized and provide information about what changed.
            (closes vim/vim#11576)

https://github.com/vim/vim/commit/35fc61cb5b5eba8bbb9d8f0700332fbab38f40ca

Omit "func_name" comment in tv_dict_extend(): Vim9 script only.
Skip layout locking and E1312.
Skip list_alloc_with_items() and list_set_item().

Since this overrides remaining changes in patch 9.0.0913, that patch can
now be marked as fully ported:

vim-patch:9.0.0913: only change in current window triggers the WinScrolled event

N/A patches for version.c:

vim-patch:9.0.0919: build failure with tiny features

Problem:    Build failure with tiny features.
Solution:   Adjust #ifdef's.

https://github.com/vim/vim/commit/9c5b7cb4cf67c64648a324e9dfd1e17d793335a4

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/autocmd.txt | 30 +++++++++++++++++++++---------
 runtime/doc/windows.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 9 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index b6c9253a41..9bb835e661 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1095,21 +1095,24 @@ WinNew				When a new window was created.  Not done for
 				Before WinEnter.
 
 							*WinScrolled*
-WinScrolled			After scrolling the content of a window or
-				resizing a window in the current tab page.
-
-				When more than one window scrolled or resized
-				only one WinScrolled event is triggered.  You
-				can use the `winlayout()` and `getwininfo()`
-				functions to see what changed.
+WinScrolled			After any window in the current tab page
+				scrolled the text (horizontally or vertically)
+				or changed width or height.  See
+				|win-scrolled-resized|.
 
 				The pattern is matched against the |window-ID|
 				of the first window that scrolled or resized.
 				Both  and  are set to the
 				|window-ID|.
 
+				|v:event| is set with information about size
+				and scroll changes. |WinScrolled-event|
+
 				Only starts triggering after startup finished
 				and the first screen redraw was done.
+				Does not trigger when defining the first
+				WinScrolled or WinResized event, but may
+				trigger when adding more.
 
 				Non-recursive: the event will not trigger
 				while executing commands for the WinScrolled
@@ -1117,8 +1120,17 @@ WinScrolled			After scrolling the content of a window or
 				window to scroll or change size, then another
 				WinScrolled event will be triggered later.
 
-				Does not trigger when the command is added,
-				only after the first scroll or resize.
+
+							*WinResized*
+WinResized			After a window in the current tab page changed
+				width or height.
+				See |win-scrolled-resized|.
+
+				|v:event| is set with information about size
+				changes. |WinResized-event|
+
+				Same behavior as |WinScrolled| for the
+				pattern, triggering and recursiveness.
 
 ==============================================================================
 6. Patterns					*autocmd-pattern* *{aupat}*
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index dfc2fb5abf..1776c47d33 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -607,6 +607,51 @@ it).
 The minimal height and width of a window is set with 'winminheight' and
 'winminwidth'.  These are hard values, a window will never become smaller.
 
+
+WinScrolled and WinResized autocommands ~
+						*win-scrolled-resized*
+If you want to get notified of changes in window sizes, the |WinResized|
+autocommand event can be used.
+If you want to get notified of text in windows scrolling vertically or
+horizontally, the |WinScrolled| autocommand event can be used.  This will also
+trigger in window size changes.
+							*WinResized-event*
+The |WinResized| event is triggered after updating the display, several
+windows may have changed size then.  A list of the IDs of windows that changed
+since last time is provided in the v:event.windows variable, for example:
+	[1003, 1006]
+							*WinScrolled-event*
+The |WinScrolled| event is triggered after |WinResized|, and also if a window
+was scrolled.  That can be vertically (the text at the top of the window
+changed) or horizontally (when 'wrap' is off or when the first displayed part
+of the first line changes).  Note that |WinScrolled| will trigger many more
+times than |WinResized|, it may slow down editing a bit.
+
+The information provided by |WinScrolled| is a dictionary for each window that
+has changes, using the window ID as the key, and a total count of the changes
+with the key "all".  Example value for |v:event|:
+	{
+	   all: {width: 0, height: 2, leftcol: 0, topline: 1, skipcol: 0},
+	   1003: {width: 0, height: -1, leftcol: 0, topline: 0, skipcol: 0},
+	   1006: {width: 0, height: 1, leftcol: 0, topline: 1, skipcol: 0},
+	}
+
+Note that the "all" entry has the absolute values of the individual windows
+accumulated.
+
+If you need more information about what changed, or you want to "debounce" the
+events (not handle every event to avoid doing too much work), you may want to
+use the `winlayout()` and `getwininfo()` functions.
+
+|WinScrolled| and |WinResized| do not trigger when the first autocommand is
+added, only after the first scroll or resize.  They may trigger when switching
+to another tab page.
+
+The commands executed are expected to not cause window size or scroll changes.
+If this happens anyway, the event will trigger again very soon.  In other
+words: Just before triggering the event, the current sizes and scroll
+positions are stored and used to decide whether there was a change.
+
 ==============================================================================
 7. Argument and buffer list commands			*buffer-list*
 
-- 
cgit 


From ddea80ebd66617bfc3a1af0b08d55dd7ed51f2ca Mon Sep 17 00:00:00 2001
From: AzerAfram <97570339+AzerAfram@users.noreply.github.com>
Date: Wed, 23 Nov 2022 15:40:07 -0800
Subject: docs(lua): add clarifications for fs.find() and fs.normalize()
 (#21132)

Co-Authored-By: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-Authored-By: zeertzjq 
---
 runtime/doc/lua.txt | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index c5ede97725..4055d93f6a 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2286,11 +2286,12 @@ find({names}, {opts})                                          *vim.fs.find()*
     Parameters: ~
       • {names}  (string|table|fun(name: string): boolean) Names of the files
                  and directories to find. Must be base names, paths and globs
-                 are not supported. If a function it is called per file and
-                 dir within the traversed directories to test if they match.
+                 are not supported. The function is called per file and
+                 directory within the traversed directories to test if they
+                 match {names}.
       • {opts}   (table) Optional keyword arguments:
                  • path (string): Path to begin searching from. If omitted,
-                   the current working directory is used.
+                   the |current-directory| is used.
                  • upward (boolean, default false): If true, search upward
                    through parent directories. Otherwise, search through child
                    directories (recursively).
@@ -2298,13 +2299,14 @@ find({names}, {opts})                                          *vim.fs.find()*
                    reached. The directory itself is not searched.
                  • type (string): Find only files ("file") or directories
                    ("directory"). If omitted, both files and directories that
-                   match {name} are included.
+                   match {names} are included.
                  • limit (number, default 1): Stop the search after finding
                    this many matches. Use `math.huge` to place no limit on the
                    number of matches.
 
     Return: ~
-        (table) The paths of all matching files or directories
+        (table) The normalized paths |vim.fs.normalize()| of all matching
+        files or directories
 
 normalize({path})                                         *vim.fs.normalize()*
     Normalize a path to a standard format. A tilde (~) character at the
@@ -2312,16 +2314,16 @@ normalize({path})                                         *vim.fs.normalize()*
     backslash (\) characters are converted to forward slashes (/). Environment
     variables are also expanded.
 
-    Example: >
+    Examples: >
 
-     vim.fs.normalize('C:\Users\jdoe')
-     => 'C:/Users/jdoe'
+       vim.fs.normalize('C:\Users\jdoe')
+       => 'C:/Users/jdoe'
 
-     vim.fs.normalize('~/src/neovim')
-     => '/home/jdoe/src/neovim'
+       vim.fs.normalize('~/src/neovim')
+       => '/home/jdoe/src/neovim'
 
-     vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
-     => '/Users/jdoe/.config/nvim/init.vim'
+       vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
+       => '/Users/jdoe/.config/nvim/init.vim'
 <
 
     Parameters: ~
-- 
cgit 


From c9adbcafaec6c7aecb01e8f06a423a74b0a01116 Mon Sep 17 00:00:00 2001
From: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com>
Date: Thu, 24 Nov 2022 01:42:05 +0000
Subject: docs(news): add diagnostic suffix (#21141)

---
 runtime/doc/news.txt | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 42a5d7e7ee..70643cf00c 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,11 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• |vim.diagnostic.open_float()| (and therefore |vim.diagnostic.config()|) now
+  accepts a `suffix` option which, by default, renders LSP error codes.
+  Similarly, the `virtual_text` configuration in |vim.diagnostic.config()| now
+  has a `suffix` option which does nothing by default.
+
 • |vim.secure.read()| reads a file and prompts the user if it should be
   trusted and, if so, returns the file's contents.
 
-- 
cgit 


From 868d8d69627c4b8fd5225da0dff5905f75645946 Mon Sep 17 00:00:00 2001
From: Sean Dewar 
Date: Thu, 24 Nov 2022 10:23:50 +0000
Subject: vim-patch:partial:b59ae59a5870 (#21170)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Update runtime files

https://github.com/vim/vim/commit/b59ae59a58706e454ef8c78276f021b1f58466e7

- Omit `map()` lambda arg comment. Not worth mentioning for legacy script
  (and is already hinted at below).
- Cherry-pick latest `'thesaurusfunc'` example.
- Skip `optwin.vim` `'keyprotocol'` change.
- 🧜‍♀️

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/autocmd.txt |  9 +++++----
 runtime/doc/builtin.txt | 43 ++++++++++++++++++++++++++-----------------
 runtime/doc/digraph.txt |  2 +-
 runtime/doc/insert.txt  | 44 +++++++++++++++++++++-----------------------
 runtime/doc/map.txt     |  2 +-
 runtime/doc/options.txt |  8 ++++++--
 runtime/doc/tips.txt    |  2 +-
 7 files changed, 61 insertions(+), 49 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 9bb835e661..a39407aeca 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -823,8 +823,8 @@ QuickFixCmdPre			Before a quickfix command is run (|:make|,
 QuickFixCmdPost			Like QuickFixCmdPre, but after a quickfix
 				command is run, before jumping to the first
 				location. For |:cfile| and |:lfile| commands
-				it is run after error file is read and before
-				moving to the first error.
+				it is run after the error file is read and
+				before moving to the first error.
 				See |QuickFixCmdPost-example|.
 							*QuitPre*
 QuitPre				When using `:quit`, `:wq` or `:qall`, before
@@ -1065,8 +1065,9 @@ VimResume			After Nvim resumes from |suspend| state.
 							*VimSuspend*
 VimSuspend			Before Nvim enters |suspend| state.
 							*WinClosed*
-WinClosed			After closing a window.  The pattern is
-				matched against the |window-ID|.  Both
+WinClosed			When closing a window, just before it is
+				removed from the window layout.  The pattern
+				is matched against the |window-ID|.  Both
 				 and  are set to the |window-ID|.
 				After WinLeave.
 				Non-recursive (event cannot trigger itself).
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index fdee409639..08c8e2e9d6 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -6921,29 +6921,38 @@ setbufvar({buf}, {varname}, {val})			*setbufvar()*
 
 setcellwidths({list})					*setcellwidths()*
 		Specify overrides for cell widths of character ranges.  This
-		tells Vim how wide characters are, counted in screen cells.
-		This overrides 'ambiwidth'.  Example: >
-		   setcellwidths([[0xad, 0xad, 1],
-				\ [0x2194, 0x2199, 2]])
-
-<				*E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
-		The {list} argument is a list of lists with each three
-		numbers. These three numbers are [low, high, width].  "low"
-		and "high" can be the same, in which case this refers to one
-		character. Otherwise it is the range of characters from "low"
-		to "high" (inclusive).  "width" is either 1 or 2, indicating
-		the character width in screen cells.
-		An error is given if the argument is invalid, also when a
-		range overlaps with another.
+		tells Vim how wide characters are when displayed in the
+		terminal, counted in screen cells.  The values override
+		'ambiwidth'.  Example: >
+		   call setcellwidths([
+				\ [0x111, 0x111, 1],
+				\ [0x2194, 0x2199, 2],
+				\ ])
+
+<		The {list} argument is a List of Lists with each three
+		numbers: [{low}, {high}, {width}].	*E1109* *E1110*
+		{low} and {high} can be the same, in which case this refers to
+		one character.  Otherwise it is the range of characters from
+		{low} to {high} (inclusive).		*E1111* *E1114*
 		Only characters with value 0x100 and higher can be used.
 
+		{width} must be either 1 or 2, indicating the character width
+		in screen cells.			*E1112*
+		An error is given if the argument is invalid, also when a
+		range overlaps with another. 		*E1113*
+
 		If the new value causes 'fillchars' or 'listchars' to become
 		invalid it is rejected and an error is given.
 
-		To clear the overrides pass an empty list: >
-		   setcellwidths([]);
+		To clear the overrides pass an empty {list}: >
+		   call setcellwidths([])
+
 <		You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
-		the effect for known emoji characters.
+		the effect for known emoji characters.  Move the cursor
+		through the text to check if the cell widths of your terminal
+		match with what Vim knows about each emoji.  If it doesn't
+		look right you need to adjust the {list} argument.
+
 
 setcharpos({expr}, {list})				*setcharpos()*
 		Same as |setpos()| but uses the specified column number as the
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
index eb3de0111f..ce0a929bc1 100644
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -156,7 +156,7 @@ These are the RFC1345 digraphs for the one-byte characters.  See the output of
 ":digraphs" for the others.
 
 EURO
-
+							*euro* *euro-digraph*
 Exception: RFC1345 doesn't specify the euro sign.  In Vim the digraph =e was
 added for this.  Note the difference between latin1, where the digraph Cu is
 used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 0133824e76..e25f5901ef 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -857,29 +857,27 @@ invoked and what it should return.
 Here is an example that uses the "aiksaurus" command (provided by Magnus
 Groß): >
 
-	func Thesaur(findstart, base)
-	    if a:findstart
-		let line = getline('.')
-		let start = col('.') - 1
-		while start > 0 && line[start - 1] =~ '\a'
-		   let start -= 1
-		endwhile
-		return start
-	    else
-		let res = []
-		let h = ''
-		for l in split(system('aiksaurus ' .. shellescape(a:base)), '\n')
-		    if l[:3] == '=== '
-		    	let h = substitute(l[4:], ' =*$', '', '')
-		    elseif l[0] =~ '\a'
-			call extend(res, map(split(l, ', '), {_, val -> {'word': val, 'menu': '('.h.')'}}))
-		    endif
-		endfor
-		return res
-	    endif
-	endfunc
-
-	set thesaurusfunc=Thesaur
+    func Thesaur(findstart, base)
+      if a:findstart
+	return searchpos('\<', 'bnW', line('.'))[1] - 1
+      endif
+      let res = []
+      let h = ''
+      for l in systemlist('aiksaurus ' .. shellescape(a:base))
+	if l[:3] == '=== '
+	  let h = '(' .. substitute(l[4:], ' =*$', ')', '')
+	elseif l ==# 'Alphabetically similar known words are: '
+	  let h = "\U0001f52e"
+	elseif l[0] =~ '\a' || (h ==# "\U0001f52e" && l[0] ==# "\t")
+	  call extend(res, map(split(substitute(l, '^\t', '', ''), ', '), {_, val -> {'word': val, 'menu': h}}))
+	endif
+      endfor
+      return res
+    endfunc
+
+    if exists('+thesaurusfunc')
+      set thesaurusfunc=Thesaur
+    endif
 
 
 Completing keywords in the current and included files	*compl-keyword*
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index c4bacfd632..fe07c2e1c1 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1713,7 +1713,7 @@ When executed as: >
 This will invoke: >
 	:call Myfunc("arg1","arg2")
 
-<						*q-args-example* 
+<						*q-args-example*
 A more substantial example: >
    :function Allargs(command)
    :   let i = 0
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 0895d980f5..36eabfdcbf 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3349,9 +3349,13 @@ A jump table for the options with a short description can be found at |Q_op|.
 			local to buffer
 	Expression to be used to transform the string found with the 'include'
 	option to a file name.  Mostly useful to change "." to "/" for Java: >
-		:set includeexpr=substitute(v:fname,'\\.','/','g')
+		:setlocal includeexpr=substitute(v:fname,'\\.','/','g')
 <	The "v:fname" variable will be set to the file name that was detected.
-
+	Note the double backslash: the `:set` command first halves them, then
+	one remains in the value, where "\." matches a dot literally.  For
+	simple character replacements `tr()` avoids the need for escaping: >
+		:setlocal includeexpr=tr(v:fname,'.','/')
+<
 	Also used for the |gf| command if an unmodified file name can't be
 	found.  Allows doing "gf" on the name after an 'include' statement.
 	Also used for ||.
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index 5416ba5d89..559f31eb2d 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -454,7 +454,7 @@ the current window, try this custom `:HelpCurwin` command:
 >
 	command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin()
 	let s:did_open_help = v:false
-	
+
 	function s:HelpCurwin(subject) abort
 	  let mods = 'silent noautocmd keepalt'
 	  if !s:did_open_help
-- 
cgit 


From 9dfbbde240fc095b856d8e0e1c670b1912ec6640 Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Sat, 26 Nov 2022 00:52:30 +0100
Subject: docs: fix typos (#21168)

---
 runtime/doc/lua.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 4055d93f6a..b506226697 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2280,7 +2280,7 @@ find({names}, {opts})                                          *vim.fs.find()*
     searches are recursive and may search through many directories! If {stop}
     is non-nil, then the search stops when the directory given in {stop} is
     reached. The search terminates when {limit} (default 1) matches are found.
-    The search can be narrowed to find only files or or only directories by
+    The search can be narrowed to find only files or only directories by
     specifying {type} to be "file" or "directory", respectively.
 
     Parameters: ~
-- 
cgit 


From 77a0f4a542ad9354c647b6bafc1bbd5579212a9e Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Mon, 28 Nov 2022 18:29:15 +0100
Subject: docs(lua): correct the tags for vim.opt_local and vim.opt_global
 (#21138)

---
 runtime/doc/lua.txt | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index b506226697..005b6409d6 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1159,9 +1159,8 @@ vim.wo[{winid}]                                                                *
 
 
 
-                                                                          *lua-vim-opt*
-                                                                     *lua-vim-optlocal*
-                                                                    *lua-vim-optglobal*
+                                                                        *vim.opt_local*
+                                                                       *vim.opt_global*
                                                                               *vim.opt*
 
 
-- 
cgit 


From f004812b338340e5f5157aa68d09d3f0e5605c6c Mon Sep 17 00:00:00 2001
From: Jlll1 
Date: Mon, 28 Nov 2022 20:23:04 +0100
Subject: feat(secure): add `:trust` command  and vim.secure.trust() (#21107)

Introduce vim.secure.trust() to programmatically manage the trust
database. Use this function in a new :trust ex command which can
be used as a simple frontend.

Resolves: https://github.com/neovim/neovim/issues/21092
Co-authored-by: Gregory Anders 
Co-authored-by: ii14 
---
 runtime/doc/editing.txt | 28 ++++++++++++++++++++++++++++
 runtime/doc/index.txt   |  1 +
 runtime/doc/lua.txt     | 24 ++++++++++++++++++++++++
 runtime/doc/news.txt    |  3 +++
 runtime/doc/options.txt |  2 ++
 5 files changed, 58 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 76c528ef3c..e379d9eeb1 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1650,4 +1650,32 @@ There are three different types of searching:
    currently work with 'path' items that contain a URL or use the double star
    with depth limiter (/usr/**2) or upward search (;) notations.
 
+==============================================================================
+11. Trusted Files						*trust*
+
+Nvim has the ability to execute arbitrary code through the 'exrc' option. In
+order to prevent executing code from untrusted sources, Nvim has the concept of
+"trusted files". An untrusted file will not be executed without the user's
+consent, and a user can permanently mark a file as trusted or untrusted using
+the |:trust| command or the |vim.secure.read()| function.
+
+							*:trust* *E5570*
+:trust [++deny] [++remove] [{file}]
+
+			Manage files in the trust database. Without any options
+			or arguments, :trust adds the file associated with the
+			current buffer to the trust database, along with the
+			SHA256 hash of its contents.
+
+			[++deny] marks the file associated with the current
+			buffer (or {file}, if given) as denied; no prompts will
+			be displayed to the user and the file will never be
+			executed.
+
+			[++remove] removes the file associated with the current
+			buffer (or {file}, if given) from the trust database.
+			Future attempts to read the file in a secure setting
+			(i.e. with 'exrc' or |vim.secure.read()|) will prompt
+			the user if the file is trusted.
+
  vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 376487ad1d..66353e05f3 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1633,6 +1633,7 @@ tag		command		action ~
 |:topleft|	:to[pleft]	make split window appear at top or far left
 |:tprevious|	:tp[revious]	jump to previous matching tag
 |:trewind|	:tr[ewind]	jump to first matching tag
+|:trust|	:trust		add or remove file from trust database
 |:try|		:try		execute commands, abort on error or exception
 |:tselect|	:ts[elect]	list matching tags and select one
 |:tunmap|	:tunma[p]	like ":unmap" but for |Terminal-mode|
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 005b6409d6..bcbbd69f11 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2371,4 +2371,28 @@ read({path})                                               *vim.secure.read()*
         (string|nil) The contents of the given file if it exists and is
         trusted, or nil otherwise.
 
+    See also: ~
+        |:trust|
+
+trust({opts})                                             *vim.secure.trust()*
+    Manage the trust database.
+
+    The trust database is located at |$XDG_STATE_HOME|/nvim/trust.
+
+    Parameters: ~
+      • {opts}  (table)
+                • action (string): "allow" to add a file to the trust database
+                  and trust it, "deny" to add a file to the trust database and
+                  deny it, "remove" to remove file from the trust database
+                • path (string|nil): Path to a file to update. Mutually
+                  exclusive with {bufnr}. Cannot be used when {action} is
+                  "allow".
+                • bufnr (number|nil): Buffer number to update. Mutually
+                  exclusive with {path}.
+
+    Return: ~
+        (boolean, string) success, msg:
+        • true and full path of target file if operation was successful
+        • false and error message on failure
+
  vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 70643cf00c..b155bae5a4 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,9 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• |vim.secure.trust()|, |:trust| allows the user to manage files in trust
+  database.
+
 • |vim.diagnostic.open_float()| (and therefore |vim.diagnostic.config()|) now
   accepts a `suffix` option which, by default, renders LSP error codes.
   Similarly, the `virtual_text` configuration in |vim.diagnostic.config()| now
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 36eabfdcbf..33bade3545 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2275,6 +2275,8 @@ A jump table for the options with a short description can be found at |Q_op|.
 	file are persisted to a trust database. The user is only prompted
 	again if the file contents change. See |vim.secure.read()|.
 
+	Use |:trust| to manage the trusted file database.
+
 	This option cannot be set from a |modeline| or in the |sandbox|, for
 	security reasons.
 
-- 
cgit 


From 615f124003376c007442319b31a172360796974c Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Tue, 29 Nov 2022 02:45:48 +0100
Subject: docs: fix typos (#21196)

Co-authored-by: zeertzjq 
Co-authored-by: Raphael 
Co-authored-by: Gregory Anders 
---
 runtime/doc/api.txt     | 2 +-
 runtime/doc/editing.txt | 2 +-
 runtime/doc/gui.txt     | 4 ++--
 runtime/doc/lsp.txt     | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 9faff82f06..90dca81953 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -809,7 +809,7 @@ nvim_feedkeys({keys}, {mode}, {escape_ks})                   *nvim_feedkeys()*
     Parameters: ~
       • {keys}       to be typed
       • {mode}       behavior flags, see |feedkeys()|
-      • {escape_ks}  If true, escape K_SPECIAL bytes in `keys` This should be
+      • {escape_ks}  If true, escape K_SPECIAL bytes in `keys`. This should be
                      false if you already used |nvim_replace_termcodes()|, and
                      true otherwise.
 
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index e379d9eeb1..34650b88d4 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1651,7 +1651,7 @@ There are three different types of searching:
    with depth limiter (/usr/**2) or upward search (;) notations.
 
 ==============================================================================
-11. Trusted Files						*trust*
+12. Trusted Files						*trust*
 
 Nvim has the ability to execute arbitrary code through the 'exrc' option. In
 order to prevent executing code from untrusted sources, Nvim has the concept of
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 8f09e5225f..1fda624fc6 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -450,8 +450,8 @@ The default "PopUp" menu is: >
     anoremenu PopUp.Paste                       "+gP
     vnoremenu PopUp.Paste                       "+P
     vnoremenu PopUp.Delete                      "_x
-    nnoremenu PopUp.Select\ All>                ggVG
-    vnoremenu PopUp.Select\ All>                gg0oG$
+    nnoremenu PopUp.Select\ All                 ggVG
+    vnoremenu PopUp.Select\ All                 gg0oG$
     inoremenu PopUp.Select\ All                 VG
     anoremenu PopUp.-1-                         
     anoremenu PopUp.How-to\ disable\ mouse      help disable-mouse
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 0255d78c4c..d9b944bfe2 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1416,7 +1416,7 @@ buf_highlight_references({bufnr}, {references}, {offset_encoding})
       • {offset_encoding}  (string) One of "utf-8", "utf-16", "utf-32".
 
     See also: ~
-        https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight
+        https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentContentChangeEvent
 
                                              *vim.lsp.util.character_offset()*
 character_offset({buf}, {row}, {col}, {offset_encoding})
@@ -1952,7 +1952,7 @@ compute_diff({___MissingCloseParenHere___})
       • {offset_encoding}  (string) encoding requested by language server
 
     Return: ~
-        (table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent
+        (table) TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentContentChangeEvent
 
 
 ==============================================================================
-- 
cgit 


From 5093f38c9fed9fae04234035ea253862ba8375ef Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 22 Nov 2022 13:50:50 +0100
Subject: feat(help): highlighted codeblocks

---
 runtime/doc/lua.txt | 110 ++++++++++++++++++++++++++--------------------------
 1 file changed, 55 insertions(+), 55 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index bcbbd69f11..93471b50ad 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -12,7 +12,7 @@ Lua engine                                                           *lua* *Lua*
 INTRODUCTION                                                       *lua-intro*
 
 The Lua 5.1 script engine is builtin and always available. Try this command to
-get an idea of what lurks beneath: >
+get an idea of what lurks beneath: >vim
 
     :lua print(vim.inspect(package.loaded))
 
@@ -56,20 +56,20 @@ https://www.lua.org/doc/cacm2018.pdf
   versatile control for both Lua and its host (Nvim).
 
                                                            *lua-call-function*
-Lua functions can be called in multiple ways. Consider the function: >
+Lua functions can be called in multiple ways. Consider the function: >lua
     local foo = function(a, b)
         print("A: ", a)
         print("B: ", b)
     end
 
-The first way to call this function is: >
+The first way to call this function is: >lua
     foo(1, 2)
     -- ==== Result ====
     -- A: 1
     -- B: 2
 
 This way of calling a function is familiar from most scripting languages.
-In Lua, any missing arguments are passed as `nil`. Example: >
+In Lua, any missing arguments are passed as `nil`. Example: >lua
     foo(1)
     -- ==== Result ====
     -- A: 1
@@ -81,7 +81,7 @@ discarded.
 It is also allowed to omit the parentheses (only) if the function takes
 exactly one string (`"foo"`) or table literal (`{1,2,3}`). The latter is often
 used to approximate the "named parameters" feature of languages like Python
-("kwargs" or "keyword args"). Example: >
+("kwargs" or "keyword args"). Example: >lua
     local func_with_opts = function(opts)
         local will_do_foo = opts.foo
         local filename = opts.filename
@@ -95,7 +95,7 @@ There is nothing special going on here except that parentheses are treated as
 whitespace. But visually, this small bit of sugar gets reasonably close to
 a "keyword args" interface.
 
-It is of course also valid to call the function with parentheses: >
+It is of course also valid to call the function with parentheses: >lua
 
     func_with_opts({ foo = true, filename = "hello.world" })
 <
@@ -108,7 +108,7 @@ Lua intentionally does not support regular expressions, instead it has limited
 "patterns" which avoid the performance pitfalls of extended regex.
 |luaref-patterns|
 
-Examples using |string.match()|: >
+Examples using |string.match()|: >lua
 
     print(string.match("foo123bar123", "%d+"))
     -- 123
@@ -205,7 +205,7 @@ Note:
 
 - Although adjustments happen automatically, Nvim does not track current
   values of |package.path| or |package.cpath|. If you happen to delete some
-  paths from there you can set 'runtimepath' to trigger an update: >
+  paths from there you can set 'runtimepath' to trigger an update: >vim
       let &runtimepath = &runtimepath
 
 - Skipping paths from 'runtimepath' which contain semicolons applies both to
@@ -231,11 +231,11 @@ arguments separated by " " (space) instead of "\t" (tab).
     chunk is evaluated as an expression and printed. `:lua =expr` is
     equivalent to `:lua print(vim.inspect(expr))`
 
-    Examples: >
+    Examples: >vim
         :lua vim.api.nvim_command('echo "Hello, Nvim!"')
-<    To see the Lua version: >
+<    To see the Lua version: >vim
         :lua print(_VERSION)
-<    To see the LuaJIT version: >
+<    To see the LuaJIT version: >vim
         :lua =jit.version
 <
                                                                 *:lua-heredoc*
@@ -246,7 +246,7 @@ arguments separated by " " (space) instead of "\t" (tab).
     be preceded by whitespace. You can omit [endmarker] after the "<<" and use
     a dot "." after {script} (similar to |:append|, |:insert|).
 
-    Example: >
+    Example: >vim
         function! CurrentLineInfo()
         lua << EOF
         local linenr = vim.api.nvim_win_get_cursor(0)[1]
@@ -268,7 +268,7 @@ arguments separated by " " (space) instead of "\t" (tab).
     that becomes the text of the corresponding buffer line. Default [range] is
     the whole file: "1,$".
 
-    Examples: >
+    Examples: >vim
         :luado return string.format("%s\t%d", line:reverse(), #line)
 
         :lua require"lpeg"
@@ -282,7 +282,7 @@ arguments separated by " " (space) instead of "\t" (tab).
     The whole argument is used as the filename (like |:edit|), spaces do not
     need to be escaped. Alternatively you can |:source| Lua files.
 
-    Examples: >
+    Examples: >vim
         :luafile script.lua
         :luafile %
 <
@@ -293,7 +293,7 @@ luaeval()                                                 *lua-eval* *luaeval()*
 The (dual) equivalent of "vim.eval" for passing Lua values to Nvim is
 "luaeval". "luaeval" takes an expression string and an optional argument used
 for _A inside expression and returns the result of the expression. It is
-semantically equivalent in Lua to: >
+semantically equivalent in Lua to: >lua
 
     local chunkheader = "local _A = select(1, ...) return "
     function luaeval (expstr, arg)
@@ -307,11 +307,11 @@ converted to a |Blob|. Conversion of other Lua types is an error.
 
 The magic global "_A" contains the second argument to luaeval().
 
-Example: >
+Example: >vim
     :echo luaeval('_A[1] + _A[2]', [40, 2])
-    42
+    " 42
     :echo luaeval('string.match(_A, "[a-z]+")', 'XYXfoo123')
-    foo
+    " foo
 <
 Lua tables are used as both dictionaries and lists, so it is impossible to
 determine whether empty table is meant to be empty list or empty dictionary.
@@ -343,7 +343,7 @@ cases there is the following agreement:
      form a 1-step sequence from 1 to N are ignored, as well as all
      non-integral keys.
 
-Examples: >
+Examples: >vim
 
     :echo luaeval('math.pi')
     :function Rand(x,y) " random uniform between x and y
@@ -360,16 +360,16 @@ treated specially.
 Vimscript v:lua interface                                         *v:lua-call*
 
 From Vimscript the special `v:lua` prefix can be used to call Lua functions
-which are global or accessible from global tables. The expression >
+which are global or accessible from global tables. The expression >vim
     v:lua.func(arg1, arg2)
-is equivalent to the Lua chunk >
+is equivalent to the Lua chunk >lua
     return func(...)
-where the args are converted to Lua values. The expression >
+where the args are converted to Lua values. The expression >vim
     v:lua.somemod.func(args)
-is equivalent to the Lua chunk >
+is equivalent to the Lua chunk >lua
     return somemod.func(...)
 
-In addition, functions of packages can be accessed like >
+In addition, functions of packages can be accessed like >vim
     v:lua.require'mypack'.func(arg1, arg2)
     v:lua.require'mypack.submod'.func(arg1, arg2)
 Note: Only single quote form without parens is allowed. Using
@@ -378,11 +378,11 @@ is still valid as a function call of itself, in case require returns a useful
 value).
 
 The `v:lua` prefix may be used to call Lua functions as |method|s. For
-example: >
+example: >vim
     arg1->v:lua.somemod.func(arg2)
 <
 You can use `v:lua` in "func" options like 'tagfunc', 'omnifunc', etc.
-For example consider the following Lua omnifunc handler: >
+For example consider the following Lua omnifunc handler: >lua
 
     function mymod.omnifunc(findstart, base)
       if findstart == 1 then
@@ -397,7 +397,7 @@ Note: The module ("mymod" in the above example) must either be a Lua global,
 or use the require syntax as specified above to access it from a package.
 
 Note: `v:lua` without a call is not allowed in a Vimscript expression:
-|Funcref|s cannot represent Lua functions. The following are errors: >
+|Funcref|s cannot represent Lua functions. The following are errors: >vim
 
     let g:Myvar = v:lua.myfunc        " Error
     call SomeFunc(v:lua.mycallback)   " Error
@@ -411,7 +411,7 @@ The Nvim Lua "standard library" (stdlib) is the `vim` module, which exposes
 various functions and sub-modules. It is always loaded, thus `require("vim")`
 is unnecessary.
 
-You can peek at the module properties: >
+You can peek at the module properties: >vim
 
     :lua print(vim.inspect(vim))
 
@@ -431,7 +431,7 @@ Result is something like this: >
       ...
     }
 
-To find documentation on e.g. the "deepcopy" function: >
+To find documentation on e.g. the "deepcopy" function: >vim
 
     :help vim.deepcopy()
 
@@ -443,7 +443,7 @@ VIM.LOOP                                                   *lua-loop* *vim.loop*
 
 `vim.loop` exposes all features of the Nvim event-loop. This is a low-level
 API that provides functionality for networking, filesystem, and process
-management. Try this command to see available functions: >
+management. Try this command to see available functions: >vim
 
     :lua print(vim.inspect(vim.loop))
 <
@@ -452,14 +452,14 @@ see |luv-intro| for a full reference manual.
 
                                                     *E5560* *lua-loop-callbacks*
 It is an error to directly invoke `vim.api` functions (except |api-fast|) in
-`vim.loop` callbacks. For example, this is an error: >
+`vim.loop` callbacks. For example, this is an error: >lua
 
     local timer = vim.loop.new_timer()
     timer:start(1000, 0, function()
       vim.api.nvim_command('echomsg "test"')
     end)
 <
-To avoid the error use |vim.schedule_wrap()| to defer the callback: >
+To avoid the error use |vim.schedule_wrap()| to defer the callback: >lua
 
     local timer = vim.loop.new_timer()
     timer:start(1000, 0, vim.schedule_wrap(function()
@@ -471,7 +471,7 @@ wrapping.)
 
 Example: repeating timer
     1. Save this code to a file.
-    2. Execute it with ":luafile %". >
+    2. Execute it with ":luafile %". >lua
 
     -- Create a timer handle (implementation detail: uv_timer_t).
     local timer = vim.loop.new_timer()
@@ -492,7 +492,7 @@ Example: File-change detection                                    *watch-file*
     3. Use ":Watch %" to watch any file.
     4. Try editing the file from another text editor.
     5. Observe that the file reloads in Nvim (because on_change() calls
-       |:checktime|). >
+       |:checktime|). >lua
 
     local w = vim.loop.new_fs_event()
     local function on_change(err, fname, status)
@@ -515,7 +515,7 @@ Example: TCP echo-server                                          *tcp-server*
     1. Save this code to a file.
     2. Execute it with ":luafile %".
     3. Note the port number.
-    4. Connect from any TCP client (e.g. "nc 0.0.0.0 36795"): >
+    4. Connect from any TCP client (e.g. "nc 0.0.0.0 36795"): >lua
 
     local function create_server(host, port, on_connect)
       local server = vim.loop.new_tcp()
@@ -564,16 +564,16 @@ VIM.HIGHLIGHT                                                  *lua-highlight*
 
 Nvim includes a function for highlighting a selection on yank (see for example
 https://github.com/machakann/vim-highlightedyank). To enable it, add
->
+>vim
     au TextYankPost * silent! lua vim.highlight.on_yank()
 <
 to your `init.vim`. You can customize the highlight group and the duration of
 the highlight via
->
+>vim
     au TextYankPost * silent! lua vim.highlight.on_yank {higroup="IncSearch", timeout=150}
 <
 If you want to exclude visual selections from highlighting on yank, use
->
+>vim
     au TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}
 <
 vim.highlight.on_yank({opts})                        *vim.highlight.on_yank()*
@@ -756,7 +756,7 @@ VIM                                                              *lua-builtin*
 
 vim.api.{func}({...})                                                *vim.api*
     Invokes Nvim |API| function {func} with arguments {...}.
-    Example: call the "nvim_get_current_line()" API function: >
+    Example: call the "nvim_get_current_line()" API function: >lua
         print(tostring(vim.api.nvim_get_current_line()))
 
 vim.version()                                                    *vim.version*
@@ -881,7 +881,7 @@ vim.wait({time} [, {callback}, {interval}, {fast_only}])          *vim.wait()*
 
         If {callback} errors, the error is raised.
 
-        Examples: >
+        Examples: >lua
 
     ---
     -- Wait for 100 ms, allowing other events to process
@@ -922,7 +922,7 @@ vim.ui_attach({ns}, {options}, {callback})                *vim.ui_attach()*
     used to handle messages when setting 'cmdheight' to zero (which is
     likewise experimental).
 
-    Example (stub for a |ui-popupmenu| implementation): >
+    Example (stub for a |ui-popupmenu| implementation): >lua
 
       ns = vim.api.nvim_create_namespace('my_fancy_pum')
 
@@ -950,7 +950,7 @@ vim.type_idx                                                    *vim.type_idx*
 
 vim.val_idx                                                      *vim.val_idx*
     Value index for tables representing |Float|s. A table representing
-    floating-point value 1.0 looks like this: >
+    floating-point value 1.0 looks like this: >lua
         {
           [vim.type_idx] = vim.types.float,
           [vim.val_idx] = 1.0,
@@ -997,7 +997,7 @@ See also https://github.com/nanotee/nvim-lua-guide.
 vim.call({func}, {...})                                           *vim.call()*
     Invokes |vim-function| or |user-function| {func} with arguments {...}.
     See also |vim.fn|.
-    Equivalent to: >
+    Equivalent to: >lua
         vim.fn[func]({...})
 
 vim.cmd({command})
@@ -1005,7 +1005,7 @@ vim.cmd({command})
 
 vim.fn.{func}({...})                                                  *vim.fn*
     Invokes |vim-function| or |user-function| {func} with arguments {...}.
-    To call autoload functions, use the syntax: >
+    To call autoload functions, use the syntax: >lua
         vim.fn['some#function']({...})
 <
     Unlike vim.api.|nvim_call_function()| this converts directly between Vim
@@ -1028,7 +1028,7 @@ from Lua conveniently and idiomatically by referencing the `vim.*` Lua tables
 described below. In this way you can easily read and modify global Vimscript
 variables from Lua.
 
-Example: >
+Example: >lua
 
     vim.g.foo = 5     -- Set the g:foo Vimscript variable.
     print(vim.g.foo)  -- Get and print the g:foo Vimscript variable.
@@ -1041,7 +1041,7 @@ Nvim. This is because the index into the namespace simply returns a copy.
 Instead the whole dictionary must be written as one. This can be achieved by
 creating a short-lived temporary.
 
-Example: >
+Example: >lua
 
     vim.g.my_dict.field1 = 'value'  -- Does not work
 
@@ -1076,7 +1076,7 @@ vim.env                                                              *vim.env*
     Environment variables defined in the editor session.
     See |expand-env| and |:let-environment| for the Vimscript behavior.
     Invalid or unset key returns `nil`.
-    Example: >
+    Example: >lua
         vim.env.FOO = 'bar'
         print(vim.env.TERM)
 <
@@ -1110,7 +1110,7 @@ vim.o                                                                  *vim.o*
     Note: this works on both buffer-scoped and window-scoped options using the
     current buffer and window.
 
-    Example: >
+    Example: >lua
         vim.o.cmdheight = 4
         print(vim.o.columns)
         print(vim.o.foo)     -- error: invalid key
@@ -1123,7 +1123,7 @@ vim.go                                                                *vim.go*
     option value and thus is mostly useful for use with |global-local|
     options.
 
-    Example: >
+    Example: >lua
         vim.go.cmdheight = 4
         print(vim.go.columns)
         print(vim.go.bar)     -- error: invalid key
@@ -1135,7 +1135,7 @@ vim.bo[{bufnr}]                                                                *
 
     Note: this is equivalent to both `:set` and `:setlocal`.
 
-    Example: >
+    Example: >lua
         local bufnr = vim.api.nvim_get_current_buf()
         vim.bo[bufnr].buflisted = true    -- same as vim.bo.buflisted = true
         print(vim.bo.comments)
@@ -1146,11 +1146,11 @@ vim.wo[{winid}]                                                                *
     Like `:set`. If [{winid}] is omitted then the current window is used.
     Invalid {winid} or key is an error.
 
-    Note: this does not access |local-options| (`:setlocal`) instead use: >
+    Note: this does not access |local-options| (`:setlocal`) instead use: >lua
         nvim_get_option_value(OPTION, { scope = 'local', win = winid })
         nvim_set_option_value(OPTION, VALUE, { scope = 'local', win = winid }
 <
-    Example: >
+    Example: >lua
         local winid = vim.api.nvim_get_current_win()
         vim.wo[winid].number = true    -- same as vim.wo.number = true
         print(vim.wo.foldmarker)
@@ -1232,7 +1232,7 @@ Option:get()
     values will be returned in exactly the same fashion.
 
     For values that are comma-separated lists, an array will be returned with
-    the values as entries in the array: >
+    the values as entries in the array: >lua
         vim.cmd [[set wildignore=*.pyc,*.o]]
 
         vim.pretty_print(vim.opt.wildignore:get())
@@ -1245,7 +1245,7 @@ Option:get()
         -- Will ignore: *.o
 <
     For values that are comma-separated maps, a table will be returned with
-    the names as keys and the values as entries: >
+    the names as keys and the values as entries: >lua
         vim.cmd [[set listchars=space:_,tab:>~]]
 
         vim.pretty_print(vim.opt.listchars:get())
@@ -1256,7 +1256,7 @@ Option:get()
         end
 <
     For values that are lists of flags, a set will be returned with the flags
-    as keys and `true` as entries. >
+    as keys and `true` as entries. >lua
         vim.cmd [[set formatoptions=njtcroql]]
 
         vim.pretty_print(vim.opt.formatoptions:get())
-- 
cgit 


From 952f19ba38a3c826c268c4f744a332cf90021800 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 22 Nov 2022 18:41:00 +0100
Subject: docs: add language annotation to Nvim manual

---
 runtime/doc/api.txt                    |  38 +--
 runtime/doc/channel.txt                |  14 +-
 runtime/doc/deprecated.txt             |   2 +-
 runtime/doc/dev_style.txt              |  87 ++++---
 runtime/doc/develop.txt                |   2 +-
 runtime/doc/diagnostic.txt             |  14 +-
 runtime/doc/if_pyth.txt                |  62 ++---
 runtime/doc/intro.txt                  |   4 +-
 runtime/doc/job_control.txt            |  16 +-
 runtime/doc/lsp-extension.txt          |   4 +-
 runtime/doc/lsp.txt                    |  47 ++--
 runtime/doc/lua.txt                    | 126 +++++-----
 runtime/doc/luaref.txt                 | 410 ++++++++++++++++-----------------
 runtime/doc/luvref.txt                 |  40 ++--
 runtime/doc/nvim.txt                   |  14 +-
 runtime/doc/nvim_terminal_emulator.txt |  78 +++----
 runtime/doc/provider.txt               |  43 ++--
 runtime/doc/term.txt                   |  18 +-
 runtime/doc/treesitter.txt             |  10 +-
 runtime/doc/ui.txt                     |   6 +-
 runtime/doc/vim_diff.txt               |  18 +-
 21 files changed, 528 insertions(+), 525 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 90dca81953..0eccb64517 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -51,7 +51,7 @@ Connecting to the socket is the easiest way a programmer can test the API,
 which can be done through any msgpack-rpc client library or full-featured
 |api-client|. Here's a Ruby script that prints "hello world!" in the current
 Nvim instance:
->
+>ruby
     #!/usr/bin/env ruby
     # Requires msgpack-rpc: gem install msgpack-rpc
     #
@@ -79,7 +79,7 @@ functions can be called interactively:
 <
 You can also embed Nvim via |jobstart()|, and communicate using |rpcrequest()|
 and |rpcnotify()|:
->
+>vim
     let nvim = jobstart(['nvim', '--embed'], {'rpc': v:true})
     echo rpcrequest(nvim, 'nvim_eval', '"Hello " . "world!"')
     call jobstop(nvim)
@@ -201,9 +201,9 @@ any of these approaches:
      Example (requires Python "pyyaml" and "msgpack-python" modules): >
      nvim --api-info | python -c 'import msgpack, sys, yaml; yaml.dump(msgpack.unpackb(sys.stdin.buffer.read()), sys.stdout)'
 <
-  3. Use the |api_info()| Vimscript function. >
+  3. Use the |api_info()| Vimscript function. >vim
      :lua print(vim.inspect(vim.fn.api_info()))
-<     Example using |filter()| to exclude non-deprecated API functions: >
+<     Example using |filter()| to exclude non-deprecated API functions: >vim
      :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val.name')
 
 ==============================================================================
@@ -361,10 +361,10 @@ callbacks. These callbacks are called frequently in various contexts;
 receive parameters ("lines", {buf}, {changedtick}, {firstline}, {lastline},
 {new_lastline}, {old_byte_size} [, {old_utf32_size}, {old_utf16_size}]).
 Unlike remote channel events the text contents are not passed. The new text can
-be accessed inside the callback as
-
-    `vim.api.nvim_buf_get_lines(buf, firstline, new_lastline, true)`
+be accessed inside the callback as >lua
 
+    vim.api.nvim_buf_get_lines(buf, firstline, new_lastline, true)
+<
 {old_byte_size} is the total size of the replaced region {firstline} to
 {lastline} in bytes, including the final newline after {lastline}. if
 `utf_sizes` is set to true in |nvim_buf_attach()| keyword args, then the
@@ -400,7 +400,7 @@ performance can be improved by calling |nvim_buf_add_highlight()| as an
 asynchronous notification, after first (synchronously) requesting a source id.
 
 Example using the Python API client (|pynvim|):
->
+>python
     src = vim.new_highlight_source()
     buf = vim.current.buffer
     for i in range(5):
@@ -414,7 +414,7 @@ clear highlights from a specific source, in a specific line range or the
 entire buffer by passing in the line range 0, -1 (the latter is the default in
 python as used above).
 
-Example using the API from Vimscript: >
+Example using the API from Vimscript: >vim
 
     call nvim_buf_set_lines(0, 0, 0, v:true, ["test text"])
     let src = nvim_buf_add_highlight(0, 0, "String", 1, 0, 4)
@@ -438,7 +438,7 @@ Two ways to create a floating window:
 To close it use |nvim_win_close()| or a command such as |:close|.
 
 To check whether a window is floating, check whether the `relative` option in
-its config is non-empty: >
+its config is non-empty: >lua
 
     if vim.api.nvim_win_get_config(window_id).relative ~= '' then
       -- window with this window_id is floating
@@ -456,7 +456,7 @@ Currently, floating windows don't support some widgets like scrollbar.
 The output of |:mksession| does not include commands for restoring floating
 windows.
 
-Example: create a float with scratch buffer: >
+Example: create a float with scratch buffer: >vim
 
     let buf = nvim_create_buf(v:false, v:true)
     call nvim_buf_set_lines(buf, 0, -1, v:true, ["test", "text"])
@@ -510,19 +510,20 @@ Let's set an extmark at the first row (row=0) and third column (column=2).
       01 2345678
     0 ex|ample..
         ^ extmark position
-
+<
+>vim
     let g:mark_ns = nvim_create_namespace('myplugin')
     let g:mark_id = nvim_buf_set_extmark(0, g:mark_ns, 0, 2, {})
 <
-We can get the mark by its id: >
+We can get the mark by its id: >vim
 
     echo nvim_buf_get_extmark_by_id(0, g:mark_ns, g:mark_id, {})
-    => [0, 2]
+    " => [0, 2]
 
-We can get all marks in a buffer by |namespace| (or by a range): >
+We can get all marks in a buffer by |namespace| (or by a range): >vim
 
     echo nvim_buf_get_extmarks(0, g:mark_ns, 0, -1, {})
-    => [[1, 0, 2]]
+    " => [[1, 0, 2]]
 
 Deleting all surrounding text does NOT remove an extmark! To remove extmarks
 use |nvim_buf_del_extmark()|. Deleting "x" in our example: >
@@ -530,9 +531,10 @@ use |nvim_buf_del_extmark()|. Deleting "x" in our example: >
       0 12345678
     0 e|ample..
        ^ extmark position
-
+<
+>vim
     echo nvim_buf_get_extmark_by_id(0, g:mark_ns, g:mark_id, {})
-    => [0, 1]
+    " => [0, 1]
 <
     Note: Extmark "gravity" decides how it will shift after a text edit.
           See |nvim_buf_set_extmark()|
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt
index f4a17b1842..1c52b2d692 100644
--- a/runtime/doc/channel.txt
+++ b/runtime/doc/channel.txt
@@ -91,7 +91,7 @@ only bytes can be written to Nvim's own stderr.
 
     There are two ways to deal with this:
     - 1. To wait for the entire output, use |channel-buffered| mode.
-    - 2. To read line-by-line, use the following code: >
+    - 2. To read line-by-line, use the following code: >vim
 	let s:lines = ['']
 	func! s:on_event(job_id, data, event) dict
 	  let eof = (a:data == [''])
@@ -108,7 +108,7 @@ callbacks.
 
 Data can be sent to the channel using the |chansend()| function. Here is a
 simple example, echoing some data through a cat-process:
->
+>vim
     function! s:OnEvent(id, data, event) dict
       let str = join(a:data, "\n")
       echomsg str
@@ -119,7 +119,7 @@ simple example, echoing some data through a cat-process:
 
 Here is a example of setting a buffer to the result of grep, but only after
 all data has been processed:
->
+>vim
     function! s:OnEvent(id, data, event) dict
       call nvim_buf_set_lines(2, 0, -1, v:true, a:data)
     endfunction
@@ -142,7 +142,7 @@ However, change of PTY size can be signaled to the slave using |jobresize()|.
 See also |terminal-emulator|.
 
 Terminal characteristics (termios) for |:terminal| and PTY channels are copied
-from the host TTY, or if Nvim is |--headless| it uses default values: >
+from the host TTY, or if Nvim is |--headless| it uses default values: >vim
     :echo system('nvim --headless +"te stty -a" +"sleep 1" +"1,/^$/print" +q')
 
 ==============================================================================
@@ -163,7 +163,7 @@ used as a channel. See also |--embed|.
 Call |stdioopen()| during |startup| to open the stdio channel as |channel-id| 1.
 Nvim's stderr is always available as |v:stderr|, a write-only bytes channel.
 
-Example: >
+Example: >vim
     func! OnEvent(id, data, event)
       if a:data == [""]
         quit
@@ -172,7 +172,7 @@ Example: >
     endfunc
     call stdioopen({'on_stdin': 'OnEvent'})
 <
-Put this in `uppercase.vim` and run:  >
+Put this in `uppercase.vim` and run:  >bash
     nvim --headless --cmd "source uppercase.vim"
 
 ==============================================================================
@@ -223,7 +223,7 @@ start of the line.
 
 Here is an example for Unix.  It starts a shell in the background and prompts
 for the next shell command.  Output from the shell is displayed above the
-prompt. >
+prompt. >vim
 
 	" Function handling a line of text that has been typed.
 	func TextEntered(text)
diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt
index 401ac87d90..1bdd13ac0c 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -30,7 +30,7 @@ ENVIRONMENT VARIABLES
     - detect a parent Nvim (use |$NVIM| instead)
   - Ignored if --listen is given.
   - Unset by |terminal| and |jobstart()| unless explicitly given by the "env"
-    option. Example: >
+    option. Example: >vim
 	call jobstart(['foo'], { 'env': { 'NVIM_LISTEN_ADDRESS': v:servername  } })
 <
 
diff --git a/runtime/doc/dev_style.txt b/runtime/doc/dev_style.txt
index 6afe2f7ee7..b96b01dbff 100644
--- a/runtime/doc/dev_style.txt
+++ b/runtime/doc/dev_style.txt
@@ -38,7 +38,7 @@ All header files should have `#define` guards to prevent multiple inclusion.
 The format of the symbol name should be `NVIM___H`.
 
     In foo/bar.h:
->
+>c
         #ifndef NVIM_FOO_BAR_H
         #define NVIM_FOO_BAR_H
 
@@ -71,7 +71,7 @@ C99 allows you to declare variables anywhere in a function. Declare them in as
 local a scope as possible, and as close to the first use as possible. This
 makes it easier for the reader to find the declaration and see what type the
 variable is and what it was initialized to. In particular, initialization
-should be used instead of declaration and assignment, e.g. >
+should be used instead of declaration and assignment, e.g. >c
 
     int i;
     i = f();      // BAD: initialization separate from declaration.
@@ -110,7 +110,7 @@ Variable-length arrays can cause hard to detect stack overflows.
 
 Postincrement and Postdecrement ~
 
-Use postfix form (`i++`) in statements. >
+Use postfix form (`i++`) in statements. >c
 
     for (int i = 0; i < 3; i++) { }
     int j = ++i;  // OK: ++i is used as an expression.
@@ -136,7 +136,7 @@ Use `const` pointers whenever possible. Avoid `const` on non-pointer parameter d
     before the "noun" (`int`).
 
     That said, while we encourage putting `const` first, we do not require it.
-    But be consistent with the code around you! >
+    But be consistent with the code around you! >c
 
     void foo(const char *p, int i);
     }
@@ -176,14 +176,14 @@ Type		unsigned    signed
 
 Booleans ~
 
-Use `bool` to represent boolean values. >
+Use `bool` to represent boolean values. >c
 
     int loaded = 1;  // BAD: loaded should have type bool.
 
 
 Conditions ~
 
-Don't use "yoda-conditions". Use at most one assignment per condition. >
+Don't use "yoda-conditions". Use at most one assignment per condition. >c
 
     if (1 == x) {
 
@@ -196,7 +196,7 @@ Function declarations ~
 
 Every function must not have a separate declaration.
 
-Function declarations are created by the gendeclarations.lua script. >
+Function declarations are created by the gendeclarations.lua script. >c
 
     static void f(void);
 
@@ -209,7 +209,7 @@ Function declarations are created by the gendeclarations.lua script. >
 General translation unit layout ~
 
 The definitions of public functions precede the definitions of static
-functions. >
+functions. >c
 
     
@@ -230,7 +230,7 @@ if .c file does not contain any static functions. Included file name consists of the .c file name without extension, preceded by the directory name relative to src/nvim. Name of the file containing static functions declarations ends with `.c.generated.h`, `*.h.generated.h` files -contain only non-static function declarations. > +contain only non-static function declarations. >c // src/nvim/foo.c file #include @@ -274,7 +274,7 @@ comparisons, and structure alignment. `#pragma pack()` and `__declspec(align())`. - Use the `LL` or `ULL` suffixes as needed to create 64-bit constants. For - example: > + example: >c int64_t my_value = 0x123456789LL; uint64_t my_mask = 3ULL << 48; @@ -288,7 +288,7 @@ Use `sizeof(varname)` when you take the size of a particular variable. `sizeof(varname)` will update appropriately if someone changes the variable type either now or later. You may use `sizeof(type)` for code unrelated to any particular variable, such as code that manages an external or internal data -format where a variable of an appropriate C type is not convenient. > +format where a variable of an appropriate C type is not convenient. >c Struct data; memset(&data, 0, sizeof(data)); @@ -324,7 +324,7 @@ Give as descriptive a name as possible, within reason. Do not worry about saving horizontal space as it is far more important to make your code immediately understandable by a new reader. Do not use abbreviations that are ambiguous or unfamiliar to readers outside your project, and do not abbreviate -by deleting letters within a word. > +by deleting letters within a word. >c int price_count_reader; // No abbreviation. int num_errors; // "num" is a widespread convention. @@ -361,7 +361,7 @@ Typedef-ed structs and enums start with a capital letter and have a capital letter for each new word, with no underscores: `MyExcitingStruct`. Non-Typedef-ed structs and enums are all lowercase with underscores between -words: `struct my_exciting_struct` . > +words: `struct my_exciting_struct` . >c struct my_struct { ... @@ -376,7 +376,7 @@ instance: `my_exciting_local_variable`. Common Variable names ~ - For example: > + For example: >c string table_name; // OK: uses underscore. string tablename; // OK: all lowercase. @@ -386,7 +386,7 @@ instance: `my_exciting_local_variable`. Struct Variables ~ - Data members in structs should be named like regular variables. > + Data members in structs should be named like regular variables. >c struct url_table_properties { string name; @@ -406,7 +406,7 @@ Use a `k` followed by mixed case: `kDaysInAWeek`. All compile-time constants, whether they are declared locally or globally, follow a slightly different naming convention from other variables. Use a `k` -followed by words with uppercase first letters: > +followed by words with uppercase first letters: >c const int kDaysInAWeek = 7; @@ -416,7 +416,7 @@ Function names are all lowercase, with underscores between words. For instance: `my_exceptional_function()`. All functions in the same header file should have a common prefix. -In `os_unix.h`: > +In `os_unix.h`: >c void unix_open(const char *path); void unix_user_id(void); @@ -429,7 +429,7 @@ normal operation. Enumerator Names ~ -Enumerators should be named like constants: `kEnumName`. > +Enumerators should be named like constants: `kEnumName`. >c enum url_table_errors { kOK = 0, @@ -440,7 +440,7 @@ Enumerators should be named like constants: `kEnumName`. > Macro Names ~ -They're like this: `MY_MACRO_THAT_SCARES_CPP_DEVELOPERS`. > +They're like this: `MY_MACRO_THAT_SCARES_CPP_DEVELOPERS`. >c #define ROUND(x) ... #define PI_ROUNDED 5.0 @@ -461,7 +461,7 @@ Nvim uses Doxygen comments. Comment Style ~ -Use the `//`-style syntax only. > +Use the `//`-style syntax only. >c // This is a comment spanning // multiple lines @@ -489,7 +489,7 @@ Start each file with a description of its contents. mention in the `.c` that the documentation is in the `.h` file. Do not duplicate comments in both the `.h` and the `.c`. Duplicated - comments diverge. > + comments diverge. >c /// A brief description of this file. /// @@ -500,7 +500,7 @@ Start each file with a description of its contents. Struct Comments ~ Every struct definition should have accompanying comments that describes what -it is for and how it should be used. > +it is for and how it should be used. >c /// Window info stored with a buffer. /// @@ -522,7 +522,7 @@ it is for and how it should be used. > }; If the field comments are short, you can also put them next to the field. But -be consistent within one struct, and follow the necessary doxygen style. > +be consistent within one struct, and follow the necessary doxygen style. >c struct wininfo_S { WinInfo *wi_next; ///< Next entry or NULL for last entry. @@ -560,8 +560,7 @@ of a function describe operation. - If the function allocates memory that the caller must free. - Whether any of the arguments can be a null pointer. - If there are any performance implications of how a function is used. - - If the function is re-entrant. What are its synchronization assumptions? - > + - If the function is re-entrant. What are its synchronization assumptions? >c /// Brief description of the function. /// /// Detailed description. @@ -589,7 +588,7 @@ of a function describe operation. Note you should not just repeat the comments given with the function declaration, in the `.h` file or wherever. It's okay to recapitulate briefly what the function does, but the focus of the comments should be on - how it does it. > + how it does it. >c // Note that we don't use Doxygen comments here. Iterator *get_iterator(void *arg1, void *arg2) @@ -607,7 +606,7 @@ comments are required. Global Variables ~ All global variables should have a comment describing what they are and - what they are used for. For example: > + what they are used for. For example: >c /// The total number of tests cases that we run /// through in this regression test. @@ -623,7 +622,7 @@ interesting, or important parts of your code. Also, lines that are non-obvious should get a comment at the end of the line. These end-of-line comments should be separated from the code by 2 - spaces. Example: > + spaces. Example: >c // If we have enough memory, mmap the data portion too. mmap_budget = max(0, mmap_budget - index_->length()); @@ -636,7 +635,7 @@ interesting, or important parts of your code. function returns. If you have several comments on subsequent lines, it can often be more - readable to line them up: > + readable to line them up: >c do_something(); // Comment here so the comments line up. do_something_else_that_is_longer(); // Comment here so there are two spaces between @@ -652,7 +651,7 @@ interesting, or important parts of your code. When you pass in a null pointer, boolean, or literal integer values to functions, you should consider adding a comment about what they are, or make your code self-documenting by using constants. For example, compare: - > + >c bool success = calculate_something(interesting_value, 10, @@ -660,7 +659,7 @@ interesting, or important parts of your code. NULL); // What are these arguments?? < - versus: > + versus: >c bool success = calculate_something(interesting_value, 10, // Default base value. @@ -668,7 +667,7 @@ interesting, or important parts of your code. NULL); // No callback. < - Or alternatively, constants or self-describing variables: > + Or alternatively, constants or self-describing variables: >c const int kDefaultBaseValue = 10; const bool kFirstTimeCalling = false; @@ -683,7 +682,7 @@ interesting, or important parts of your code. Note that you should never describe the code itself. Assume that the person reading the code knows C better than you do, even though he or she - does not know what you are trying to do: > + does not know what you are trying to do: >c // Now go through the b array and make sure that if i occurs, // the next element is i+1. @@ -718,7 +717,7 @@ about the problem referenced by the `TODO`. The main purpose is to have a consistent `TODO` format that can be searched to find the person who can provide more details upon request. A `TODO` is not a commitment that the person referenced will fix the problem. Thus when you create a `TODO`, it is -almost always your name that is given. > +almost always your name that is given. >c // TODO(kl@gmail.com): Use a "*" here for concatenation operator. // TODO(Zeke): change this to use relations. @@ -786,19 +785,19 @@ Function Calls ~ On one line if it fits; otherwise, wrap arguments at the parenthesis. -Function calls have the following format: > +Function calls have the following format: >c bool retval = do_something(argument1, argument2, argument3); If the arguments do not all fit on one line, they should be broken up onto multiple lines, with each subsequent line aligned with the first argument. Do -not add spaces after the open paren or before the close paren: > +not add spaces after the open paren or before the close paren: >c bool retval = do_something(averyveryveryverylongargument1, argument2, argument3); If the function has many arguments, consider having one per line if this makes -the code more readable: > +the code more readable: >c bool retval = do_something(argument1, argument2, @@ -806,7 +805,7 @@ the code more readable: > argument4); Arguments may optionally all be placed on subsequent lines, with one line per -argument: > +argument: >c if (...) { ... @@ -830,7 +829,7 @@ place but with one space after the `{` and one space before the `}` If the braced list follows a name (e.g. a type or variable name), format as if the `{}` were the parentheses of a function call with that name. If there is -no name, assume a zero-length name. > +no name, assume a zero-length name. >c struct my_struct m = { // Here, you could also break before {. superlongvariablename1, @@ -847,7 +846,7 @@ Annotate non-trivial fall-through between cases. If not conditional on an enumerated value, switch statements should always have a `default` case (in the case of an enumerated value, the compiler will warn you if any values are not handled). If the default case should never -execute, simply `assert`: > +execute, simply `assert`: >c switch (var) { case 0: @@ -865,7 +864,7 @@ Return Values ~ Do not needlessly surround the `return` expression with parentheses. Use parentheses in `return expr`; only where you would use them in `x = -expr;`. > +expr;`. >c return result; return (some_long_condition && another_condition); @@ -879,12 +878,12 @@ Horizontal Whitespace ~ Use of horizontal whitespace depends on location. General ~ -> +>c int x[] = { 0 }; // Spaces inside braces for braced-init-list. < Variables ~ -> +>c int long_variable = 0; // Don't align assignments. int i = 1; @@ -901,7 +900,7 @@ Use of horizontal whitespace depends on location. Operators ~ -> +>c x = 0; // Assignment operators always have spaces around // them. x = -5; // No spaces separating unary operators and their diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 1ba6ae757b..6862426b1b 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -119,7 +119,7 @@ reflects whether Python support is working. *provider-reload* Sometimes a GUI or other application may want to force a provider to "reload". To reload a provider, undefine its "loaded" flag, then use -|:runtime| to reload it: > +|:runtime| to reload it: >vim :unlet g:loaded_clipboard_provider :runtime autoload/provider/clipboard.vim diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index 07a7d5190f..56c2af10b4 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -68,11 +68,11 @@ The "severity" key in a diagnostic is one of the values defined in Functions that take a severity as an optional parameter (e.g. |vim.diagnostic.get()|) accept one of two forms: -1. A single |vim.diagnostic.severity| value: > +1. A single |vim.diagnostic.severity| value: >lua vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }) -2. A table with a "min" or "max" key (or both): > +2. A table with a "min" or "max" key (or both): >lua vim.diagnostic.get(0, { severity = { min = vim.diagnostic.severity.WARN } }) @@ -107,7 +107,7 @@ Nvim provides these handlers by default: "virtual_text", "signs", and *diagnostic-handlers-example* The example below creates a new handler that notifies the user of diagnostics -with |vim.notify()|: > +with |vim.notify()|: >lua -- It's good practice to namespace custom handlers to avoid collisions vim.diagnostic.handlers["my/notify"] = { @@ -135,7 +135,7 @@ In this example, there is nothing to do when diagnostics are hidden, so we omit the "hide" function. Existing handlers can be overridden. For example, use the following to only -show a sign for the highest severity diagnostic on a given line: > +show a sign for the highest severity diagnostic on a given line: >lua -- Create a custom namespace. This will aggregate signs from all other -- namespaces and only show the one with the highest severity on a @@ -185,7 +185,7 @@ own default highlight groups. For example, the default highlighting for |hl-DiagnosticSignError| is linked to |hl-DiagnosticError|. To change the default (and therefore the linked -highlights), use the |:highlight| command: > +highlights), use the |:highlight| command: >vim highlight DiagnosticError guifg="BrightRed" < @@ -279,7 +279,7 @@ SIGNS *diagnostic-signs* Signs are defined for each diagnostic severity. The default text for each sign is the first letter of the severity name (for example, "E" for ERROR). Signs -can be customized using the following: > +can be customized using the following: >vim sign define DiagnosticSignError text=E texthl=DiagnosticSignError linehl= numhl= sign define DiagnosticSignWarn text=W texthl=DiagnosticSignWarn linehl= numhl= @@ -299,7 +299,7 @@ DiagnosticChanged After diagnostics have changed. When used from Lua, the new diagnostics are passed to the autocmd callback in the "data" table. -Example: > +Example: >lua vim.api.nvim_create_autocmd('DiagnosticChanged', { callback = function(args) diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 9b434e61d7..4c184ddf94 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -16,7 +16,7 @@ Commands *python-commands* *:python* *:py* *E263* *E264* *E887* :[range]py[thon] {stmt} Execute Python statement {stmt}. A simple check if - the `:python` command is working: > + the `:python` command is working: >vim :python print "Hello" :[range]py[thon] << [endmarker] @@ -31,7 +31,7 @@ The {endmarker} below the {script} must NOT be preceded by any white space. If [endmarker] is omitted from after the "<<", a dot '.' must be used after {script}, like for the |:append| and |:insert| commands. -Example: > +Example: >vim function! IcecreamInitialize() python << EOF class StrawberryIcecream: @@ -40,7 +40,7 @@ Example: > EOF endfunction -To see what version of Python you have: > +To see what version of Python you have: >vim :python print(sys.version) There is no need to "import sys", it's done by default. @@ -64,12 +64,12 @@ Note: Python is very sensitive to indenting. Make sure the "class" line and is the whole file: "1,$". Examples: -> +>vim :pydo return "%s\t%d" % (line[::-1], len(line)) :pydo if line: return "%4d: %s" % (linenr, line) < One can use `:pydo` in possible conjunction with `:py` to filter a range using -python. For example: > +python. For example: >vim :py3 << EOF needle = vim.eval('@a') @@ -94,12 +94,13 @@ In the case of :pyfile, the code to execute is the contents of the given file. Python commands cannot be used in the |sandbox|. -To pass arguments you need to set sys.argv[] explicitly. Example: > +To pass arguments you need to set sys.argv[] explicitly. Example: >vim :python sys.argv = ["foo", "bar"] :pyfile myscript.py -Here are some examples *python-examples* > +Here are some examples *python-examples* +>vim :python from vim import * :python from string import upper @@ -113,7 +114,7 @@ to the next, just like the Python REPL. *script-here* When using a script language in-line, you might want to skip this when the language isn't supported. Note that this mechanism doesn't work: -> +>vim if has('python') python << EOF this will NOT work! @@ -121,7 +122,7 @@ language isn't supported. Note that this mechanism doesn't work: endif Instead, put the Python command in a function and call that function: -> +>vim if has('python') function DefPython() python << EOF @@ -139,10 +140,10 @@ The vim module *python-vim* Python code gets all of its access to vim (with one exception - see |python-output| below) via the "vim" module. The vim module implements two methods, three constants, and one error object. You need to import the vim -module before using it: > +module before using it: >vim :python import vim -Overview > +Overview >vim :py print "Hello" # displays a message :py vim.command(cmd) # execute an Ex command :py w = vim.windows[n] # gets window "n" @@ -166,10 +167,10 @@ Methods of the "vim" module vim.command(str) *python-command* Executes the vim (ex-mode) command str. Returns None. - Examples: > + Examples: >vim :py vim.command("set tw=72") :py vim.command("%s/aaa/bbb/g") -< The following definition executes Normal mode commands: > +< The following definition executes Normal mode commands: >python def normal(str): vim.command("normal "+str) # Note the use of single quotes to delimit a string containing @@ -177,7 +178,7 @@ vim.command(str) *python-command* normal('"a2dd"aP') < *E659* The ":python" command cannot be used recursively with Python 2.2 and - older. This only works with Python 2.3 and later: > + older. This only works with Python 2.3 and later: >vim :py vim.command("python print 'Hello again Python'") vim.eval(str) *python-eval* @@ -187,7 +188,7 @@ vim.eval(str) *python-eval* - a list if the Vim expression evaluates to a Vim list - a dictionary if the Vim expression evaluates to a Vim dictionary Dictionaries and lists are recursively expanded. - Examples: > + Examples: >vim :py text_width = vim.eval("&tw") :py str = vim.eval("12+12") # NB result is a string! Use # string.atoi() to convert to @@ -215,7 +216,7 @@ Error object of the "vim" module vim.error *python-error* Upon encountering a Vim error, Python raises an exception of type vim.error. - Example: > + Example: >python try: vim.command("put a") except vim.error: @@ -229,7 +230,7 @@ Constants of the "vim" module vim.buffers *python-buffers* A mapping object providing access to the list of vim buffers. The - object supports the following operations: > + object supports the following operations: >vim :py b = vim.buffers[i] # Indexing (read-only) :py b in vim.buffers # Membership test :py n = len(vim.buffers) # Number of elements @@ -237,7 +238,7 @@ vim.buffers *python-buffers* < vim.windows *python-windows* A sequence object providing access to the list of vim windows. The - object supports the following operations: > + object supports the following operations: >vim :py w = vim.windows[i] # Indexing (read-only) :py w in vim.windows # Membership test :py n = len(vim.windows) # Number of elements @@ -251,7 +252,7 @@ vim.windows *python-windows* vim.tabpages *python-tabpages* A sequence object providing access to the list of vim tab pages. The - object supports the following operations: > + object supports the following operations: >vim :py t = vim.tabpages[i] # Indexing (read-only) :py t in vim.tabpages # Membership test :py n = len(vim.tabpages) # Number of elements @@ -277,7 +278,7 @@ vim.current *python-current* switching to given buffer, window or tab page. It is the only way to switch UI objects in python: you can't assign to |python-tabpage|.window attribute. To switch without triggering - autocommands use > + autocommands use >vim py << EOF saved_eventignore = vim.options['eventignore'] vim.options['eventignore'] = 'all' @@ -330,7 +331,7 @@ the list of paths found in 'runtimepath': with this directory in sys.path and vim.path_hooks in sys.path_hooks python will try to load module from {rtp}/python3 and {rtp}/pythonx for each {rtp} found in 'runtimepath'. -Implementation is similar to the following, but written in C: > +Implementation is similar to the following, but written in C: >python from imp import find_module, load_module import vim @@ -461,12 +462,12 @@ The buffer object methods are: numbers s and e |inclusive|. Note that when adding a line it must not contain a line break character '\n'. -A trailing '\n' is allowed and ignored, so that you can do: > +A trailing '\n' is allowed and ignored, so that you can do: >vim :py b.append(f.readlines()) Buffer object type is available using "Buffer" attribute of vim module. -Examples (assume b is the current buffer) > +Examples (assume b is the current buffer) >vim :py print b.name # write the buffer file name :py b[0] = "hello!!!" # replace the top line :py b[:] = None # delete the whole buffer @@ -605,10 +606,10 @@ variants explicitly if Python 3 is required. {script} {endmarker} The `:py3` and `:python3` commands work similar to `:python`. A - simple check if the `:py3` command is working: > + simple check if the `:py3` command is working: >vim :py3 print("Hello") < - To see what version of Python you have: > + To see what version of Python you have: >vim :py3 import sys :py3 print(sys.version) < *:py3file* @@ -619,11 +620,12 @@ variants explicitly if Python 3 is required. The `:py3do` command works similar to `:pydo`. *E880* -Raising SystemExit exception in python isn't endorsed way to quit vim, use: > +Raising SystemExit exception in python isn't endorsed way to quit vim, use: +>vim :py vim.command("qall!") < *has-python* -You can test if Python is available with: > +You can test if Python is available with: >vim if has('pythonx') echo 'there is Python' endif @@ -642,10 +644,10 @@ works with Python 2.6+ and Python 3. As Nvim only supports Python 3, all these commands are now synonymous to their "python3" equivalents. *:pyx* *:pythonx* -`:pyx` and `:pythonx` work the same as `:python3`. To check if `:pyx` works: > +`:pyx` and `:pythonx` work the same as `:python3`. To check if `:pyx` works: >vim :pyx print("Hello") -To see what version of Python is being used: > +To see what version of Python is being used: >vim :pyx import sys :pyx print(sys.version) < @@ -656,7 +658,7 @@ To see what version of Python is being used: > `:pyxdo` works the same as `:py3do`. *has-pythonx* -To check if `pyx*` functions and commands are available: > +To check if `pyx*` functions and commands are available: >vim if has('pythonx') echo 'pyx* commands are available. (Python ' .. &pyx .. ')' endif diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 348c56ba70..4722982ab5 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -408,12 +408,12 @@ the ":map" command. The rules are: The <> notation uses to escape the special meaning of key names. Using a backslash also works, but only when 'cpoptions' does not include the 'B' flag. -Examples for mapping CTRL-H to the six characters "": > +Examples for mapping CTRL-H to the six characters "": >vim :imap \ :imap Home> The first one only works when the 'B' flag is not in 'cpoptions'. The second one always works. -To get a literal "" in a mapping: > +To get a literal "" in a mapping: >vim :map lt> The notation can be used in a double quoted strings, using "\<" at the start, diff --git a/runtime/doc/job_control.txt b/runtime/doc/job_control.txt index 6a9d865c40..37a4e2ebb1 100644 --- a/runtime/doc/job_control.txt +++ b/runtime/doc/job_control.txt @@ -30,7 +30,7 @@ Usage *job-control-usage* To control jobs, use the "job…" family of functions: |jobstart()|, |jobstop()|, etc. -Example: > +Example: >vim function! s:OnEvent(job_id, data, event) dict if a:event == 'stdout' @@ -51,7 +51,7 @@ Example: > let job1 = jobstart(['bash'], extend({'shell': 'shell 1'}, s:callbacks)) let job2 = jobstart(['bash', '-c', 'for i in {1..10}; do echo hello $i!; sleep 1; done'], extend({'shell': 'shell 2'}, s:callbacks)) -To test the above script, copy it to a file ~/foo.vim and run it: > +To test the above script, copy it to a file ~/foo.vim and run it: >bash nvim -u ~/foo.vim < Description of what happens: @@ -75,7 +75,7 @@ Arguments passed to on_exit callback: will not trigger the on_stdout/on_stderr callback (but if the process ends, the on_exit callback will be invoked). For example, "ruby -e" buffers output, so small strings will be - buffered unless "auto-flushing" ($stdout.sync=true) is enabled. > + buffered unless "auto-flushing" ($stdout.sync=true) is enabled. >vim function! Receive(job_id, data, event) echom printf('%s: %s',a:event,string(a:data)) endfunction @@ -92,7 +92,7 @@ Arguments passed to on_exit callback: - `abc\nefg` may arrive as `['abc', '']`, `['efg']` or `['abc']`, `['','efg']`, or even `['ab']`, `['c','efg']`. Easy way to deal with this: initialize a list as `['']`, then append - to it as follows: > + to it as follows: >vim let s:chunks = [''] func! s:on_stdout(job_id, data, event) dict let s:chunks[-1] .= a:data[0] @@ -101,7 +101,7 @@ Arguments passed to on_exit callback: < The |jobstart-options| dictionary is passed as |self| to the callback. -The above example could be written in this "object-oriented" style: > +The above example could be written in this "object-oriented" style: >vim let Shell = {} @@ -129,16 +129,16 @@ The above example could be written in this "object-oriented" style: > let instance = Shell.new('bomb', \ 'for i in $(seq 9 -1 1); do echo $i 1>&$((i % 2 + 1)); sleep 1; done') < -To send data to the job's stdin, use |chansend()|: > +To send data to the job's stdin, use |chansend()|: >vim :call chansend(job1, "ls\n") :call chansend(job1, "invalid-command\n") :call chansend(job1, "exit\n") < -A job may be killed with |jobstop()|: > +A job may be killed with |jobstop()|: >vim :call jobstop(job1) < A job may be killed at any time with the |jobstop()| function: -> +>vim :call jobstop(job1) < Individual streams can be closed without killing the job, see |chanclose()|. diff --git a/runtime/doc/lsp-extension.txt b/runtime/doc/lsp-extension.txt index 6e9ad940c7..fe72e9eb18 100644 --- a/runtime/doc/lsp-extension.txt +++ b/runtime/doc/lsp-extension.txt @@ -6,7 +6,7 @@ The `vim.lsp` Lua module is a framework for building LSP plugins. 1. Start with |vim.lsp.start_client()| and |vim.lsp.buf_attach_client()|. - 2. Peek at the API: > + 2. Peek at the API: >vim :lua print(vim.inspect(vim.lsp)) < 3. See |lsp-extension-example| for a full example. @@ -30,7 +30,7 @@ The example will: 3. Create a new LSP for that root directory if one doesn't exist. 4. Attach the buffer to the client for that root directory. -> +>lua -- Some path manipulation utilities local function is_dir(filename) local stat = vim.loop.fs_stat(filename) diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index d9b944bfe2..06c0f466e7 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -33,7 +33,7 @@ Follow these steps to get LSP features: 2. Configure the LSP client per language server. A minimal example: -> +>lua vim.lsp.start({ name = 'my-server-name', cmd = {'name-of-language-server-executable'}, @@ -44,7 +44,7 @@ Follow these steps to get LSP features: 3. Configure keymaps and autocmds to utilize LSP features. See |lsp-config|. -< + *lsp-config* Starting a LSP client will automatically report diagnostics via @@ -66,7 +66,7 @@ language server supports the functionality. To use other LSP features like hover, rename, etc. you can setup some additional keymaps. It's recommended to setup them in a |LspAttach| autocmd to ensure they're only active if there is a LSP client running. An example: -> +>lua vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = args.buf }) @@ -86,7 +86,7 @@ The most used functions are: Not all language servers provide the same capabilities. To ensure you only set keymaps if the language server supports a feature, you can guard the keymap calls behind capability checks: -> +>lua vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) local client = vim.lsp.get_client_by_id(args.data.client_id) @@ -100,7 +100,7 @@ calls behind capability checks: To learn what capabilities are available you can run the following command in a buffer with a started LSP client: -> +>vim :lua =vim.lsp.get_active_clients()[1].server_capabilities < @@ -110,14 +110,14 @@ Full list of features provided by default can be found in |lsp-buf|. FAQ *lsp-faq* - Q: How to force-reload LSP? - A: Stop all clients, then reload the buffer. > + A: Stop all clients, then reload the buffer. >vim :lua vim.lsp.stop_client(vim.lsp.get_active_clients()) :edit - Q: Why isn't completion working? A: In the buffer where you want to use LSP, check that 'omnifunc' is set to - "v:lua.vim.lsp.omnifunc": > + "v:lua.vim.lsp.omnifunc": >vim :verbose set omnifunc? @@ -129,7 +129,7 @@ FAQ *lsp-faq* A: Check if the function has an `async` parameter and set the value to false. - E.g. code formatting: > + E.g. code formatting: >vim " Auto-format *.rs (rust) files prior to saving them " (async = false is the default for format) @@ -162,7 +162,7 @@ to the given buffer. |lsp-buf| LSP request/response handlers are implemented as Lua functions (see |lsp-handler|). The |vim.lsp.handlers| table defines default handlers used -when creating a new client. Keys are LSP method names: > +when creating a new client. Keys are LSP method names: >vim :lua print(vim.inspect(vim.tbl_keys(vim.lsp.handlers))) < @@ -291,7 +291,7 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method To configure the behavior of |vim.lsp.diagnostic.on_publish_diagnostics()|, consider the following example, where a new |lsp-handler| is created using - |vim.lsp.with()| that no longer generates signs for the diagnostics: > + |vim.lsp.with()| that no longer generates signs for the diagnostics: >lua vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { @@ -301,7 +301,7 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method ) < To enable signs, use |vim.lsp.with()| again to create and assign a new - |lsp-handler| to |vim.lsp.handlers| for the associated method: > + |lsp-handler| to |vim.lsp.handlers| for the associated method: >lua vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.diagnostic.on_publish_diagnostics, { @@ -311,7 +311,7 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method ) < To configure a handler on a per-server basis, you can use the {handlers} key - for |vim.lsp.start_client()| > + for |vim.lsp.start_client()| >lua vim.lsp.start_client { ..., -- Other configuration omitted. @@ -325,7 +325,8 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method }, } < - or if using 'nvim-lspconfig', you can use the {handlers} key of `setup()`: > + or if using 'nvim-lspconfig', you can use the {handlers} key of `setup()`: + >lua require('lspconfig').rust_analyzer.setup { handlers = { @@ -340,7 +341,7 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method < Some handlers do not have an explicitly named handler function (such as ||vim.lsp.diagnostic.on_publish_diagnostics()|). To override these, first - create a reference to the existing handler: > + create a reference to the existing handler: >lua local on_references = vim.lsp.handlers["textDocument/references"] vim.lsp.handlers["textDocument/references"] = vim.lsp.with( @@ -357,14 +358,14 @@ Handlers can be set by: vim.lsp.handlers is a global table that contains the default mapping of |lsp-method| names to |lsp-handlers|. - To override the handler for the `"textDocument/definition"` method: > + To override the handler for the `"textDocument/definition"` method: >lua vim.lsp.handlers["textDocument/definition"] = my_custom_default_definition < - The {handlers} parameter for |vim.lsp.start_client()|. This will set the |lsp-handler| as the default handler for this server. - For example: > + For example: >lua vim.lsp.start_client { ..., -- Other configuration omitted. @@ -376,7 +377,7 @@ Handlers can be set by: - The {handler} parameter for |vim.lsp.buf_request()|. This will set the |lsp-handler| ONLY for the current request. - For example: > + For example: >lua vim.lsp.buf_request( 0, @@ -403,7 +404,7 @@ and helper functions for creating protocol-related objects. https://github.com/microsoft/language-server-protocol/raw/gh-pages/_specifications/specification-3-14.md For example `vim.lsp.protocol.ErrorCodes` allows reverse lookup by number or -name: > +name: >lua vim.lsp.protocol.TextDocumentSyncKind.Full == 1 vim.lsp.protocol.TextDocumentSyncKind[1] == "Full" @@ -426,7 +427,7 @@ For the format of the notification message, see: - `context` table|nil. `ctx` from |lsp-handler| This table can be used with vim.fn.setqflist or vim.fn.setloclist. E.g.: -> +>lua local function on_list(options) vim.fn.setqflist({}, ' ', options) vim.api.nvim_command('cfirst') @@ -436,7 +437,7 @@ This table can be used with vim.fn.setqflist or vim.fn.setloclist. E.g.: vim.lsp.buf.references(nil, {on_list=on_list}) < If you prefer loclist do something like this: -> +>lua local function on_list(options) vim.fn.setloclist(0, {}, ' ', options) vim.api.nvim_command('lopen') @@ -487,7 +488,7 @@ EVENTS *lsp-events* *LspAttach* After an LSP client attaches to a buffer. The |autocmd-pattern| is the name of the buffer. When used from Lua, the client ID is passed to the -callback in the "data" table. Example: > +callback in the "data" table. Example: >lua vim.api.nvim_create_autocmd("LspAttach", { callback = function(args) @@ -505,7 +506,7 @@ callback in the "data" table. Example: > *LspDetach* Just before an LSP client detaches from a buffer. The |autocmd-pattern| is the name of the buffer. When used from Lua, the client ID is passed to the -callback in the "data" table. Example: > +callback in the "data" table. Example: >lua vim.api.nvim_create_autocmd("LspDetach", { callback = function(args) @@ -525,7 +526,7 @@ LspRequest *LspRequest* After a change to the active set of pending LSP requests. See {requests} in |vim.lsp.client|. -Example: > +Example: >vim autocmd User LspProgressUpdate redrawstatus autocmd User LspRequest redrawstatus < diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 93471b50ad..1c381bd956 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -361,17 +361,17 @@ Vimscript v:lua interface *v:lua-call* From Vimscript the special `v:lua` prefix can be used to call Lua functions which are global or accessible from global tables. The expression >vim - v:lua.func(arg1, arg2) + call v:lua.func(arg1, arg2) is equivalent to the Lua chunk >lua return func(...) where the args are converted to Lua values. The expression >vim - v:lua.somemod.func(args) + call v:lua.somemod.func(args) is equivalent to the Lua chunk >lua return somemod.func(...) In addition, functions of packages can be accessed like >vim - v:lua.require'mypack'.func(arg1, arg2) - v:lua.require'mypack.submod'.func(arg1, arg2) + call v:lua.require'mypack'.func(arg1, arg2) + call v:lua.require'mypack.submod'.func(arg1, arg2) Note: Only single quote form without parens is allowed. Using `require"mypack"` or `require('mypack')` as prefixes do NOT work (the latter is still valid as a function call of itself, in case require returns a useful @@ -379,7 +379,7 @@ value). The `v:lua` prefix may be used to call Lua functions as |method|s. For example: >vim - arg1->v:lua.somemod.func(arg2) + :eval arg1->v:lua.somemod.func(arg2) < You can use `v:lua` in "func" options like 'tagfunc', 'omnifunc', etc. For example consider the following Lua omnifunc handler: >lua @@ -646,20 +646,19 @@ vim.diff({a}, {b}, {opts}) *vim.diff()* Run diff on strings {a} and {b}. Any indices returned by this function, either directly or via callback arguments, are 1-based. - Examples: > - + Examples: >lua vim.diff('a\n', 'b\nc\n') - => - @@ -1 +1,2 @@ - -a - +b - +c + -- => + -- @@ -1 +1,2 @@ + -- -a + -- +b + -- +c vim.diff('a\n', 'b\nc\n', {result_type = 'indices'}) - => - { - {1, 1, 1, 2} - } + -- => + -- { + -- {1, 1, 1, 2} + -- } < Parameters: ~ • {a} First string to compare @@ -730,13 +729,12 @@ vim.spell.check({str}) *vim.spell.check()* 'spellfile', 'spellcapcheck' and 'spelloptions' which can all be local to the buffer. Consider calling this with |nvim_buf_call()|. - Example: > - + Example: >lua vim.spell.check("the quik brown fox") - => - { - {'quik', 'bad', 4} - } + -- => + -- { + -- {'quik', 'bad', 4} + -- } < Parameters: ~ • {str} String to spell check. @@ -1171,37 +1169,37 @@ offers object-oriented method for adding and removing entries. Examples: ~ The following methods of setting a list-style option are equivalent: - In Vimscript: - `set wildignore=*.o,*.a,__pycache__` - - In Lua using `vim.o`: - `vim.o.wildignore = '*.o,*.a,__pycache__'` - - In Lua using `vim.opt`: - `vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }` - - To replicate the behavior of |:set+=|, use: > + In Vimscript: >vim + set wildignore=*.o,*.a,__pycache__ +< + In Lua using `vim.o`: >lua + vim.o.wildignore = '*.o,*.a,__pycache__' +< + In Lua using `vim.opt`: >lua + vim.opt.wildignore = { '*.o', '*.a', '__pycache__' } +< + To replicate the behavior of |:set+=|, use: >lua vim.opt.wildignore:append { "*.pyc", "node_modules" } < - To replicate the behavior of |:set^=|, use: > + To replicate the behavior of |:set^=|, use: >lua vim.opt.wildignore:prepend { "new_first_value" } < - To replicate the behavior of |:set-=|, use: > + To replicate the behavior of |:set-=|, use: >lua vim.opt.wildignore:remove { "node_modules" } < The following methods of setting a map-style option are equivalent: - In Vimscript: - `set listchars=space:_,tab:>~` - - In Lua using `vim.o`: - `vim.o.listchars = 'space:_,tab:>~'` - - In Lua using `vim.opt`: - `vim.opt.listchars = { space = '_', tab = '>~' }` - + In Vimscript: >vim + set listchars=space:_,tab:>~ +< + In Lua using `vim.o`: >lua + vim.o.listchars = 'space:_,tab:>~' +< + In Lua using `vim.opt`: >lua + vim.opt.listchars = { space = '_', tab = '>~' } +< Note that |vim.opt| returns an `Option` object, not the value of the option, which is accessed through |vim.opt:get()|: @@ -1209,15 +1207,15 @@ which is accessed through |vim.opt:get()|: Examples: ~ The following methods of getting a list-style option are equivalent: - In Vimscript: - `echo wildignore` - - In Lua using `vim.o`: - `print(vim.o.wildignore)` - - In Lua using `vim.opt`: - `vim.pretty_print(vim.opt.wildignore:get())` - + In Vimscript: >vim + echo wildignore +< + In Lua using `vim.o`: >lua + print(vim.o.wildignore) +< + In Lua using `vim.opt`: >lua + vim.pretty_print(vim.opt.wildignore:get()) +< In any of the above examples, to replicate the behavior |:setlocal|, use `vim.opt_local`. Additionally, to replicate the behavior of |:setglobal|, use @@ -1272,28 +1270,28 @@ Option:append(value) Append a value to string-style options. See |:set+=| - These are equivalent: - `vim.opt.formatoptions:append('j')` - `vim.opt.formatoptions = vim.opt.formatoptions + 'j'` - + These are equivalent: >lua + vim.opt.formatoptions:append('j') + vim.opt.formatoptions = vim.opt.formatoptions + 'j' +< *vim.opt:prepend()* Option:prepend(value) Prepend a value to string-style options. See |:set^=| - These are equivalent: - `vim.opt.wildignore:prepend('*.o')` - `vim.opt.wildignore = vim.opt.wildignore ^ '*.o'` - + These are equivalent: >lua + vim.opt.wildignore:prepend('*.o') + vim.opt.wildignore = vim.opt.wildignore ^ '*.o' +< *vim.opt:remove()* Option:remove(value) Remove a value from string-style options. See |:set-=| - These are equivalent: - `vim.opt.wildignore:remove('*.pyc')` - `vim.opt.wildignore = vim.opt.wildignore - '*.pyc'` - + These are equivalent: >lua + vim.opt.wildignore:remove('*.pyc') + vim.opt.wildignore = vim.opt.wildignore - '*.pyc' +< ============================================================================== Lua module: vim *lua-vim* diff --git a/runtime/doc/luaref.txt b/runtime/doc/luaref.txt index 259f2ba681..aafdd5c43e 100644 --- a/runtime/doc/luaref.txt +++ b/runtime/doc/luaref.txt @@ -136,7 +136,7 @@ For convenience, when the opening long bracket is immediately followed by a newline, the newline is not included in the string. As an example, in a system using ASCII (in which `a` is coded as 97, newline is coded as 10, and `1` is coded as 49), the five literals below denote the same string: -> +>lua a = 'alo\n123"' a = "alo\n123\"" a = '\97lo\10\04923"' @@ -283,7 +283,7 @@ library; see |luaref-libDebug|.) An access to a global variable `x` is equivalent to `_env.x`, which in turn is equivalent to -> +>lua gettable_event(_env, "x") < where `_env` is the environment of the running function. (The `_env` variable is @@ -366,13 +366,13 @@ before the adjustment (except when the call is enclosed in parentheses; see The assignment statement first evaluates all its expressions and only then are the assignments performed. Thus the code -> +>lua i = 3 i, a[i] = i+1, 20 < sets `a[3]` to 20, without affecting `a[4]` because the `i` in `a[i]` is evaluated (to 3) before it is assigned 4. Similarly, the line -> +>lua x, y = y, x < exchanges the values of `x` and `y`. @@ -385,7 +385,7 @@ defined or callable in Lua. We use it here only for explanatory purposes.) An assignment to a global variable `x = val` is equivalent to the assignment `_env.x = val`, which in turn is equivalent to -> +>lua settable_event(_env, "x", val) < where `_env` is the environment of the running function. (The `_env` variable is @@ -448,11 +448,11 @@ through an arithmetic progression. It has the following syntax: < The `block` is repeated for `name` starting at the value of the first `exp`, until it passes the second `exp` by steps of the third `exp`. More precisely, -a `for` statement like > +a `for` statement like - for var = e1, e2, e3 do block end + `for var = e1, e2, e3 do block end` -< is equivalent to the code: > +is equivalent to the code: >lua do local var, limit, step = tonumber(e1), tonumber(e2), tonumber(e3) @@ -489,7 +489,7 @@ A `for` statement like `for` `var1, ..., varn` `in` `explist` `do` `block` `end` -is equivalent to the code: > +is equivalent to the code: >lua do local f, s, var = explist @@ -582,7 +582,7 @@ adjusts the result list to one element, discarding all values except the first one. Here are some examples: -> +>lua f() -- adjusted to 0 results g(f(), x) -- f() is adjusted to 1 result g(x, f()) -- g gets x plus all results from f() @@ -615,7 +615,7 @@ or strings that can be converted to numbers (see |luaref-langCoercion|), then al operations have the usual meaning. Exponentiation works for any exponent. For instance, `x^(-0.5)` computes the inverse of the square root of `x`. Modulo is defined as -> +>lua a % b == a - math.floor(a/b)*b < That is, it is the remainder of a division that rounds the quotient towards @@ -742,11 +742,11 @@ key `exp1` and value `exp2`. A field of the form `name = exp` is equivalent to `["name"] = exp`. Finally, fields of the form `exp` are equivalent to `[i] = exp`, where `i` are consecutive numerical integers, starting with 1. Fields in the other formats do not affect this counting. For example, -> +>lua a = { [f(1)] = g; "x", "y"; x = 1, f(x), [30] = 23; 45 } < is equivalent to -> +>lua do local t = {} t[f(1)] = g @@ -802,7 +802,7 @@ argument list is a single new table. A call of the form `f'` `string` `'` As an exception to the free-format syntax of Lua, you cannot put a line break before the `(` in a function call. This restriction avoids some ambiguities in the language. If you write -> +>lua a = f (g).x(a) < @@ -820,7 +820,7 @@ function. Note that a tail call only happens with a particular syntax, where the `return` has one single function call as argument; this syntax makes the calling function return exactly the returns of the called function. So, none of the following examples are tail calls: -> +>lua return (f(x)) -- results adjusted to 1 return 2 * f(x) return x, f(x) -- additional results @@ -901,7 +901,7 @@ expression is used as the last element of a list of expressions, then no adjustment is made (unless the call is enclosed in parentheses). As an example, consider the following definitions: -> +>lua function f(a, b) end function g(a, b, ...) end function r() return 1,2,3 end @@ -942,7 +942,7 @@ is syntactic sugar for Lua is a lexically scoped language. The scope of variables begins at the first statement after their declaration and lasts until the end of the innermost block that includes the declaration. Consider the following example: -> +>lua x = 10 -- global variable do -- new block local x = x -- new `x`, with value 10 @@ -967,7 +967,7 @@ function. Notice that each execution of a local statement defines new local variables. Consider the following example: -> +>lua a = {} local x = 20 for i=1,10 do @@ -1043,7 +1043,7 @@ given object, we use the expression metatable(obj)[event] < This should be read as -> +>lua rawget(metatable(obj) or {}, event) < That is, the access to a metamethod does not invoke other metamethods, and the @@ -1057,13 +1057,13 @@ the `+` operation. The function `getbinhandler` below defines how Lua chooses a handler for a binary operation. First, Lua tries the first operand. If its type does not define a handler for the operation, then Lua tries the second operand. -> +>lua function getbinhandler (op1, op2, event) return metatable(op1)[event] or metatable(op2)[event] end < By using this function, the behavior of the `op1 + op2` is -> +>lua function add_event (op1, op2) local o1, o2 = tonumber(op1), tonumber(op2) if o1 and o2 then -- both operands are numeric? @@ -1104,7 +1104,7 @@ with the function `pow` (from the C math library) as the primitive operation. "unm": *__unm()* ------ the unary `-` operation. -> +>lua function unm_event (op) local o = tonumber(op) if o then -- operand is numeric? @@ -1124,7 +1124,7 @@ the unary `-` operation. "concat": *__concat()* --------- the `..` (concatenation) operation. -> +>lua function concat_event (op1, op2) if (type(op1) == "string" or type(op1) == "number") and (type(op2) == "string" or type(op2) == "number") then @@ -1142,7 +1142,7 @@ the `..` (concatenation) operation. "len": *__len()* ------ the `#` operation. -> +>lua function len_event (op) if type(op) == "string" then return strlen(op) -- primitive string length @@ -1167,7 +1167,7 @@ The function `getcomphandler` defines how Lua chooses a metamethod for comparison operators. A metamethod only is selected when both objects being compared have the same type and the same metamethod for the selected operation. -> +>lua function getcomphandler (op1, op2, event) if type(op1) ~= type(op2) then return nil end local mm1 = metatable(op1)[event] @@ -1176,7 +1176,7 @@ operation. end < The "eq" event is defined as follows: -> +>lua function eq_event (op1, op2) if type(op1) ~= type(op2) then -- different types? return false -- different objects @@ -1198,7 +1198,7 @@ The "eq" event is defined as follows: "lt": *__lt()* ----- the `<` operation. -> +>lua function lt_event (op1, op2) if type(op1) == "number" and type(op2) == "number" then return op1 < op2 -- numeric comparison @@ -1219,7 +1219,7 @@ the `<` operation. "le": *__le()* ----- the `<=` operation. -> +>lua function le_event (op1, op2) if type(op1) == "number" and type(op2) == "number" then return op1 <= op2 -- numeric comparison @@ -1247,7 +1247,7 @@ to `not (b < a)`. "index": *__index()* -------- The indexing access `table[key]`. -> +>lua function gettable_event (table, key) local h if type(table) == "table" then @@ -1269,7 +1269,7 @@ The indexing access `table[key]`. "newindex": *__newindex()* ----------- The indexing assignment `table[key] = value`. -> +>lua function settable_event (table, key, value) local h if type(table) == "table" then @@ -1291,7 +1291,7 @@ The indexing assignment `table[key] = value`. "call": *__call()* ------- called when Lua calls a value. -> +>lua function function_event (func, ...) if type(func) == "function" then return func(...) -- primitive call @@ -1386,7 +1386,7 @@ Garbage userdata with a field `__gc` in their metatables are not collected immediately by the garbage collector. Instead, Lua puts them in a list. After the collection, Lua does the equivalent of the following function for each userdata in that list: -> +>lua function gc_event (udata) local h = metatable(udata).__gc if h then @@ -1469,7 +1469,7 @@ coroutine. Any arguments passed to this function go as extra arguments to propagated to the caller. As an example, consider the next code: -> +>lua function foo1 (a) print("foo", a) return coroutine.yield(2*a) @@ -1559,7 +1559,7 @@ Most query functions accept as indices any value inside the available stack space, that is, indices up to the maximum stack size you have set through `lua_checkstack`. Such indices are called acceptable indices. More formally, we define an acceptable index as follows: -> +>lua (index < 0 && abs(index) <= top) || (index > 0 && index <= stackspace) < Note that 0 is never an acceptable index. @@ -1580,7 +1580,7 @@ pseudo-index `LUA_ENVIRONINDEX`. To access and change the value of global variables, you can use regular table operations over an environment table. For instance, to access the value of a global variable, do -> +>c lua_getfield(L, LUA_GLOBALSINDEX, varname); < @@ -1639,7 +1639,7 @@ Inside a C function you can raise an error by calling `lua_error` (see Here we list all functions and types from the C API in alphabetical order. lua_Alloc *lua_Alloc()* -> +>c typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, @@ -1663,7 +1663,7 @@ lua_Alloc *lua_Alloc()* Here is a simple implementation for the allocator function. It is used in the auxiliary library by `luaL_newstate` (see |luaL_newstate()|). -> +>c static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { (void)ud; (void)osize; /* not used */ @@ -1680,7 +1680,7 @@ lua_Alloc *lua_Alloc()* behaviors. lua_atpanic *lua_atpanic()* -> +>c lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf); < Sets a new panic function and returns the old one. @@ -1694,7 +1694,7 @@ lua_atpanic *lua_atpanic()* stack. lua_call *lua_call()* -> +>c void lua_call (lua_State *L, int nargs, int nresults); < Calls a function. @@ -1718,11 +1718,11 @@ lua_call *lua_call()* The following example shows how the host program may do the equivalent to this Lua code: -> +>lua a = f("how", t.x, 14) < Here it is in C: -> +>c lua_getfield(L, LUA_GLOBALSINDEX, "f"); // function to be called lua_pushstring(L, "how"); // 1st argument lua_getfield(L, LUA_GLOBALSINDEX, "t"); // table to be indexed @@ -1737,7 +1737,7 @@ lua_call *lua_call()* practice. lua_CFunction *luaref-cfunction* *lua_CFunction()* -> +>c typedef int (*lua_CFunction) (lua_State *L); < Type for C functions. @@ -1758,7 +1758,7 @@ lua_CFunction *luaref-cfunction* *lua_CFunction()* *luaref-cfunctionexample* As an example, the following function receives a variable number of numerical arguments and returns their average and sum: -> +>c static int foo (lua_State *L) { int n = lua_gettop(L); /* number of arguments */ lua_Number sum = 0; @@ -1777,7 +1777,7 @@ lua_CFunction *luaref-cfunction* *lua_CFunction()* < lua_checkstack *lua_checkstack()* -> +>c int lua_checkstack (lua_State *L, int extra); < Ensures that there are at least `extra` free stack slots in the stack. @@ -1786,7 +1786,7 @@ lua_checkstack *lua_checkstack()* the new size, it is left unchanged. lua_close *lua_close()* -> +>c void lua_close (lua_State *L); < Destroys all objects in the given Lua state (calling the corresponding @@ -1798,7 +1798,7 @@ lua_close *lua_close()* are not needed, to avoid growing too large. lua_concat *lua_concat()* -> +>c void lua_concat (lua_State *L, int n); < Concatenates the `n` values at the top of the stack, pops them, and @@ -1808,7 +1808,7 @@ lua_concat *lua_concat()* usual semantics of Lua (see |luaref-langConcat|). lua_cpcall *lua_cpcall()* -> +>c int lua_cpcall (lua_State *L, lua_CFunction func, void *ud); < Calls the C function `func` in protected mode. `func` starts with only @@ -1819,7 +1819,7 @@ lua_cpcall *lua_cpcall()* returned by `func` are discarded. lua_createtable *lua_createtable()* -> +>c void lua_createtable (lua_State *L, int narr, int nrec); < Creates a new empty table and pushes it onto the stack. The new table @@ -1829,7 +1829,7 @@ lua_createtable *lua_createtable()* `lua_newtable` (see |lua_newtable()|). lua_dump *lua_dump()* -> +>c int lua_dump (lua_State *L, lua_Writer writer, void *data); < Dumps a function as a binary chunk. Receives a Lua function on the top @@ -1844,7 +1844,7 @@ lua_dump *lua_dump()* This function does not pop the Lua function from the stack. lua_equal *lua_equal()* -> +>c int lua_equal (lua_State *L, int index1, int index2); < Returns 1 if the two values in acceptable indices `index1` and @@ -1853,7 +1853,7 @@ lua_equal *lua_equal()* if any of the indices is non valid. lua_error *lua_error()* -> +>c int lua_error (lua_State *L); < Generates a Lua error. The error message (which can actually be a Lua @@ -1861,7 +1861,7 @@ lua_error *lua_error()* jump, and therefore never returns (see |luaL_error()|). lua_gc *lua_gc()* -> +>c int lua_gc (lua_State *L, int what, int data); < Controls the garbage collector. @@ -1893,7 +1893,7 @@ lua_gc *lua_gc()* previous value of the step multiplier. lua_getallocf *lua_getallocf()* -> +>c lua_Alloc lua_getallocf (lua_State *L, void **ud); < Returns the memory-allocation function of a given state. If `ud` is @@ -1901,14 +1901,14 @@ lua_getallocf *lua_getallocf()* `lua_newstate` (see |lua_newstate()|). lua_getfenv *lua_getfenv()* -> +>c void lua_getfenv (lua_State *L, int index); < Pushes onto the stack the environment table of the value at the given index. lua_getfield *lua_getfield()* -> +>c void lua_getfield (lua_State *L, int index, const char *k); < Pushes onto the stack the value `t[k]`, where `t` is the value at the @@ -1916,17 +1916,17 @@ lua_getfield *lua_getfield()* metamethod for the "index" event (see |luaref-langMetatables|). lua_getglobal *lua_getglobal()* -> +>c void lua_getglobal (lua_State *L, const char *name); < Pushes onto the stack the value of the global `name`. It is defined as a macro: -> +>c #define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, s) < lua_getmetatable *lua_getmetatable()* -> +>c int lua_getmetatable (lua_State *L, int index); < Pushes onto the stack the metatable of the value at the given @@ -1935,7 +1935,7 @@ lua_getmetatable *lua_getmetatable()* stack. lua_gettable *lua_gettable()* -> +>c void lua_gettable (lua_State *L, int index); < Pushes onto the stack the value `t[k]`, where `t` is the value at the @@ -1947,7 +1947,7 @@ lua_gettable *lua_gettable()* the "index" event (see |luaref-langMetatables|). lua_gettop *lua_gettop()* -> +>c int lua_gettop (lua_State *L); < Returns the index of the top element in the stack. Because indices @@ -1956,7 +1956,7 @@ lua_gettop *lua_gettop()* 0 means an empty stack). lua_insert *lua_insert()* -> +>c void lua_insert (lua_State *L, int index); < Moves the top element into the given valid index, shifting up the @@ -1964,7 +1964,7 @@ lua_insert *lua_insert()* pseudo-index, because a pseudo-index is not an actual stack position. lua_Integer *lua_Integer()* -> +>c typedef ptrdiff_t lua_Integer; < The type used by the Lua API to represent integral values. @@ -1973,77 +1973,77 @@ lua_Integer *lua_Integer()* type the machine handles "comfortably". lua_isboolean *lua_isboolean()* -> +>c int lua_isboolean (lua_State *L, int index); < Returns 1 if the value at the given acceptable index has type boolean, and 0 otherwise. lua_iscfunction *lua_iscfunction()* -> +>c int lua_iscfunction (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a C function, and 0 otherwise. lua_isfunction *lua_isfunction()* -> +>c int lua_isfunction (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a function (either C or Lua), and 0 otherwise. lua_islightuserdata *lua_islightuserdata()* -> +>c int lua_islightuserdata (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a light userdata, and 0 otherwise. lua_isnil *lua_isnil()* -> +>c int lua_isnil (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is `nil`, and 0 otherwise. lua_isnumber *lua_isnumber()* -> +>c int lua_isnumber (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a number or a string convertible to a number, and 0 otherwise. lua_isstring *lua_isstring()* -> +>c int lua_isstring (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a string or a number (which is always convertible to a string), and 0 otherwise. lua_istable *lua_istable()* -> +>c int lua_istable (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a table, and 0 otherwise. lua_isthread *lua_isthread()* -> +>c int lua_isthread (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a thread, and 0 otherwise. lua_isuserdata *lua_isuserdata()* -> +>c int lua_isuserdata (lua_State *L, int index); < Returns 1 if the value at the given acceptable index is a userdata (either full or light), and 0 otherwise. lua_lessthan *lua_lessthan()* -> +>c int lua_lessthan (lua_State *L, int index1, int index2); < Returns 1 if the value at acceptable index `index1` is smaller than @@ -2052,7 +2052,7 @@ lua_lessthan *lua_lessthan()* Also returns 0 if any of the indices is non valid. lua_load *lua_load()* -> +>c int lua_load (lua_State *L, lua_Reader reader, void *data, @@ -2079,7 +2079,7 @@ lua_load *lua_load()* error messages and in debug information (see |luaref-apiDebug|). lua_newstate *lua_newstate()* -> +>c lua_State *lua_newstate (lua_Alloc f, void *ud); < Creates a new, independent state. Returns `NULL` if cannot create the @@ -2089,7 +2089,7 @@ lua_newstate *lua_newstate()* simply passes to the allocator in every call. lua_newtable *lua_newtable()* -> +>c void lua_newtable (lua_State *L); < Creates a new empty table and pushes it onto the stack. It is @@ -2097,7 +2097,7 @@ lua_newtable *lua_newtable()* |lua_createtable()|). lua_newthread *lua_newthread()* -> +>c lua_State *lua_newthread (lua_State *L); < Creates a new thread, pushes it on the stack, and returns a pointer to @@ -2110,7 +2110,7 @@ lua_newthread *lua_newthread()* are subject to garbage collection, like any Lua object. lua_newuserdata *lua_newuserdata()* -> +>c void *lua_newuserdata (lua_State *L, size_t size); < This function allocates a new block of memory with the given size, @@ -2128,7 +2128,7 @@ lua_newuserdata *lua_newuserdata()* is collected again then Lua frees its corresponding memory. lua_next *lua_next()* -> +>c int lua_next (lua_State *L, int index); < Pops a key from the stack, and pushes a key-value pair from the table @@ -2138,7 +2138,7 @@ lua_next *lua_next()* *luaref-tabletraversal* A typical traversal looks like this: -> +>c /* table is in the stack at index 't' */ lua_pushnil(L); /* first key */ while (lua_next(L, t) != 0) { @@ -2156,7 +2156,7 @@ lua_next *lua_next()* value at the given index; this confuses the next call to `lua_next`. lua_Number *lua_Number()* -> +>c typedef double lua_Number; < The type of numbers in Lua. By default, it is double, but that can be @@ -2166,7 +2166,7 @@ lua_Number *lua_Number()* another type for numbers (e.g., float or long). lua_objlen *lua_objlen()* -> +>c size_t lua_objlen (lua_State *L, int index); < Returns the "length" of the value at the given acceptable index: for @@ -2175,7 +2175,7 @@ lua_objlen *lua_objlen()* block of memory allocated for the userdata; for other values, it is 0. lua_pcall *lua_pcall()* -> +>c lua_pcall (lua_State *L, int nargs, int nresults, int errfunc); < Calls a function in protected mode. @@ -2210,19 +2210,19 @@ lua_pcall *lua_pcall()* - `LUA_ERRERR` error while running the error handler function. lua_pop *lua_pop()* -> +>c void lua_pop (lua_State *L, int n); < Pops `n` elements from the stack. lua_pushboolean *lua_pushboolean()* -> +>c void lua_pushboolean (lua_State *L, int b); < Pushes a boolean value with value `b` onto the stack. lua_pushcclosure *lua_pushcclosure()* -> +>c void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); < Pushes a new C closure onto the stack. @@ -2238,7 +2238,7 @@ lua_pushcclosure *lua_pushcclosure()* pops these values from the stack. lua_pushcfunction *lua_pushcfunction()* -> +>c void lua_pushcfunction (lua_State *L, lua_CFunction f); < Pushes a C function onto the stack. This function receives a pointer @@ -2250,12 +2250,12 @@ lua_pushcfunction *lua_pushcfunction()* |lua_CFunction()|). `lua_pushcfunction` is defined as a macro: -> +>c #define lua_pushcfunction(L,f) lua_pushcclosure(L,f,0) < lua_pushfstring *lua_pushfstring()* -> +>c const char *lua_pushfstring (lua_State *L, const char *fmt, ...); < Pushes onto the stack a formatted string and returns a pointer to this @@ -2274,13 +2274,13 @@ lua_pushfstring *lua_pushfstring()* character). lua_pushinteger *lua_pushinteger()* -> +>c void lua_pushinteger (lua_State *L, lua_Integer n); < Pushes a number with value `n` onto the stack. lua_pushlightuserdata *lua_pushlightuserdata()* -> +>c void lua_pushlightuserdata (lua_State *L, void *p); < Pushes a light userdata onto the stack. @@ -2292,7 +2292,7 @@ lua_pushlightuserdata *lua_pushlightuserdata()* same C address. lua_pushlstring *lua_pushlstring()* -> +>c void lua_pushlstring (lua_State *L, const char *s, size_t len); < Pushes the string pointed to by `s` with size `len` onto the stack. @@ -2301,19 +2301,19 @@ lua_pushlstring *lua_pushlstring()* returns. The string can contain embedded zeros. lua_pushnil *lua_pushnil()* -> +>c void lua_pushnil (lua_State *L); < Pushes a nil value onto the stack. lua_pushnumber *lua_pushnumber()* -> +>c void lua_pushnumber (lua_State *L, lua_Number n); < Pushes a number with value `n` onto the stack. lua_pushstring *lua_pushstring()* -> +>c void lua_pushstring (lua_State *L, const char *s); < Pushes the zero-terminated string pointed to by `s` onto the stack. @@ -2323,20 +2323,20 @@ lua_pushstring *lua_pushstring()* end at the first zero. lua_pushthread *lua_pushthread()* -> +>c int lua_pushthread (lua_State *L); < Pushes the thread represented by `L` onto the stack. Returns 1 if this thread is the main thread of its state. lua_pushvalue *lua_pushvalue()* -> +>c void lua_pushvalue (lua_State *L, int index); < Pushes a copy of the element at the given valid index onto the stack. lua_pushvfstring *lua_pushvfstring()* -> +>c const char *lua_pushvfstring (lua_State *L, const char *fmt, va_list argp); @@ -2346,7 +2346,7 @@ lua_pushvfstring *lua_pushvfstring()* arguments. lua_rawequal *lua_rawequal()* -> +>c int lua_rawequal (lua_State *L, int index1, int index2); < Returns 1 if the two values in acceptable indices `index1` and @@ -2355,14 +2355,14 @@ lua_rawequal *lua_rawequal()* valid. lua_rawget *lua_rawget()* -> +>c void lua_rawget (lua_State *L, int index); < Similar to `lua_gettable` (see |lua_gettable()|), but does a raw access (i.e., without metamethods). lua_rawgeti *lua_rawgeti()* -> +>c void lua_rawgeti (lua_State *L, int index, int n); < Pushes onto the stack the value `t[n]`, where `t` is the value at the @@ -2370,14 +2370,14 @@ lua_rawgeti *lua_rawgeti()* invoke metamethods. lua_rawset *lua_rawset()* -> +>c void lua_rawset (lua_State *L, int index); < Similar to `lua_settable` (see |lua_settable()|), but does a raw assignment (i.e., without metamethods). lua_rawseti *lua_rawseti()* -> +>c void lua_rawseti (lua_State *L, int index, int n); < Does the equivalent of `t[n] = v`, where `t` is the value at the given @@ -2387,7 +2387,7 @@ lua_rawseti *lua_rawseti()* that is, it does not invoke metamethods. lua_Reader *lua_Reader()* -> +>c typedef const char * (*lua_Reader) (lua_State *L, void *data, size_t *size); @@ -2402,20 +2402,20 @@ lua_Reader *lua_Reader()* zero. lua_register *lua_register()* -> +>c void lua_register (lua_State *L, const char *name, lua_CFunction f); < Sets the C function `f` as the new value of global `name`. It is defined as a macro: -> +>c #define lua_register(L,n,f) \ (lua_pushcfunction(L, f), lua_setglobal(L, n)) < lua_remove *lua_remove()* -> +>c void lua_remove (lua_State *L, int index); < Removes the element at the given valid index, shifting down the @@ -2423,7 +2423,7 @@ lua_remove *lua_remove()* pseudo-index, because a pseudo-index is not an actual stack position. lua_replace *lua_replace()* -> +>c void lua_replace (lua_State *L, int index); < Moves the top element into the given position (and pops it), without @@ -2431,7 +2431,7 @@ lua_replace *lua_replace()* position). lua_resume *lua_resume()* -> +>c int lua_resume (lua_State *L, int narg); < Starts and resumes a coroutine in a given thread. @@ -2452,14 +2452,14 @@ lua_resume *lua_resume()* and then call `lua_resume`. lua_setallocf *lua_setallocf()* -> +>c void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); < Changes the allocator function of a given state to `f` with user data `ud`. lua_setfenv *lua_setfenv()* -> +>c int lua_setfenv (lua_State *L, int index); < Pops a table from the stack and sets it as the new environment for the @@ -2468,7 +2468,7 @@ lua_setfenv *lua_setfenv()* Otherwise it returns 1. lua_setfield *lua_setfield()* -> +>c void lua_setfield (lua_State *L, int index, const char *k); < Does the equivalent to `t[k] = v`, where `t` is the value at the given @@ -2479,24 +2479,24 @@ lua_setfield *lua_setfield()* |luaref-langMetatables|). lua_setglobal *lua_setglobal()* -> +>c void lua_setglobal (lua_State *L, const char *name); < Pops a value from the stack and sets it as the new value of global `name`. It is defined as a macro: -> +>c #define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, s) < lua_setmetatable *lua_setmetatable()* -> +>c int lua_setmetatable (lua_State *L, int index); < Pops a table from the stack and sets it as the new metatable for the value at the given acceptable index. lua_settable *lua_settable()* -> +>c void lua_settable (lua_State *L, int index); < Does the equivalent to `t[k] = v`, where `t` is the value at the given @@ -2508,7 +2508,7 @@ lua_settable *lua_settable()* (see |luaref-langMetatables|). lua_settop *lua_settop()* -> +>c void lua_settop (lua_State *L, int index); < Accepts any acceptable index, or 0, and sets the stack top to this @@ -2517,7 +2517,7 @@ lua_settop *lua_settop()* elements are removed. lua_State *lua_State()* -> +>c typedef struct lua_State lua_State; < Opaque structure that keeps the whole state of a Lua interpreter. The @@ -2529,7 +2529,7 @@ lua_State *lua_State()* |lua_newstate()|), which creates a Lua state from scratch. lua_status *lua_status()* -> +>c int lua_status (lua_State *L); < Returns the status of the thread `L`. @@ -2539,7 +2539,7 @@ lua_status *lua_status()* suspended. lua_toboolean *lua_toboolean()* -> +>c int lua_toboolean (lua_State *L, int index); < Converts the Lua value at the given acceptable index to a C boolean @@ -2550,14 +2550,14 @@ lua_toboolean *lua_toboolean()* |lua_isboolean()| to test the value's type.) lua_tocfunction *lua_tocfunction()* -> +>c lua_CFunction lua_tocfunction (lua_State *L, int index); < Converts a value at the given acceptable index to a C function. That value must be a C function; otherwise it returns `NULL`. lua_tointeger *lua_tointeger()* -> +>c lua_Integer lua_tointeger (lua_State *L, int idx); < Converts the Lua value at the given acceptable index to the signed @@ -2569,7 +2569,7 @@ lua_tointeger *lua_tointeger()* way. lua_tolstring *lua_tolstring()* -> +>c const char *lua_tolstring (lua_State *L, int index, size_t *len); < Converts the Lua value at the given acceptable index to a C string. If @@ -2588,7 +2588,7 @@ lua_tolstring *lua_tolstring()* value is removed from the stack. lua_tonumber *lua_tonumber()* -> +>c lua_Number lua_tonumber (lua_State *L, int index); < Converts the Lua value at the given acceptable index to the C type @@ -2597,7 +2597,7 @@ lua_tonumber *lua_tonumber()* otherwise, `lua_tonumber` returns 0. lua_topointer *lua_topointer()* -> +>c const void *lua_topointer (lua_State *L, int index); < Converts the value at the given acceptable index to a generic C @@ -2609,14 +2609,14 @@ lua_topointer *lua_topointer()* Typically this function is used only for debug information. lua_tostring *lua_tostring()* -> +>c const char *lua_tostring (lua_State *L, int index); < Equivalent to `lua_tolstring` (see |lua_tolstring()|) with `len` equal to `NULL`. lua_tothread *lua_tothread()* -> +>c lua_State *lua_tothread (lua_State *L, int index); < Converts the value at the given acceptable index to a Lua thread @@ -2624,7 +2624,7 @@ lua_tothread *lua_tothread()* thread; otherwise, the function returns `NULL`. lua_touserdata *lua_touserdata()* -> +>c void *lua_touserdata (lua_State *L, int index); < If the value at the given acceptable index is a full userdata, returns @@ -2632,7 +2632,7 @@ lua_touserdata *lua_touserdata()* pointer. Otherwise, it returns `NULL`. lua_type *lua_type()* -> +>c int lua_type (lua_State *L, int index); < Returns the type of the value in the given acceptable index, or @@ -2643,14 +2643,14 @@ lua_type *lua_type()* `LUA_TUSERDATA`, `LUA_TTHREAD`, and `LUA_TLIGHTUSERDATA`. lua_typename *lua_typename()* -> +>c const char *lua_typename (lua_State *L, int tp); < Returns the name of the type encoded by the value `tp`, which must be one the values returned by `lua_type`. lua_Writer *lua_Writer()* -> +>c typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, @@ -2665,7 +2665,7 @@ lua_Writer *lua_Writer()* means an error and stops `lua_dump` from calling the writer again. lua_xmove *lua_xmove()* -> +>c void lua_xmove (lua_State *from, lua_State *to, int n); < Exchange values between different threads of the `same` global state. @@ -2674,14 +2674,14 @@ lua_xmove *lua_xmove()* onto the stack `to`. lua_yield *lua_yield()* -> +>c int lua_yield (lua_State *L, int nresults); < Yields a coroutine. This function should only be called as the return expression of a C function, as follows: -> +>c return lua_yield (L, nresults); < When a C function calls `lua_yield` in that way, the running coroutine @@ -2715,7 +2715,7 @@ need "inside information" from the interpreter. lua_Debug *lua_Debug()* -> +>c typedef struct lua_Debug { int event; const char *name; /* (n) */ @@ -2768,25 +2768,25 @@ The fields of `lua_Debug` have the following meaning: upvalues of the function. lua_gethook *lua_gethook()* -> +>c lua_Hook lua_gethook (lua_State *L); < Returns the current hook function. lua_gethookcount *lua_gethookcount()* -> +>c int lua_gethookcount (lua_State *L); < Returns the current hook count. lua_gethookmask *lua_gethookmask()* -> +>c int lua_gethookmask (lua_State *L); < Returns the current hook mask. lua_getinfo *lua_getinfo()* -> +>c int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); < Returns information about a specific function or function invocation. @@ -2801,7 +2801,7 @@ lua_getinfo *lua_getinfo()* `lua_getinfo` pops the function in the top of the stack.) For instance, to know in which line a function `f` was defined, you can write the following code: -> +>c lua_Debug ar; lua_getfield(L, LUA_GLOBALSINDEX, "f"); /* get global 'f' */ lua_getinfo(L, ">S", &ar); @@ -2826,7 +2826,7 @@ lua_getinfo *lua_getinfo()* `what`). lua_getlocal *lua_getlocal()* -> +>c const char *lua_getlocal (lua_State *L, lua_Debug *ar, int n); < Gets information about a local variable of a given activation record. @@ -2846,7 +2846,7 @@ lua_getlocal *lua_getlocal()* number of active local variables. lua_getstack *lua_getstack()* -> +>c int lua_getstack (lua_State *L, int level, lua_Debug *ar); < Gets information about the interpreter runtime stack. @@ -2859,7 +2859,7 @@ lua_getstack *lua_getstack()* with a level greater than the stack depth, it returns 0. lua_getupvalue *lua_getupvalue()* -> +>c const char *lua_getupvalue (lua_State *L, int funcindex, int n); < Gets information about a closure's upvalue. (For Lua functions, @@ -2875,7 +2875,7 @@ lua_getupvalue *lua_getupvalue()* string `""` as a name for all upvalues. lua_Hook *lua_Hook()* -> +>c typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); < Type for debugging hook functions. @@ -2897,7 +2897,7 @@ lua_Hook *lua_Hook()* lua_sethook *lua_sethook()* -> +>c int lua_sethook (lua_State *L, lua_Hook f, int mask, int count); < Sets the debugging hook function. @@ -2926,7 +2926,7 @@ lua_sethook *lua_sethook()* A hook is disabled by setting `mask` to zero. lua_setlocal *lua_setlocal()* -> +>c const char *lua_setlocal (lua_State *L, lua_Debug *ar, int n); < Sets the value of a local variable of a given activation record. @@ -2939,7 +2939,7 @@ lua_setlocal *lua_setlocal()* number of active local variables. lua_setupvalue *lua_setupvalue()* -> +>c const char *lua_setupvalue (lua_State *L, int funcindex, int n); < Sets the value of a closure's upvalue. It assigns the value at the top @@ -2953,7 +2953,7 @@ lua_setupvalue *lua_setupvalue()* *luaref-debugexample* As an example, the following function lists the names of all local variables and upvalues for a function at a given level of the stack: -> +>c int listvars (lua_State *L, int level) { lua_Debug ar; int i; @@ -3002,20 +3002,20 @@ Here we list all functions and types from the auxiliary library in alphabetical order. luaL_addchar *luaL_addchar()* -> +>c void luaL_addchar (luaL_Buffer *B, char c); < Adds the character `c` to the buffer `B` (see |luaL_Buffer()|). luaL_addlstring *luaL_addlstring()* -> +>c void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); < Adds the string pointed to by `s` with length `l` to the buffer `B` (see |luaL_Buffer()|). The string may contain embedded zeros. luaL_addsize *luaL_addsize()* -> +>c void luaL_addsize (luaL_Buffer *B, size_t n); < Adds to the buffer `B` (see |luaL_Buffer()|) a string of length @@ -3023,14 +3023,14 @@ luaL_addsize *luaL_addsize()* |luaL_prepbuffer()|). luaL_addstring *luaL_addstring()* -> +>c void luaL_addstring (luaL_Buffer *B, const char *s); < Adds the zero-terminated string pointed to by `s` to the buffer `B` (see |luaL_Buffer()|). The string may not contain embedded zeros. luaL_addvalue *luaL_addvalue()* -> +>c void luaL_addvalue (luaL_Buffer *B); < Adds the value at the top of the stack to the buffer `B` (see @@ -3041,7 +3041,7 @@ luaL_addvalue *luaL_addvalue()* added to the buffer. luaL_argcheck *luaL_argcheck()* -> +>c void luaL_argcheck (lua_State *L, int cond, int narg, @@ -3054,7 +3054,7 @@ luaL_argcheck *luaL_argcheck()* < luaL_argerror *luaL_argerror()* -> +>c int luaL_argerror (lua_State *L, int narg, const char *extramsg); < Raises an error with the following message, where `func` is retrieved @@ -3066,7 +3066,7 @@ luaL_argerror *luaL_argerror()* functions as `return luaL_argerror(` `args` `)`. luaL_Buffer *luaL_Buffer()* -> +>c typedef struct luaL_Buffer luaL_Buffer; < Type for a `string buffer`. @@ -3095,14 +3095,14 @@ luaL_Buffer *luaL_Buffer()* string on its top. luaL_buffinit *luaL_buffinit()* -> +>c void luaL_buffinit (lua_State *L, luaL_Buffer *B); < Initializes a buffer `B`. This function does not allocate any space; the buffer must be declared as a variable (see |luaL_Buffer()|). luaL_callmeta *luaL_callmeta()* -> +>c int luaL_callmeta (lua_State *L, int obj, const char *e); < Calls a metamethod. @@ -3115,49 +3115,49 @@ luaL_callmeta *luaL_callmeta()* 0 (without pushing any value on the stack). luaL_checkany *luaL_checkany()* -> +>c void luaL_checkany (lua_State *L, int narg); < Checks whether the function has an argument of any type (including `nil`) at position `narg`. luaL_checkint *luaL_checkint()* -> +>c int luaL_checkint (lua_State *L, int narg); < Checks whether the function argument `narg` is a number and returns this number cast to an `int`. luaL_checkinteger *luaL_checkinteger()* -> +>c lua_Integer luaL_checkinteger (lua_State *L, int narg); < Checks whether the function argument `narg` is a number and returns this number cast to a `lua_Integer` (see |lua_Integer()|). luaL_checklong *luaL_checklong()* -> +>c long luaL_checklong (lua_State *L, int narg); < Checks whether the function argument `narg` is a number and returns this number cast to a `long`. luaL_checklstring *luaL_checklstring()* -> +>c const char *luaL_checklstring (lua_State *L, int narg, size_t *l); < Checks whether the function argument `narg` is a string and returns this string; if `l` is not `NULL` fills `*l` with the string's length. luaL_checknumber *luaL_checknumber()* -> +>c lua_Number luaL_checknumber (lua_State *L, int narg); < Checks whether the function argument `narg` is a number and returns this number (see |lua_Number()|). luaL_checkoption *luaL_checkoption()* -> +>c int luaL_checkoption (lua_State *L, int narg, const char *def, @@ -3177,7 +3177,7 @@ luaL_checkoption *luaL_checkoption()* select options.) luaL_checkstack *luaL_checkstack()* -> +>c void luaL_checkstack (lua_State *L, int sz, const char *msg); < Grows the stack size to `top + sz` elements, raising an error if the @@ -3185,48 +3185,48 @@ luaL_checkstack *luaL_checkstack()* the error message. luaL_checkstring *luaL_checkstring()* -> +>c const char *luaL_checkstring (lua_State *L, int narg); < Checks whether the function argument `narg` is a string and returns this string. luaL_checktype *luaL_checktype()* -> +>c void luaL_checktype (lua_State *L, int narg, int t); < Checks whether the function argument `narg` has type `t` (see |lua_type()|). luaL_checkudata *luaL_checkudata()* -> +>c void *luaL_checkudata (lua_State *L, int narg, const char *tname); < Checks whether the function argument `narg` is a userdata of the type `tname` (see |luaL_newmetatable()|). luaL_dofile *luaL_dofile()* -> +>c int luaL_dofile (lua_State *L, const char *filename); < Loads and runs the given file. It is defined as the following macro: -> +>c (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0)) < It returns 0 if there are no errors or 1 in case of errors. luaL_dostring *luaL_dostring()* -> +>c int luaL_dostring (lua_State *L, const char *str); < Loads and runs the given string. It is defined as the following macro: -> +>c (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0)) < It returns 0 if there are no errors or 1 in case of errors. luaL_error *luaL_error()* -> +>c int luaL_error (lua_State *L, const char *fmt, ...); < Raises an error. The error message format is given by `fmt` plus any @@ -3239,7 +3239,7 @@ luaL_error *luaL_error()* functions as `return luaL_error(` `args` `)`. luaL_getmetafield *luaL_getmetafield()* -> +>c int luaL_getmetafield (lua_State *L, int obj, const char *e); < Pushes onto the stack the field `e` from the metatable of the object @@ -3247,14 +3247,14 @@ luaL_getmetafield *luaL_getmetafield()* metatable does not have this field, returns 0 and pushes nothing. luaL_getmetatable *luaL_getmetatable()* -> +>c void luaL_getmetatable (lua_State *L, const char *tname); < Pushes onto the stack the metatable associated with name `tname` in the registry (see |luaL_newmetatable()|). luaL_gsub *luaL_gsub()* -> +>c const char *luaL_gsub (lua_State *L, const char *s, const char *p, @@ -3265,7 +3265,7 @@ luaL_gsub *luaL_gsub()* returns it. luaL_loadbuffer *luaL_loadbuffer()* -> +>c int luaL_loadbuffer (lua_State *L, const char *buff, size_t sz, @@ -3279,7 +3279,7 @@ luaL_loadbuffer *luaL_loadbuffer()* chunk name, used for debug information and error messages. luaL_loadfile *luaL_loadfile()* -> +>c int luaL_loadfile (lua_State *L, const char *filename); < Loads a file as a Lua chunk. This function uses `lua_load` (see @@ -3293,7 +3293,7 @@ luaL_loadfile *luaL_loadfile()* As `lua_load`, this function only loads the chunk; it does not run it. luaL_loadstring *luaL_loadstring()* -> +>c int luaL_loadstring (lua_State *L, const char *s); < Loads a string as a Lua chunk. This function uses `lua_load` (see @@ -3306,7 +3306,7 @@ luaL_loadstring *luaL_loadstring()* run it. luaL_newmetatable *luaL_newmetatable()* -> +>c int luaL_newmetatable (lua_State *L, const char *tname); < If the registry already has the key `tname`, returns 0. Otherwise, @@ -3317,7 +3317,7 @@ luaL_newmetatable *luaL_newmetatable()* `tname` in the registry. luaL_newstate *luaL_newstate()* -> +>c lua_State *luaL_newstate (void); < Creates a new Lua state. It calls `lua_newstate` (see @@ -3330,14 +3330,14 @@ luaL_newstate *luaL_newstate()* error. luaL_openlibs *luaL_openlibs()* -> +>c void luaL_openlibs (lua_State *L); < Opens all standard Lua libraries into the given state. See also |luaref-openlibs| for details on how to open individual libraries. luaL_optint *luaL_optint()* -> +>c int luaL_optint (lua_State *L, int narg, int d); < If the function argument `narg` is a number, returns this number cast @@ -3345,7 +3345,7 @@ luaL_optint *luaL_optint()* Otherwise, raises an error. luaL_optinteger *luaL_optinteger()* -> +>c lua_Integer luaL_optinteger (lua_State *L, int narg, lua_Integer d); @@ -3355,7 +3355,7 @@ luaL_optinteger *luaL_optinteger()* absent or is `nil`, returns `d`. Otherwise, raises an error. luaL_optlong *luaL_optlong()* -> +>c long luaL_optlong (lua_State *L, int narg, long d); < If the function argument `narg` is a number, returns this number cast @@ -3363,7 +3363,7 @@ luaL_optlong *luaL_optlong()* Otherwise, raises an error. luaL_optlstring *luaL_optlstring()* -> +>c const char *luaL_optlstring (lua_State *L, int narg, const char *d, @@ -3376,7 +3376,7 @@ luaL_optlstring *luaL_optlstring()* If `l` is not `NULL`, fills the position `*l` with the results' length. luaL_optnumber *luaL_optnumber()* -> +>c lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number d); < If the function argument `narg` is a number, returns this number. If @@ -3384,7 +3384,7 @@ luaL_optnumber *luaL_optnumber()* error. luaL_optstring *luaL_optstring()* -> +>c const char *luaL_optstring (lua_State *L, int narg, const char *d); @@ -3394,7 +3394,7 @@ luaL_optstring *luaL_optstring()* error. luaL_prepbuffer *luaL_prepbuffer()* -> +>c char *luaL_prepbuffer (luaL_Buffer *B); < Returns an address to a space of size `LUAL_BUFFERSIZE` where you can @@ -3404,14 +3404,14 @@ luaL_prepbuffer *luaL_prepbuffer()* add it to the buffer. luaL_pushresult *luaL_pushresult()* -> +>c void luaL_pushresult (luaL_Buffer *B); < Finishes the use of buffer `B` leaving the final string on the top of the stack. luaL_ref *luaL_ref()* -> +>c int luaL_ref (lua_State *L, int t); < Creates and returns a `reference`, in the table at index `t`, for the @@ -3429,7 +3429,7 @@ luaL_ref *luaL_ref()* different from any reference returned by `luaL_ref`. luaL_Reg *luaL_Reg()* -> +>c typedef struct luaL_Reg { const char *name; lua_CFunction func; @@ -3441,7 +3441,7 @@ luaL_Reg *luaL_Reg()* sentinel entry in which both `name` and `func` are `NULL`. luaL_register *luaL_register()* -> +>c void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l); @@ -3462,13 +3462,13 @@ luaL_register *luaL_register()* In any case the function leaves the table on the top of the stack. luaL_typename *luaL_typename()* -> +>c const char *luaL_typename (lua_State *L, int idx); < Returns the name of the type of the value at index `idx`. luaL_typerror *luaL_typerror()* -> +>c int luaL_typerror (lua_State *L, int narg, const char *tname); < Generates an error with a message like the following: @@ -3481,7 +3481,7 @@ luaL_typerror *luaL_typerror()* `rt` is the type name of the actual argument. luaL_unref *luaL_unref()* -> +>c void luaL_unref (lua_State *L, int t, int ref); < Releases reference `ref` from the table at index `t` (see @@ -3492,7 +3492,7 @@ luaL_unref *luaL_unref()* If `ref` is `LUA_NOREF` or `LUA_REFNIL`, `luaL_unref` does nothing. luaL_where *luaL_where()* -> +>c void luaL_where (lua_State *L, int lvl); < Pushes onto the stack a string identifying the current position of the @@ -3641,7 +3641,7 @@ loadstring({string} [, {chunkname}]) *luaref-loadstring()* given {string}. To load and run a given string, use the idiom -> +>lua assert(loadstring(s))() < @@ -3756,7 +3756,7 @@ type({v}) *luaref-type()* unpack({list} [, {i} [, {j}]]) *luaref-unpack()* Returns the elements from the given table. This function is equivalent to -> +>lua return list[i], list[i+1], ..., list[j] < except that the above code can be written only for a fixed number of @@ -4021,11 +4021,11 @@ string.format({formatstring}, {...}) *string.format()* interpreter: the string is written between double quotes, and all double quotes, newlines, embedded zeros, and backslashes in the string are correctly escaped when written. For instance, the call -> +>lua string.format('%q', 'a string with "quotes" and \n new line') < will produce the string: -> +>lua "a string with \"quotes\" and \ new line" < @@ -4043,7 +4043,7 @@ string.gmatch({s}, {pattern}) *string.gmatch()* in each call. As an example, the following loop -> +>lua s = "hello world from Lua" for w in string.gmatch(s, "%a+") do print(w) @@ -4052,7 +4052,7 @@ string.gmatch({s}, {pattern}) *string.gmatch()* will iterate over all the words from string {s}, printing one per line. The next example collects all pairs `key=value` from the given string into a table: -> +>lua t = {} s = "from=world, to=Lua" for k, v in string.gmatch(s, "(%w+)=(%w+)") do @@ -4091,7 +4091,7 @@ string.gsub({s}, {pattern}, {repl} [, {n}]) *string.gsub()* occurrence of `pattern` is replaced. Here are some examples: -> +>lua x = string.gsub("hello world", "(%w+)", "%1 %1") --> x="hello hello world world" diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt index dd4162c179..b0d1b6764a 100644 --- a/runtime/doc/luvref.txt +++ b/runtime/doc/luvref.txt @@ -28,7 +28,7 @@ TCP Echo Server Example~ Here is a small example showing a TCP echo server: - > + >lua local uv = vim.loop local server = uv.new_tcp() @@ -250,7 +250,7 @@ uv.loop_configure({option}, {...}) *uv.loop_configure()* An example of a valid call to this function is: - > + >lua uv.loop_configure("block_signal", "sigprof") < @@ -343,7 +343,7 @@ uv.walk({callback}) *uv.walk()* Returns: Nothing. - > + >lua -- Example usage of uv.walk to close all handles that -- aren't already closing. uv.walk(function (handle) @@ -613,7 +613,7 @@ uv.new_timer() *uv.new_timer()* Returns: `uv_timer_t userdata` or `fail` - > + >lua -- Creating a simple setTimeout wrapper local function setTimeout(timeout, callback) local timer = uv.new_timer() @@ -737,7 +737,7 @@ uv.timer_get_due_in({timer}) *uv.timer_get_due_in()* Prepare handles will run the given callback once per loop iteration, right before polling for I/O. - > + >lua local prepare = uv.new_prepare() prepare:start(function() print("Before I/O polling") @@ -782,7 +782,7 @@ uv.prepare_stop({prepare}) *uv.prepare_stop()* Check handles will run the given callback once per loop iteration, right after polling for I/O. - > + >lua local check = uv.new_check() check:start(function() print("After I/O polling") @@ -834,7 +834,7 @@ blocking for I/O. WARNING: Despite the name, idle handles will get their callbacks called on every loop iteration, not when the loop is actually "idle". - > + >lua local idle = uv.new_idle() idle:start(function() print("Before I/O polling, no blocking") @@ -879,7 +879,7 @@ uv.idle_stop({check}) *uv.idle_stop()* Async handles allow the user to "wakeup" the event loop and get a callback called from another thread. - > + >lua local async async = uv.new_async(function() print("async operation ran") @@ -1062,7 +1062,7 @@ Unix Notes: will lead to unpredictable behavior and is strongly discouraged. Future versions of libuv may simply reject them. - > + >lua -- Create a new signal handler local signal = uv.new_signal() -- Define a handler function @@ -1164,7 +1164,7 @@ uv.spawn({path}, {options}, {on_exit}) *uv.spawn()* permissions to use the setuid or setgid specified, or not having enough memory to allocate for the new process. - > + >lua local stdin = uv.new_pipe() local stdout = uv.new_pipe() local stderr = uv.new_pipe() @@ -1358,7 +1358,7 @@ uv.accept({stream}, {client_stream}) *uv.accept()* Returns: `0` or `fail` - > + >lua server:listen(128, function (err) local client = uv.new_tcp() server:accept(client) @@ -1382,7 +1382,7 @@ uv.read_start({stream}, {callback}) *uv.read_start()* Returns: `0` or `fail` - > + >lua stream:read_start(function (err, chunk) if err then -- handle read error @@ -1690,7 +1690,7 @@ uv.tcp_connect({tcp}, {host}, {port}, {callback}) *uv.tcp_connect()* Returns: `uv_connect_t userdata` or `fail` - > + >lua local client = uv.new_tcp() client:connect("127.0.0.1", 8080, function (err) -- check error and carry on. @@ -1755,7 +1755,7 @@ uv.socketpair([{socktype}, [{protocol}, [{flags1}, [{flags2}]]]]) Returns: `table` or `fail` - `[1, 2]` : `integer` (file descriptor) - > + >lua -- Simple read/write with tcp local fds = uv.socketpair(nil, nil, {nonblock=true}, {nonblock=true}) @@ -1780,7 +1780,7 @@ uv.socketpair([{socktype}, [{protocol}, [{flags1}, [{flags2}]]]]) Pipe handles provide an abstraction over local domain sockets on Unix and named pipes on Windows. - > + >lua local pipe = uv.new_pipe(false) pipe:bind('/tmp/sock.test') @@ -1959,7 +1959,7 @@ uv.pipe({read_flags}, {write_flags}) *uv.pipe()* - `read` : `integer` (file descriptor) - `write` : `integer` (file descriptor) - > + >lua -- Simple read/write with pipe_open local fds = uv.pipe({nonblock=true}, {nonblock=true}) @@ -1983,7 +1983,7 @@ uv.pipe({read_flags}, {write_flags}) *uv.pipe()* TTY handles represent a stream for the console. - > + >lua -- Simple echo program local stdin = uv.new_tty(0, true) local stdout = uv.new_tty(1, false) @@ -2537,7 +2537,7 @@ FS call. Synchronous and asynchronous versions of `readFile` (with naive error handling) are implemented below as an example: - > + >lua local function readFileSync(path) local fd = assert(uv.fs_open(path, "r", 438)) local stat = assert(uv.fs_fstat(fd)) @@ -2550,7 +2550,7 @@ handling) are implemented below as an example: print("synchronous read", data) < - > + >lua local function readFile(path, callback) uv.fs_open(path, "r", 438, function(err, fd) assert(not err, err) @@ -3253,7 +3253,7 @@ Libuv provides a threadpool which can be used to run user code and get notified in the loop thread. This threadpool is internally used to run all file system operations, as well as `getaddrinfo` and `getnameinfo` requests. - > + >lua local function work_callback(a, b) return a + b end diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt index 203f57024c..4946779a7c 100644 --- a/runtime/doc/nvim.txt +++ b/runtime/doc/nvim.txt @@ -9,7 +9,7 @@ Nvim *nvim* *nvim-intro* Nvim is based on Vim by Bram Moolenaar. If you already use Vim see |nvim-from-vim| for a quickstart. -If you are new to Vim, try the 30-minute tutorial: > +If you are new to Vim, try the 30-minute tutorial: >vim :Tutor @@ -22,12 +22,12 @@ Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim ============================================================================== Transitioning from Vim *nvim-from-vim* -1. To start the transition, create your |init.vim| (user config) file: > +1. To start the transition, create your |init.vim| (user config) file: >vim :call mkdir(stdpath('config'), 'p') :exe 'edit '.stdpath('config').'/init.vim' -2. Add these contents to the file: > +2. Add these contents to the file: >vim set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath = &runtimepath @@ -43,19 +43,19 @@ Your Vim configuration might not be entirely Nvim-compatible (see because mouse support is always enabled if possible. If you use the same |vimrc| for Vim and Nvim you could guard |'ttymouse'| in your configuration like so: -> +>vim if !has('nvim') set ttymouse=xterm2 endif And for Nvim-specific configuration, you can do this: -> +>vim if has('nvim') tnoremap endif For a more granular approach use |exists()|: -> +>vim if exists(':tnoremap') tnoremap endif @@ -67,7 +67,7 @@ for more information. Because Nvim follows the XDG |base-directories| standard, configuration on Windows is stored in ~/AppData instead of ~/.config. But you can still share the same Nvim configuration on all of your machines, by creating -~/AppData/Local/nvim/init.vim containing just this line: > +~/AppData/Local/nvim/init.vim containing just this line: >vim source ~/.config/nvim/init.vim ============================================================================== diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index 3fe86b00bc..96f99528ed 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -27,12 +27,12 @@ There are several ways to create a terminal buffer: - Run the |:terminal| command. - Call the |nvim_open_term()| or |termopen()| function. -- Edit a "term://" buffer. Examples: > +- Edit a "term://" buffer. Examples: >vim :edit term://bash :vsplit term://top < Note: To open a "term://" buffer from an autocmd, the |autocmd-nested| - modifier is required. > + modifier is required. >vim autocmd VimEnter * ++nested split term://sh < (This is only mentioned for reference; use |:terminal| instead.) @@ -62,13 +62,13 @@ Terminal-mode forces these local options: Terminal-mode has its own |:tnoremap| namespace for mappings, this can be used to automate any terminal interaction. -To map to exit terminal-mode: > +To map to exit terminal-mode: >vim :tnoremap -To simulate |i_CTRL-R| in terminal-mode: > +To simulate |i_CTRL-R| in terminal-mode: >vim :tnoremap '"'.nr2char(getchar()).'pi' -To use `ALT+{h,j,k,l}` to navigate windows from any mode: > +To use `ALT+{h,j,k,l}` to navigate windows from any mode: >vim :tnoremap h :tnoremap j :tnoremap k @@ -109,7 +109,7 @@ global configuration. - 'list' is disabled - 'wrap' is disabled -You can change the defaults with a TermOpen autocommand: > +You can change the defaults with a TermOpen autocommand: >vim au TermOpen * setlocal list TERMINAL COLORS ~ @@ -117,7 +117,7 @@ TERMINAL COLORS ~ The `{g,b}:terminal_color_x` variables control the terminal color palette, where `x` is the color index between 0 and 255 inclusive. The variables are read during |TermOpen|. The value must be a color name or hexadecimal string. -Example: > +Example: >vim let g:terminal_color_4 = '#ff0000' let g:terminal_color_5 = 'green' Only works for RGB UIs (see 'termguicolors'); for 256-color terminals the @@ -131,7 +131,7 @@ Status Variables *terminal-status* Terminal buffers maintain some buffer-local variables and options. The values are initialized before TermOpen, so you can use them in a local 'statusline'. -Example: > +Example: >vim :autocmd TermOpen * setlocal statusline=%{b:term_title} - *b:term_title* Terminal title (user-writable), typically displayed in the @@ -141,10 +141,10 @@ Example: > input to the terminal. - The |TermClose| event gives the terminal job exit code in the |v:event| "status" field. For example, this autocmd closes terminal buffers if the job - exited without error: > + exited without error: >vim autocmd TermClose * if !v:event.status | exe 'bdelete! '..expand('') | endif -Use |jobwait()| to check if the terminal job has finished: > +Use |jobwait()| to check if the terminal job has finished: >vim let running = jobwait([&channel], 0)[0] == -1 ============================================================================== @@ -156,11 +156,11 @@ Vim this also works remotely over an ssh connection. Starting ~ *termdebug-starting* -Load the plugin with this command: > +Load the plugin with this command: >vim packadd termdebug < *:Termdebug* To start debugging use `:Termdebug` or `:TermdebugCommand` followed by the -command name, for example: > +command name, for example: >vim :Termdebug vim This opens two windows: @@ -189,16 +189,16 @@ Only one debugger can be active at a time. *:TermdebugCommand* If you want to give specific commands to the command being debugged, you can use the `:TermdebugCommand` command followed by the command name and -additional parameters. > +additional parameters. >vim :TermdebugCommand vim --clean -c ':set nu' Both the `:Termdebug` and `:TermdebugCommand` support an optional "!" bang argument to start the command right away, without pausing at the gdb window -(and cursor will be in the debugged window). For example: > +(and cursor will be in the debugged window). For example: >vim :TermdebugCommand! vim --clean To attach gdb to an already running executable or use a core file, pass extra -arguments. E.g.: > +arguments. E.g.: >vim :Termdebug vim core :Termdebug vim 98343 @@ -212,7 +212,7 @@ Start in the Vim "src" directory and build Vim: > % make Start Vim: > % ./vim -Load the termdebug plugin and start debugging Vim: > +Load the termdebug plugin and start debugging Vim: >vim :packadd termdebug :Termdebug vim You should now have three windows: @@ -223,7 +223,7 @@ You should now have three windows: Put focus on the gdb window and type: > break ex_help run -Vim will start running in the program window. Put focus there and type: > +Vim will start running in the program window. Put focus there and type: >vim :help gui Gdb will run into the ex_help breakpoint. The source window now shows the ex_cmds.c file. A red "1 " marker will appear in the signcolumn where the @@ -329,7 +329,7 @@ Other commands ~ Events ~ *termdebug-events* -Four autocommands can be used: > +Four autocommands can be used: >vim au User TermdebugStartPre echomsg 'debugging starting' au User TermdebugStartPost echomsg 'debugging started' au User TermdebugStopPre echomsg 'debugging stopping' @@ -360,7 +360,7 @@ Customizing ~ In the past several global variables were used for configuration. These are deprecated and using the g:termdebug_config dictionary is preferred. When g:termdebug_config exists the other global variables will NOT be used. -The recommended way is to start with an empty dictionary: > +The recommended way is to start with an empty dictionary: >vim let g:termdebug_config = {} Then you can add entries to the dictionary as mentioned below. The @@ -380,23 +380,23 @@ This works slightly differently: - A separate :terminal window will be opened to run the debugged program in. *termdebug_use_prompt* -Prompt mode can be used with: > +Prompt mode can be used with: >vim let g:termdebug_config['use_prompt'] = 1 -If there is no g:termdebug_config you can use: > +If there is no g:termdebug_config you can use: >vim let g:termdebug_use_prompt = 1 < *termdebug_map_K* -The K key is normally mapped to :Evaluate. If you do not want this use: > +The K key is normally mapped to :Evaluate. If you do not want this use: >vim let g:termdebug_config['map_K'] = 0 -If there is no g:termdebug_config you can use: > +If there is no g:termdebug_config you can use: >vim let g:termdebug_map_K = 0 < *termdebug_disasm_window* If you want the Asm window shown by default, set the flag to 1. -the "disasm_window_height" entry can be used to set the window height: > +the "disasm_window_height" entry can be used to set the window height: >vim let g:termdebug_config['disasm_window'] = 1 let g:termdebug_config['disasm_window_height'] = 15 -If there is no g:termdebug_config you can use: > +If there is no g:termdebug_config you can use: >vim let g:termdebug_disasm_window = 15 Any value greater than 1 will set the Asm window height to that value. @@ -418,34 +418,34 @@ GDB command ~ *g:termdebugger* To change the name of the gdb command, set "debugger" entry in g:termdebug_config or the "g:termdebugger" variable before invoking -`:Termdebug`: > +`:Termdebug`: >vim let g:termdebug_config['command'] = "mygdb" -If there is no g:termdebug_config you can use: > +If there is no g:termdebug_config you can use: >vim let g:termdebugger = "mygdb" -If the command needs an argument use a List: > +If the command needs an argument use a List: >vim let g:termdebug_config['command'] = ['rr', 'replay', '--'] -If there is no g:termdebug_config you can use: > +If there is no g:termdebug_config you can use: >vim let g:termdebugger = ['rr', 'replay', '--'] To not use neovim floating windows for previewing variable evaluation, set the -`g:termdebug_useFloatingHover` variable like this: > +`g:termdebug_useFloatingHover` variable like this: >vim let g:termdebug_useFloatingHover = 0 If you are a mouse person, you can also define a mapping using your right click to one of the terminal command like evaluate the variable under the -cursor: > +cursor: >vim nnoremap :Evaluate -or set/unset a breakpoint: > +or set/unset a breakpoint: >vim nnoremap :Break Several arguments will be added to make gdb work well for the debugger. -If you want to modify them, add a function to filter the argument list: > +If you want to modify them, add a function to filter the argument list: >vim let g:termdebug_config['command_filter'] = MyDebugFilter If you do not want the arguments to be added, but you do need to set the -"pty", use a function to add the necessary arguments: > +"pty", use a function to add the necessary arguments: >vim let g:termdebug_config['command_add_args'] = MyAddArguments The function will be called with the list of arguments so far, and a second argument that is the name of the pty. @@ -475,7 +475,7 @@ When 'background' is "dark": Shortcuts ~ *termdebug_shortcuts* You can define your own shortcuts (mappings) to control gdb, that can work in -any window, using the TermDebugSendCommand() function. Example: > +any window, using the TermDebugSendCommand() function. Example: >vim map ,w :call TermDebugSendCommand('where') The argument is the gdb command. @@ -487,18 +487,18 @@ these entries to the popup menu: Set breakpoint `:Break` Clear breakpoint `:Clear` Evaluate `:Evaluate` -If you don't want this then disable it with: > +If you don't want this then disable it with: >vim let g:termdebug_config['popup'] = 0 -If there is no g:termdebug_config you can use: > +If there is no g:termdebug_config you can use: >vim let g:termdebug_popup = 0 Vim window width ~ *termdebug_wide* To change the width of the Vim window when debugging starts and use a vertical -split: > +split: >vim let g:termdebug_config['wide'] = 163 -If there is no g:termdebug_config you can use: > +If there is no g:termdebug_config you can use: >vim let g:termdebug_wide = 163 This will set 'columns' to 163 when `:Termdebug` is used. The value is diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 3ccff3dc3c..8f2feb416b 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -36,7 +36,7 @@ itself). For Python 3 plugins: 1. Make sure Python 3.4+ is available in your $PATH. -2. Install the module (try "python" if "python3" is missing): > +2. Install the module (try "python" if "python3" is missing): >bash python3 -m pip install --user --upgrade pynvim The pip `--upgrade` flag ensures that you get the latest version even if @@ -46,7 +46,7 @@ See also |python-virtualenv|. Note: The old "neovim" module was renamed to "pynvim". https://github.com/neovim/neovim/wiki/Following-HEAD#20181118 -If you run into problems, uninstall _both_ then install "pynvim" again: > +If you run into problems, uninstall _both_ then install "pynvim" again: >bash python -m pip uninstall neovim pynvim python -m pip install --user --upgrade pynvim @@ -55,11 +55,11 @@ PYTHON PROVIDER CONFIGURATION ~ *g:python3_host_prog* Command to start Python 3 (executable, not directory). Setting this makes startup faster. Useful for working with virtualenvs. Must be set before any -check for has("python3"). > +check for has("python3"). >vim let g:python3_host_prog = '/path/to/python3' < *g:loaded_python3_provider* -To disable Python 3 support: > +To disable Python 3 support: >vim let g:loaded_python3_provider = 0 @@ -70,13 +70,13 @@ virtualenv for Neovim and hard-code the interpreter path via |g:python3_host_prog| so that the "pynvim" package is not required for each virtualenv. -Example using pyenv: > +Example using pyenv: >bash pyenv install 3.4.4 pyenv virtualenv 3.4.4 py3nvim pyenv activate py3nvim python3 -m pip install pynvim pyenv which python # Note the path -The last command reports the interpreter path, add it to your init.vim: > +The last command reports the interpreter path, add it to your init.vim: >vim let g:python3_host_prog = '/path/to/py3nvim/bin/python' See also: https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim @@ -90,7 +90,7 @@ Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface RUBY QUICKSTART ~ -To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: > +To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >bash gem install neovim Run |:checkhealth| to see if your system is up-to-date. @@ -98,7 +98,7 @@ Run |:checkhealth| to see if your system is up-to-date. RUBY PROVIDER CONFIGURATION ~ *g:loaded_ruby_provider* -To disable Ruby support: > +To disable Ruby support: >vim let g:loaded_ruby_provider = 0 < *g:ruby_host_prog* @@ -106,10 +106,10 @@ Command to start the Ruby host. By default this is "neovim-ruby-host". With project-local Ruby versions (via tools like RVM or rbenv) setting this can avoid the need to install the "neovim" gem in every project. -To use an absolute path (e.g. to an rbenv installation): > +To use an absolute path (e.g. to an rbenv installation): >vim let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host' -To use the RVM "system" Ruby installation: > +To use the RVM "system" Ruby installation: >vim let g:ruby_host_prog = 'rvm system do neovim-ruby-host' ============================================================================== @@ -125,7 +125,7 @@ Note: Only perl versions from 5.22 onward are supported. PERL QUICKSTART~ -To use perl remote-plugins with Nvim, install the "Neovim::Ext" cpan package: > +To use perl remote-plugins with Nvim, install the "Neovim::Ext" cpan package: >bash cpanm -n Neovim::Ext Run |:checkhealth| to see if your system is up-to-date. @@ -133,12 +133,12 @@ Run |:checkhealth| to see if your system is up-to-date. PERL PROVIDER CONFIGURATION~ *g:loaded_perl_provider* -To disable Perl support: > +To disable Perl support: >vim :let g:loaded_perl_provider = 0 < *g:perl_host_prog* Command to start the Perl executable. Must be set before any -check for has("perl"). > +check for has("perl"). >vim let g:perl_host_prog = '/path/to/perl' < ============================================================================== @@ -150,7 +150,7 @@ https://github.com/neovim/node-client/ NODEJS QUICKSTART~ -To use javascript remote-plugins with Nvim, install the "neovim" npm package: > +To use javascript remote-plugins with Nvim, install the "neovim" npm package: >bash npm install -g neovim Run |:checkhealth| to see if your system is up-to-date. @@ -158,14 +158,14 @@ Run |:checkhealth| to see if your system is up-to-date. NODEJS PROVIDER CONFIGURATION~ *g:loaded_node_provider* -To disable Node.js support: > +To disable Node.js support: >vim :let g:loaded_node_provider = 0 < *g:node_host_prog* Command to start the Node.js host. Setting this makes startup faster. By default, Nvim searches for "neovim-node-host" using "npm root -g", which -can be slow. To avoid this, set g:node_host_prog to the host path: > +can be slow. To avoid this, set g:node_host_prog to the host path: >vim let g:node_host_prog = '/usr/local/bin/neovim-node-host' < ============================================================================== @@ -176,7 +176,7 @@ a |provider| which transparently uses shell commands to communicate with the system clipboard or any other clipboard "backend". To ALWAYS use the clipboard for ALL operations (instead of interacting with -the '+' and/or '*' registers explicitly): > +the '+' and/or '*' registers explicitly): >vim set clipboard+=unnamedplus See 'clipboard' for details and options. @@ -199,7 +199,7 @@ registers. Nvim looks for these clipboard tools, in order of priority: *g:clipboard* To configure a custom clipboard tool, set g:clipboard to a dictionary. -For example this configuration integrates the tmux clipboard: > +For example this configuration integrates the tmux clipboard: >vim let g:clipboard = { \ 'name': 'myClipboard', @@ -219,7 +219,8 @@ the selection until the copy command process dies. When pasting, if the copy process has not died the cached selection is applied. g:clipboard can also use functions (see |lambda|) instead of strings. -For example this configuration uses the g:foo variable as a fake clipboard: > +For example this configuration uses the g:foo variable as a fake clipboard: +>vim let g:clipboard = { \ 'name': 'myClipboard', @@ -239,7 +240,7 @@ a list of lines and `regtype` is a register type conforming to |setreg()|. *clipboard-wsl* For Windows WSL, try this g:clipboard definition: -> +>vim let g:clipboard = { \ 'name': 'WslClipboard', \ 'copy': { @@ -283,7 +284,7 @@ many commands. Use the |cmdline-window| if you really want to paste multiple lines to the cmdline. You can implement a custom paste handler by redefining |vim.paste()|. -Example: > +Example: >lua vim.paste = (function(lines, phase) vim.api.nvim_put(lines, 'c', true, true) diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index 2a131a34dd..847b4b6112 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -76,7 +76,7 @@ supplying an external one with entries for the terminal type. Settings depending on terminal *term-dependent-settings* If you want to set terminal-dependent options or mappings, you can do this in -your init.vim. Example: > +your init.vim. Example: >vim if $TERM =~ '^\(rxvt\|screen\|interix\|putty\)\(-.*\)\?$' set notermguicolors @@ -222,9 +222,9 @@ are not in terminfo you must add them by setting "terminal-overrides" in ~/.tmux.conf . See the tmux(1) manual page for the details of how and what to do in the tmux -configuration file. It will look something like: > +configuration file. It will look something like: >bash set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' - +bash set -ga terminal-overrides 'xterm*:\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%{1}%;%d\007' < ============================================================================== @@ -262,7 +262,7 @@ See the "Options" chapter |options|. If you are using a color terminal that is slow when displaying lines beyond the end of a buffer, this is because Nvim is drawing the whitespace twice, in -two sets of colours and attributes. To prevent this, use this command: > +two sets of colours and attributes. To prevent this, use this command: >vim hi NonText cterm=NONE ctermfg=NONE This draws the spaces with the default colours and attributes, which allows the second pass of drawing to be optimized away. Note: Although in theory the @@ -372,7 +372,7 @@ that has a match selects until that match (like using "v%"). If the match is an #if/#else/#endif block, the selection becomes linewise. For MS-Windows and xterm the time for double clicking can be set with the 'mousetime' option. For the other systems this time is defined outside of Vim. -An example, for using a double click to jump to the tag under the cursor: > +An example, for using a double click to jump to the tag under the cursor: >vim :map <2-LeftMouse> :exe "tag " .. expand("") Dragging the mouse with a double click (button-down, button-up, button-down @@ -410,23 +410,23 @@ The X1 and X2 buttons refer to the extra buttons found on some mice. The 'Microsoft Explorer' mouse has these buttons available to the right thumb. Currently X1 and X2 only work on Win32 and X11 environments. -Examples: > +Examples: >vim :noremap Paste at the position of the middle mouse button click (otherwise the paste -would be done at the cursor position). > +would be done at the cursor position). >vim :noremap y Immediately yank the selection, when using Visual mode. Note the use of ":noremap" instead of "map" to avoid a recursive mapping. -> +>vim :map :map Map the X1 and X2 buttons to go forwards and backwards in the jump list, see |CTRL-O| and |CTRL-I|. *mouse-swap-buttons* -To swap the meaning of the left and right mouse buttons: > +To swap the meaning of the left and right mouse buttons: >vim :noremap :noremap :noremap diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index dfaff672e6..cef48e207f 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -24,7 +24,7 @@ via a plugin like https://github.com/nvim-treesitter/nvim-treesitter. Parsers are searched for as `parser/{lang}.*` in any 'runtimepath' directory. If multiple parsers for the same language are found, the first one is used. (This typically implies the priority "user config > plugins > bundled". -A parser can also be loaded manually using a full path: > +A parser can also be loaded manually using a full path: >lua vim.treesitter.require_language("python", "/path/to/python.so") < @@ -37,7 +37,7 @@ file), multiple parsers may be needed to parse the full buffer. These are combined in a |LanguageTree| object. To create a LanguageTree (parser object) for a buffer and a given language, -use > +use >lua tsparser = vim.treesitter.get_parser(bufnr, lang) < @@ -46,7 +46,7 @@ Currently, the parser will be retained for the lifetime of a buffer but this is subject to change. A plugin should keep a reference to the parser object as long as it wants incremental updates. -Whenever you need to access the current syntax tree, parse the buffer: > +Whenever you need to access the current syntax tree, parse the buffer: >lua tstree = tsparser:parse() < @@ -366,10 +366,10 @@ queries that make them available. As an additional rule, capture highlights can always be specialized by language, by appending the language name after an additional dot. For -instance, to highlight comments differently per language: > +instance, to highlight comments differently per language: >vim hi @comment.c guifg=Blue - hi @comment.lua @guifg=DarkBlue + hi @comment.lua guifg=DarkBlue hi link @comment.doc.java String < The following captures are linked by default to standard |group-name|s: diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 5d1788be1b..1cffe1f902 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -119,7 +119,7 @@ for forward-compatibility. |api-contract| UI startup *ui-startup* UI embedders (clients that start Nvim with |--embed| and later call -|nvim_ui_attach()|) must start Nvim without |--headless|: > +|nvim_ui_attach()|) must start Nvim without |--headless|: >bash nvim --embed Nvim will pause before loading startup files and reading buffers, so the UI has a chance to invoke requests and do early initialization. Startup will @@ -138,7 +138,7 @@ procedure: to set |g:| variables visible to init.vim 3. If the UI wants to do additional setup after user config is loaded, - register a VimEnter autocmd: > + register a VimEnter autocmd: >vim nvim_command("autocmd VimEnter * call rpcrequest(1, 'vimenter')") 4. Now invoke |nvim_ui_attach()|. The UI must handle user input by now: @@ -722,7 +722,7 @@ For command-line 'wildmenu' UI events, activate |ui-popupmenu|. ["cmdline_block_show", lines] ~ Show a block of context to the current command line. For example if - the user defines a |:function| interactively: > + the user defines a |:function| interactively: >vim :function Foo() : echo "foo" : diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index b5222c9ddd..6a2e74eaf5 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -73,7 +73,7 @@ centralized reference of the differences. - 'wildoptions' defaults to "pum,tagfile" - |man.lua| plugin is enabled, so |:Man| is available by default. -- |matchit| plugin is enabled. To disable it in your config: > +- |matchit| plugin is enabled. To disable it in your config: >vim :let loaded_matchit = 1 - |g:vimsyn_embed| defaults to "l" to enable Lua highlighting @@ -88,11 +88,11 @@ typing ":". If you don't like this you can disable the mouse in your |config| using any of the following: -- Disable mouse completely by unsetting the 'mouse' option: > +- Disable mouse completely by unsetting the 'mouse' option: >vim set mouse= -- Pressing extends selection instead of showing popup-menu: > +- Pressing extends selection instead of showing popup-menu: >vim set mousemodel=extend -- Pressing releases mouse until the cursor moves: > +- Pressing releases mouse until the cursor moves: >vim nnoremap \ set mouse= \ echo 'mouse OFF until next cursor-move' @@ -104,7 +104,7 @@ Default Mappings ~ *default-mappings* Nvim creates the following default mappings at |startup|. You can disable any of these in your config by simply removing the mapping, e.g. ":unmap Y". -> +>vim nnoremap Y y$ nnoremap nohlsearchdiffupdatenormal! inoremap u @@ -302,7 +302,7 @@ are always available and may be used simultaneously. See |provider-python|. structures. 2. |string()| fails immediately on nested containers, not when recursion limit was exceeded. -2. When |:echo| encounters duplicate containers like > +2. When |:echo| encounters duplicate containers like >vim let l = [] echo [l, l] @@ -462,7 +462,7 @@ TUI: < *'term'* *E529* *E530* *E531* 'term' reflects the terminal type derived from |$TERM| and other environment - checks. For debugging only; not reliable during startup. > + checks. For debugging only; not reliable during startup. >vim :echo &term < "builtin_x" means one of the |builtin-terms| was chosen, because the expected terminfo file was not found on the system. @@ -568,7 +568,7 @@ Events: Highlight groups: *hl-StatusLineTerm* *hl-StatusLineTermNC* are unnecessary because Nvim supports 'winhighlight' window-local highlights. - For example, to mimic Vim's StatusLineTerm: > + For example, to mimic Vim's StatusLineTerm: >vim hi StatusLineTerm ctermfg=black ctermbg=green hi StatusLineTermNC ctermfg=green autocmd TermOpen,WinEnter * if &buftype=='terminal' @@ -604,7 +604,7 @@ Options: *'imactivatekey'* *'imak'* *'imstatusfunc'* *'imsf'* *'insertmode'* *'im'* Use the following script to emulate 'insertmode': -> +>vim autocmd BufWinEnter * startinsert inoremap inoremap -- cgit From 0b05bd87c04f9cde5c84a062453619349e370795 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 23 Nov 2022 12:31:49 +0100 Subject: docs(gen): support language annotation in docstrings --- runtime/doc/api.txt | 89 ++++++++++++++++++++---------------------- runtime/doc/develop.txt | 6 ++- runtime/doc/diagnostic.txt | 26 ++++++------- runtime/doc/lsp.txt | 83 +++++++++++++++++++-------------------- runtime/doc/lua.txt | 97 ++++++++++++++++++++++++---------------------- runtime/doc/treesitter.txt | 6 +-- 6 files changed, 153 insertions(+), 154 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 0eccb64517..a8433640ab 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -803,7 +803,7 @@ nvim_feedkeys({keys}, {mode}, {escape_ks}) *nvim_feedkeys()* with escape_ks=false) to replace |keycodes|, then pass the result to nvim_feedkeys(). - Example: > + Example: >vim :let key = nvim_replace_termcodes("", v:true, v:false, v:true) :call nvim_feedkeys(key, 'n', v:false) < @@ -859,7 +859,7 @@ nvim_get_color_by_name({name}) *nvim_get_color_by_name()* Returns the 24-bit RGB value of a |nvim_get_color_map()| color name or "#rrggbb" hexadecimal string. - Example: > + Example: >vim :echo nvim_get_color_by_name("Pink") :echo nvim_get_color_by_name("#cbcbcb") < @@ -1444,11 +1444,11 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()* Unlike |:map|, leading/trailing whitespace is accepted as part of the {lhs} or {rhs}. Empty {rhs} is ||. |keycodes| are replaced as usual. - Example: > + Example: >vim call nvim_set_keymap('n', ' ', '', {'nowait': v:true}) < - is equivalent to: > + is equivalent to: >vim nmap < @@ -1746,7 +1746,7 @@ nvim_create_user_command({name}, {command}, {*opts}) {command} is the replacement text or Lua function to execute. - Example: > + Example: >vim :call nvim_create_user_command('SayHello', 'echo "Hello world!"', {}) :SayHello Hello world! @@ -2027,7 +2027,7 @@ whether a buffer is loaded. nvim_buf_attach({buffer}, {send_buffer}, {opts}) *nvim_buf_attach()* Activates buffer-update events on a channel, or as Lua callbacks. - Example (Lua): capture buffer updates in a global `events` variable (use "print(vim.inspect(events))" to see its contents): > + Example (Lua): capture buffer updates in a global `events` variable (use "print(vim.inspect(events))" to see its contents): >lua events = {} vim.api.nvim_buf_attach(0, false, { on_lines=function(...) table.insert(events, {...}) end}) @@ -2529,29 +2529,27 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts}) Region can be given as (row,col) tuples, or valid extmark ids (whose positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) - respectively, thus the following are equivalent: -> - nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) - nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {}) + respectively, thus the following are equivalent: >lua + nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) + nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {}) < If `end` is less than `start`, traversal works backwards. (Useful with `limit`, to get the first marks prior to a given position.) - Example: -> - local a = vim.api - local pos = a.nvim_win_get_cursor(0) - local ns = a.nvim_create_namespace('my-plugin') - -- Create new extmark at line 1, column 1. - local m1 = a.nvim_buf_set_extmark(0, ns, 0, 0, {}) - -- Create new extmark at line 3, column 1. - local m2 = a.nvim_buf_set_extmark(0, ns, 0, 2, {}) - -- Get extmarks only from line 3. - local ms = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {}) - -- Get all marks in this buffer + namespace. - local all = a.nvim_buf_get_extmarks(0, ns, 0, -1, {}) - print(vim.inspect(ms)) + Example: >lua + local a = vim.api + local pos = a.nvim_win_get_cursor(0) + local ns = a.nvim_create_namespace('my-plugin') + -- Create new extmark at line 1, column 1. + local m1 = a.nvim_buf_set_extmark(0, ns, 0, 0, {}) + -- Create new extmark at line 3, column 1. + local m2 = a.nvim_buf_set_extmark(0, ns, 0, 2, {}) + -- Get extmarks only from line 3. + local ms = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {}) + -- Get all marks in this buffer + namespace. + local all = a.nvim_buf_get_extmarks(0, ns, 0, -1, {}) + print(vim.inspect(ms)) < Parameters: ~ @@ -2969,12 +2967,12 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()* could let floats hover outside of the main window like a tooltip, but this should not be used to specify arbitrary WM screen positions. - Example (Lua): window-relative float > + Example (Lua): window-relative float >lua vim.api.nvim_open_win(0, false, {relative='win', row=3, col=3, width=12, height=3}) < - Example (Lua): buffer-relative float (travels as buffer is scrolled) > + Example (Lua): buffer-relative float (travels as buffer is scrolled) >lua vim.api.nvim_open_win(0, false, {relative='win', width=12, height=3, bufpos={100,10}}) < @@ -3210,7 +3208,7 @@ nvim_clear_autocmds({*opts}) *nvim_clear_autocmds()* nvim_create_augroup({name}, {*opts}) *nvim_create_augroup()* Create or get an autocommand group |autocmd-groups|. - To get an existing group id, do: > + To get an existing group id, do: >lua local id = vim.api.nvim_create_augroup("MyGroup", { clear = false }) @@ -3235,7 +3233,7 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()* executed when the autocommand triggers: a callback function (Lua or Vimscript), or a command (like regular autocommands). - Example using callback: > + Example using callback: >lua -- Lua function local myluafun = function() print("This buffer enters") end @@ -3250,40 +3248,39 @@ nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()* Lua functions receive a table with information about the autocmd event as an argument. To use a function which itself accepts another (optional) - parameter, wrap the function in a lambda: -> - -- Lua function with an optional parameter. - -- The autocmd callback would pass a table as argument but this - -- function expects number|nil - local myluafun = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() end - - vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { - pattern = {"*.c", "*.h"}, - callback = function() myluafun() end, - }) + parameter, wrap the function in a lambda: >lua + -- Lua function with an optional parameter. + -- The autocmd callback would pass a table as argument but this + -- function expects number|nil + local myluafun = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() end + + vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { + pattern = {"*.c", "*.h"}, + callback = function() myluafun() end, + }) < - Example using command: > + Example using command: >lua vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { pattern = {"*.c", "*.h"}, command = "echo 'Entering a C or C++ file'", }) < - Example values for pattern: > + Example values for pattern: >lua pattern = "*.py" pattern = { "*.py", "*.pyi" } < Note: The `pattern` is passed to callbacks and commands as a literal string; environment variables like `$HOME` and `~` are not automatically expanded as they are by |:autocmd|. Instead, - |expand()| such variables explicitly: > + |expand()| such variables explicitly: >lua pattern = vim.fn.expand("~") .. "/some/path/*.py" < - Example values for event: > - "BufWritePre" - {"CursorHold", "BufWritePre", "BufWritePost"} + Example values for event: >lua + event = "BufWritePre" + event = {"CursorHold", "BufWritePre", "BufWritePost"} < Parameters: ~ @@ -3394,7 +3391,7 @@ nvim_exec_autocmds({event}, {*opts}) *nvim_exec_autocmds()* nvim_get_autocmds({*opts}) *nvim_get_autocmds()* Get all autocommands that match the corresponding {opts}. - These examples will get autocommands matching ALL the given criteria: > + These examples will get autocommands matching ALL the given criteria: >lua -- Matches all criteria autocommands = vim.api.nvim_get_autocmds({ group = "MyGroup", diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 6862426b1b..9336321d73 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -185,6 +185,7 @@ Docstring format: - Limited markdown is supported. - List-items start with `-` (useful to nest or "indent") - Use `
` for code samples.
+  Code samples can be annotated as `vim` or `lua`
 
 Example: the help for |nvim_open_win()| is generated from a docstring defined
 in src/nvim/api/win_config.c like this: >
@@ -193,7 +194,7 @@ in src/nvim/api/win_config.c like this: >
     /// ...
     ///
     /// Example (Lua): window-relative float
-    /// 
+    /// 
lua
     ///     vim.api.nvim_open_win(0, false,
     ///       {relative='win', row=3, col=3, width=12, height=3})
     /// 
@@ -223,6 +224,7 @@ Docstring format: - Limited markdown is supported. - List-items start with `-` (useful to nest or "indent") - Use `
` for code samples.
+  Code samples can be annotated as `vim` or `lua`
 
 Example: the help for |vim.paste()| is generated from a docstring decorating
 vim.paste in runtime/lua/vim/_editor.lua like this: >
@@ -231,7 +233,7 @@ vim.paste in runtime/lua/vim/_editor.lua like this: >
     --- (such as the |TUI|) pastes text into the editor.
     ---
     --- Example: To remove ANSI color codes when pasting:
-    --- 
+    --- 
lua
     --- vim.paste = (function()
     ---   local overridden = vim.paste
     ---   ...
diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 56c2af10b4..457a41dc08 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -320,12 +320,12 @@ config({opts}, {namespace})                          *vim.diagnostic.config()*
     |vim.diagnostic.show()|). Ephemeral configuration has highest priority,
     followed by namespace configuration, and finally global configuration.
 
-    For example, if a user enables virtual text globally with >
+    For example, if a user enables virtual text globally with >lua
 
        vim.diagnostic.config({ virtual_text = true })
 <
 
-    and a diagnostic producer sets diagnostics with >
+    and a diagnostic producer sets diagnostics with >lua
 
        vim.diagnostic.set(ns, 0, diagnostics, { virtual_text = false })
 <
@@ -372,14 +372,14 @@ config({opts}, {namespace})                          *vim.diagnostic.config()*
                          to render an LSP diagnostic error code.
                        • format: (function) A function that takes a diagnostic
                          as input and returns a string. The return value is
-                         the text used to display the diagnostic. Example: >
+                         the text used to display the diagnostic. Example: >lua
 
-                           function(diagnostic)
-                             if diagnostic.severity == vim.diagnostic.severity.ERROR then
-                               return string.format("E: %s", diagnostic.message)
+                             function(diagnostic)
+                               if diagnostic.severity == vim.diagnostic.severity.ERROR then
+                                 return string.format("E: %s", diagnostic.message)
+                               end
+                               return diagnostic.message
                              end
-                             return diagnostic.message
-                           end
 <
 
                      • signs: (default true) Use signs for diagnostics.
@@ -553,12 +553,12 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults})
      WARNING filename:27:3: Variable 'foo' does not exist
 <
 
-    This can be parsed into a diagnostic |diagnostic-structure| with: >
+    This can be parsed into a diagnostic |diagnostic-structure| with: >lua
 
-     local s = "WARNING filename:27:3: Variable 'foo' does not exist"
-     local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$"
-     local groups = { "severity", "lnum", "col", "message" }
-     vim.diagnostic.match(s, pattern, groups, { WARNING = vim.diagnostic.WARN })
+       local s = "WARNING filename:27:3: Variable 'foo' does not exist"
+       local pattern = "^(%w+) %w+:(%d+):(%d+): (.+)$"
+       local groups = { "severity", "lnum", "col", "message" }
+       vim.diagnostic.match(s, pattern, groups, { WARNING = vim.diagnostic.WARN })
 <
 
     Parameters: ~
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 06c0f466e7..4c4403c38f 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -681,7 +681,7 @@ for_each_buffer_client({bufnr}, {fn})
       • {bufnr}  (number) Buffer number
       • {fn}     (function) Function to run on each client attached to buffer
                  {bufnr}. The function takes the client, client ID, and buffer
-                 number as arguments. Example: >
+                 number as arguments. Example: >lua
 
                    vim.lsp.for_each_buffer_client(0, function(client, client_id, bufnr)
                      print(vim.inspect(client))
@@ -780,14 +780,13 @@ start({config}, {opts})                                      *vim.lsp.start()*
     running client if one is found matching `name` and `root_dir`. Attaches
     the current buffer to the client.
 
-    Example:
->
+    Example: >lua
 
-    vim.lsp.start({
-       name = 'my-server-name',
-       cmd = {'name-of-language-server-executable'},
-       root_dir = vim.fs.dirname(vim.fs.find({'pyproject.toml', 'setup.py'}, { upward = true })[1]),
-    })
+     vim.lsp.start({
+        name = 'my-server-name',
+        cmd = {'name-of-language-server-executable'},
+        root_dir = vim.fs.dirname(vim.fs.find({'pyproject.toml', 'setup.py'}, { upward = true })[1]),
+     })
 <
 
     See |vim.lsp.start_client()| for all available options. The most important
@@ -964,11 +963,9 @@ start_client({config})                                *vim.lsp.start_client()*
 stop_client({client_id}, {force})                      *vim.lsp.stop_client()*
     Stops a client(s).
 
-    You can also use the `stop()` function on a |vim.lsp.client| object. To
-    stop all clients:
->
+    You can also use the `stop()` function on a |vim.lsp.client| object. To stop all clients: >lua
 
-    vim.lsp.stop_client(vim.lsp.get_active_clients())
+     vim.lsp.stop_client(vim.lsp.get_active_clients())
 <
 
     By default asks the server to shutdown, unless stop was requested already
@@ -1078,11 +1075,10 @@ definition({options})                               *vim.lsp.buf.definition()*
 document_highlight()                        *vim.lsp.buf.document_highlight()*
     Send request to the server to resolve document highlights for the current
     text document position. This request can be triggered by a key mapping or
-    by events such as `CursorHold`, e.g.:
->
-    autocmd CursorHold   lua vim.lsp.buf.document_highlight()
-    autocmd CursorHoldI  lua vim.lsp.buf.document_highlight()
-    autocmd CursorMoved  lua vim.lsp.buf.clear_references()
+    by events such as `CursorHold` , e.g.: >vim
+      autocmd CursorHold   lua vim.lsp.buf.document_highlight()
+      autocmd CursorHoldI  lua vim.lsp.buf.document_highlight()
+      autocmd CursorMoved  lua vim.lsp.buf.clear_references()
 <
 
     Note: Usage of |vim.lsp.buf.document_highlight()| requires the following
@@ -1126,12 +1122,12 @@ format({options})                                       *vim.lsp.buf.format()*
                      buffer (0).
                    • filter (function|nil): Predicate used to filter clients.
                      Receives a client as argument and must return a boolean.
-                     Clients matching the predicate are included. Example:               • >
+                     Clients matching the predicate are included. Example:               • >lua
 
-            -- Never request typescript-language-server for formatting
-            vim.lsp.buf.format {
-              filter = function(client) return client.name ~= "tsserver" end
-            }
+              -- Never request typescript-language-server for formatting
+              vim.lsp.buf.format {
+                filter = function(client) return client.name ~= "tsserver" end
+              }
 <
                    • async boolean|nil If true the method won't block.
                      Defaults to false. Editing the buffer while formatting
@@ -1253,7 +1249,7 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config})
     |lsp-handler| for the method "textDocument/publishDiagnostics"
 
     See |vim.diagnostic.config()| for configuration options. Handler-specific
-    configuration can be set using |vim.lsp.with()|: >
+    configuration can be set using |vim.lsp.with()|: >lua
 
      vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
        vim.lsp.diagnostic.on_publish_diagnostics, {
@@ -1306,8 +1302,9 @@ refresh()                                         *vim.lsp.codelens.refresh()*
     Refresh the codelens for the current buffer
 
     It is recommended to trigger this using an autocmd or via keymap.
->
-    autocmd BufEnter,CursorHold,InsertLeave  lua vim.lsp.codelens.refresh()
+
+    Example: >vim
+      autocmd BufEnter,CursorHold,InsertLeave  lua vim.lsp.codelens.refresh()
 <
 
 run()                                                 *vim.lsp.codelens.run()*
@@ -1326,16 +1323,16 @@ save({lenses}, {bufnr}, {client_id})                 *vim.lsp.codelens.save()*
 Lua module: vim.lsp.handlers                                    *lsp-handlers*
 
 hover({_}, {result}, {ctx}, {config})               *vim.lsp.handlers.hover()*
-    |lsp-handler| for the method "textDocument/hover" >
-
-     vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
-       vim.lsp.handlers.hover, {
-         -- Use a sharp border with `FloatBorder` highlights
-         border = "single",
-         -- add the title in hover float window
-         title = "hover"
-       }
-     )
+    |lsp-handler| for the method "textDocument/hover" >lua
+
+       vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
+         vim.lsp.handlers.hover, {
+           -- Use a sharp border with `FloatBorder` highlights
+           border = "single",
+           -- add the title in hover float window
+           title = "hover"
+         }
+       )
 <
 
     Parameters: ~
@@ -1347,14 +1344,14 @@ hover({_}, {result}, {ctx}, {config})               *vim.lsp.handlers.hover()*
                                            *vim.lsp.handlers.signature_help()*
 signature_help({_}, {result}, {ctx}, {config})
     |lsp-handler| for the method "textDocument/signatureHelp". The active
-    parameter is highlighted with |hl-LspSignatureActiveParameter|. >
-
-     vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
-       vim.lsp.handlers.signature_help, {
-         -- Use a sharp border with `FloatBorder` highlights
-         border = "single"
-       }
-     )
+    parameter is highlighted with |hl-LspSignatureActiveParameter|. >lua
+
+       vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
+         vim.lsp.handlers.signature_help, {
+           -- Use a sharp border with `FloatBorder` highlights
+           border = "single"
+         }
+       )
 <
 
     Parameters: ~
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 1c381bd956..a5e99ae162 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1302,7 +1302,7 @@ cmd({command})                                                     *vim.cmd()*
     Note that `vim.cmd` can be indexed with a command name to return a
     callable function to the command.
 
-    Example: >
+    Example: >lua
 
        vim.cmd('echo 42')
        vim.cmd([[
@@ -1436,7 +1436,7 @@ paste({lines}, {phase})                                          *vim.paste()*
     Paste handler, invoked by |nvim_paste()| when a conforming UI (such as the
     |TUI|) pastes text into the editor.
 
-    Example: To remove ANSI color codes when pasting: >
+    Example: To remove ANSI color codes when pasting: >lua
 
      vim.paste = (function(overridden)
        return function(lines, phase)
@@ -1465,7 +1465,7 @@ paste({lines}, {phase})                                          *vim.paste()*
         |paste| @alias paste_phase -1 | 1 | 2 | 3
 
 pretty_print({...})                                       *vim.pretty_print()*
-    Prints given arguments in human-readable format. Example: >
+    Prints given arguments in human-readable format. Example: >lua
       -- Print highlight group Normal and store it's contents in a variable.
       local hl_normal = vim.pretty_print(vim.api.nvim_get_hl_by_name("Normal", true))
 <
@@ -1544,10 +1544,11 @@ defaulttable({create})                                    *vim.defaulttable()*
     If {create} is `nil`, this will create a defaulttable whose constructor
     function is this function, effectively allowing to create nested tables on
     the fly:
->
 
-    local a = vim.defaulttable()
-    a.b.c = 1
+    >lua
+
+     local a = vim.defaulttable()
+     a.b.c = 1
 <
 
     Parameters: ~
@@ -1637,12 +1638,12 @@ pesc({s})                                                         *vim.pesc()*
 split({s}, {sep}, {kwargs})                                      *vim.split()*
     Splits a string at each instance of a separator.
 
-    Examples: >
+    Examples: >lua
 
-      split(":aa::b:", ":")     => {'','aa','','b',''}
-      split("axaby", "ab?")     => {'','x','y'}
-      split("x*yz*o", "*", {plain=true})  => {'x','yz','o'}
-      split("|x|y|z|", "|", {trimempty=true}) => {'x', 'y', 'z'}
+      split(":aa::b:", ":")                   --> {'','aa','','b',''}
+      split("axaby", "ab?")                   --> {'','x','y'}
+      split("x*yz*o", "*", {plain=true})      --> {'x','yz','o'}
+      split("|x|y|z|", "|", {trimempty=true}) --> {'x', 'y', 'z'}
 <
 
     Parameters: ~
@@ -1695,10 +1696,11 @@ tbl_contains({t}, {value})                                *vim.tbl_contains()*
 
 tbl_count({t})                                               *vim.tbl_count()*
     Counts the number of non-nil values in table `t`.
->
 
-    vim.tbl_count({ a=1, b=2 }) => 2
-    vim.tbl_count({ 1, 2 }) => 2
+    >lua
+
+     vim.tbl_count({ a=1, b=2 })  --> 2
+     vim.tbl_count({ 1, 2 })      --> 2
 <
 
     Parameters: ~
@@ -1771,7 +1773,7 @@ tbl_get({o}, {...})                                            *vim.tbl_get()*
     Index into a table (first argument) via string keys passed as subsequent
     arguments. Return `nil` if the key does not exist.
 
-    Examples: >
+    Examples: >lua
 
       vim.tbl_get({ key = { nested_key = true }}, 'key', 'nested_key') == true
       vim.tbl_get({ key = {}}, 'key', 'nested_key') == nil
@@ -1858,7 +1860,7 @@ trim({s})                                                         *vim.trim()*
 validate({opt})                                               *vim.validate()*
     Validates a parameter specification (types and values).
 
-    Usage example: >
+    Usage example: >lua
 
       function user.new(name, age, hobbies)
         vim.validate{
@@ -1870,25 +1872,25 @@ validate({opt})                                               *vim.validate()*
       end
 <
 
-    Examples with explicit argument values (can be run directly): >
+    Examples with explicit argument values (can be run directly): >lua
 
       vim.validate{arg1={{'foo'}, 'table'}, arg2={'foo', 'string'}}
-         => NOP (success)
+         --> NOP (success)
 
       vim.validate{arg1={1, 'table'}}
-         => error('arg1: expected table, got number')
+         --> error('arg1: expected table, got number')
 
       vim.validate{arg1={3, function(a) return (a % 2) == 0 end, 'even number'}}
-         => error('arg1: expected even number, got 3')
+         --> error('arg1: expected even number, got 3')
 <
 
-    If multiple types are valid they can be given as a list. >
+    If multiple types are valid they can be given as a list. >lua
 
       vim.validate{arg1={{'foo'}, {'table', 'string'}}, arg2={'foo', {'table', 'string'}}}
-         => NOP (success)
+         --> NOP (success)
 
       vim.validate{arg1={1, {'string', table'}}}
-         => error('arg1: expected string|table, got number')
+         --> error('arg1: expected string|table, got number')
 <
 
     Parameters: ~
@@ -1957,7 +1959,7 @@ Lua module: ui                                                        *lua-ui*
 input({opts}, {on_confirm})                                   *vim.ui.input()*
     Prompts the user for input
 
-    Example: >
+    Example: >lua
 
      vim.ui.input({ prompt = 'Enter value for shiftwidth: ' }, function(input)
          vim.o.shiftwidth = tonumber(input)
@@ -1982,7 +1984,7 @@ input({opts}, {on_confirm})                                   *vim.ui.input()*
 select({items}, {opts}, {on_choice})                         *vim.ui.select()*
     Prompts the user to pick a single item from a collection of entries
 
-    Example: >
+    Example: >lua
 
      vim.ui.select({ 'tabs', 'spaces' }, {
          prompt = 'Select tabs or spaces:',
@@ -2045,7 +2047,7 @@ add({filetypes})                                          *vim.filetype.add()*
 
     See $VIMRUNTIME/lua/vim/filetype.lua for more examples.
 
-    Example: >
+    Example: >lua
 
       vim.filetype.add({
         extension = {
@@ -2081,7 +2083,7 @@ add({filetypes})                                          *vim.filetype.add()*
       })
 <
 
-    To add a fallback match on contents, use >
+    To add a fallback match on contents, use >lua
 
      vim.filetype.add {
        pattern = {
@@ -2120,19 +2122,20 @@ match({args})                                           *vim.filetype.match()*
 
     Each of the three options is specified using a key to the single argument
     of this function. Example:
->
 
-    -- Using a buffer number
-    vim.filetype.match({ buf = 42 })
+    >lua
+
+       -- Using a buffer number
+       vim.filetype.match({ buf = 42 })
 
-    -- Override the filename of the given buffer
-    vim.filetype.match({ buf = 42, filename = 'foo.c' })
+       -- Override the filename of the given buffer
+       vim.filetype.match({ buf = 42, filename = 'foo.c' })
 
-    -- Using a filename without a buffer
-    vim.filetype.match({ filename = 'main.lua' })
+       -- Using a filename without a buffer
+       vim.filetype.match({ filename = 'main.lua' })
 
-    -- Using file contents
-    vim.filetype.match({ contents = {'#!/usr/bin/env bash'} })
+       -- Using file contents
+       vim.filetype.match({ contents = {'#!/usr/bin/env bash'} })
 <
 
     Parameters: ~
@@ -2162,7 +2165,7 @@ match({args})                                           *vim.filetype.match()*
 Lua module: keymap                                                *lua-keymap*
 
 del({modes}, {lhs}, {opts})                                 *vim.keymap.del()*
-    Remove an existing mapping. Examples: >
+    Remove an existing mapping. Examples: >lua
 
        vim.keymap.del('n', 'lhs')
 
@@ -2178,7 +2181,7 @@ del({modes}, {lhs}, {opts})                                 *vim.keymap.del()*
         |vim.keymap.set()|
 
 set({mode}, {lhs}, {rhs}, {opts})                           *vim.keymap.set()*
-    Add a new |mapping|. Examples: >
+    Add a new |mapping|. Examples: >lua
 
        -- Can add mapping to Lua functions
        vim.keymap.set('n', 'lhs', function() print("real lua function") end)
@@ -2197,14 +2200,14 @@ set({mode}, {lhs}, {rhs}, {opts})                           *vim.keymap.set()*
        vim.keymap.set('n', '[%', '(MatchitNormalMultiBackward)')
 <
 
-    Note that in a mapping like: >
+    Note that in a mapping like: >lua
 
         vim.keymap.set('n', 'asdf', require('jkl').my_fun)
 <
 
     the `require('jkl')` gets evaluated during this call in order to access the function. If you
     want to avoid this cost at startup you can wrap it in a function, for
-    example: >
+    example: >lua
 
         vim.keymap.set('n', 'asdf', function() return require('jkl').my_fun() end)
 <
@@ -2302,8 +2305,8 @@ find({names}, {opts})                                          *vim.fs.find()*
                    number of matches.
 
     Return: ~
-        (table) The normalized paths |vim.fs.normalize()| of all matching
-        files or directories
+        (table) Normalized paths |vim.fs.normalize()| of all matching files or
+        directories
 
 normalize({path})                                         *vim.fs.normalize()*
     Normalize a path to a standard format. A tilde (~) character at the
@@ -2311,16 +2314,16 @@ normalize({path})                                         *vim.fs.normalize()*
     backslash (\) characters are converted to forward slashes (/). Environment
     variables are also expanded.
 
-    Examples: >
+    Examples: >lua
 
        vim.fs.normalize('C:\Users\jdoe')
-       => 'C:/Users/jdoe'
+       --> 'C:/Users/jdoe'
 
        vim.fs.normalize('~/src/neovim')
-       => '/home/jdoe/src/neovim'
+       --> '/home/jdoe/src/neovim'
 
        vim.fs.normalize('$XDG_CONFIG_HOME/nvim/init.vim')
-       => '/Users/jdoe/.config/nvim/init.vim'
+       --> '/Users/jdoe/.config/nvim/init.vim'
 <
 
     Parameters: ~
@@ -2332,7 +2335,7 @@ normalize({path})                                         *vim.fs.normalize()*
 parents({start})                                            *vim.fs.parents()*
     Iterate over all the parents of the given file or directory.
 
-    Example: >
+    Example: >lua
 
      local root_dir
      for dir in vim.fs.parents(vim.api.nvim_buf_get_name(0)) do
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index cef48e207f..2a826e90e5 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -605,7 +605,7 @@ start({bufnr}, {lang})                                               *start()*
     required for some plugins. In this case, add `vim.bo.syntax = 'on'` after
     the call to `start`.
 
-    Example: >
+    Example: >lua
 
      vim.api.nvim_create_autocmd( 'FileType', { pattern = 'tex',
          callback = function(args)
@@ -770,7 +770,7 @@ Query:iter_captures({self}, {node}, {source}, {start}, {stop})
 
     The iterator returns three values: a numeric id identifying the capture,
     the captured node, and metadata from any directives processing the match.
-    The following example shows how to get captures by name: >
+    The following example shows how to get captures by name: >lua
 
      for id, node, metadata in query:iter_captures(tree:root(), bufnr, first, last) do
        local name = query.captures[id] -- name of the capture in the query
@@ -802,7 +802,7 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
     (1-based) index of the pattern in the query, a table mapping capture
     indices to nodes, and metadata from any directives processing the match.
     If the query has more than one pattern, the capture table might be sparse
-    and e.g. `pairs()` method should be used over `ipairs` . Here is an example iterating over all captures in every match: >
+    and e.g. `pairs()` method should be used over `ipairs` . Here is an example iterating over all captures in every match: >lua
 
      for pattern, match, metadata in cquery:iter_matches(tree:root(), bufnr, first, last) do
        for id, node in pairs(match) do
-- 
cgit 


From e40df8b1bc6a7832c7707696b374b19642dfd596 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 26 Nov 2022 11:54:26 +0100
Subject: docs(news): add entry for highlighted code

---
 runtime/doc/news.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index b155bae5a4..4896cf19d8 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,16 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• Treesitter syntax highlighting for `help` files now supports highlighted
+  code examples. To enable, create a `.config/nvim/ftplugin/help.lua` with
+  the contents >lua
+    vim.treesitter.start()
+<
+  Note: Highlighted code examples are only available in the Nvim manual, not
+  in help files taken from Vim. The treesitter `help` parser is also work in
+  progress and not guaranteed to correctly highlight every help file in the
+  wild.
+
 • |vim.secure.trust()|, |:trust| allows the user to manage files in trust
   database.
 
-- 
cgit 


From 9671908c682dc3fc4e939f44a636457db6f3e5a4 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 3 Dec 2022 08:17:38 +0800
Subject: vim-patch:8.2.3900: it is not easy to use a script-local function for
 an option

Problem:    It is not easy to use a script-local function for an option.
Solution:   recognize s: and  at the start of the expression. (Yegappan
            Lakshmanan, closes vim/vim#9401)

https://github.com/vim/vim/commit/8bb65f230d3025037f34021a72616038da0601ee

Omit duplicate docs in fold.txt: removed in a later runtime update.
Cherry-pick test_diffmode.vim changes from patch 8.2.1432.

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/diff.txt    | 10 ++++++++++
 runtime/doc/fold.txt    |  5 +++++
 runtime/doc/options.txt | 15 +++++++++++++++
 runtime/doc/print.txt   |  5 +++++
 4 files changed, 35 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index b5a3891d3f..f38f123393 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -388,6 +388,11 @@ mode, so that a CTRL-Z doesn't end the text on DOS.
 The `redraw!` command may not be needed, depending on whether executing a
 shell command shows something on the display or not.
 
+If the 'diffexpr' expression starts with s: or ||, then it is replaced
+with the script ID (|local-function|). Example: >
+		set diffexpr=s:MyDiffExpr()
+		set diffexpr=SomeDiffExpr()
+<
 						*E810* *E97*
 Vim will do a test if the diff output looks alright.  If it doesn't, you will
 get an error message.  Possible causes:
@@ -439,4 +444,9 @@ evaluating 'patchexpr'.  This hopefully avoids that files in the current
 directory are accidentally patched.  Vim will also delete files starting with
 v:fname_in and ending in ".rej" and ".orig".
 
+If the 'patchexpr' expression starts with s: or ||, then it is replaced
+with the script ID (|local-function|). Example: >
+		set patchexpr=s:MyPatchExpr()
+		set patchexpr=SomePatchExpr()
+<
  vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
index e97a0a6459..04c5b70c45 100644
--- a/runtime/doc/fold.txt
+++ b/runtime/doc/fold.txt
@@ -116,6 +116,11 @@ method can be very slow!
 Try to avoid the "=", "a" and "s" return values, since Vim often has to search
 backwards for a line for which the fold level is defined.  This can be slow.
 
+If the 'foldexpr' expression starts with s: or ||, then it is replaced
+with the script ID (|local-function|). Example: >
+		set foldexpr=s:MyFoldExpr()
+		set foldexpr=SomeFoldExpr()
+<
 An example of using "a1" and "s1": For a multi-line C comment, a line
 containing "/*" would return "a1" to start a fold, and a line containing "*/"
 would return "s1" to end the fold after that line: >
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 33bade3545..7edc965941 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2738,6 +2738,11 @@ A jump table for the options with a short description can be found at |Q_op|.
 	When the expression evaluates to non-zero Vim will fall back to using
 	the internal format mechanism.
 
+	If the expression starts with s: or ||, then it is replaced with
+	the script ID (|local-function|). Example: >
+		set formatexpr=s:MyFormatExpr()
+		set formatexpr=SomeFormatExpr()
+<
 	The expression will be evaluated in the |sandbox| when set from a
 	modeline, see |sandbox-option|.  That stops the option from working,
 	since changing the buffer text is not allowed.
@@ -3362,6 +3367,11 @@ A jump table for the options with a short description can be found at |Q_op|.
 	found.  Allows doing "gf" on the name after an 'include' statement.
 	Also used for ||.
 
+	If the expression starts with s: or ||, then it is replaced with
+	the script ID (|local-function|). Example: >
+		set includeexpr=s:MyIncludeExpr(v:fname)
+		set includeexpr=SomeIncludeExpr(v:fname)
+<
 	The expression will be evaluated in the |sandbox| when set from a
 	modeline, see |sandbox-option|.
 	This option cannot be set in a modeline when 'modelineexpr' is off.
@@ -3417,6 +3427,11 @@ A jump table for the options with a short description can be found at |Q_op|.
 	The expression is evaluated with |v:lnum| set to the line number for
 	which the indent is to be computed.  The cursor is also in this line
 	when the expression is evaluated (but it may be moved around).
+	If the expression starts with s: or ||, then it is replaced with
+	the script ID (|local-function|). Example: >
+		set indentexpr=s:MyIndentExpr()
+		set indentexpr=SomeIndentExpr()
+<
 	The expression must return the number of spaces worth of indent.  It
 	can return "-1" to keep the current indent (this means 'autoindent' is
 	used for the indent).
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index e24b6b0347..ef3e47d32c 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -155,6 +155,11 @@ an error message.  In that case Vim will delete the file.  In the default
 value for non-MS-Windows a trick is used: Adding "v:shell_error" will result
 in a non-zero number when the system() call fails.
 
+If the expression starts with s: or ||, then it is replaced with the
+script ID (|local-function|). Example: >
+		set printexpr=s:MyPrintFile()
+		set printexpr=SomePrintFile()
+<
 This option cannot be set from a |modeline| or in the |sandbox|, for security
 reasons.
 
-- 
cgit 


From 5e97984188e95de419ba5a710a060f0614c6c9e0 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 3 Dec 2022 08:37:10 +0800
Subject: vim-patch:partial:8.2.3908: cannot use a script-local function for
 'foldtext'

Problem:    Cannot use a script-local function for 'foldtext'.
Solution:   Expand "s:" and "". (Yegappan Lakshmanan, closes vim/vim#9411)

https://github.com/vim/vim/commit/27708e6c7b6f444fd599f3dc5015336b002b874d

Only port the changes actually related to 'foldtext'.

Co-authored-by: Yegappan Lakshmanan 
---
 runtime/doc/fold.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
index 04c5b70c45..fa823608df 100644
--- a/runtime/doc/fold.txt
+++ b/runtime/doc/fold.txt
@@ -117,7 +117,7 @@ Try to avoid the "=", "a" and "s" return values, since Vim often has to search
 backwards for a line for which the fold level is defined.  This can be slow.
 
 If the 'foldexpr' expression starts with s: or ||, then it is replaced
-with the script ID (|local-function|). Example: >
+with the script ID (|local-function|). Examples: >
 		set foldexpr=s:MyFoldExpr()
 		set foldexpr=SomeFoldExpr()
 <
@@ -526,6 +526,11 @@ The resulting line is truncated to fit in the window, it never wraps.
 When there is room after the text, it is filled with the character specified
 by 'fillchars'.
 
+If the 'foldtext' expression starts with s: or ||, then it is replaced
+with the script ID (|local-function|). Examples: >
+		set foldtext=s:MyFoldText()
+		set foldtext=SomeFoldText()
+<
 Note that backslashes need to be used for characters that the ":set" command
 handles differently: Space, backslash and double-quote. |option-backslash|
 
-- 
cgit 


From 8a29d9660ea27ff3cd55555f9373b1528808b264 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 3 Dec 2022 13:48:51 +0800
Subject: vim-patch:8.2.1420: test 49 is old style

Problem:    Test 49 is old style.
Solution:   Convert remaining parts to new style. Remove obsolete items.
            (Yegappan Lakshmanan, closes vim/vim#6683)

https://github.com/vim/vim/commit/f7c4d83609acdfe0e4d0fec9413697ac97c0c3f9
---
 runtime/doc/testing.txt | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 56e0dad656..ef5e179c86 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -20,17 +20,11 @@ and for testing plugins.
 Vim can be tested after building it, usually with "make test".
 The tests are located in the directory "src/testdir".
 
-There are several types of tests added over time:
-	test33.in		oldest, don't add any of these
-	test_something.in	old style tests
-	test_something.vim	new style tests
-
 						*new-style-testing*
-New tests should be added as new style tests.  These use functions such as
-|assert_equal()| to keep the test commands and the expected result in one
-place.
-						*old-style-testing*
-In some cases an old style test needs to be used.
+New tests should be added as new style tests.  The test scripts are named
+test_.vim (replace  with the feature under test). These use
+functions such as |assert_equal()| to keep the test commands and the expected
+result in one place.
 
 Find more information in the file src/testdir/README.txt.
 
-- 
cgit 


From bf4bf7f9e034ca2262e53e347ecb87054aa688d7 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sat, 3 Dec 2022 20:46:01 +0800
Subject: vim-patch:9.0.0110: help tag generation picks up words in code
 examples

Problem:    Help tag generation picks up words in code examples.
Solution:   Skip over examples. (Carlo Teubner, closes vim/vim#10813)

https://github.com/vim/vim/commit/ddab3ce3457aadffb16ce0127f67a99966a065a8

Also fix mistakes in help files.

Co-authored-by: Carlo Teubner 
---
 runtime/doc/builtin.txt | 2 +-
 runtime/doc/eval.txt    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 08c8e2e9d6..f9917ed035 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -8003,7 +8003,7 @@ stridx({haystack}, {needle} [, {start}])		*stridx()*
 
 		Can also be used as a |method|: >
 			GetHaystack()->stridx(needle)
-
+<
 							*string()*
 string({expr})	Return {expr} converted to a String.  If {expr} is a Number,
 		Float, String, Blob or a composition of them, then the result
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index eb42e10338..c989b67b96 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1780,7 +1780,7 @@ v:exiting	Exit code, or |v:null| before invoking the |VimLeavePre|
 		and |VimLeave| autocmds.  See |:q|, |:x| and |:cquit|.
 		Example: >
 			:au VimLeave * echo "Exit value is " .. v:exiting
-
+<
 					*v:echospace* *echospace-variable*
 v:echospace	Number of screen cells that can be used for an `:echo` message
 		in the last screen line before causing the |hit-enter-prompt|.
-- 
cgit 


From 707df880545703bc6f4db1af6e46820becbcd911 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Mon, 5 Dec 2022 21:09:31 +0800
Subject: docs: add missing docs from some Vim patches (#21296)

This is cherry-picked from these Vim patches:

Only applicable change outside vi_diff.txt in patch 8.1.1226:
https://github.com/vim/vim/commit/6c60f47fb9251e686217d51cf81847e14d0dd26d

Most changes outside starting.txt and vi_diff.txt in patch 8.1.1280:
https://github.com/vim/vim/commit/25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8

Missing docs for 'mousemoveevent':
https://github.com/vim/vim/commit/cbaff5e06ec525d31dc44093125c42029e01d508
---
 runtime/doc/api.txt      |  3 ++-
 runtime/doc/change.txt   |  1 -
 runtime/doc/editing.txt  |  1 +
 runtime/doc/map.txt      | 12 +++++++++---
 runtime/doc/message.txt  |  2 +-
 runtime/doc/options.txt  |  3 ++-
 runtime/doc/quickref.txt |  2 ++
 runtime/doc/tagsrch.txt  |  3 +--
 runtime/doc/usr_21.txt   |  5 ++++-
 9 files changed, 22 insertions(+), 10 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index a8433640ab..00f3473bac 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -1836,7 +1836,8 @@ nvim_parse_cmd({str}, {opts})                               *nvim_parse_cmd()*
           cannot take a register.
         • bang: (boolean) Whether command contains a || (!) modifier.
         • args: (array) Command arguments.
-        • addr: (string) Value of |:command-addr|. Uses short name.
+        • addr: (string) Value of |:command-addr|. Uses short name or "line"
+          for -addr=lines.
         • nargs: (string) Value of |:command-nargs|.
         • nextcmd: (string) Next command if there are multiple commands
           separated by a |:bar|. Empty if there isn't a next command.
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 7774793c35..990ba3d8fd 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -204,7 +204,6 @@ gR			Enter Virtual Replace mode: Each character you type
 							*v_S*
 {Visual}["x]S		Delete the highlighted lines [into register x] and
 			start insert (for {Visual} see |Visual-mode|).
-
 							*v_R*
 {Visual}["x]R		Currently just like {Visual}["x]S.  In a next version
 			it might work differently.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 34650b88d4..3cfc3429de 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1311,6 +1311,7 @@ exist, the next-higher scope in the hierarchy applies.
 :cd[!] {path}		Change the current directory to {path}.
 			If {path} is relative, it is searched for in the
 			directories listed in |'cdpath'|.
+			Clear any window-local directory.
 			Does not change the meaning of an already opened file,
 			because its full path name is remembered.  Files from
 			the |arglist| may change though!
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index fe07c2e1c1..2ecfefca7f 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -651,6 +651,10 @@ The special key name "" can be used for an internal mapping, which is
 not to be matched with any key sequence.  This is useful in plugins
 |using-|.
 
+							**
+The special key name "" can be used to handle mouse movement.  It
+needs to be enabled with 'mousemoveevent'.
+
 							** **
 To map a character by its decimal, octal or hexadecimal number the 
 construct can be used:
@@ -1439,7 +1443,7 @@ Possible attributes are:
 		    number.
 	-count=N    A count (default N) which is specified either in the line
 		    number position, or as an initial argument (like |:Next|).
-		    Specifying -count (without a default) acts like -count=0
+	-count	    acts like -count=0
 
 Note that -range=N and -count=N are mutually exclusive - only one should be
 specified.
@@ -1450,14 +1454,16 @@ which by default correspond to the current line, last line and the whole
 buffer, relate to arguments, (loaded) buffers, windows or tab pages.
 
 Possible values are (second column is the short name used in listing):
-    -addr=lines		  line	Range of lines (this is the default)
+    -addr=lines		  	Range of lines (this is the default for -range)
     -addr=arguments	  arg	Range for arguments
     -addr=buffers	  buf	Range for buffers (also not loaded buffers)
     -addr=loaded_buffers  load	Range for loaded buffers
     -addr=windows	  win	Range for windows
     -addr=tabs		  tab	Range for tab pages
     -addr=quickfix	  qf	Range for quickfix entries
-    -addr=other		  ?	other kind of range
+    -addr=other		  ?	other kind of range; can use ".", "$" and "%"
+				as with "lines" (this is the default for
+				-count)
 
 
 Incremental preview ~
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index d06a970340..dffdb5950f 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -820,7 +820,7 @@ Type					effect ~
 					the clipboard ("* and "+ registers)
     {menu-entry}			what the menu is defined to in
 					Cmdline-mode.
-     (*)			next page
+    				next page (*)
 
 Any other key causes the meaning of the keys to be displayed.
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 7edc965941..17b91fe2b6 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4123,7 +4123,8 @@ A jump table for the options with a short description can be found at |Q_op|.
 	checked for set commands.  If 'modeline' is off or 'modelines' is zero
 	no lines are checked.  See |modeline|.
 
-				*'modifiable'* *'ma'* *'nomodifiable'* *'noma'* *E21*
+				*'modifiable'* *'ma'* *'nomodifiable'* *'noma'*
+				*E21*
 'modifiable' 'ma'	boolean	(default on)
 			local to buffer
 	When off the buffer contents cannot be changed.  The 'fileformat' and
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index e4a3dae08b..62e7d4c931 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -800,6 +800,7 @@ Short explanation of each option:		*option-list*
 'mousefocus'	  'mousef'  keyboard focus follows the mouse
 'mousehide'	  'mh'	    hide mouse pointer while typing
 'mousemodel'	  'mousem'  changes meaning of mouse buttons
+'mousemoveevent'  'mousemev'  report mouse moves with 
 'mousescroll'		    amount to scroll by when scrolling with a mouse
 'mouseshape'	  'mouses'  shape of the mouse pointer in different modes
 'mousetime'	  'mouset'  max time between mouse double-click
@@ -901,6 +902,7 @@ Short explanation of each option:		*option-list*
 'tabstop'	  'ts'	    number of spaces that  in file uses
 'tagbsearch'	  'tbs'     use binary searching in tags files
 'tagcase'	  'tc'      how to handle case when searching in tags files
+'tagfunc'	  'tfu'	    function to get list of tag matches
 'taglength'	  'tl'	    number of significant characters for a tag
 'tagrelative'	  'tr'	    file names in tag file are relative
 'tags'		  'tag'     list of file names used by the tag command
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index aab6f78315..539ded07ee 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -624,8 +624,7 @@ If the command is a normal search command (it starts and ends with "/" or
 "?"), some special handling is done:
 - Searching starts on line 1 of the file.
   The direction of the search is forward for "/", backward for "?".
-  Note that 'wrapscan' does not matter, the whole file is always searched.  (Vi
-  does use 'wrapscan', which caused tags sometimes not be found.)
+  Note that 'wrapscan' does not matter, the whole file is always searched.
 - If the search fails, another try is done ignoring case.  If that fails too,
   a search is done for:
 	"^tagname[ \t]*("
diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt
index add5d48073..beb09c13df 100644
--- a/runtime/doc/usr_21.txt
+++ b/runtime/doc/usr_21.txt
@@ -255,7 +255,8 @@ well stand for "source").
 The windows that were open are restored, with the same position and size as
 before.  Mappings and option values are like before.
    What exactly is restored depends on the 'sessionoptions' option.  The
-default value is "blank,buffers,curdir,folds,help,options,winsize".
+default value is:
+"blank,buffers,curdir,folds,help,options,tabpages,winsize,terminal".
 
 	blank		keep empty windows
 	buffers		all buffers, not only the ones in a window
@@ -263,7 +264,9 @@ default value is "blank,buffers,curdir,folds,help,options,winsize".
 	folds		folds, also manually created ones
 	help		the help window
 	options		all options and mappings
+	tabpages	all tab pages
 	winsize		window sizes
+	terminal	include terminal windows
 
 Change this to your liking.  To also restore the size of the Vim window, for
 example, use: >
-- 
cgit 


From a069e88b4ea593419181271bfb41154e45b81090 Mon Sep 17 00:00:00 2001
From: Jack Rowlingson 
Date: Tue, 6 Dec 2022 11:44:43 -0500
Subject: docs(lua): correct vim.spell.check example (#21311)

---
 runtime/doc/lua.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index a5e99ae162..27b5a39459 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -733,7 +733,7 @@ vim.spell.check({str})                                     *vim.spell.check()*
         vim.spell.check("the quik brown fox")
         -- =>
         -- {
-        --     {'quik', 'bad', 4}
+        --     {'quik', 'bad', 5}
         -- }
 <
     Parameters: ~
-- 
cgit 


From c61af03cd2c310c1ee472b4529c34f6656574770 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Wed, 7 Dec 2022 14:11:26 +0800
Subject: vim-patch:0e6adf8a29d5

Update runtime files

https://github.com/vim/vim/commit/0e6adf8a29d5c2c96c42cc7157f71bf22c2ad471

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/map.txt | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 2ecfefca7f..b495b355cf 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -872,28 +872,35 @@ Here is an example that counts the number of spaces with : >
 	" doubling  works on a line
 	nnoremap   CountSpaces() .. '_'
 
-	function CountSpaces(type = '') abort
+	function CountSpaces(virtualedit = '', irregular_block = v:false, type = '') abort
 	  if a:type == ''
-	    set opfunc=CountSpaces
+	    let &operatorfunc = function('CountSpaces', [&virtualedit, v:false])
+	    set virtualedit=block
 	    return 'g@'
 	  endif
 
+	  let cb_save = &clipboard
 	  let sel_save = &selection
 	  let reg_save = getreginfo('"')
-	  let cb_save = &clipboard
 	  let visual_marks_save = [getpos("'<"), getpos("'>")]
 
 	  try
-	    set clipboard= selection=inclusive
-	    let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\`]y"}
-	    silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '')
-	    echom count(getreg('"'), ' ')
+	    set clipboard= selection=inclusive virtualedit=
+	    let commands = #{line: "'[V']", char: "`[v`]", block: "`[\`]"}->get(a:type, 'v')
+	    if getpos("']")[-1] != 0 || a:irregular_block
+	      let commands ..= 'oO$'
+	      let &operatorfunc = function('CountSpaces', [a:virtualedit, v:true])
+	    endif
+	    let commands ..= 'y'
+	    execute 'silent noautocmd keepjumps normal! ' .. commands
+	    echomsg getreg('"')->count(' ')
 	  finally
 	    call setreg('"', reg_save)
 	    call setpos("'<", visual_marks_save[0])
 	    call setpos("'>", visual_marks_save[1])
 	    let &clipboard = cb_save
 	    let &selection = sel_save
+	    let &virtualedit = a:virtualedit
 	  endtry
 	endfunction
 
-- 
cgit 


From 214c9ed1e2ad7881103a0eaed646a29e3e1392cd Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Wed, 7 Dec 2022 14:07:30 +0800
Subject: vim-patch:fa3b72348d88

Update runtime files

https://github.com/vim/vim/commit/fa3b72348d88343390fbe212cfc230fec1602fc2

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/map.txt     | 53 ++++++++++++++++++++++++++++++++++---------------
 runtime/doc/options.txt |  2 +-
 2 files changed, 38 insertions(+), 17 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index b495b355cf..b51268eebf 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -872,35 +872,56 @@ Here is an example that counts the number of spaces with : >
 	" doubling  works on a line
 	nnoremap   CountSpaces() .. '_'
 
-	function CountSpaces(virtualedit = '', irregular_block = v:false, type = '') abort
+	function CountSpaces(context = {}, type = '') abort
 	  if a:type == ''
-	    let &operatorfunc = function('CountSpaces', [&virtualedit, v:false])
+	    let context = #{
+	      \ dot_command: v:false,
+	      \ extend_block: '',
+	      \ virtualedit: [&l:virtualedit, &g:virtualedit],
+	      \ }
+	    let &operatorfunc = function('CountSpaces', [context])
 	    set virtualedit=block
 	    return 'g@'
 	  endif
 
-	  let cb_save = &clipboard
-	  let sel_save = &selection
-	  let reg_save = getreginfo('"')
-	  let visual_marks_save = [getpos("'<"), getpos("'>")]
+	  let save = #{
+	    \ clipboard: &clipboard,
+	    \ selection: &selection,
+	    \ virtualedit: [&l:virtualedit, &g:virtualedit],
+	    \ register: getreginfo('"'),
+	    \ visual_marks: [getpos("'<"), getpos("'>")],
+	    \ }
 
 	  try
 	    set clipboard= selection=inclusive virtualedit=
-	    let commands = #{line: "'[V']", char: "`[v`]", block: "`[\`]"}->get(a:type, 'v')
-	    if getpos("']")[-1] != 0 || a:irregular_block
-	      let commands ..= 'oO$'
-	      let &operatorfunc = function('CountSpaces', [a:virtualedit, v:true])
+	    let commands = #{
+	      \ line: "'[V']",
+	      \ char: "`[v`]",
+	      \ block: "`[\`]",
+	      \ }[a:type]
+	    let [_, _, col, off] = getpos("']")
+	    if off != 0
+	      let vcol = getline("'[")->strpart(0, col + off)->strdisplaywidth()
+	      if vcol >= [line("'["), '$']->virtcol() - 1
+	        let a:context.extend_block = '$'
+	      else
+	        let a:context.extend_block = vcol .. '|'
+	      endif
+	    endif
+	    if a:context.extend_block != ''
+	      let commands ..= 'oO' .. a:context.extend_block
 	    endif
 	    let commands ..= 'y'
 	    execute 'silent noautocmd keepjumps normal! ' .. commands
 	    echomsg getreg('"')->count(' ')
 	  finally
-	    call setreg('"', reg_save)
-	    call setpos("'<", visual_marks_save[0])
-	    call setpos("'>", visual_marks_save[1])
-	    let &clipboard = cb_save
-	    let &selection = sel_save
-	    let &virtualedit = a:virtualedit
+	    call setreg('"', save.register)
+	    call setpos("'<", save.visual_marks[0])
+	    call setpos("'>", save.visual_marks[1])
+	    let &clipboard = save.clipboard
+	    let &selection = save.selection
+	    let [&l:virtualedit, &g:virtualedit] = get(a:context.dot_command ? save : a:context, 'virtualedit')
+	    let a:context.dot_command = v:true
 	  endtry
 	endfunction
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 17b91fe2b6..2e5381e5fe 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -324,7 +324,7 @@ the name, e.g. "123".  Examples:
 	set opfunc={a\ ->\ MyOpFunc(a)}
 	" set using a funcref variable
 	let Fn = function('MyTagFunc')
-	let &tagfunc = string(Fn)
+	let &tagfunc = Fn
 	" set using a lambda expression
 	let &tagfunc = {t -> MyTagFunc(t)}
 	" set using a variable with lambda expression
-- 
cgit 


From f8aa2a0deaf473af0e6b4640356eaf5477c6ee90 Mon Sep 17 00:00:00 2001
From: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date: Wed, 7 Dec 2022 01:27:41 -0700
Subject: docs(treesitter): use full function names in tags (#21321)

---
 runtime/doc/treesitter.txt | 77 ++++++++++++++++++++++++++--------------------
 1 file changed, 43 insertions(+), 34 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 2a826e90e5..869ed8a187 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -56,11 +56,11 @@ current state of the buffer. When the plugin wants to access the state after a
 the same tree will be returned again without extra work. If the buffer was
 parsed before, incremental parsing will be done of the changed parts.
 
-Note: To use the parser directly inside a |nvim_buf_attach()| Lua callback, you
-must call |get_parser()| before you register your callback. But preferably
-parsing shouldn't be done directly in the change callback anyway as they will
-be very frequent. Rather a plugin that does any kind of analysis on a tree
-should use a timer to throttle too frequent updates.
+Note: To use the parser directly inside a |nvim_buf_attach()| Lua callback,
+you must call |vim.treesitter.get_parser()| before you register your callback.
+But preferably parsing shouldn't be done directly in the change callback
+anyway as they will be very frequent. Rather a plugin that does any kind of
+analysis on a tree should use a timer to throttle too frequent updates.
 
 See |lua-treesitter-languagetree| for the list of available methods.
 
@@ -253,8 +253,8 @@ The following predicates are built in:
 Each predicate has a `not-` prefixed predicate that is just the negation of
 the predicate.
 
-Further predicates can be added via `vim.treesitter.query.`|add_predicate()|.
-Use `vim.treesitter.query.`|list_predicates()| to list all available
+Further predicates can be added via |vim.treesitter.query.add_predicate()|.
+Use |vim.treesitter.query.list_predicates()| to list all available
 predicates.
 
 
@@ -297,8 +297,8 @@ The following directives are built in:
             ((identifier) @constant (#offset! @constant 0 1 0 -1))
 <
 
-Further directives can be added via `vim.treesitter.query.`|add_directive()|.
-Use `vim.treesitter.query.`|list_directives()| to list all available
+Further directives can be added via |vim.treesitter.query.add_directive()|.
+Use |vim.treesitter.query.list_directives()| to list all available
 directives.
 
 
@@ -481,7 +481,8 @@ library.
 ==============================================================================
 Lua module: vim.treesitter                               *lua-treesitter-core*
 
-get_captures_at_cursor({winnr})                     *get_captures_at_cursor()*
+                                     *vim.treesitter.get_captures_at_cursor()*
+get_captures_at_cursor({winnr})
     Returns a list of highlight capture names under the cursor
 
     Parameters: ~
@@ -490,7 +491,8 @@ get_captures_at_cursor({winnr})                     *get_captures_at_cursor()*
     Return: ~
         string[] List of capture names
 
-get_captures_at_pos({bufnr}, {row}, {col})             *get_captures_at_pos()*
+                                        *vim.treesitter.get_captures_at_pos()*
+get_captures_at_pos({bufnr}, {row}, {col})
     Returns a list of highlight captures at the given position
 
     Each capture is represented by a table containing the capture name as a
@@ -506,7 +508,7 @@ get_captures_at_pos({bufnr}, {row}, {col})             *get_captures_at_pos()*
         table[] List of captures `{ capture = "capture name", metadata = { ...
         } }`
 
-get_node_at_cursor({winnr})                             *get_node_at_cursor()*
+get_node_at_cursor({winnr})              *vim.treesitter.get_node_at_cursor()*
     Returns the smallest named node under the cursor
 
     Parameters: ~
@@ -515,7 +517,8 @@ get_node_at_cursor({winnr})                             *get_node_at_cursor()*
     Return: ~
         (string) Name of node under the cursor
 
-get_node_at_pos({bufnr}, {row}, {col}, {opts})             *get_node_at_pos()*
+                                            *vim.treesitter.get_node_at_pos()*
+get_node_at_pos({bufnr}, {row}, {col}, {opts})
     Returns the smallest named node at the given position
 
     Parameters: ~
@@ -529,7 +532,7 @@ get_node_at_pos({bufnr}, {row}, {col}, {opts})             *get_node_at_pos()*
     Return: ~
         userdata |tsnode| under the cursor
 
-get_node_range({node_or_range})                             *get_node_range()*
+get_node_range({node_or_range})              *vim.treesitter.get_node_range()*
     Returns the node's range or an unpacked range table
 
     Parameters: ~
@@ -538,7 +541,7 @@ get_node_range({node_or_range})                             *get_node_range()*
     Return: ~
         (table) `{ start_row, start_col, end_row, end_col }`
 
-get_parser({bufnr}, {lang}, {opts})                             *get_parser()*
+get_parser({bufnr}, {lang}, {opts})              *vim.treesitter.get_parser()*
     Returns the parser for a specific buffer and filetype and attaches it to
     the buffer
 
@@ -554,7 +557,8 @@ get_parser({bufnr}, {lang}, {opts})                             *get_parser()*
     Return: ~
         LanguageTree |LanguageTree| object to use for parsing
 
-get_string_parser({str}, {lang}, {opts})                 *get_string_parser()*
+                                          *vim.treesitter.get_string_parser()*
+get_string_parser({str}, {lang}, {opts})
     Returns a string parser
 
     Parameters: ~
@@ -565,7 +569,7 @@ get_string_parser({str}, {lang}, {opts})                 *get_string_parser()*
     Return: ~
         LanguageTree |LanguageTree| object to use for parsing
 
-is_ancestor({dest}, {source})                                  *is_ancestor()*
+is_ancestor({dest}, {source})                   *vim.treesitter.is_ancestor()*
     Determines whether a node is the ancestor of another
 
     Parameters: ~
@@ -575,7 +579,8 @@ is_ancestor({dest}, {source})                                  *is_ancestor()*
     Return: ~
         (boolean) True if {dest} is an ancestor of {source}
 
-is_in_node_range({node}, {line}, {col})                   *is_in_node_range()*
+                                           *vim.treesitter.is_in_node_range()*
+is_in_node_range({node}, {line}, {col})
     Determines whether (line, col) position is in node range
 
     Parameters: ~
@@ -586,7 +591,7 @@ is_in_node_range({node}, {line}, {col})                   *is_in_node_range()*
     Return: ~
         (boolean) True if the position is in node range
 
-node_contains({node}, {range})                               *node_contains()*
+node_contains({node}, {range})                *vim.treesitter.node_contains()*
     Determines if a node contains a range
 
     Parameters: ~
@@ -596,7 +601,7 @@ node_contains({node}, {range})                               *node_contains()*
     Return: ~
         (boolean) True if the {node} contains the {range}
 
-start({bufnr}, {lang})                                               *start()*
+start({bufnr}, {lang})                                *vim.treesitter.start()*
     Starts treesitter highlighting for a buffer
 
     Can be used in an ftplugin or FileType autocommand.
@@ -621,7 +626,7 @@ start({bufnr}, {lang})                                               *start()*
       • {lang}   (string|nil) Language of the parser (default: buffer
                  filetype)
 
-stop({bufnr})                                                         *stop()*
+stop({bufnr})                                          *vim.treesitter.stop()*
     Stops treesitter highlighting for a buffer
 
     Parameters: ~
@@ -632,7 +637,7 @@ stop({bufnr})                                                         *stop()*
 ==============================================================================
 Lua module: vim.treesitter.language                  *lua-treesitter-language*
 
-inspect_language({lang})                                  *inspect_language()*
+inspect_language({lang})          *vim.treesitter.language.inspect_language()*
     Inspects the provided language.
 
     Inspecting provides some useful information on the language like node
@@ -644,7 +649,7 @@ inspect_language({lang})                                  *inspect_language()*
     Return: ~
         (table)
 
-                                                          *require_language()*
+                                  *vim.treesitter.language.require_language()*
 require_language({lang}, {path}, {silent}, {symbol_name})
     Asserts that a parser for the language {lang} is installed.
 
@@ -666,7 +671,8 @@ require_language({lang}, {path}, {silent}, {symbol_name})
 ==============================================================================
 Lua module: vim.treesitter.query                        *lua-treesitter-query*
 
-add_directive({name}, {handler}, {force})                    *add_directive()*
+                                        *vim.treesitter.query.add_directive()*
+add_directive({name}, {handler}, {force})
     Adds a new directive to be used in queries
 
     Handlers can set match level data by setting directly on the metadata
@@ -679,7 +685,8 @@ add_directive({name}, {handler}, {force})                    *add_directive()*
       • {handler}  function(match:string, pattern:string, bufnr:number,
                    predicate:function, metadata:table)
 
-add_predicate({name}, {handler}, {force})                    *add_predicate()*
+                                        *vim.treesitter.query.add_predicate()*
+add_predicate({name}, {handler}, {force})
     Adds a new predicate to be used in queries
 
     Parameters: ~
@@ -687,7 +694,8 @@ add_predicate({name}, {handler}, {force})                    *add_predicate()*
       • {handler}  function(match:string, pattern:string, bufnr:number,
                    predicate:function)
 
-get_node_text({node}, {source}, {opts})                      *get_node_text()*
+                                        *vim.treesitter.query.get_node_text()*
+get_node_text({node}, {source}, {opts})
     Gets the text corresponding to a given node
 
     Parameters: ~
@@ -701,7 +709,7 @@ get_node_text({node}, {source}, {opts})                      *get_node_text()*
     Return: ~
         (string[]|string)
 
-get_query({lang}, {query_name})                                  *get_query()*
+get_query({lang}, {query_name})             *vim.treesitter.query.get_query()*
     Returns the runtime query {query_name} for {lang}.
 
     Parameters: ~
@@ -711,7 +719,7 @@ get_query({lang}, {query_name})                                  *get_query()*
     Return: ~
         Query Parsed query
 
-                                                           *get_query_files()*
+                                      *vim.treesitter.query.get_query_files()*
 get_query_files({lang}, {query_name}, {is_included})
     Gets the list of files used to make up a query
 
@@ -725,19 +733,19 @@ get_query_files({lang}, {query_name}, {is_included})
         string[] query_files List of files to load for given query and
         language
 
-list_directives()                                          *list_directives()*
+list_directives()                     *vim.treesitter.query.list_directives()*
     Lists the currently available directives to use in queries.
 
     Return: ~
         string[] List of supported directives.
 
-list_predicates()                                          *list_predicates()*
+list_predicates()                     *vim.treesitter.query.list_predicates()*
     Lists the currently available predicates to use in queries.
 
     Return: ~
         string[] List of supported predicates.
 
-parse_query({lang}, {query})                                   *parse_query()*
+parse_query({lang}, {query})              *vim.treesitter.query.parse_query()*
     Parse {query} as a string. (If the query is in a file, the caller should
     read the contents into a string before calling).
 
@@ -828,7 +836,8 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
         (table) match
         (table) metadata
 
-set_query({lang}, {query_name}, {text})                          *set_query()*
+                                            *vim.treesitter.query.set_query()*
+set_query({lang}, {query_name}, {text})
     Sets the runtime query named {query_name} for {lang}
 
     This allows users to override any runtime files and/or configuration set
@@ -843,7 +852,7 @@ set_query({lang}, {query_name}, {text})                          *set_query()*
 ==============================================================================
 Lua module: vim.treesitter.highlighter            *lua-treesitter-highlighter*
 
-new({tree}, {opts})                                        *highlighter.new()*
+new({tree}, {opts})                         *vim.treesitter.highlighter.new()*
     Creates a new highlighter using
 
     Parameters: ~
@@ -1014,7 +1023,7 @@ LanguageTree:trees({self})                              *LanguageTree:trees()*
     Parameters: ~
       • {self}
 
-new({source}, {lang}, {opts})                             *languagetree.new()*
+new({source}, {lang}, {opts})              *vim.treesitter.languagetree.new()*
     A |LanguageTree| holds the treesitter parser for a given language {lang}
     used to parse a buffer. As the buffer may contain injected languages, the LanguageTree needs to store parsers for these child languages as well (which in turn
     may contain child languages themselves, hence the name).
-- 
cgit 


From f92aab5f704f6e94e80f2fcbab42acc272a66a29 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Wed, 7 Dec 2022 18:34:39 +0800
Subject: vim-patch:9.0.1025: WinScrolled is not triggered when filler lines
 change (#21325)

Problem:    WinScrolled is not triggered when filler lines change.
Solution:   Add "topfill" to the values that WinScrolled triggers on.
            (closes vim/vim#11668)

https://github.com/vim/vim/commit/3fc84dc2c7efecd7c14ce341cd777475058936fd

Cherry-pick StopVimInTerminal() from patch 9.0.1010.
---
 runtime/doc/windows.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 1776c47d33..1e96d00291 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -631,9 +631,9 @@ The information provided by |WinScrolled| is a dictionary for each window that
 has changes, using the window ID as the key, and a total count of the changes
 with the key "all".  Example value for |v:event|:
 	{
-	   all: {width: 0, height: 2, leftcol: 0, topline: 1, skipcol: 0},
-	   1003: {width: 0, height: -1, leftcol: 0, topline: 0, skipcol: 0},
-	   1006: {width: 0, height: 1, leftcol: 0, topline: 1, skipcol: 0},
+	   all: {width: 0, height: 2, leftcol: 0, skipcol: 0, topline: 1, topfill: 0},
+	   1003: {width: 0, height: -1, leftcol: 0, skipcol: 0, topline: 0, topfill: 0},
+	   1006: {width: 0, height: 1, leftcol: 0, skipcol: 0, topline: 1, topfill: 0},
 	}
 
 Note that the "all" entry has the absolute values of the individual windows
-- 
cgit 


From 54305443b9cd5ac2c2220f12e01a653e8064c3a4 Mon Sep 17 00:00:00 2001
From: Mathias Fußenegger 
Date: Thu, 8 Dec 2022 10:55:01 +0100
Subject: feat(lsp): support willSave & willSaveWaitUntil capability (#21315)

`willSaveWaitUntil` allows servers to respond with text edits before
saving a document. That is used by some language servers to format a
document or apply quick fixes like removing unused imports.
---
 runtime/doc/news.txt | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 4896cf19d8..047973242f 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,11 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• Added support for the `willSave` and `willSaveWaitUntil` capabilities to the
+  LSP client. `willSaveWaitUntil` allows a server to modify a document before it
+  gets saved. Example use-cases by language servers include removing unused
+  imports, or formatting the file.
+
 • Treesitter syntax highlighting for `help` files now supports highlighted
   code examples. To enable, create a `.config/nvim/ftplugin/help.lua` with
   the contents >lua
-- 
cgit 


From a27ed57ad040a7dfb67deba026df684fc375d509 Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Thu, 8 Dec 2022 11:21:42 +0100
Subject: docs(lua): add guide to using Lua in Neovim (#21137)

Add introductory guide explaining how to use Lua in Neovim:
where to put Lua files, how to set variables and options, how
to create mappings, autocommands, and user commands.

Adapted with kind permission from
https://github.com/nanotee/nvim-lua-guide
---
 runtime/doc/help.txt      |   1 +
 runtime/doc/lua-guide.txt | 757 ++++++++++++++++++++++++++++++++++++++++++++++
 runtime/doc/lua.txt       |   9 +-
 3 files changed, 760 insertions(+), 7 deletions(-)
 create mode 100644 runtime/doc/lua-guide.txt

(limited to 'runtime/doc')

diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 63d9d10845..9cf0ea69f2 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -102,6 +102,7 @@ API (EXTENSIBILITY/SCRIPTING/PLUGINS)
 
 |api|			Nvim API via RPC, Lua and VimL
 |ui|			Nvim UI protocol
+|lua-guide|		Nvim Lua guide
 |lua|			Lua API
 |luaref|		Lua reference manual
 |luvref|		Luv (|vim.loop|) reference manual
diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt
new file mode 100644
index 0000000000..e96345cda6
--- /dev/null
+++ b/runtime/doc/lua-guide.txt
@@ -0,0 +1,757 @@
+*lua-guide.txt*                        Nvim
+
+                            NVIM REFERENCE MANUAL
+
+                          Guide to using Lua in Nvim
+
+
+                                       Type |gO| to see the table of contents.
+
+==============================================================================
+Introduction                                                         *lua-guide*
+
+This guide will go through the basics of using Lua in Neovim. It is not meant
+to be a comprehensive encyclopedia of all available features, nor will it
+detail all intricacies. Think of it as a survival kit -- the bare minimum
+needed to know to comfortably get started on using Lua in Neovim.
+
+An important thing to note is that this isn't a guide to the Lua language
+itself. Rather, this is a guide on how to configure and modify Neovim through
+the Lua language and the functions we provide to help with this. Take a look
+at |luaref| and |lua-concepts| if you'd like to learn more about Lua itself.
+Similarly, this guide assumes some familiarity with the basics of Neovim
+(commands, options, mappings, autocommands), which are covered in the
+|user-manual|.
+
+------------------------------------------------------------------------------
+Some words on the API                                            *lua-guide-api*
+
+The purpose of this guide is to introduce the different ways of interacting
+with Neovim through Lua (the "API"). This API consists of three different
+layers:
+
+1. The "Vim API" inherited from Vim: |ex-commands| and |builtin-functions| as
+well as |user-function|s in Vimscript. These are accessed through |vim.cmd()|
+and |vim.fn| respectively, which are discussed under |lua-guide-vimscript|
+below.
+
+2. The "Neovim API" written in C for use in remote plugins and GUIs; see |api|.
+These functions are accessed through |vim.api|.
+
+3. The "Lua API" written in and specifically for Lua. These are any other
+functions accessible through `vim.*` not mentioned already; see |lua-stdlib|.
+
+This distinction is important, as API functions inherit behavior from their
+original layer: For example, Neovim API functions always need all arguments to
+be specified even if Lua itself allows omitting arguments (which are then
+passed as `nil`); and Vim API functions can use 0-based indexing even if Lua
+arrays are 1-indexed by default.
+
+Through this, any possible interaction can be done through Lua without writing
+a complete new API from scratch. For this reason, functions are usually not
+duplicated between layers unless there is a significant benefit in
+functionality or performance (e.g., you can map Lua functions directly through
+|nvim_create_autocmd()| but not through |:autocmd|). In case there are multiple
+ways of achieving the same thing, this guide will only cover what is most
+convenient to use from Lua.
+
+==============================================================================
+Using Lua                                                  *lua-guide-using-Lua*
+
+To run Lua code from the Neovim command line, use the |:lua| command:
+>vim
+    :lua print("Hello!")
+<
+Note: each |:lua| command has its own scope and variables declared with the
+local keyword are not accessible outside of the command. This won't work:
+>vim
+    :lua local foo = 1
+    :lua print(foo)
+    " prints "nil" instead of "1"
+<
+You can also use `:lua=`, which is the same as `:lua vim.pretty_print(...)`,
+to conveniently check the value of a variable or a table:
+>lua
+    :lua=package
+<
+To run a Lua script in an external file, you can use the |:source| command
+exactly like for a Vimscript file:
+>vim
+    :source ~/programs/baz/myluafile.lua
+<
+Finally, you can include Lua code in a Vimscript file by putting it inside a
+|lua-heredoc| block:
+>vim
+    lua << EOF
+      local tbl = {1, 2, 3}
+      for k, v in ipairs(tbl) do
+        print(v)
+      end
+    EOF
+<
+------------------------------------------------------------------------------
+Using Lua files on startup                                    *lua-guide-config*
+
+Neovim supports using `init.vim` or `init.lua` as the configuration file, but
+not both at the same time. This should be placed in your |config| directory,
+which is typically `~/.config/nvim` for Linux, BSD, or macOS, and
+`~/AppData/Local/nvim/` for Windows. Note that you can use Lua in `init.vim`
+and Vimscript in `init.lua`, which will be covered below.
+
+If you'd like to run any other Lua script on |startup| automatically, then you
+can simply put it in `plugin/` in your |'runtimepath'|.
+
+------------------------------------------------------------------------------
+Lua modules                                                  *lua-guide-modules*
+
+If you want to load Lua files on demand, you can place them in the `lua/`
+directory in your |'runtimepath'| and load them with `require`. (This is the
+Lua equivalent of Vimscript's |autoload| mechanism.)
+
+Let's assume you have the following directory structure:
+>
+    ~/.config/nvim
+    |-- after/
+    |-- ftplugin/
+    |-- lua/
+    |  |-- myluamodule.lua
+    |  |-- other_modules/
+    |     |-- anothermodule.lua
+    |     |-- init.lua
+    |-- plugin/
+    |-- syntax/
+    |-- init.vim
+<
+
+Then the following Lua code will load `myluamodule.lua`:
+>lua
+    require("myluamodule")
+<
+Note the absence of a `.lua` extension.
+
+Similarly, loading `other_modules/anothermodule.lua` is done via
+>lua
+    require('other_modules/anothermodule')
+    -- or
+    require('other_modules.anothermodule')
+<
+
+Note how "submodules" are just subdirectories; the `.` is equivalent to the
+path separator `/` (even on Windows).
+
+A folder containing an |init.lua| file can be required directly, without
+having to specify the name of the file:
+>lua
+    require('other_modules') -- loads other_modules/init.lua
+<
+Requiring a nonexistent module or a module which contains syntax errors aborts
+the currently executing script. `pcall()` may be used to catch such errors. The
+following example tries to load the `module_with_error` and only calls one of
+its functions if this succeeds and prints an error message otherwise:
+>lua
+    local ok, mymod = pcall(require, 'module_with_error')
+    if not ok then
+      print("Module had an error")
+    else
+      mymod.function()
+    end
+<
+In contrast to |:source|, |require()| not only searches through all `lua/` directories
+under |'runtimepath'|, it also cache the module on first use. Calling
+`require()` a second time will therefore _not_ execute the script again and
+instead return the cached file. To rerun the file, you need to remove it from
+the cache manually first:
+>lua
+    package.loaded['myluamodule'] = nil
+    require('myluamodule')    -- read and execute the module again from disk
+<
+------------------------------------------------------------------------------
+See also:
+• |lua-require|
+• |luaref-pcall()|
+
+==============================================================================
+Using Vim commands and functions from Lua                  *lua-guide-vimscript*
+
+All Vim commands and functions are accessible from Lua.
+
+------------------------------------------------------------------------------
+Vim commands                                            *lua-guide-vim-commands*
+
+To run an arbitrary Vim command from Lua, pass it as a string to |vim.cmd()|:
+>lua
+    vim.cmd("colorscheme habamax")
+<
+Note that special characters will need to be escaped with backslashes:
+>lua
+    vim.cmd("%s/\\Vfoo/bar/g")
+<
+An alternative is to use a literal string (see |luaref-literal|) delimited by
+double brackets `[[ ]]` as in
+>lua
+    vim.cmd([[%s/\Vfoo/bar/g]])
+<
+Another benefit of using literal strings is that they can be multiple lines;
+this allows you to pass multiple commands to a single call of |vim.cmd()|:
+>lua
+    vim.cmd([[
+      highlight Error guibg=red
+      highlight link Warning Error
+    ]])
+<
+This is the converse of |lua-heredoc| and allows you to include Lua code in
+your `init.vim`.
+
+If you want to build your Vim command programmatically, the following form can
+be useful (all these are equivalent to the corresponding line above):
+>lua
+    vim.cmd.colorscheme("habamax")
+    vim.cmd.highlight({ "Error", "guibg=red" })
+    vim.cmd.highlight({ "link", "Warning", "Error" })
+<
+------------------------------------------------------------------------------
+Vimscript functions                                    *lua-guide-vim-functions*
+
+Use |vim.fn| to call Vimscript functions from Lua. Data types between Lua and
+Vimscript are automatically converted:
+>lua
+    print(vim.fn.printf('Hello from %s', 'Lua'))
+
+    local reversed_list = vim.fn.reverse({ 'a', 'b', 'c' })
+    print(vim.inspect(reversed_list)) -- { "c", "b", "a" }
+
+    local function print_stdout(chan_id, data, name)
+      print(data[1])
+    end
+
+    vim.fn.jobstart('ls', { on_stdout = print_stdout })
+    print(vim.fn.printf('Hello from %s', 'Lua'))
+<
+This works for both |builtin-functions| and |user-function|s.
+
+Note that hashes (`#`) are not valid characters for identifiers in Lua, so,
+e.g., |autoload| functions have to be called with this syntax:
+>lua
+    vim.fn['my#autoload#function']()
+<
+------------------------------------------------------------------------------
+See also:
+• |builtin-functions|: alphabetic list of all Vimscript functions
+• |function-list|:     list of all Vimscript functions grouped by topic
+• |:runtime|:          run all Lua scripts matching a pattern in |'runtimepath'|
+• |package.path|:      list of all paths searched by `require()`
+
+==============================================================================
+Variables                                                  *lua-guide-variables*
+
+Variables can be set and read using the following wrappers, which directly
+correspond to their |variable-scope|:
+
+• |vim.g|:   global variables (|g:|)
+• |vim.b|:   variables for the current buffer (|b:|)
+• |vim.w|:   variables for the current window (|w:|)
+• |vim.t|:   variables for the current tabpage (|t:|)
+• |vim.v|:   predefined Vim variables (|v:|)
+• |vim.env|: environment variables defined in the editor session
+
+Data types are converted automatically. For example:
+>lua
+    vim.g.some_global_variable = {
+      key1 = "value",
+      key2 = 300
+    }
+
+    print(vim.inspect(vim.g.some_global_variable))
+    --> { key1 = "value", key2 = 300 }
+<
+You can target specific buffers (via number), windows (via |window-ID|), or
+tabpages by indexing the wrappers:
+>lua
+    vim.b[2].myvar = 1               -- set myvar for buffer number 2
+    vim.w[1005].myothervar = true    -- set myothervar for window ID 1005
+<
+Some variable names may contain characters that cannot be used for identifiers
+in Lua. You can still manipulate these variables by using the syntax
+>lua
+    vim.g['my#variable'] = 1
+<
+Note that you cannot directly change fields of array variables. This won't
+work:
+>lua
+    vim.g.some_global_variable.key2 = 400
+    vim.pretty_print(vim.g.some_global_variable)
+    --> { key1 = "value", key2 = 300 }
+<
+Instead, you need to create an intermediate Lua table and change this:
+>lua
+    local temp_table = vim.g.some_global_variable
+    temp_table = keys = 400
+    vim.g.some_global_variable = temp_table
+    vim.pretty_print(vim.g.some_global_variable)
+    --> { key1 = "value", key2 = 400 }
+<
+To delete a variable, simply set it to `nil`:
+>lua
+    vim.g.myvar = nil
+<
+------------------------------------------------------------------------------
+See also:
+• |lua-vim-variables|
+
+==============================================================================
+Options                                                      *lua-guide-options*
+
+There are two complementary ways of setting |options| via Lua.
+
+------------------------------------------------------------------------------
+vim.opt
+
+The most convenient way for setting global and local options, e.g., in `init.lua`,
+is through `vim.opt` and friends:
+
+• |vim.opt|:        behaves like |:set|
+• |vim.opt_global|: behaves like |:setglobal|
+• |vim.opt_local|:  behaves like |:setlocal|
+
+For example, the Vimscript commands
+>vim
+    set smarttab
+    set nosmarttab
+<
+are equivalent to
+>lua
+    vim.opt.smarttab = true
+    vim.opt.smarttab = false
+<
+In particular, they allow an easy way to working with list-like, map-like, and
+set-like options through Lua tables: Instead of
+>vim
+    set wildignore=*.o,*.a,__pycache__
+    set listchars=space:_,tab:>~
+    set formatoptions=njt
+<
+you can use
+>lua
+    vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }
+    vim.opt.listchars = { space = '_', tab = '>~' }
+    vim.opt.formatoptions = { n = true, j = true, t = true }
+<
+These wrappers also come with methods that work similarly to their |:set+=|,
+|:set^=| and |:set-=| counterparts in Vimscript:
+>lua
+    vim.opt.shortmess:append({ I = true })
+    vim.opt.wildignore:prepend('*.o')
+    vim.opt.whichwrap:remove({ 'b', 's' })
+<
+The price to pay is that you cannot access the option values directly but must
+use |vim.opt:get()|:
+>lua
+    print(vim.opt.smarttab)
+    --> {...} (big table)
+    print(vim.opt.smarttab:get())
+    --> false
+    vim.pretty_print(vim.opt.listchars:get())
+    --> { space = '_', tab = '>~' }
+<
+------------------------------------------------------------------------------
+vim.o
+
+For this reason, there exists a more direct variable-like access using `vim.o`
+and friends, similarly to how you can get and set options via `:echo &number`
+and `:let &listchars='space:_,tab:>~'`:
+
+• |vim.o|:  behaves like |:set|
+• |vim.go|: behaves like |:setglobal|
+• |vim.bo|: for buffer-scoped options
+• |vim.wo|: for window-scoped options
+
+For example:
+>lua
+    vim.o.smarttab = false -- :set nosmarttab
+    print(vim.o.smarttab)
+    --> false
+    vim.o.listchars = 'space:_,tab:>~' -- :set listchars='space:_,tab:>~'
+    print(vim.o.listchars)
+    --> 'space:_,tab:>~'
+    vim.o.isfname = vim.o.isfname .. ',@-@' -- :set isfname+=@-@
+    print(vim.o.isfname)
+    --> '@,48-57,/,.,-,_,+,,,#,$,%,~,=,@-@'
+    vim.bo.shiftwidth = 4 -- :setlocal shiftwidth=4
+    print(vim.bo.shiftwidth)
+    --> 4
+<
+Just like variables, you can specify a buffer number or |window-ID| for buffer
+and window options, respectively. If no number is given, the current buffer or
+window is used:
+>lua
+    vim.bo[4].expandtab = true -- sets expandtab to true in buffer 4
+    vim.wo.number = true       -- sets number to true in current window
+    print(vim.wo[0].number)    --> true
+<
+------------------------------------------------------------------------------
+See also:
+• |lua-options|
+
+==============================================================================
+Mappings                                                    *lua-guide-mappings*
+
+You can map either Vim commands or Lua functions to key sequences.
+
+------------------------------------------------------------------------------
+Creating mappings                                       *lua-guide-mappings-set*
+
+Mappings can be created using |vim.keymap.set()|. This function takes three
+mandatory arguments:
+• {mode} is a string or a table of strings containing the mode
+  prefix for which the mapping will take effect. The prefixes are the ones
+  listed in |:map-modes|, or "!" for |:map!|, or empty string for |:map|.
+• {lhs} is a string with the key sequences that should trigger the mapping.
+  An empty string is equivalent to ||, which disables a key.
+• {rhs} is either a string with a Vim command or a Lua function that should
+  be execucted when the {lhs} is entered.
+
+Examples:
+>lua
+    -- Normal mode mapping for Vim command
+    vim.keymap.set('n', 'ex1', 'echo "Example 1"')
+    -- Normal and Command-line mode mapping for Vim command
+    vim.keymap.set({'n', 'c'}, 'ex2', 'echo "Example 2"')
+    -- Normal mode mapping for Lua function
+    vim.keymap.set('n', 'ex3', vim.treesitter.start)
+    -- Normal mode mapping for Lua function with arguments
+    vim.keymap.set('n', 'ex4', function() print('Example 4') end)
+<
+You can map functions from Lua modules via
+>lua
+    vim.keymap.set('n', 'pl1', require('plugin').action)
+<
+Note that this loads the plugin at the time the mapping is defined. If you
+want to defer the loading to the time when the mapping is executed (as for
+|autoload| functions), wrap it in `function() end`:
+>lua
+    vim.keymap.set('n', 'pl2', function() require('plugin').action() end)
+<
+The fourth, optional, argument is a table with keys that modify the behavior
+of the mapping such as those from |:map-arguments|. The following are the most
+useful options:
+• `buffer`: If given, only set the mapping for the buffer with the specified
+  number; `0` or `true` means the current buffer. >lua
+    -- set mapping for the current buffer
+    vim.keymap.set('n', 'pl1', require('plugin').action, { buffer = true })
+    -- set mapping for the buffer number 4
+    vim.keymap.set('n', 'pl1', require('plugin').action, { buffer = 4 })
+<
+• `silent`: If set to `true`, suppress output such as error messages. >lua
+    vim.keymap.set('n', 'pl1', require('plugin').action, { silent = true })
+<
+• `expr`: If set to `true`, do not execute the {rhs} but use the return value
+  as input. Special |keycodes| are converted automatically. For example, the following
+  mapping replaces  with  in the popupmenu only: >lua
+    vim.keymap.set('c', '', function()
+      if vim.fn.pumvisible() == 1 then return '' end
+      return ''
+    end, { expr = true })
+<
+• `desc`: A string that is shown when listing mappings with, e.g., |:map|.
+  This is useful since Lua functions as {rhs} are otherwise only listed as
+  `Lua:  :`. Plugins should therefore always use this
+  for mappings they create. >lua
+    vim.keymap.set('n', 'pl1', require('plugin').action,
+      { desc = 'Execute action from plugin' })
+<
+• `remap`: By default, all mappings are nonrecursive by default (i.e.,
+  |vim.keymap.set()| behaves like |:noremap|). If the {rhs} is itself a mapping
+  that should be executed, set `remap = true`: >lua
+    vim.keymap.set('n', 'ex1', 'echo "Example 1"')
+    -- add a shorter mapping
+    vim.keymap.set('n', 'e', 'ex1', { remap = true })
+<
+  Note: || mappings are always expanded even with the default `remap = false`: >lua
+    vim.keymap.set('n', '[%', '(MatchitNormalMultiBackward)')
+<
+------------------------------------------------------------------------------
+Removing mappings                                       *lua-guide-mappings-del*
+
+A specific mapping can be removed with |vim.keymap.del()|:
+>lua
+    vim.keymap.del('n', 'ex1')
+    vim.keymap.del({'n', 'c'}, 'ex2', {buffer = true})
+<
+------------------------------------------------------------------------------
+See also:
+• `vim.api.`|nvim_get_keymap()|:     return all global mapping
+• `vim.api.`|nvim_buf_get_keymap()|: return all mappings for buffer
+
+==============================================================================
+Autocommands                                            *lua-guide-autocommands*
+
+An |autocommand| is a Vim command or a Lua function that is automatically
+executed whenever one or more |events| are triggered, e.g., when a file is
+read or written, or when a window is created. These are accessible from Lua
+through the Neovim API.
+
+------------------------------------------------------------------------------
+Creating autocommands                             *lua-guide-autocommand-create*
+
+Autocommands are created using `vim.api.`|nvim_create_autocmd()|, which takes
+two mandatory arguments:
+• {event}: a string or table of strings containing the event(s) which should
+           trigger the command or function.
+• {opts}:  a table with keys that control what should happen when the event(s)
+           are triggered.
+
+The most important options are:
+
+• `pattern`:  A string or table of strings containing the |autocmd-pattern|.
+            Note: Environment variable like `$HOME` and `~` are not automatically
+            expanded; you need to explicitly use `vim.fn.`|expand()| for this.
+• `command`:  A string containing a Vim command.
+• `callback`: A Lua function.
+
+You must specify one and only one of `command` and `callback`. If `pattern` is
+omitted, it defaults to `pattern = '*'`.
+Examples:
+>lua
+    vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
+      pattern = {"*.c", "*.h"},
+      command = "echo 'Entering a C or C++ file'",
+    })
+
+    -- Same autocommand written with a Lua function instead
+    vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
+      pattern = {"*.c", "*.h"},
+      callback = function() print("Entering a C or C++ file") end,
+    })
+
+    -- User event triggered by MyPlugin
+    vim.api.nvim_create_autocmd("User", {
+      pattern = "MyPlugin",
+      callback = function() print("My Plugin Works!") end,
+    })
+<
+
+Neovim will always call a Lua function with a single table containing information
+about the triggered autocommand. The most useful keys are
+• `match`: a string that matched the `pattern` (see ||)
+• `buf`:   the number of the buffer the event was triggered in (see ||)
+• `file`:  the file name of the buffer the event was triggered in (see ||)
+• `data`:  a table with other relevant data that is passed for some events
+
+For example, this allows you to set buffer-local mappings for some filetypes:
+>lua
+    vim.api.nvim.create_autocmd("FileType", {
+      pattern = "lua",
+      callback = function(args)
+        vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = args.buf })
+      end
+    })
+<
+This means that if your callback itself takes an (even optional) argument, you
+must wrap it in `function() end` to avoid an error:
+>lua
+    vim.api.nvim_create_autocmd('TextYankPost', {
+      callback = function() vim.highlight.on_yank() end
+    })
+<
+(Since unused arguments can be omitted in Lua function definitions, this is
+equivalent to `function(args) ... end`.)
+
+Instead of using a pattern, you can create a buffer-local autocommand (see
+|autocmd-buflocal|) with `buffer`; in this case, `pattern` cannot be used:
+>lua
+    -- set autocommand for current buffer
+    vim.api.nvim_create_autocmd("CursorHold", {
+      buffer = 0,
+      callback = function() print("hold") end,
+    })
+
+    -- set autocommand for buffer number 33
+    vim.api.nvim_create_autocmd("CursorHold", {
+      buffer = 33,
+      callback = function() print("hold") end,
+    })
+<
+Similarly to mappings, you can (and should) add a description using `desc`:
+>lua
+    vim.api.nvim_create_autocmd('TextYankPost', {
+      callback = function() vim.highlight.on_yank() end,
+      desc = "Briefly highlight yanked text"
+    })
+<
+Finally, you can group autocommands using the `group` key; this will be
+covered in detail in the next section.
+
+------------------------------------------------------------------------------
+Grouping autocommands                             *lua-guide-autocommands-group*
+
+Autocommand groups can be used to group related autocommands together; see
+|autocmd-groups|. This is useful for organizing autocommands and especially
+for preventing autocommands to be set multiple times.
+
+Groups can be created with `vim.api.`|nvim_create_augroup()|. This function
+takes two mandatory arguments: a string with the name of a group and a table
+determining whether the group should be cleared (i.e., all grouped
+autocommands removed) if it already exists. The function returns a number that
+is the internal identifier of the group. Groups can be specified either by
+this identifier or by the name (but only if the group has been created first).
+
+For example, a common Vimscript pattern for autocommands defined in files that
+may be reloaded is
+>vim
+    augroup vimrc
+      " Remove all vimrc autocommands
+      autocmd!
+      au BufNewFile,BufRead *.html set shiftwidth=4
+      au BufNewFile,BufRead *.html set expandtab
+    augroup END
+<
+This is equivalent to the following Lua code:
+>lua
+    local mygroup = vim.api.nvim_create_augroup('vimrc', { clear = true })
+    vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
+      pattern = '*.html',
+      group = mygroup,
+      cmd = 'set shiftwidth=4',
+    })
+    vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
+      pattern = '*.html',
+      group = 'vimrc',  -- equivalent to group=mygroup
+      cmd = 'set expandtab',
+    })
+<
+Autocommand groups are unique for a given name, so you can reuse them, e.g.,
+in a different file:
+>lua
+    local mygroup = vim.api.nvim_create_augroup('vimrc', { clear = false })
+    vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
+      pattern = '*.html',
+      group = mygroup,
+      cmd = 'set shiftwidth=4',
+    })
+<
+------------------------------------------------------------------------------
+Deleting autocommands                            *lua-guide-autocommands-delete*
+
+You can use `vim.api.`|nvim_clear_autocmds()| to remove autocommands. This
+function takes a single mandatory argument that is a table of keys describing
+the autocommands that are to be removed:
+>lua
+    -- Delete all BufEnter and InsertLeave autocommands
+    vim.api.nvim_clear_autocmds({event = {"BufEnter", "InsertLeave"}})
+
+    -- Delete all autocommands that uses "*.py" pattern
+    vim.api.nvim_clear_autocmds({pattern = "*.py"})
+
+    -- Delete all autocommands in group "scala"
+    vim.api.nvim_clear_autocmds({group = "scala"})
+
+    -- Delete all ColorScheme autocommands in current buffer
+    vim.api.nvim_clear_autocmds({event = "ColorScheme", buffer = 0 })
+<
+Note: Autocommands in groups will only be removed if the `group` key is
+specified, even if another option matches it.
+
+------------------------------------------------------------------------------
+See also
+• |nvim_get_autocmds()|:  return all matching autocommands
+• |nvim_exec_autocmds()|: execute all matching autocommands
+
+==============================================================================
+User commands                                           *lua-guide-usercommands*
+
+|user-commands| are custom Vim commands that call a Vimscript or Lua function.
+Just like built-in commands, they can have arguments, act on ranges, or have
+custom completion of arguments. As these are most useful for plugins, we will
+cover only the basics of this advanced topic.
+
+------------------------------------------------------------------------------
+Creating user commands                           *lua-guide-usercommands-create*
+
+User commands can be created through the Neovim API with
+`vim.api.`|nvim_create_user_command()|. This function takes three mandatory
+arguments:
+• a string that is the name of the command (which must start with an uppercase
+  letter to distinguish it from builtin commands);
+• a string containing Vim commands or a Lua function that is executed when the
+  command is invoked;
+• a table with |command-attributes|; in addition, it can contain the keys
+  `desc` (a string describing the command); `force` (set to `false` to avoid
+  replacing an already existing command with the same name), and `preview` (a
+  Lua function that is used for |:command-preview|).
+
+Example:
+>lua
+    vim.api.nvim_create_user_command('Test', 'echo "It works!"', {})
+    vim.cmd.Test()
+    --> It works!
+<
+(Note that the third argument is mandatory even if no attributes are given.)
+
+Lua functions are called with a single table argument containing arguments and
+modifiers. The most important are:
+• `name`: a string with the command name
+• `fargs`: a table containing the command arguments split by whitespace (see ||)
+• `bang`: `true` if the command was executed with a `!` modifier (see ||)
+• `line1`: the starting line number of the command range (see ||)
+• `line2`: the final line number of the command range (see ||)
+• `range`: the number of items in the command range: 0, 1, or 2 (see ||)
+• `count`: any count supplied (see ||)
+• `smods`: a table containing the command modifiers (see ||)
+
+For example:
+>lua
+    vim.api.nvim_create_user_command('Upper',
+      function(opts)
+        print(string.upper(opts.fargs[1]))
+      end,
+      { nargs = 1 })
+
+    vim.cmd.Upper('foo')
+    --> FOO
+<
+The `complete` attribute can take a Lua function in addition to the
+attributes listed in |:command-complete|. >lua
+
+    vim.api.nvim_create_user_command('Upper',
+      function(opts)
+        print(string.upper(opts.fargs[1]))
+      end,
+      { nargs = 1,
+        complete = function(ArgLead, CmdLine, CursorPos)
+          -- return completion candidates as a list-like table
+          return { "foo", "bar", "baz" }
+        end,
+    })
+<
+Buffer-local user commands are created with `vim.api.`|nvim_buf_create_user_command()|.
+Here the first argument is the buffer number (`0` being the current buffer);
+the remaining arguments are the same as for |nvim_create_user_command()|:
+>lua
+    vim.api.nvim_buf_create_user_command(0, 'Upper',
+      function(opts)
+        print(string.upper(opts.fargs[1]))
+      end,
+      { nargs = 1 })
+<
+------------------------------------------------------------------------------
+Deleting user commands                           *lua-guide-usercommands-delete*
+
+User commands can be deleted with `vim.api.`|nvim_del_user_command()|. The only
+argument is the name of the command:
+>lua
+    vim.api.nvim_del_user_command('Upper')
+<
+To delete buffer-local user commands use `vim.api.`|nvim_buf_del_user_command()|.
+Here the first argument is the buffer number (`0` being the current buffer),
+and second is command name:
+>lua
+    vim.api.nvim_buf_del_user_command(4, 'Upper')
+<
+==============================================================================
+Credits                                                      *lua-guide-credits*
+This guide is in large part taken from nanotee's Lua guide:
+https://github.com/nanotee/nvim-lua-guide
+
+Thank you @nanotee!
+
+vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 27b5a39459..2682725167 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -21,12 +21,7 @@ Nvim includes a "standard library" |lua-stdlib| for Lua.  It complements the
 which can be used from Lua code (|lua-vimscript| |vim.api|). Together these
 "namespaces" form the Nvim programming interface.
 
-The |:source| and |:runtime| commands can run Lua scripts. Lua modules can be
-loaded with `require('name')`, which by convention usually returns a table.
-See |lua-require| for how Nvim finds and loads Lua modules.
-
-See this page for more insight into Nvim Lua:
-    https://github.com/nanotee/nvim-lua-guide
+See the |lua-guide| for an introduction to using Lua in Neovim.
 
                                                                   *lua-compat*
 Lua 5.1 is the permanent interface for Nvim Lua.  Plugins need only consider
@@ -125,7 +120,7 @@ Examples using |string.match()|: >lua
 For more complex matching you can use Vim regex from Lua via |vim.regex()|.
 
 ==============================================================================
-IMPORTING LUA MODULES                                            *lua-require*
+IMPORTING LUA MODULES                                  *require()* *lua-require*
 
 Modules are searched for under the directories specified in 'runtimepath', in
 the order they appear.  Any "." in the module name is treated as a directory
-- 
cgit 


From 35767769036671d5ce562f53cae574f9c66e4bb2 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Thu, 8 Dec 2022 16:33:38 +0100
Subject: vim-patch:86b4816766d9 (#21314)

Update runtime files

https://github.com/vim/vim/commit/86b4816766d976a7ecd4403eca1f8bf6b4105800

vim-patch:9.0.1029: autoload directory missing from distribution

Problem:    Autoload directory missing from distribution.
Solution:   Add the autoload/zig directory to the list of distributed files.

https://github.com/vim/vim/commit/84dbf855fb2d883481f74ad0ccf3df3f8837e6bf

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/fold.txt    | 5 +++++
 runtime/doc/map.txt     | 4 ++--
 runtime/doc/syntax.txt  | 8 ++++++++
 runtime/doc/windows.txt | 2 ++
 4 files changed, 17 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
index fa823608df..35a3be35fb 100644
--- a/runtime/doc/fold.txt
+++ b/runtime/doc/fold.txt
@@ -586,6 +586,11 @@ line is folded, it cannot be displayed there.
 Many movement commands handle a sequence of folded lines like an empty line.
 For example, the "w" command stops once in the first column.
 
+When starting a search in a closed fold it will not find a match in the
+current fold.  It's like a forward search always starts from the end of the
+closed fold, while a backwards search starts from the start of the closed
+fold.
+
 When in Insert mode, the cursor line is never folded.  That allows you to see
 what you type!
 
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index b51268eebf..b7656211c6 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1471,7 +1471,7 @@ Possible attributes are:
 		    number.
 	-count=N    A count (default N) which is specified either in the line
 		    number position, or as an initial argument (like |:Next|).
-	-count	    acts like -count=0
+	-count	    Acts like -count=0
 
 Note that -range=N and -count=N are mutually exclusive - only one should be
 specified.
@@ -1489,7 +1489,7 @@ Possible values are (second column is the short name used in listing):
     -addr=windows	  win	Range for windows
     -addr=tabs		  tab	Range for tab pages
     -addr=quickfix	  qf	Range for quickfix entries
-    -addr=other		  ?	other kind of range; can use ".", "$" and "%"
+    -addr=other		  ?	Other kind of range; can use ".", "$" and "%"
 				as with "lines" (this is the default for
 				-count)
 
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index f74a046ee6..3cd36f7652 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -3571,6 +3571,14 @@ highlighting is to put the following line in your |vimrc|: >
 <
 
 
+WDL							*wdl.vim* *wdl-syntax*
+
+The Workflow Description Language is a way to specify data processing workflows
+with a human-readable and writeable syntax.  This is used a lot in
+bioinformatics.  More info on the spec can be found here:
+https://github.com/openwdl/wdl
+
+
 XF86CONFIG				*xf86conf.vim* *ft-xf86conf-syntax*
 
 The syntax of XF86Config file differs in XFree86 v3.x and v4.x.  Both
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 1e96d00291..e7c58b00a0 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -615,6 +615,8 @@ autocommand event can be used.
 If you want to get notified of text in windows scrolling vertically or
 horizontally, the |WinScrolled| autocommand event can be used.  This will also
 trigger in window size changes.
+Exception: the events will not be triggered when the text scrolls for
+'incsearch'.
 							*WinResized-event*
 The |WinResized| event is triggered after updating the display, several
 windows may have changed size then.  A list of the IDs of windows that changed
-- 
cgit 


From d44699800cd0dbf14fb45476c13b6cc3c993b5c7 Mon Sep 17 00:00:00 2001
From: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date: Thu, 8 Dec 2022 09:22:57 -0700
Subject: feat(treesitter): add vim.treesitter.show_tree() (#21322)

Add a "show_tree" function to view a textual representation of the
nodes in a language tree in a window. Moving the cursor in the
window highlights the corresponding text in the source buffer, and
moving the cursor in the source buffer highlights the corresponding
nodes in the window.
---
 runtime/doc/news.txt       |  3 +++
 runtime/doc/treesitter.txt | 25 ++++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 047973242f..881faaa84e 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,9 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• |vim.treesitter.show_tree()| opens a split window showing a text
+  representation of the nodes in a language tree for the current buffer.
+
 • Added support for the `willSave` and `willSaveWaitUntil` capabilities to the
   LSP client. `willSaveWaitUntil` allows a server to modify a document before it
   gets saved. Example use-cases by language servers include removing unused
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 869ed8a187..71a5fdaad0 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -530,7 +530,7 @@ get_node_at_pos({bufnr}, {row}, {col}, {opts})
                    (default true)
 
     Return: ~
-        userdata |tsnode| under the cursor
+        userdata|nil |tsnode| under the cursor
 
 get_node_range({node_or_range})              *vim.treesitter.get_node_range()*
     Returns the node's range or an unpacked range table
@@ -601,6 +601,29 @@ node_contains({node}, {range})                *vim.treesitter.node_contains()*
     Return: ~
         (boolean) True if the {node} contains the {range}
 
+show_tree({opts})                                 *vim.treesitter.show_tree()*
+    Open a window that displays a textual representation of the nodes in the
+    language tree.
+
+    While in the window, press "a" to toggle display of anonymous nodes, "I"
+    to toggle the display of the source language of each node, and press
+     to jump to the node under the cursor in the source buffer.
+
+    Parameters: ~
+      • {opts}  (table|nil) Optional options table with the following possible
+                keys:
+                • bufnr (number|nil): Buffer to draw the tree into. If
+                  omitted, a new buffer is created.
+                • winid (number|nil): Window id to display the tree buffer in.
+                  If omitted, a new window is created with {command}.
+                • command (string|nil): Vimscript command to create the
+                  window. Default value is "topleft 60vnew". Only used when
+                  {winid} is nil.
+                • title (string|fun(bufnr:number):string|nil): Title of the
+                  window. If a function, it accepts the buffer number of the
+                  source buffer as its only argument and should return a
+                  string.
+
 start({bufnr}, {lang})                                *vim.treesitter.start()*
     Starts treesitter highlighting for a buffer
 
-- 
cgit 


From 42009ac7df88bfffeea49a83e642fdc6cf9f9447 Mon Sep 17 00:00:00 2001
From: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date: Thu, 8 Dec 2022 09:51:46 -0700
Subject: feat(treesitter): add 'lang' option to show_tree() (#21341)

This is necessary for now to support filetypes that use a parser with a
different name (e.g. the "terraform" filetype uses the "hcl" parser).
---
 runtime/doc/treesitter.txt | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 71a5fdaad0..096cec6678 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -526,6 +526,7 @@ get_node_at_pos({bufnr}, {row}, {col}, {opts})
       • {row}    (number) Position row
       • {col}    (number) Position column
       • {opts}   (table) Optional keyword arguments:
+                 • lang string|nil Parser language
                  • ignore_injections boolean Ignore injected languages
                    (default true)
 
@@ -612,6 +613,8 @@ show_tree({opts})                                 *vim.treesitter.show_tree()*
     Parameters: ~
       • {opts}  (table|nil) Optional options table with the following possible
                 keys:
+                • lang (string|nil): The language of the source buffer. If
+                  omitted, the filetype of the source buffer is used.
                 • bufnr (number|nil): Buffer to draw the tree into. If
                   omitted, a new buffer is created.
                 • winid (number|nil): Window id to display the tree buffer in.
-- 
cgit 


From 9f035559defd9d575f37fd825954610065d9cf96 Mon Sep 17 00:00:00 2001
From: John Drouhard 
Date: Wed, 23 Nov 2022 10:06:36 -0600
Subject: feat(lsp): initial support for semantic token highlighting

* credit to @smolck and @theHamsta for their contributions in laying the
  groundwork for this feature and for their work on some of the helper
  utility functions and tests
---
 runtime/doc/lsp.txt  | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 runtime/doc/lua.txt  |  1 +
 runtime/doc/news.txt |  8 ++++++++
 3 files changed, 58 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 4c4403c38f..22593d8331 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1319,6 +1319,55 @@ save({lenses}, {bufnr}, {client_id})                 *vim.lsp.codelens.save()*
       • {client_id}  (number)
 
 
+==============================================================================
+Lua module: vim.lsp.semantic_tokens                      *lsp-semantic_tokens*
+
+force_refresh({bufnr})               *vim.lsp.semantic_tokens.force_refresh()*
+    Force a refresh of all semantic tokens
+
+    Only has an effect if the buffer is currently active for semantic token
+    highlighting (|vim.lsp.semantic_tokens.start()| has been called for it)
+
+    Parameters: ~
+      • {bufnr}  (nil|number) default: current buffer
+
+start({bufnr}, {client_id}, {opts})          *vim.lsp.semantic_tokens.start()*
+    Start the semantic token highlighting engine for the given buffer with the
+    given client. The client must already be attached to the buffer.
+
+    NOTE: This is currently called automatically by
+    |vim.lsp.buf_attach_client()|. To opt-out of semantic highlighting with a
+    server that supports it, you can delete the semanticTokensProvider table
+    from the {server_capabilities} of your client in your |LspAttach| callback
+    or your configuration's `on_attach` callback.
+
+    >lua
+
+       client.server_capabilities.semanticTokensProvider = nil
+<
+
+    Parameters: ~
+      • {bufnr}      (number)
+      • {client_id}  (number)
+      • {opts}       (nil|table) Optional keyword arguments
+                     • debounce (number, default: 200): Debounce token
+                       requests to the server by the given number in
+                       milliseconds
+
+stop({bufnr}, {client_id})                    *vim.lsp.semantic_tokens.stop()*
+    Stop the semantic token highlighting engine for the given buffer with the
+    given client.
+
+    NOTE: This is automatically called by a |LspDetach| autocmd that is set up
+    as part of `start()`, so you should only need this function to manually
+    disengage the semantic token engine without fully detaching the LSP client
+    from the buffer.
+
+    Parameters: ~
+      • {bufnr}      (number)
+      • {client_id}  (number)
+
+
 ==============================================================================
 Lua module: vim.lsp.handlers                                    *lsp-handlers*
 
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 2682725167..5a1c186192 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -604,6 +604,7 @@ vim.highlight.priorities                            *vim.highlight.priorities*
     Table with default priorities used for highlighting:
         • `syntax`: `50`, used for standard syntax highlighting
         • `treesitter`: `100`, used for tree-sitter-based highlighting
+        • `semantic_tokens`: `125`, used for LSP semantic token highlighting
         • `diagnostics`: `150`, used for code analysis such as diagnostics
         • `user`: `200`, used for user-triggered highlights such as LSP document
           symbols or `on_yank` autocommands
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 881faaa84e..bd0d1cfc5b 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,14 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• Added support for semantic token highlighting to the LSP client. This
+  functionality is enabled by default when a client that supports this feature
+  is attached to a buffer. Opt-out can be performed by deleting the
+  `semanticTokensProvider` from the LSP client's {server_capabilities} in the
+  `LspAttach` callback.
+
+  See |lsp-semantic_tokens| for more information.
+
 • |vim.treesitter.show_tree()| opens a split window showing a text
   representation of the nodes in a language tree for the current buffer.
 
-- 
cgit 


From 49df92da9459bea9eec356d23cea20a0a2383d68 Mon Sep 17 00:00:00 2001
From: Mathias Fußenegger 
Date: Fri, 9 Dec 2022 19:18:31 +0100
Subject: fix(lsp): correct some type annotations (#21365)

---
 runtime/doc/lsp.txt | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 22593d8331..37a0a8c076 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -564,9 +564,9 @@ buf_notify({bufnr}, {method}, {params})                 *vim.lsp.buf_notify()*
     Send a notification to a server
 
     Parameters: ~
-      • {bufnr}   [number] (optional): The number of the buffer
-      • {method}  [string]: Name of the request method
-      • {params}  [string]: Arguments to send to the server
+      • {bufnr}   (number|nil) The number of the buffer
+      • {method}  (string) Name of the request method
+      • {params}  (string) Arguments to send to the server
 
     Return: ~
         true if any client returns true; false otherwise
@@ -580,7 +580,7 @@ buf_request_all({bufnr}, {method}, {params}, {callback})
     Parameters: ~
       • {bufnr}     (number) Buffer handle, or 0 for current.
       • {method}    (string) LSP method name
-      • {params}    (optional, table) Parameters to send to the server
+      • {params}    (table|nil) Parameters to send to the server
       • {callback}  (function) The callback to call when all requests are
                     finished.
 
@@ -599,9 +599,9 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms})
     Parameters: ~
       • {bufnr}       (number) Buffer handle, or 0 for current.
       • {method}      (string) LSP method name
-      • {params}      (optional, table) Parameters to send to the server
-      • {timeout_ms}  (optional, number, default=1000) Maximum time in
-                      milliseconds to wait for a result.
+      • {params}      (table|nil) Parameters to send to the server
+      • {timeout_ms}  (number|nil) Maximum time in milliseconds to wait for a
+                      result. Defaults to 1000
 
     Return: ~
         Map of client_id:request_result. On timeout, cancel or error, returns
@@ -668,7 +668,7 @@ client_is_stopped({client_id})                   *vim.lsp.client_is_stopped()*
     Checks whether a client is stopped.
 
     Parameters: ~
-      • {client_id}  (Number)
+      • {client_id}  (number)
 
     Return: ~
         true if client is stopped, false otherwise.
@@ -747,8 +747,8 @@ omnifunc({findstart}, {base})                             *vim.lsp.omnifunc()*
     Implements 'omnifunc' compatible LSP completion.
 
     Parameters: ~
-      • {findstart}  0 or 1, decides behavior
-      • {base}       If findstart=0, text to match against
+      • {findstart}  (number) 0 or 1, decides behavior
+      • {base}       (number) findstart=0, text to match against
 
     Return: ~
         (number) Decided by {findstart}:
@@ -770,7 +770,7 @@ set_log_level({level})                               *vim.lsp.set_log_level()*
     Use `lsp.log_levels` for reverse lookup.
 
     Parameters: ~
-      • {level}  [number|string] the case insensitive level name or number
+      • {level}  (number|string) the case insensitive level name or number
 
     See also: ~
         |vim.lsp.log_levels|
@@ -972,7 +972,8 @@ stop_client({client_id}, {force})                      *vim.lsp.stop_client()*
     for this client, then force-shutdown is attempted.
 
     Parameters: ~
-      • {client_id}  client id or |vim.lsp.client| object, or list thereof
+      • {client_id}  number|table id or |vim.lsp.client| object, or list
+                     thereof
       • {force}      (boolean) (optional) shutdown forcefully
 
 tagfunc({...})                                             *vim.lsp.tagfunc()*
@@ -984,8 +985,8 @@ tagfunc({...})                                             *vim.lsp.tagfunc()*
     LSP servers, falls back to using built-in tags.
 
     Parameters: ~
-      • {pattern}  Pattern used to find a workspace symbol
-      • {flags}    See |tag-function|
+      • {pattern}  (string) Pattern used to find a workspace symbol
+      • {flags}    (string) See |tag-function|
 
     Return: ~
         A list of matching tags
@@ -1877,7 +1878,7 @@ set_level({level})                                   *vim.lsp.log.set_level()*
     Sets the current log level.
 
     Parameters: ~
-      • {level}  (string or number) One of `vim.lsp.log.levels`
+      • {level}  (string|number) One of `vim.lsp.log.levels`
 
 should_log({level})                                 *vim.lsp.log.should_log()*
     Checks whether the level is sufficient for logging.
-- 
cgit 


From b12bb97feeb84df47d672d39b2de170061c37f45 Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Mon, 12 Dec 2022 01:53:07 +0100
Subject: docs: fix typos (#21328)

---
 runtime/doc/api.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 00f3473bac..decd3ca7d3 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -1129,7 +1129,7 @@ nvim_list_uis()                                              *nvim_list_uis()*
         • "width" Requested width of the UI
         • "rgb" true if the UI uses RGB colors (false implies |cterm-colors|)
         • "ext_..." Requested UI extensions, see |ui-option|
-        • "chan" Channel id of remote UI (not present for TUI)
+        • "chan" Channel id of remote UI or 0 for TUI
 
 nvim_list_wins()                                            *nvim_list_wins()*
     Gets the current list of window handles.
-- 
cgit 


From 1c324cb1927e03b5a3584a8982e3d5029498f14e Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Sun, 11 Dec 2022 21:41:26 -0500
Subject: docs #20986

- https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most
  errors in pi_netrw.txt, so we can remove that workaround from
  ignore_parse_error().
- improved codeblock
---
 runtime/doc/api.txt      | 97 ++++++++++++++++--------------------------------
 runtime/doc/develop.txt  | 31 +++++++++++-----
 runtime/doc/editing.txt  | 44 ++++++++++++++--------
 runtime/doc/eval.txt     | 14 +++----
 runtime/doc/lsp.txt      |  6 +--
 runtime/doc/nvim.txt     |  2 +-
 runtime/doc/provider.txt |  2 +-
 runtime/doc/vim_diff.txt | 29 +++++++++++----
 8 files changed, 114 insertions(+), 111 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index decd3ca7d3..6659e9b79b 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3228,89 +3228,54 @@ nvim_create_augroup({name}, {*opts})                   *nvim_create_augroup()*
         |autocmd-groups|
 
 nvim_create_autocmd({event}, {*opts})                  *nvim_create_autocmd()*
-    Create an |autocommand|
-
-    The API allows for two (mutually exclusive) types of actions to be
-    executed when the autocommand triggers: a callback function (Lua or
-    Vimscript), or a command (like regular autocommands).
-
-    Example using callback: >lua
-        -- Lua function
-        local myluafun = function() print("This buffer enters") end
-
-        -- Vimscript function name (as a string)
-        local myvimfun = "g:MyVimFunction"
+    Creates an |autocommand| event handler, defined by `callback` (Lua function or Vimscript function name string) or `command` (Ex command string).
 
+    Example using Lua callback: >lua
         vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
           pattern = {"*.c", "*.h"},
-          callback = myluafun,  -- Or myvimfun
+          callback = function(ev)
+            print(string.format('event fired: s', vim.inspect(ev)))
+          end
         })
 <
 
-    Lua functions receive a table with information about the autocmd event as
-    an argument. To use a function which itself accepts another (optional)
-    parameter, wrap the function in a lambda: >lua
-        -- Lua function with an optional parameter.
-        -- The autocmd callback would pass a table as argument but this
-        -- function expects number|nil
-        local myluafun = function(bufnr) bufnr = bufnr or vim.api.nvim_get_current_buf() end
-
-        vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
-          pattern = {"*.c", "*.h"},
-          callback = function() myluafun() end,
-        })
-<
-
-    Example using command: >lua
+    Example using an Ex command as the handler: >lua
         vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
           pattern = {"*.c", "*.h"},
           command = "echo 'Entering a C or C++ file'",
         })
 <
 
-    Example values for pattern: >lua
-      pattern = "*.py"
-      pattern = { "*.py", "*.pyi" }
-<
-
-    Note: The `pattern` is passed to callbacks and commands as a literal string; environment
-    variables like `$HOME` and `~` are not automatically expanded as they are by |:autocmd|. Instead,
-    |expand()| such variables explicitly: >lua
+    Note: `pattern` is NOT automatically expanded (unlike with |:autocmd|), thus names like
+    "$HOME" and "~" must be expanded explicitly: >lua
       pattern = vim.fn.expand("~") .. "/some/path/*.py"
 <
 
-    Example values for event: >lua
-      event = "BufWritePre"
-      event = {"CursorHold", "BufWritePre", "BufWritePost"}
-<
-
     Parameters: ~
-      • {event}  (string|array) The event or events to register this
-                 autocommand
-      • {opts}   Dictionary of autocommand options:
-                 • group (string|integer) optional: the autocommand group name
-                   or id to match against.
-                 • pattern (string|array) optional: pattern or patterns to
-                   match literally against |autocmd-pattern|.
-                 • buffer (integer) optional: buffer number for buffer local
+      • {event}  (string|array) Event(s) that will trigger the handler
+                 (`callback` or `command`).
+      • {opts}   Options dict:
+                 • group (string|integer) optional: autocommand group name or
+                   id to match against.
+                 • pattern (string|array) optional: pattern(s) to match
+                   literally |autocmd-pattern|.
+                 • buffer (integer) optional: buffer number for buffer-local
                    autocommands |autocmd-buflocal|. Cannot be used with
                    {pattern}.
-                 • desc (string) optional: description of the autocommand.
-                 • callback (function|string) optional: if a string, the name
-                   of a Vimscript function to call when this autocommand is
-                   triggered. Otherwise, a Lua function which is called when
-                   this autocommand is triggered. Cannot be used with
-                   {command}. Lua callbacks can return true to delete the
-                   autocommand; in addition, they accept a single table
-                   argument with the following keys:
-                   • id: (number) the autocommand id
-                   • event: (string) the name of the event that triggered the
-                     autocommand |autocmd-events|
-                   • group: (number|nil) the autocommand group id, if it
-                     exists
-                   • match: (string) the expanded value of ||
-                   • buf: (number) the expanded value of ||
-                   • file: (string) the expanded value of ||
+                 • desc (string) optional: description (for documentation and
+                   troubleshooting).
+                 • callback (function|string) optional: Lua function (or
+                   Vimscript function name, if string) called when the
+                   event(s) is triggered. Lua callback can return true to
+                   delete the autocommand, and receives a table argument with
+                   these keys:
+                   • id: (number) autocommand id
+                   • event: (string) name of the triggered event
+                     |autocmd-events|
+                   • group: (number|nil) autocommand group id, if any
+                   • match: (string) expanded value of ||
+                   • buf: (number) expanded value of ||
+                   • file: (string) expanded value of ||
                    • data: (any) arbitrary data passed to
                      |nvim_exec_autocmds()|
 
@@ -3322,7 +3287,7 @@ nvim_create_autocmd({event}, {*opts})                  *nvim_create_autocmd()*
                    autocommands |autocmd-nested|.
 
     Return: ~
-        Integer id of the created autocommand.
+        Autocommand id (number)
 
     See also: ~
         |autocommand|
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index 9336321d73..ff48ae3e26 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -28,11 +28,9 @@ The Neo bits of Nvim should make it a better Vim, without becoming a
 completely different editor.
 - In matters of taste, prefer Vim/Unix tradition. If there is no relevant
   Vim/Unix tradition, consider the "common case".
-- A feature that people do not know about is a useless feature.  Don't add
-  obscure features, or at least add hints in documentation that they exist.
-- There is no limit to the features that can be added.  Selecting new features
-  is based on (1) what users ask for, (2) how much effort it takes to
-  implement and (3) someone actually implementing it.
+- There is no limit to the features that can be added.  Select new features
+  based on (1) what users ask for, (2) how much effort it takes to implement
+  and (3) someone actually implementing it.
 - Backwards compatibility is a feature.  The RPC API in particular should
   never break.
 
@@ -48,7 +46,7 @@ NVIM IS... WELL DOCUMENTED				*design-documented*
 
 NVIM IS... FAST AND SMALL				*design-speed-size*
 
-Keep Nvim small and fast.
+Keep Nvim small and fast. This directly affects versatility and usability.
 - Computers are becoming faster and bigger each year.  Vim can grow too, but
   no faster than computers are growing.  Keep Vim usable on older systems.
 - Many users start Vim from a shell very often.  Startup time must be short.
@@ -57,7 +55,8 @@ Keep Nvim small and fast.
 - Don't forget that some people use Vim over a slow connection.  Minimize the
   communication overhead.
 - Vim is a component among other components.  Don't turn it into a massive
-  application, but have it work well together with other programs.
+  application, but have it work well together with other programs
+  ("composability").
 
 
 NVIM IS... MAINTAINABLE					*design-maintain*
@@ -250,13 +249,25 @@ vim.paste in runtime/lua/vim/_editor.lua like this: >
 LUA							*dev-lua*
 
 - Keep the core Lua modules |lua-stdlib| simple. Avoid elaborate OOP or
-  pseudo-OOP designs. Plugin authors just want functions to call, they don't
-  want to learn a big, fancy inheritance hierarchy. Thus avoid specialized
-  objects; tables or values are usually better.
+  pseudo-OOP designs. Plugin authors just want functions to call, not a big,
+  fancy inheritance hierarchy.
+- Avoid requiring or returning special objects in the Nvim stdlib. Plain
+  tables or values are easier to serialize, easier to construct from literals,
+  easier to inspect and print, and inherently compatible with all Lua plugins.
+  (This guideline doesn't apply to opaque, non-data objects like `vim.cmd`.)
 
 
 API							*dev-api*
 
+- Avoid "mutually exclusive" parameters--via constraints or limitations, if
+  necessary. For example nvim_create_autocmd() has mutually exclusive
+  "callback" and "command" args; but the "command" arg could be eliminated by
+  simply not supporting Vimscript function names, and treating a string
+  "callback" arg as an Ex command (which can call Vimscript functions). The
+  "buffer" arg could also be eliminated by treating a number "pattern" as
+  a buffer number.
+
+                                                              *dev-api-naming*
 Use this format to name new RPC |API| functions:
 
     nvim_{thing}_{action}_{arbitrary-qualifiers}
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 3cfc3429de..13b953ed60 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -423,9 +423,8 @@ Note that such expressions are only supported in places where a filename is
 expected as an argument to an Ex-command.
 
 							*++opt* *[++opt]*
-The [++opt] argument can be used to force the value of 'fileformat',
-'fileencoding' or 'binary' to a value for one command, and to specify the
-behavior for bad characters.  The form is: >
+The [++opt] argument can be used to set some options for one command, and to
+specify the behavior for bad characters.  The form is: >
 	++{optname}
 Or: >
 	++{optname}={value}
@@ -436,13 +435,11 @@ Where {optname} is one of:	    *++ff* *++enc* *++bin* *++nobin* *++edit*
     bin    or  binary	    sets 'binary'
     nobin  or  nobinary	    resets 'binary'
     bad			    specifies behavior for bad characters
-    edit		    for |:read| only: keep option values as if editing
-			    a file
-    p			    creates the parent directory (or directories) of
-			    a filename if they do not exist
+    edit		    for |:read|: keeps options as if editing a file
+    p			    for |:write|: creates the file's parent directory
 
-{value} cannot contain white space.  It can be any valid value for these
-options.  Examples: >
+{value} cannot contain whitespace.  It can be any valid value for the options.
+Examples: >
 	:e ++ff=unix
 This edits the same file again with 'fileformat' set to "unix". >
 
@@ -452,9 +449,24 @@ This writes the current buffer to "newfile" in latin1 format.
 The message given when writing a file will show "[converted]" when
 'fileencoding' or the value specified with ++enc differs from 'encoding'.
 
-There may be several ++opt arguments, separated by white space.  They must all
+There may be several ++opt arguments, separated by whitespace.  They must all
 appear before any |+cmd| argument.
 
+								*++p*
+The "++p" flag creates the parent directory of the file if it does not exist.
+For example if you edit "foo/bar/file.txt", the ":write ++p" command creates
+"foo/bar/" if necessary before writing the file. >
+
+	:edit foo/bar/file.txt
+	:write ++p
+
+If you want :write (without "++p") to always create missing parent
+directories, add this autocmd to your config: >
+
+	" Auto-create parent directories (except for URIs "://").
+	au BufWritePre,FileWritePre * if @% !~# '\(://\)' | call mkdir(expand(':p:h'), 'p') | endif
+<
+
 								*++bad*
 The argument of "++bad=" specifies what happens with characters that can't be
 converted and illegal bytes.  It can be one of three things:
@@ -895,11 +907,13 @@ Note: When the 'write' option is off, you are not able to write any file.
 					*E502* *E503* *E504* *E505*
 					*E512* *E514* *E667* *E949*
 :w[rite] [++opt]	Write the whole buffer to the current file.  This is
-			the normal way to save changes to a file.  It fails
-			when the 'readonly' option is set or when there is
-			another reason why the file can't be written.
-			For ++opt see |++opt|, but only ++bin, ++nobin, ++ff
-			and ++enc are effective.
+			the normal way to save changes to a file.  Fails when
+			'readonly' is set or when there is another reason why
+			the file can't be written, such as when the parent
+			directory doesn't exist (use |++p| to avoid that).
+			For ++opt see |++opt|, but only ++p, ++bin, ++nobin,
+			++ff and ++enc are effective.
+
 
 :w[rite]! [++opt]	Like ":write", but forcefully write when 'readonly' is
 			set or there is another reason why writing was
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index c989b67b96..61d540a3dd 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1708,13 +1708,13 @@ v:charconvert_to
 
 					*v:cmdarg* *cmdarg-variable*
 v:cmdarg	This variable is used for two purposes:
-		1. The extra arguments given to a file read/write command.
-		   Currently these are "++enc=" and "++ff=".  This variable is
-		   set before an autocommand event for a file read/write
-		   command is triggered.  There is a leading space to make it
-		   possible to append this variable directly after the
-		   read/write command.  Note: The "+cmd" argument isn't
-		   included here, because it will be executed anyway.
+		1. The extra arguments ("++p", "++enc=", "++ff=") given to
+		   a file read/write command.  This is set before an
+		   autocommand event for a file read/write command is
+		   triggered.  There is a leading space to make it possible to
+		   append this variable directly after the read/write command.
+		   Note: "+cmd" isn't included here, because it will be
+		   executed anyway.
 		2. When printing a PostScript file with ":hardcopy" this is
 		   the argument for the ":hardcopy" command.  This can be used
 		   in 'printexpr'.
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 37a0a8c076..89a6e89511 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -325,7 +325,7 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method
       },
     }
 <
-  or if using 'nvim-lspconfig', you can use the {handlers} key of `setup()`:
+  or if using "nvim-lspconfig", you can use the {handlers} key of `setup()`:
   >lua
 
     require('lspconfig').rust_analyzer.setup {
@@ -1340,9 +1340,7 @@ start({bufnr}, {client_id}, {opts})          *vim.lsp.semantic_tokens.start()*
     |vim.lsp.buf_attach_client()|. To opt-out of semantic highlighting with a
     server that supports it, you can delete the semanticTokensProvider table
     from the {server_capabilities} of your client in your |LspAttach| callback
-    or your configuration's `on_attach` callback.
-
-    >lua
+    or your configuration's `on_attach` callback. >lua
 
        client.server_capabilities.semanticTokensProvider = nil
 <
diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt
index 4946779a7c..ef407922da 100644
--- a/runtime/doc/nvim.txt
+++ b/runtime/doc/nvim.txt
@@ -24,8 +24,8 @@ Transitioning from Vim                          *nvim-from-vim*
 
 1. To start the transition, create your |init.vim| (user config) file: >vim
 
-    :call mkdir(stdpath('config'), 'p')
     :exe 'edit '.stdpath('config').'/init.vim'
+    :write ++p
 
 2. Add these contents to the file: >vim
 
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 8f2feb416b..5375d971f0 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -176,7 +176,7 @@ a |provider| which transparently uses shell commands to communicate with the
 system clipboard or any other clipboard "backend".
 
 To ALWAYS use the clipboard for ALL operations (instead of interacting with
-the '+' and/or '*' registers explicitly): >vim
+the "+" and/or "*" registers explicitly): >vim
     set clipboard+=unnamedplus
 
 See 'clipboard' for details and options.
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 6a2e74eaf5..5c1725a1f8 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -127,7 +127,7 @@ nvim_cmdwin:
 ==============================================================================
 3. New Features						       *nvim-features*
 
-MAJOR COMPONENTS ~
+MAJOR COMPONENTS
 
 API				|API|
 Job control			|job-control|
@@ -145,7 +145,7 @@ Terminal emulator		|terminal|
 Vimscript parser		|nvim_parse_expression()|
 XDG base directories		|xdg|
 
-USER EXPERIENCE  ~
+USER EXPERIENCE
 
 Working intuitively and consistently is a major goal of Nvim.
 
@@ -176,7 +176,7 @@ Some features are built in that otherwise required external plugins:
 
 - Highlighting the yanked region, see |lua-highlight|.
 
-ARCHITECTURE ~
+ARCHITECTURE
 
 External plugins run in separate processes. |remote-plugin| This improves
 stability and allows those plugins to work without blocking the editor. Even
@@ -187,7 +187,7 @@ Platform and I/O facilities are built upon libuv. Nvim benefits from libuv
 features and bug fixes, and other projects benefit from improvements to libuv
 by Nvim developers.
 
-FEATURES ~
+FEATURES
 
 Command-line highlighting:
   The expression prompt (|@=|, |c_CTRL-R_=|, |i_CTRL-R_=|) is highlighted
@@ -206,6 +206,7 @@ Commands:
   |:match| can be invoked before highlight group is defined
   |:source| works with Lua
   User commands can support |:command-preview| to show results as you type
+  |:write| with "++p" flag creates parent directories.
 
 Events:
   |RecordingEnter|
@@ -226,6 +227,7 @@ Functions:
   |stdpath()|
   |system()|, |systemlist()| can run {cmd} directly (without 'shell')
   |matchadd()| can be called before highlight group is defined
+  |writefile()| with "p" flag creates parent directories.
 
 Highlight groups:
   |highlight-blend| controls blend level for a highlight group
@@ -277,7 +279,20 @@ Variables:
   |v:windowid| is always available (for use by external UIs)
 
 ==============================================================================
-4. Changed features					 *nvim-features-changed*
+4. Upstreamed features					 *nvim-upstreamed*
+
+These Nvim features were later integrated into Vim.
+
+- 'fillchars' flags: "eob"
+- 'wildoptions' flags: "pum" enables popupmenu for wildmode completion
+- ||
+- |WinClosed|
+- |WinScrolled|
+- |:sign-define| "numhl" argument
+- |:source| works with anonymous (no file) scripts
+
+==============================================================================
+5. Changed features					 *nvim-features-changed*
 
 Nvim always builds with all features, in contrast to Vim which may have
 certain features removed/added at compile-time. |feature-compile|
@@ -499,7 +514,7 @@ Working directory (Vim implemented some of these later than Nvim):
   working directory. Use `getcwd(-1, -1)` to get the global working directory.
 
 ==============================================================================
-5. Missing legacy features				 *nvim-features-missing*
+6. Missing legacy features				 *nvim-features-missing*
 
 Some legacy Vim features are not yet implemented:
 
@@ -512,7 +527,7 @@ Some legacy Vim features are not yet implemented:
 *:gvim*
 
 ==============================================================================
-6. Removed features					 *nvim-features-removed*
+7. Removed features					 *nvim-features-removed*
 
 These Vim features were intentionally removed from Nvim.
 
-- 
cgit 


From 3217a31f9b0eb93a9c4d01f6a15b9a104e4f56f3 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Mon, 12 Dec 2022 06:13:23 +0100
Subject: vim-patch:7db29e4b5c3a (#21380)

* vim-patch:7db29e4b5c3a

Update runtime files

https://github.com/vim/vim/commit/7db29e4b5c3a347d24ca5062ddaa5cf4c4d54b9c

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/options.txt  | 78 +++++++++++++++++++++++++-----------------------
 runtime/doc/quickfix.txt | 15 ++++++++++
 2 files changed, 56 insertions(+), 37 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 2e5381e5fe..b6eb7c57e8 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5563,44 +5563,48 @@ A jump table for the options with a short description can be found at |Q_op|.
 	messages, for example  with CTRL-G, and to avoid some other messages.
 	It is a list of flags:
 	 flag	meaning when present	~
-	  f	use "(3 of 5)" instead of "(file 3 of 5)"
-	  i	use "[noeol]" instead of "[Incomplete last line]"
-	  l	use "999L, 888B" instead of "999 lines, 888 bytes"
-	  m	use "[+]" instead of "[Modified]"
-	  n	use "[New]" instead of "[New File]"
-	  r	use "[RO]" instead of "[readonly]"
-	  w	use "[w]" instead of "written" for file write message
+	  f	use "(3 of 5)" instead of "(file 3 of 5)"		*shm-f*
+	  i	use "[noeol]" instead of "[Incomplete last line]"	*shm-i*
+	  l	use "999L, 888B" instead of "999 lines, 888 bytes"	*shm-l*
+	  m	use "[+]" instead of "[Modified]"			*shm-m*
+	  n	use "[New]" instead of "[New File]"			*shm-n*
+	  r	use "[RO]" instead of "[readonly]"			*shm-r*
+	  w	use "[w]" instead of "written" for file write message	*shm-w*
 		and "[a]" instead of "appended" for ':w >> file' command
-	  x	use "[dos]" instead of "[dos format]", "[unix]" instead of
-		"[unix format]" and "[mac]" instead of "[mac format]".
-	  a	all of the above abbreviations
-
-	  o	overwrite message for writing a file with subsequent message
-		for reading a file (useful for ":wn" or when 'autowrite' on)
-	  O	message for reading a file overwrites any previous message.
-		Also for quickfix message (e.g., ":cn").
-	  s	don't give "search hit BOTTOM, continuing at TOP" or "search
-		hit TOP, continuing at BOTTOM" messages; when using the search
-		count do not show "W" after the count message (see S below)
-	  t	truncate file message at the start if it is too long to fit
-		on the command-line, "<" will appear in the left most column.
-		Ignored in Ex mode.
-	  T	truncate other messages in the middle if they are too long to
-		fit on the command line.  "..." will appear in the middle.
-		Ignored in Ex mode.
-	  W	don't give "written" or "[w]" when writing a file
-	  A	don't give the "ATTENTION" message when an existing swap file
-		is found.
-	  I	don't give the intro message when starting Vim |:intro|.
-	  c	don't give |ins-completion-menu| messages.  For example,
-		"-- XXX completion (YYY)", "match 1 of 2", "The only match",
-		"Pattern not found", "Back at original", etc.
-	  C	don't give messages while scanning for ins-completion items,
-		for instance "scanning tags"
-	  q	use "recording" instead of "recording @a"
-	  F	don't give the file info when editing a file, like `:silent`
-		was used for the command
-	  S     do not show search count message when searching, e.g.
+	  x	use "[dos]" instead of "[dos format]", "[unix]"		*shm-x*
+		instead of "[unix format]" and "[mac]" instead of "[mac
+		format]".
+	  a	all of the above abbreviations				*shm-a*
+
+	  o	overwrite message for writing a file with subsequent	*shm-o*
+		message for reading a file (useful for ":wn" or when
+		'autowrite' on)
+	  O	message for reading a file overwrites any previous	*smh-O*
+		message.  Also for quickfix message (e.g., ":cn").
+	  s	don't give "search hit BOTTOM, continuing at TOP" or	*shm-s*
+		"search hit TOP, continuing at BOTTOM" messages; when using
+		the search count do not show "W" after the count message (see
+		S below)
+	  t	truncate file message at the start if it is too long	*shm-t*
+		to fit on the command-line, "<" will appear in the left most
+		column.  Ignored in Ex mode.
+	  T	truncate other messages in the middle if they are too	*shm-T*
+		long to fit on the command line.  "..." will appear in the
+		middle.  Ignored in Ex mode.
+	  W	don't give "written" or "[w]" when writing a file	*shm-W*
+	  A	don't give the "ATTENTION" message when an existing	*shm-A*
+		swap file is found.
+	  I	don't give the intro message when starting Vim,		*shm-I*
+	  	see |:intro|.
+	  c	don't give |ins-completion-menu| messages.  For		*shm-c*
+		example, "-- XXX completion (YYY)", "match 1 of 2", "The only
+		match", "Pattern not found", "Back at original", etc.
+	  C	don't give messages while scanning for ins-completion	*shm-C*
+		items, for instance "scanning tags"
+	  q	use "recording" instead of "recording @a"		*shm-q*
+	  F	don't give the file info when editing a file, like	*shm-F*
+		`:silent` was used for the command
+	  S     do not show search count message when searching, e.g.	*shm-S*
 	        "[1/5]"
 
 	This gives you the opportunity to avoid that a change between buffers
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 904d3581bb..e79d79ba1b 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1259,6 +1259,21 @@ not "b:current_compiler".  What the command actually does is the following:
 For writing a compiler plugin, see |write-compiler-plugin|.
 
 
+DOTNET							*compiler-dotnet*
+
+The .NET CLI compiler outputs both errors and warnings by default. The output
+may be limited to include only errors, by setting the g:dotnet_errors_only
+variable to |v:true|.
+
+The associated project name is included in each error and warning. To supress
+the project name, set the g:dotnet_show_project_file variable to |v:false|.
+
+Example: limit output to only display errors, and suppress the project name: >
+	let dotnet_errors_only = v:true
+	let dotnet_show_project_file = v:false
+	compiler dotnet
+<
+
 GCC					*quickfix-gcc*	*compiler-gcc*
 
 There's one variable you can set for the GCC compiler:
-- 
cgit 


From 49c240d3a2a783f3b62954d3e9153dbd07eb5f46 Mon Sep 17 00:00:00 2001
From: ii14 <59243201+ii14@users.noreply.github.com>
Date: Mon, 12 Dec 2022 16:15:31 +0100
Subject: docs: add links to extmarks and namespaces (#21378)

Co-authored-by: ii14 
---
 runtime/doc/api.txt | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 6659e9b79b..d555cff443 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -468,7 +468,7 @@ Example: create a float with scratch buffer: >vim
 <
 
 ==============================================================================
-Extended marks                                  *api-extended-marks* *extmarks*
+Extended marks                       *api-extended-marks* *extmarks* *extmark*
 
 Extended marks (extmarks) represent buffer annotations that track text changes
 in the buffer. They can represent cursors, folds, misspelled words, anything
@@ -2485,7 +2485,7 @@ nvim_buf_add_highlight({buffer}, {ns_id}, {hl_group}, {line}, {col_start},
 
                                                   *nvim_buf_clear_namespace()*
 nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end})
-    Clears namespaced objects (highlights, extmarks, virtual text) from a
+    Clears |namespace|d objects (highlights, |extmarks|, virtual text) from a
     region.
 
     Lines are 0-indexed. |api-indexing| To clear the namespace in the entire
@@ -2499,7 +2499,7 @@ nvim_buf_clear_namespace({buffer}, {ns_id}, {line_start}, {line_end})
                       clear to end of buffer.
 
 nvim_buf_del_extmark({buffer}, {ns_id}, {id})         *nvim_buf_del_extmark()*
-    Removes an extmark.
+    Removes an |extmark|.
 
     Parameters: ~
       • {buffer}  Buffer handle, or 0 for current buffer
@@ -2511,7 +2511,7 @@ nvim_buf_del_extmark({buffer}, {ns_id}, {id})         *nvim_buf_del_extmark()*
 
                                                 *nvim_buf_get_extmark_by_id()*
 nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts})
-    Gets the position (0-indexed) of an extmark.
+    Gets the position (0-indexed) of an |extmark|.
 
     Parameters: ~
       • {buffer}  Buffer handle, or 0 for current buffer
@@ -2525,7 +2525,7 @@ nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts})
 
                                                      *nvim_buf_get_extmarks()*
 nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
-    Gets extmarks in "traversal order" from a |charwise| region defined by
+    Gets |extmarks| in "traversal order" from a |charwise| region defined by
     buffer positions (inclusive, 0-indexed |api-indexing|).
 
     Region can be given as (row,col) tuples, or valid extmark ids (whose
@@ -2570,7 +2570,7 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
 
                                                       *nvim_buf_set_extmark()*
 nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
-    Creates or updates an extmark.
+    Creates or updates an |extmark|.
 
     By default a new extmark is created when no id is passed in, but it is
     also possible to create a new mark by passing in a previously unused id or
@@ -2699,19 +2699,19 @@ nvim_create_namespace({name})                        *nvim_create_namespace()*
         Namespace id
 
 nvim_get_namespaces()                                  *nvim_get_namespaces()*
-    Gets existing, non-anonymous namespaces.
+    Gets existing, non-anonymous |namespace|s.
 
     Return: ~
         dict that maps from names to namespace ids.
 
                                               *nvim_set_decoration_provider()*
 nvim_set_decoration_provider({ns_id}, {*opts})
-    Set or change decoration provider for a namespace
+    Set or change decoration provider for a |namespace|
 
     This is a very general purpose interface for having lua callbacks being
     triggered during the redraw code.
 
-    The expected usage is to set extmarks for the currently redrawn buffer.
+    The expected usage is to set |extmarks| for the currently redrawn buffer.
     |nvim_buf_set_extmark()| can be called to add marks on a per-window or
     per-lines basis. Use the `ephemeral` key to only use the mark for the
     current screen redraw (the callback will be called again for the next
-- 
cgit 


From 54d6a32fbdcbd5b26b72f4dca8906e60f5186d2c Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Mon, 12 Dec 2022 20:43:14 +0100
Subject: feat(lsp): highlight semantic token modifiers (#21390)

Apply semantic token modifiers as separate extmarks with corresponding
highlight groups (e.g., `@readonly`). This is a low-effort PR to enable
the most common use cases (applying, e.g., italics or backgrounds on top
of type highlights; language-specific fallbacks like `@global.lua` are
also available). This can be replaced by more complicated selector-style
themes later on.
---
 runtime/doc/lsp.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 89a6e89511..75d5c067b1 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1340,7 +1340,7 @@ start({bufnr}, {client_id}, {opts})          *vim.lsp.semantic_tokens.start()*
     |vim.lsp.buf_attach_client()|. To opt-out of semantic highlighting with a
     server that supports it, you can delete the semanticTokensProvider table
     from the {server_capabilities} of your client in your |LspAttach| callback
-    or your configuration's `on_attach` callback. >lua
+    or your configuration's `on_attach` callback: >lua
 
        client.server_capabilities.semanticTokensProvider = nil
 <
-- 
cgit 


From 0b20762c6042f2bfc5facf05754fd549b95b3cc1 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 13 Dec 2022 09:43:49 +0800
Subject: docs: remove "How-to disable mouse" menu item #21394

---
 runtime/doc/vim_diff.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 5c1725a1f8..229ed95826 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -78,7 +78,6 @@ centralized reference of the differences.
 
 - |g:vimsyn_embed| defaults to "l" to enable Lua highlighting
 
-
 Default Mouse ~
 						*default-mouse* *disable-mouse*
 By default the mouse is enabled, and  opens a |popup-menu| with
@@ -99,7 +98,10 @@ the following:
     \ autocmd CursorMoved * ++once set mouse&
     \ echo 'mouse ON'
 <
-
+To remove the "How-to disable mouse" menu item and the separator above it: >vim
+  aunmenu PopUp.How-to\ disable\ mouse
+  aunmenu PopUp.-1-
+<
 Default Mappings ~
 							*default-mappings*
 Nvim creates the following default mappings at |startup|. You can disable any
-- 
cgit 


From 04da0432446fac57e391c31bd4de0a9c06b1626d Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 10 Dec 2022 13:17:07 +0100
Subject: feat(lsp): add function to get semantic tokens at cursor

---
 runtime/doc/lsp.txt | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 75d5c067b1..32cfbd37eb 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1332,6 +1332,19 @@ force_refresh({bufnr})               *vim.lsp.semantic_tokens.force_refresh()*
     Parameters: ~
       • {bufnr}  (nil|number) default: current buffer
 
+                                        *vim.lsp.semantic_tokens.get_at_pos()*
+get_at_pos({bufnr}, {row}, {col})
+    Return the semantic token(s) at the given position. If called without
+    argument, returns the token under the cursor.
+
+    Parameters: ~
+      • {bufnr}  (number|nil) Buffer number (0 for current buffer, default)
+      • {row}    (number|nil) Position row (default cursor position)
+      • {col}    (number|nil) Position column (default cursor position)
+
+    Return: ~
+        table[]|nil tokens Table of tokens at position
+
 start({bufnr}, {client_id}, {opts})          *vim.lsp.semantic_tokens.start()*
     Start the semantic token highlighting engine for the given buffer with the
     given client. The client must already be attached to the buffer.
-- 
cgit 


From ef91146efcece1b6d97152251e7137d301146189 Mon Sep 17 00:00:00 2001
From: Folke Lemaitre 
Date: Wed, 14 Dec 2022 10:46:54 +0100
Subject: feat: `vim.inspect_pos`, `vim.show_pos`, `:Inspect`

---
 runtime/doc/api.txt  |  2 +-
 runtime/doc/lsp.txt  |  4 ++--
 runtime/doc/lua.txt  | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 runtime/doc/news.txt |  4 ++++
 4 files changed, 57 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index d555cff443..8a33fc58a3 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2683,7 +2683,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
         Id of the created/updated extmark
 
 nvim_create_namespace({name})                        *nvim_create_namespace()*
-    Creates a new *namespace* or gets an existing one.
+    Creates a new namespace or gets an existing one.               *namespace*
 
     Namespaces are used for buffer highlights and virtual text, see
     |nvim_buf_add_highlight()| and |nvim_buf_set_extmark()|.
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 32cfbd37eb..b101740b03 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1335,7 +1335,7 @@ force_refresh({bufnr})               *vim.lsp.semantic_tokens.force_refresh()*
                                         *vim.lsp.semantic_tokens.get_at_pos()*
 get_at_pos({bufnr}, {row}, {col})
     Return the semantic token(s) at the given position. If called without
-    argument, returns the token under the cursor.
+    arguments, returns the token under the cursor.
 
     Parameters: ~
       • {bufnr}  (number|nil) Buffer number (0 for current buffer, default)
@@ -1343,7 +1343,7 @@ get_at_pos({bufnr}, {row}, {col})
       • {col}    (number|nil) Position column (default cursor position)
 
     Return: ~
-        table[]|nil tokens Table of tokens at position
+        (table|nil) List of tokens at position
 
 start({bufnr}, {client_id}, {opts})          *vim.lsp.semantic_tokens.start()*
     Start the semantic token highlighting engine for the given buffer with the
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 5a1c186192..9c98ed7771 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1504,6 +1504,56 @@ schedule_wrap({cb})                                      *vim.schedule_wrap()*
         |vim.in_fast_event()|
 
 
+==============================================================================
+Lua module: inspector                                          *lua-inspector*
+
+inspect_pos({bufnr}, {row}, {col}, {filter})               *vim.inspect_pos()*
+    Get all the items at a given buffer position.
+
+    Can also be pretty-printed with `:Inspect!`.                   *:Inspect!*
+
+    Parameters: ~
+      • {bufnr}   (number|nil) defaults to the current buffer
+      • {row}     (number|nil) row to inspect, 0-based. Defaults to the row of
+                  the current cursor
+      • {col}     (number|nil) col to inspect, 0-based. Defaults to the col of
+                  the current cursor
+      • {filter}  (table|nil) a table with key-value pairs to filter the items
+                  • syntax (boolean): include syntax based highlight groups
+                    (defaults to true)
+                  • treesitter (boolean): include treesitter based highlight
+                    groups (defaults to true)
+                  • extmarks (boolean|"all"): include extmarks. When `all`,
+                    then extmarks without a `hl_group` will also be included
+                    (defaults to true)
+                  • semantic_tokens (boolean): include semantic tokens
+                    (defaults to true)
+
+    Return: ~
+        (table) a table with the following key-value pairs. Items are in
+        "traversal order":
+        • treesitter: a list of treesitter captures
+        • syntax: a list of syntax groups
+        • semantic_tokens: a list of semantic tokens
+        • extmarks: a list of extmarks
+        • buffer: the buffer used to get the items
+        • row: the row used to get the items
+        • col: the col used to get the items
+
+show_pos({bufnr}, {row}, {col}, {filter})                     *vim.show_pos()*
+    Show all the items at a given buffer position.
+
+    Can also be shown with `:Inspect`.                              *:Inspect*
+
+    Parameters: ~
+      • {bufnr}   (number|nil) defaults to the current buffer
+      • {row}     (number|nil) row to inspect, 0-based. Defaults to the row of
+                  the current cursor
+      • {col}     (number|nil) col to inspect, 0-based. Defaults to the col of
+                  the current cursor
+      • {filter}  (table|nil) see |vim.inspect_pos()|
+
+
 
 
 deep_equal({a}, {b})                                        *vim.deep_equal()*
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index bd0d1cfc5b..e5336edb5a 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,10 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items
+  at a given buffer postion. Currently this includes treesitter captures,
+  semantic tokens, syntax groups and extmarks.
+
 • Added support for semantic token highlighting to the LSP client. This
   functionality is enabled by default when a client that supports this feature
   is attached to a buffer. Opt-out can be performed by deleting the
-- 
cgit 


From 23d8f5b870ab2a12882ba20e32d24b31c137f6a9 Mon Sep 17 00:00:00 2001
From: Munif Tanjim 
Date: Mon, 19 Dec 2022 22:33:47 +0600
Subject: feat(exrc): support .nvim.lua (#21436)

---
 runtime/doc/news.txt     | 1 +
 runtime/doc/options.txt  | 2 +-
 runtime/doc/quickref.txt | 2 +-
 runtime/doc/starting.txt | 9 +++++----
 runtime/doc/vim_diff.txt | 4 ++--
 5 files changed, 10 insertions(+), 8 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index e5336edb5a..013089acc7 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -98,6 +98,7 @@ CHANGED FEATURES                                                 *news-changes*
 
 The following changes to existing APIs or features add new behavior.
 
+• 'exrc' now supports `.nvim.lua` file.
 • 'exrc' is no longer marked deprecated.
 
 ==============================================================================
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index b6eb7c57e8..c3bec5a0c1 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2267,7 +2267,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 					*'exrc'* *'ex'* *'noexrc'* *'noex'*
 'exrc' 'ex'		boolean (default off)
 			global
-	Enables the reading of .nvimrc and .exrc files in the current
+	Enables the reading of .nvim.lua, .nvimrc, and .exrc files in the current
 	directory.
 
 	The file is only sourced if the user indicates the file is trusted. If
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 62e7d4c931..5f5ca2af2c 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -698,7 +698,7 @@ Short explanation of each option:		*option-list*
 'errorformat'	  'efm'     description of the lines in the error file
 'eventignore'	  'ei'	    autocommand events that are ignored
 'expandtab'	  'et'	    use spaces when  is inserted
-'exrc'		  'ex'	    read .nvimrc and .exrc in the current directory
+'exrc'		  'ex'	    read init files in the current directory
 'fileencoding'	  'fenc'    file encoding for multibyte text
 'fileencodings'   'fencs'   automatically detected character encodings
 'fileformat'	  'ff'	    file format used for file I/O
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 14543b0a27..1a7b73601e 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -453,10 +453,11 @@ accordingly, proceeding as follows:
 	set or when using $VIMINIT.
 
      c. If the 'exrc' option is on (which is NOT the default), the current
-	directory is searched for two files.  The first that exists is used,
-	the others are ignored.
-	-  The file ".nvimrc"
-	-  The file ".exrc"
+	directory is searched for the following files, in order of precedence:
+	- ".nvim.lua"
+	- ".nvimrc"
+	- ".exrc"
+	The first that exists is used, the others are ignored.
 
 8. Enable filetype detection.
 	This does the same as the command: >
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 229ed95826..46d620e461 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -434,8 +434,8 @@ Options:
   'jumpoptions' "view" tries to restore the |mark-view| when moving through
   the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|.
   'shortmess' the "F" flag does not affect output from autocommands
-  'exrc' searches for ".nvimrc" or ".exrc" files. The user is prompted whether
-  to trust the file.
+  'exrc' searches for ".nvim.lua", ".nvimrc", or ".exrc" files. The user is
+  prompted whether to trust the file.
 
 Shell:
   Shell output (|:!|, |:make|, …) is always routed through the UI, so it
-- 
cgit 


From de90a8bfe5ff4b440597e6d3301bdc3bde01990a Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 20 Dec 2022 11:03:38 +0800
Subject: test(old): make test_signs.vim closer to upstream (#21479)

---
 runtime/doc/sign.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index a2a5645baa..efe0c3390d 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -334,8 +334,10 @@ See |sign_getplaced()| for the equivalent Vim script function.
 :sign place group=* buffer={nr}
 		List signs in all the groups placed in buffer {nr}.
 
+:sign place	List placed signs in the global group in all files.
+
 :sign place group={group}
-		List placed signs in all sign groups in all the files.
+		List placed signs with sign group {group} in all files.
 
 :sign place group=*
 		List placed signs in all sign groups in all files.
@@ -381,15 +383,14 @@ sign_define({list})
 		   icon		full path to the bitmap file for the sign.
 		   linehl	highlight group used for the whole line the
 				sign is placed in.
+		   numhl	highlight group used for the line number where
+				the sign is placed.
 		   text		text that is displayed when there is no icon
 				or the GUI is not being used.
 		   texthl	highlight group used for the text item
 		   culhl	highlight group used for the text item when
 				the cursor is on the same line as the sign and
 				'cursorline' is enabled.
-		   numhl	highlight group used for 'number' column at the
-				associated line. Overrides |hl-LineNr|,
-				|hl-CursorLineNr|.
 
 		If the sign named {name} already exists, then the attributes
 		of the sign are updated.
@@ -431,6 +432,8 @@ sign_getdefined([{name}])				*sign_getdefined()*
 		   linehl	highlight group used for the whole line the
 				sign is placed in; not present if not set.
 		   name		name of the sign
+		   numhl	highlight group used for the line number where
+				the sign is placed; not present if not set.
 		   text		text that is displayed when there is no icon
 				or the GUI is not being used.
 		   texthl	highlight group used for the text item; not
@@ -439,9 +442,6 @@ sign_getdefined([{name}])				*sign_getdefined()*
 				the cursor is on the same line as the sign and
 				'cursorline' is enabled; not present if not
 				set.
-		   numhl	highlight group used for 'number' column at the
-				associated line. Overrides |hl-LineNr|,
-				|hl-CursorLineNr|; not present if not set.
 
 		Returns an empty List if there are no signs and when {name} is
 		not found.
-- 
cgit 


From fb5576c2d36464b55c2c639aec9259a6f2461970 Mon Sep 17 00:00:00 2001
From: Lewis Russell 
Date: Tue, 13 Dec 2022 13:59:31 +0000
Subject: feat(fs): add opts argument to vim.fs.dir()

Added option depth to allow recursively searching a directory tree.
---
 runtime/doc/lua.txt  | 7 ++++++-
 runtime/doc/news.txt | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 5a1c186192..5364477d13 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2245,13 +2245,18 @@ basename({file})                                           *vim.fs.basename()*
     Return: ~
         (string) Basename of {file}
 
-dir({path})                                                     *vim.fs.dir()*
+dir({path}, {opts})                                             *vim.fs.dir()*
     Return an iterator over the files and directories located in {path}
 
     Parameters: ~
       • {path}  (string) An absolute or relative path to the directory to
                 iterate over. The path is first normalized
                 |vim.fs.normalize()|.
+      • {opts}  table|nil Optional keyword arguments:
+                • depth: integer|nil How deep the traverse (default 1)
+                • skip: (fun(dir_name: string): boolean)|nil Predicate to
+                  control traversal. Return false to stop searching the
+                  current directory. Only useful when depth > 1
 
     Return: ~
         Iterator over files and directories in {path}. Each iteration yields
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index bd0d1cfc5b..9c9b616913 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -73,6 +73,9 @@ The following new APIs or features were added.
   Similarly, the `virtual_text` configuration in |vim.diagnostic.config()| now
   has a `suffix` option which does nothing by default.
 
+• |vim.fs.dir()| now has a `opts` argument with a depth field to allow
+  recursively searching a directory tree.
+
 • |vim.secure.read()| reads a file and prompts the user if it should be
   trusted and, if so, returns the file's contents.
 
-- 
cgit 


From b42d8a43b9f1b3316e73108ebefc4850b1a2c65b Mon Sep 17 00:00:00 2001
From: bfredl 
Date: Fri, 16 Dec 2022 13:50:12 +0100
Subject: refactor(tui): use nvim_echo() for verbose terminfo

This is needed for #18375 for the obvious reasons.
note: verbose_terminfo_event is only temporarily needed
until the full TUI process refactor is merged.
---
 runtime/doc/api.txt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 8a33fc58a3..3cd4578750 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -717,7 +717,7 @@ nvim_del_var({name})                                          *nvim_del_var()*
     Parameters: ~
       • {name}  Variable name
 
-nvim_echo({chunks}, {history}, {opts})                           *nvim_echo()*
+nvim_echo({chunks}, {history}, {*opts})                          *nvim_echo()*
     Echo a message.
 
     Parameters: ~
@@ -725,7 +725,11 @@ nvim_echo({chunks}, {history}, {opts})                           *nvim_echo()*
                    chunk with specified highlight. `hl_group` element can be
                    omitted for no highlight.
       • {history}  if true, add to |message-history|.
-      • {opts}     Optional parameters. Reserved for future use.
+      • {opts}     Optional parameters.
+                   • verbose: Message was printed as a result of 'verbose'
+                     option if Nvim was invoked with -V3log_file, the message
+                     will be redirected to the log_file and surpressed from
+                     direct output.
 
 nvim_err_write({str})                                       *nvim_err_write()*
     Writes a message to the Vim error buffer. Does not append "\n", the
-- 
cgit 


From 5b89d480e30367259f82680945572b1406219da5 Mon Sep 17 00:00:00 2001
From: Luuk van Baal 
Date: Thu, 15 Dec 2022 21:23:28 +0100
Subject: vim-patch:9.0.1061: cannot display 'showcmd' somewhere else

Problem:    Cannot display 'showcmd' somewhere else.
Solution:   Add the 'showcmdloc' option. (Luuk van Baal, closes vim/vim#11684)

https://github.com/vim/vim/commit/ba936f6f4e85cc1408bc3967f9fd7665d948909b

Co-authored-by: Luuk van Baal 
---
 runtime/doc/news.txt    |  7 ++++++-
 runtime/doc/options.txt | 18 +++++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 2ce0bd4de2..d6f6464f78 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -86,7 +86,12 @@ The following new APIs or features were added.
 • When using Nvim inside tmux 3.2 or later, the default clipboard provider
   will now copy to the system clipboard. |provider-clipboard|
 
-• 'splitkeep' option to control the scroll behavior of horizontal splits.
+• |'showcmdloc'| option to display the 'showcmd' information in the
+  status line or tab line. A new %S statusline item is available to place
+  the 'showcmd' text in a custom 'statusline'. Useful for when |'cmdheight'|
+  is set to 0.
+
+• |'splitkeep'| option to control the scroll behavior of horizontal splits.
 
 • |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index c3bec5a0c1..b0c4193927 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5641,7 +5641,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 			global
 	Show (partial) command in the last line of the screen.  Set this
 	option off if your terminal is slow.
-	The option has no effect when 'cmdheight' is zero.
 	In Visual mode the size of the selected area is shown:
 	- When selecting characters within a line, the number of characters.
 	  If the number of bytes is different it is also displayed: "2-6"
@@ -5649,6 +5648,22 @@ A jump table for the options with a short description can be found at |Q_op|.
 	- When selecting more than one line, the number of lines.
 	- When selecting a block, the size in screen characters:
 	  {lines}x{columns}.
+	This information can be displayed in an alternative location using the
+	'showcmdloc' option, useful when 'cmdheight' is 0.
+
+			*'showcmdloc'* *'sloc'*
+'showcmdloc' 'sloc'	string	(default "last")
+	This option can be used to display the (partially) entered command in
+	another location.  Possible values are:
+	  last		Last line of the screen (default).
+	  statusline	Status line of the current window.
+	  tabline	First line of the screen if 'showtabline' is enabled.
+	Setting this option to "statusline" or "tabline" means that these will
+	be redrawn whenever the command changes, which can be on every key
+	pressed.
+	The %S 'statusline' item can be used in 'statusline' or 'tabline' to
+	place the text.  Without a custom 'statusline' or 'tabline' it will be
+	displayed in a convenient location.
 
 			*'showfulltag'* *'sft'* *'noshowfulltag'* *'nosft'*
 'showfulltag' 'sft'	boolean (default off)
@@ -6120,6 +6135,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	P S   Percentage through file of displayed window.  This is like the
 	      percentage described for 'ruler'.  Always 3 in length, unless
 	      translated.
+	S S   'showcmd' content, see 'showcmdloc'.
 	a S   Argument list status as in default title.  ({current} of {max})
 	      Empty if the argument file count is zero or one.
 	{ NF  Evaluate expression between '%{' and '}' and substitute result.
-- 
cgit 


From d215dae0e0908d464d70e5645f3e2690bd9caf60 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 27 Dec 2022 13:22:33 +0100
Subject: docs(lua): add `vim.json` (#21538)

---
 runtime/doc/lua.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 1459392a81..25d7fa2f35 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -714,6 +714,22 @@ vim.mpack.encode({obj})                                     *vim.mpack.encode*
 vim.mpack.decode({str})                                     *vim.mpack.decode*
     Decodes (or "unpacks") the msgpack-encoded {str} to a Lua object.
 
+------------------------------------------------------------------------------
+VIM.JSON                                                            *lua-json*
+
+The *vim.json* module provides encoding and decoding of Lua objects to and
+from JSON-encoded strings. Supports |vim.NIL| and |vim.empty_dict()|.
+
+vim.json.encode({obj})                                       *vim.json.encode*
+    Encodes (or "packs") Lua object {obj} as JSON in a Lua string.
+
+vim.json.decode({str}[, {opts}])                             *vim.json.decode*
+    Decodes (or "unpacks") the JSON-encoded {str} to a Lua object.
+
+    {opts} is a table with the key `luanil = { object: bool, array: bool }`
+    that controls whether `null` in JSON objects or arrays should be converted
+    to Lua `nil` instead of `vim.NIL`.
+
 ------------------------------------------------------------------------------
 VIM.SPELL                                                          *lua-spell*
 
-- 
cgit 


From e6cae44cbf44d623bc89eb3323da043249c0f052 Mon Sep 17 00:00:00 2001
From: Oliver Marriott 
Date: Thu, 29 Dec 2022 03:01:40 +1100
Subject: feat(highlight): add DiagnosticOk (and associated) highlight groups
 (#21286)

The existing groups, Error, Hint, Info, Warn cover many use cases, but
neglect the occasion where a diagnostic message should communicate a
non-informative (not a Hint or Info) event. DiagnosticOk covers this
with a generic green colorscheme.
---
 runtime/doc/diagnostic.txt | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 457a41dc08..66ac2170e3 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -206,6 +206,11 @@ DiagnosticInfo
 
                                                         *hl-DiagnosticHint*
 DiagnosticHint
+    Used as the base highlight group.
+    Other Diagnostic highlights link to this by default (except Underline)
+
+                                                        *hl-DiagnosticOk*
+DiagnosticOk
     Used as the base highlight group.
     Other Diagnostic highlights link to this by default (except Underline)
 
@@ -225,6 +230,10 @@ DiagnosticVirtualTextInfo
 DiagnosticVirtualTextHint
     Used for "Hint" diagnostic virtual text.
 
+                                                *hl-DiagnosticVirtualTextOk*
+DiagnosticVirtualTextOk
+    Used for "Ok" diagnostic virtual text.
+
                                                 *hl-DiagnosticUnderlineError*
 DiagnosticUnderlineError
     Used to underline "Error" diagnostics.
@@ -241,6 +250,10 @@ DiagnosticUnderlineInfo
 DiagnosticUnderlineHint
     Used to underline "Hint" diagnostics.
 
+                                                *hl-DiagnosticUnderlineOk*
+DiagnosticUnderlineOk
+    Used to underline "Ok" diagnostics.
+
                                                 *hl-DiagnosticFloatingError*
 DiagnosticFloatingError
     Used to color "Error" diagnostic messages in diagnostics float.
@@ -258,6 +271,10 @@ DiagnosticFloatingInfo
 DiagnosticFloatingHint
     Used to color "Hint" diagnostic messages in diagnostics float.
 
+                                                *hl-DiagnosticFloatingOk*
+DiagnosticFloatingOk
+    Used to color "Ok" diagnostic messages in diagnostics float.
+
                                                 *hl-DiagnosticSignError*
 DiagnosticSignError
     Used for "Error" signs in sign column.
@@ -274,6 +291,10 @@ DiagnosticSignInfo
 DiagnosticSignHint
     Used for "Hint" signs in sign column.
 
+                                                *hl-DiagnosticSignOk*
+DiagnosticSignOk
+    Used for "Ok" signs in sign column.
+
 ==============================================================================
 SIGNS                                                   *diagnostic-signs*
 
-- 
cgit 


From 587fbdd7a0fdd8987e63d2932837c1ec19d5fb49 Mon Sep 17 00:00:00 2001
From: Ryan Mehri <52933714+rmehri01@users.noreply.github.com>
Date: Wed, 28 Dec 2022 20:41:26 -0800
Subject: docs: fix order of numbers in syntax.txt (#21581)

---
 runtime/doc/syntax.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 3cd36f7652..e8f0924cb4 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -4851,7 +4851,7 @@ Note that the ":syntax" command can be abbreviated to ":sy", although ":syn"
 is mostly used, because it looks better.
 
 ==============================================================================
-12. Highlight command			*:highlight* *:hi* *E28* *E411* *E415*
+13. Highlight command			*:highlight* *:hi* *E28* *E411* *E415*
 
 There are two types of highlight groups:
 - The built-in |highlight-groups|.
@@ -5333,7 +5333,7 @@ Tooltip		Current font, background and foreground of the tooltips.
 		Applicable highlight arguments: font, guibg, guifg.
 
 ==============================================================================
-13. Linking groups		*:hi-link* *:highlight-link* *E412* *E413*
+14. Linking groups		*:hi-link* *:highlight-link* *E412* *E413*
 
 When you want to use the same highlighting for several syntax groups, you
 can do this more easily by linking the groups into one common highlight
@@ -5492,7 +5492,7 @@ is loaded into that window or the file is reloaded.
 When splitting the window, the new window will use the original syntax.
 
 ==============================================================================
-17. Color xterms				*xterm-color* *color-xterm*
+18. Color xterms				*xterm-color* *color-xterm*
 
 							*colortest.vim*
 To test your color setup, a file has been included in the Vim distribution.
@@ -5502,7 +5502,7 @@ To use it, execute this command: >
 Nvim uses 256-color and |true-color| terminal capabilities wherever possible.
 
 ==============================================================================
-18. When syntax is slow						*:syntime*
+19. When syntax is slow						*:syntime*
 
 This is aimed at authors of a syntax file.
 
-- 
cgit 


From b49599ce7e6582a2324353baf996c84d084e8a46 Mon Sep 17 00:00:00 2001
From: Sean <44933921+seantwie03@users.noreply.github.com>
Date: Fri, 30 Dec 2022 10:55:38 -0600
Subject: docs: clarify line about converse of lua-heredoc (#21592)

Co-authored-by: sean.twie03 
---
 runtime/doc/lua-guide.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt
index e96345cda6..b0b2857300 100644
--- a/runtime/doc/lua-guide.txt
+++ b/runtime/doc/lua-guide.txt
@@ -199,8 +199,8 @@ this allows you to pass multiple commands to a single call of |vim.cmd()|:
       highlight link Warning Error
     ]])
 <
-This is the converse of |lua-heredoc| and allows you to include Lua code in
-your `init.vim`.
+This is the converse of |lua-heredoc| and allows you to include Vimscript code in
+your `init.lua`.
 
 If you want to build your Vim command programmatically, the following form can
 be useful (all these are equivalent to the corresponding line above):
-- 
cgit 


From 24488169564c39a506c235bf6a33b8e23a8cb528 Mon Sep 17 00:00:00 2001
From: hlpr98 
Date: Mon, 27 May 2019 22:04:24 +0530
Subject: feat(tui): run TUI as external process

---
 runtime/doc/starting.txt | 4 ++++
 runtime/doc/ui.txt       | 2 ++
 2 files changed, 6 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 1a7b73601e..24d22c62f8 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -384,6 +384,10 @@ argument.
 		Start |RPC| server on pipe or TCP address {addr}. Sets the
 		primary listen address |v:servername| to {addr}. |serverstart()|
 
+--connect {addr}					 *--connect*
+		Connect to the remote nvim server instance which is listening to 
+		{addr}. {addr} can be either a pipe or a TCP address.
+
 ==============================================================================
 Initialization					*initialization* *startup*
 
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index 1cffe1f902..1b699cf0a9 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -56,6 +56,8 @@ with these (optional) keys:
 - `stdin_fd`		Read buffer from `fd` as if it was a stdin pipe
 			This option can only used by |--embed| ui,
 			see |ui-startup-stdin|.
+	`term_ttyin`		Tells if `stdin` is a `tty` or not.
+	`term_ttyout`		Tells if `stdout` is a `tty` or not.
 
 Specifying an unknown option is an error; UIs can check the |api-metadata|
 `ui_options` key for supported options.
-- 
cgit 


From 43e8ec92de9e0850e7d202cb7ff9051bc408447e Mon Sep 17 00:00:00 2001
From: bfredl 
Date: Mon, 2 May 2022 21:10:01 +0200
Subject: fix(tui): more work in the TUI

---
 runtime/doc/api.txt      | 6 ++++++
 runtime/doc/news.txt     | 9 +++++++++
 runtime/doc/remote.txt   | 4 ++++
 runtime/doc/starting.txt | 4 ----
 runtime/doc/ui.txt       | 4 ++--
 5 files changed, 21 insertions(+), 6 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 3cd4578750..26679f0330 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3471,6 +3471,12 @@ nvim_ui_pum_set_height({height})                    *nvim_ui_pum_set_height()*
     Parameters: ~
       • {height}  Popupmenu height, must be greater than zero.
 
+nvim_ui_set_focus({gained})                              *nvim_ui_set_focus()*
+    Tells the nvim server if focus was gained or lost by the GUI.
+
+    Attributes: ~
+        |RPC| only
+
 nvim_ui_set_option({name}, {value})                     *nvim_ui_set_option()*
     TODO: Documentation
 
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index d6f6464f78..f5ebacdf98 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -101,6 +101,11 @@ The following new APIs or features were added.
 
   See https://github.com/neovim/neovim/pull/14537.
 
+• |--remote-ui| option was added to connect to a remote instance and display
+  in it in a |TUI| in the local terminal. This can be used run a headless nvim
+  instance in the background and display its UI on demand, which previously
+  only was possible usiing a external UI implementation.
+
 ==============================================================================
 CHANGED FEATURES                                                 *news-changes*
 
@@ -109,6 +114,10 @@ The following changes to existing APIs or features add new behavior.
 • 'exrc' now supports `.nvim.lua` file.
 • 'exrc' is no longer marked deprecated.
 
+• The |TUI| is changed to run in a separate process (previously, a separate
+  thread was used). This is not supposed to be a visible change to the user,
+  but might be the cause of subtle changes of behavior and bugs.
+
 ==============================================================================
 REMOVED FEATURES                                                 *news-removed*
 
diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt
index 0c1e3438de..4610088ab0 100644
--- a/runtime/doc/remote.txt
+++ b/runtime/doc/remote.txt
@@ -52,6 +52,10 @@ The following command line arguments are available:
 								*--remote-expr*
    --remote-expr {expr}		Evaluate {expr} in server and print the result
 				on stdout.
+								*--remote-ui*
+   --remote-ui			Display the UI of the server in the terminal.
+				Fully interactive: keyboard and mouse input
+				are forwarded to the server.
 								*--server*
    --server {addr}		Connect to the named pipe or socket at the
 				given address for executing remote commands.
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 24d22c62f8..1a7b73601e 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -384,10 +384,6 @@ argument.
 		Start |RPC| server on pipe or TCP address {addr}. Sets the
 		primary listen address |v:servername| to {addr}. |serverstart()|
 
---connect {addr}					 *--connect*
-		Connect to the remote nvim server instance which is listening to 
-		{addr}. {addr} can be either a pipe or a TCP address.
-
 ==============================================================================
 Initialization					*initialization* *startup*
 
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index 1b699cf0a9..a2ae9f22ce 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -56,8 +56,8 @@ with these (optional) keys:
 - `stdin_fd`		Read buffer from `fd` as if it was a stdin pipe
 			This option can only used by |--embed| ui,
 			see |ui-startup-stdin|.
-	`term_ttyin`		Tells if `stdin` is a `tty` or not.
-	`term_ttyout`		Tells if `stdout` is a `tty` or not.
+	`stdin_tty`		Tells if `stdin` is a `tty` or not.
+	`stdout_tty`		Tells if `stdout` is a `tty` or not.
 
 Specifying an unknown option is an error; UIs can check the |api-metadata|
 `ui_options` key for supported options.
-- 
cgit 


From 9fdcbbb4063daa125e420e0ffe9dae6801c264bc Mon Sep 17 00:00:00 2001
From: bfredl 
Date: Tue, 27 Dec 2022 14:43:03 +0100
Subject: feat(tui): graduate the +tui feature

This was previously disabled due to build issues on windows.
Any reasonable platform can now be expected to have the necessary
interfaces to build and run the TUI subsystem.

Runtime quality issues of using the TUI (on any new platform) are not
relevant here. Just run Nvim in an external UI instead of the TUI as always.
---
 runtime/doc/news.txt | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index f5ebacdf98..25e753aaed 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -118,6 +118,10 @@ The following changes to existing APIs or features add new behavior.
   thread was used). This is not supposed to be a visible change to the user,
   but might be the cause of subtle changes of behavior and bugs.
 
+  Previously, the TUI could be disabled as a build time feature (+tui/-tui),
+  resulting in a nvim binary which only could be run headless or embedded
+  in an external process. As of this version, TUI is always avalibale.
+
 ==============================================================================
 REMOVED FEATURES                                                 *news-removed*
 
-- 
cgit 


From 6ba34e21fee2a81677e8261dfeaf24c8cd320500 Mon Sep 17 00:00:00 2001
From: Mathias Fußenegger 
Date: Sat, 31 Dec 2022 16:16:21 +0100
Subject: feat(lsp): add function to clear codelens (#21504)

Currently once you retrieve the lenses you're pretty much stuck with
them as saving new lenses is additive.

Adding a dedicated method to reset lenses allows users to toggle lenses
on/off which can be useful for language servers where they are noisy or
expensive and you only want to see them temporary.
---
 runtime/doc/lsp.txt  | 7 +++++++
 runtime/doc/news.txt | 2 ++
 2 files changed, 9 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index b101740b03..705d7675e5 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1278,6 +1278,13 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config})
 ==============================================================================
 Lua module: vim.lsp.codelens                                    *lsp-codelens*
 
+clear({client_id}, {bufnr})                         *vim.lsp.codelens.clear()*
+    Clear the lenses
+
+    Parameters: ~
+      • {client_id}  (number|nil) filter by client_id. All clients if nil
+      • {bufnr}      (number|nil) filter by buffer. All buffers if nil
+
 display({lenses}, {bufnr}, {client_id})           *vim.lsp.codelens.display()*
     Display the lenses using virtual text
 
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 25e753aaed..1a242e9128 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -39,6 +39,8 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• Added a |vim.lsp.codelens.clear()| function to clear codelenses.
+
 • |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items
   at a given buffer postion. Currently this includes treesitter captures,
   semantic tokens, syntax groups and extmarks.
-- 
cgit 


From c4942880be0521673548c48bf61c1eac6bd37036 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sun, 1 Jan 2023 15:00:39 +0100
Subject: vim-patch:partial:f1dcd14fc5d4 (#21602)

Update runtime files

https://github.com/vim/vim/commit/f1dcd14fc5d4370476cd82895a4479ca2d252e54

missing autocmd blocks and getscriptinfo()

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/diff.txt     |  4 ++++
 runtime/doc/options.txt  | 19 ++++++++++---------
 runtime/doc/quickref.txt |  3 ++-
 runtime/doc/sign.txt     |  6 +++---
 runtime/doc/syntax.txt   |  2 +-
 5 files changed, 20 insertions(+), 14 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index f38f123393..382d025d3c 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -137,6 +137,10 @@ Otherwise they are set to their default value:
 	'foldmethod'	"manual"
 	'foldcolumn'	0
 
+'foldenable' will most-likely be reset to off.  That is when 'foldmethod' is
+restored to "manual".  The folds themselves are not cleared but they should
+not show up, resetting 'foldenable' is the best way to do that.
+
 ==============================================================================
 2. Viewing diffs						*view-diffs*
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index b0c4193927..657d4bc06e 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5573,30 +5573,30 @@ A jump table for the options with a short description can be found at |Q_op|.
 		and "[a]" instead of "appended" for ':w >> file' command
 	  x	use "[dos]" instead of "[dos format]", "[unix]"		*shm-x*
 		instead of "[unix format]" and "[mac]" instead of "[mac
-		format]".
+		format]"
 	  a	all of the above abbreviations				*shm-a*
 
 	  o	overwrite message for writing a file with subsequent	*shm-o*
 		message for reading a file (useful for ":wn" or when
 		'autowrite' on)
-	  O	message for reading a file overwrites any previous	*smh-O*
-		message.  Also for quickfix message (e.g., ":cn").
+	  O	message for reading a file overwrites any previous	*shm-O*
+		message;  also for quickfix message (e.g., ":cn")
 	  s	don't give "search hit BOTTOM, continuing at TOP" or	*shm-s*
 		"search hit TOP, continuing at BOTTOM" messages; when using
 		the search count do not show "W" after the count message (see
 		S below)
 	  t	truncate file message at the start if it is too long	*shm-t*
 		to fit on the command-line, "<" will appear in the left most
-		column.  Ignored in Ex mode.
+		column; ignored in Ex mode
 	  T	truncate other messages in the middle if they are too	*shm-T*
-		long to fit on the command line.  "..." will appear in the
-		middle.  Ignored in Ex mode.
+		long to fit on the command line; "..." will appear in the
+		middle; ignored in Ex mode
 	  W	don't give "written" or "[w]" when writing a file	*shm-W*
 	  A	don't give the "ATTENTION" message when an existing	*shm-A*
-		swap file is found.
+		swap file is found
 	  I	don't give the intro message when starting Vim,		*shm-I*
-	  	see |:intro|.
-	  c	don't give |ins-completion-menu| messages.  For		*shm-c*
+	  	see |:intro|
+	  c	don't give |ins-completion-menu| messages; for		*shm-c*
 		example, "-- XXX completion (YYY)", "match 1 of 2", "The only
 		match", "Pattern not found", "Back at original", etc.
 	  C	don't give messages while scanning for ins-completion	*shm-C*
@@ -5653,6 +5653,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 
 			*'showcmdloc'* *'sloc'*
 'showcmdloc' 'sloc'	string	(default "last")
+			global
 	This option can be used to display the (partially) entered command in
 	another location.  Possible values are:
 	  last		Last line of the screen (default).
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 5f5ca2af2c..da136ade16 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -868,7 +868,8 @@ Short explanation of each option:		*option-list*
 'shiftwidth'	  'sw'	    number of spaces to use for (auto)indent step
 'shortmess'	  'shm'     list of flags, reduce length of messages
 'showbreak'	  'sbr'     string to use at the start of wrapped lines
-'showcmd'	  'sc'	    show (partial) command in status line
+'showcmd'	  'sc'	    show (partial) command somewhere
+'showcmdloc'	  'sloc'    where to show (partial) command
 'showfulltag'	  'sft'     show full tag pattern when completing tag
 'showmatch'	  'sm'	    briefly jump to matching bracket if insert one
 'showmode'	  'smd'     message on status line to show current mode
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index efe0c3390d..d09d0f226f 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -606,9 +606,9 @@ sign_placelist({list})
 				then a new unique identifier is allocated.
 				Otherwise the specified number is used. See
 				|sign-identifier| for more information.
-		    lnum	line number in the buffer {buf} where the
-				sign is to be placed. For the accepted values,
-				see |line()|.
+		    lnum	line number in the buffer where the sign is to
+				be placed. For the accepted values, see
+				|line()|.
 		    name	name of the sign to place. See |sign_define()|
 		    		for more information.
 		    priority	priority of the sign. When multiple signs are
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index e8f0924cb4..49ca7e38f6 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -4902,7 +4902,7 @@ in their own color.
 
 						*highlight-clear* *:hi-clear*
 :hi[ghlight] clear	Reset all highlighting to the defaults.  Removes all
-			highlighting for groups added by the user!
+			highlighting for groups added by the user.
 			Uses the current value of 'background' to decide which
 			default colors to use.
 			If there was a default link, restore it. |:hi-link|
-- 
cgit 


From 18c22a6fb4c2526c996452215abd62a6a2abe781 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Wed, 28 Dec 2022 13:39:39 +0100
Subject: docs: fix treesitter parsing errors

---
 runtime/doc/builtin.txt  | 26 +++++++++----------
 runtime/doc/editing.txt  | 28 ++++++++++----------
 runtime/doc/eval.txt     | 51 +++++++++++++++++++++---------------
 runtime/doc/ft_sql.txt   | 67 +++++++++++++++++++++++++++---------------------
 runtime/doc/gui.txt      | 16 ++++++------
 runtime/doc/hebrew.txt   | 16 +++++++-----
 runtime/doc/helphelp.txt |  2 +-
 runtime/doc/indent.txt   | 63 ++++++++++++++++++++-------------------------
 runtime/doc/insert.txt   |  7 ++---
 runtime/doc/intro.txt    | 26 +++++++++----------
 runtime/doc/map.txt      |  4 +--
 runtime/doc/mbyte.txt    |  4 +--
 runtime/doc/motion.txt   | 14 +++++-----
 runtime/doc/options.txt  | 44 +++++++++++++++----------------
 runtime/doc/pi_netrw.txt | 22 ++++++++--------
 runtime/doc/pi_spec.txt  |  8 +++---
 runtime/doc/quickfix.txt |  7 ++---
 runtime/doc/rileft.txt   | 17 +++++++-----
 runtime/doc/starting.txt |  6 ++---
 runtime/doc/syntax.txt   |  4 +--
 runtime/doc/tagsrch.txt  | 20 +++++++--------
 runtime/doc/tips.txt     |  2 +-
 runtime/doc/userfunc.txt |  1 -
 runtime/doc/windows.txt  |  4 +--
 24 files changed, 240 insertions(+), 219 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index f9917ed035..cc1d1b568d 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -68,8 +68,8 @@ bufnr([{expr} [, {create}]])	Number	Number of the buffer {expr}
 bufwinid({expr})		Number	|window-ID| of buffer {expr}
 bufwinnr({expr})		Number	window number of buffer {expr}
 byte2line({byte})		Number	line number at byte count {byte}
-byteidx({expr}, {nr})		Number	byte index of {nr}'th char in {expr}
-byteidxcomp({expr}, {nr})	Number	byte index of {nr}'th char in {expr}
+byteidx({expr}, {nr})		Number	byte index of {nr}th char in {expr}
+byteidxcomp({expr}, {nr})	Number	byte index of {nr}th char in {expr}
 call({func}, {arglist} [, {dict}])
 				any	call {func} with arguments {arglist}
 ceil({expr})			Float	round {expr} up
@@ -318,9 +318,9 @@ matchfuzzypos({list}, {str} [, {dict}])
 matchlist({expr}, {pat} [, {start} [, {count}]])
 				List	match and submatches of {pat} in {expr}
 matchstr({expr}, {pat} [, {start} [, {count}]])
-				String	{count}'th match of {pat} in {expr}
+				String	{count}th match of {pat} in {expr}
 matchstrpos({expr}, {pat} [, {start} [, {count}]])
-				List	{count}'th match of {pat} in {expr}
+				List	{count}th match of {pat} in {expr}
 max({expr})			Number	maximum value of items in {expr}
 menu_get({path} [, {modes}])	List	description of |menus| matched by {path}
 menu_info({name} [, {mode}])	Dict	get menu item information
@@ -956,7 +956,7 @@ byte2line({byte})					*byte2line()*
 			GetOffset()->byte2line()
 
 byteidx({expr}, {nr})					*byteidx()*
-		Return byte index of the {nr}'th character in the String
+		Return byte index of the {nr}th character in the String
 		{expr}.  Use zero for the first character, it then returns
 		zero.
 		If there are no multibyte characters the returned value is
@@ -1508,7 +1508,7 @@ debugbreak({pid})					*debugbreak()*
 		Specifically used to interrupt a program being debugged.  It
 		will cause process {pid} to get a SIGTRAP.  Behavior for other
 		processes is undefined. See |terminal-debug|.
-		{Sends a SIGINT to a process {pid} other than MS-Windows}
+		(Sends a SIGINT to a process {pid} other than MS-Windows)
 
 		Returns |TRUE| if successfully interrupted the program.
 		Otherwise returns |FALSE|.
@@ -1597,9 +1597,9 @@ dictwatcheradd({dict}, {pattern}, {callback})		      *dictwatcheradd()*
 			call dictwatcheradd(g:, '*', 'OnDictChanged')
 <
 		For now {pattern} only accepts very simple patterns that can
-		contain a '*' at the end of the string, in which case it will
-		match every key that begins with the substring before the '*'.
-		That means if '*' is not the last character of {pattern}, only
+		contain a "*" at the end of the string, in which case it will
+		match every key that begins with the substring before the "*".
+		That means if "*" is not the last character of {pattern}, only
 		keys that are exactly equal as {pattern} will be matched.
 
 		The {callback} receives three arguments:
@@ -4956,7 +4956,7 @@ match({expr}, {pat} [, {start} [, {count}]])			*match()*
 		If {start} is out of range ({start} > strlen({expr}) for a
 		String or {start} > len({expr}) for a |List|) -1 is returned.
 
-		When {count} is given use the {count}'th match.  When a match
+		When {count} is given use the {count}th match.  When a match
 		is found in a String the search for the next one starts one
 		character further.  Thus this example results in 1: >
 			echo match("testing", "..", 0, 2)
@@ -5186,7 +5186,7 @@ matchfuzzy({list}, {str} [, {dict}])			*matchfuzzy()*
 		   :let l = readfile("buffer.c")->matchfuzzy("str")
 <		results in a list of lines in "buffer.c" fuzzy matching "str". >
 		   :echo ['one two', 'two one']->matchfuzzy('two one')
-<		results in ['two one', 'one two']. >
+<		results in `['two one', 'one two']` . >
 		   :echo ['one two', 'two one']->matchfuzzy('two one',
 						\ {'matchseq': 1})
 <		results in ['two one'].
@@ -6683,7 +6683,7 @@ searchcount([{options}])					*searchcount()*
 		  pos		|List|		`[lnum, col, off]` value
 						when recomputing the result.
 						this changes "current" result
-						value. see |cursor()|, |getpos()
+						value. see |cursor()|, |getpos()|
 						(default: cursor's position)
 
 		Can also be used as a |method|: >
@@ -8147,7 +8147,7 @@ strwidth({string})					*strwidth()*
 submatch({nr} [, {list}])			*submatch()* *E935*
 		Only for an expression in a |:substitute| command or
 		substitute() function.
-		Returns the {nr}'th submatch of the matched text.  When {nr}
+		Returns the {nr}th submatch of the matched text.  When {nr}
 		is 0 the whole matched text is returned.
 		Note that a NL in the string can stand for a line break of a
 		multi-line match or a NUL character in the text.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 13b953ed60..f77db5fab3 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -345,9 +345,9 @@ escaped with a backslash.
 Wildcards in {file} are expanded, but as with file completion, 'wildignore'
 and 'suffixes' apply.  Which wildcards are supported depends on the system.
 These are the common ones:
-	?	matches one character
-	*	matches anything, including nothing
-	**	matches anything, including nothing, recurses into directories
+	`?`	matches one character
+	`*`	matches anything, including nothing
+	`**`	matches anything, including nothing, recurses into directories
 	[abc]	match 'a', 'b' or 'c'
 
 To avoid the special meaning of the wildcards prepend a backslash.  However,
@@ -406,7 +406,7 @@ external command, by putting an equal sign right after the first backtick,
 e.g.: >
 	:e `=tempname()`
 The expression can contain just about anything, thus this can also be used to
-avoid the special meaning of '"', '|', '%' and '#'.  However, 'wildignore'
+avoid the special meaning of '"', "|", '%' and '#'.  However, 'wildignore'
 does apply like to other wildcards.
 
 Environment variables in the expression are expanded when evaluating the
@@ -894,7 +894,7 @@ changed.  This is done for all *.c files.
 Example: >
 	:args *.[ch]
 	:argdo %s/\/My_Foo/ge | update
-This changes the word "my_foo" to "My_Foo" in all *.c and *.h files.  The "e"
+This changes the word "my_foo" to "My_Foo" in all "*.c" and "*.h" files.  The "e"
 flag is used for the ":substitute" command to avoid an error for files where
 "my_foo" isn't used.  ":update" writes the file only if changes were made.
 
@@ -1276,8 +1276,8 @@ unmodified.
 For MS-Windows you can modify the filters that are used in the browse
 dialog.  By setting the g:browsefilter or b:browsefilter variables, you can
 change the filters globally or locally to the buffer.  The variable is set to
-a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter
-label} is the text that appears in the "Files of Type" comboBox, and {pattern}
+a string in the format "{filter label}\t{pattern};{pattern}\n" where "{filter
+label}" is the text that appears in the "Files of Type" comboBox, and {pattern}
 is the pattern which filters the filenames.  Several patterns can be given,
 separated by ';'.
 
@@ -1576,8 +1576,8 @@ which is slightly different.
 There are three different types of searching:
 
 1) Downward search:					*starstar*
-   Downward search uses the wildcards '*', '**' and possibly others
-   supported by your operating system.  '*' and '**' are handled inside Vim,
+   Downward search uses the wildcards "*", "**" and possibly others
+   supported by your operating system.  "*" and "**" are handled inside Vim,
    so they work on all operating systems.  Note that "**" only acts as a
    special wildcard when it is at the start of a name.
 
@@ -1585,12 +1585,12 @@ There are three different types of searching:
    search pattern this would be ".*".  Note that the "." is not used for file
    searching.
 
-   '**' is more sophisticated:
+   "**" is more sophisticated:
       - It ONLY matches directories.
       - It matches up to 30 directories deep by default, so you can use it to
 	search an entire directory tree
       - The maximum number of levels matched can be given by appending a number
-	to '**'.
+	to "**".
 	Thus '/usr/**2' can match: >
 		/usr
 		/usr/include
@@ -1601,14 +1601,14 @@ There are three different types of searching:
 		....
 <	It does NOT match '/usr/include/g++/std' as this would be three
 	levels.
-	The allowed number range is 0 ('**0' is removed) to 100
+	The allowed number range is 0 ("**0" is removed) to 100
 	If the given number is smaller than 0 it defaults to 30, if it's
 	bigger than 100 then 100 is used.  The system also has a limit on the
 	path length, usually 256 or 1024 bytes.
-      - '**' can only be at the end of the path or be followed by a path
+      - "**" can only be at the end of the path or be followed by a path
 	separator or by a number and a path separator.
 
-   You can combine '*' and '**' in any order: >
+   You can combine "*" and "**" in any order: >
 	/usr/**/sys/*
 	/usr/*tory/sys/**
 	/usr/**2/sys/*
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 61d540a3dd..8dd79d45a4 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -840,8 +840,8 @@ Example: >
 All expressions within one level are parsed from left to right.
 
 
+------------------------------------------------------------------------------
 expr1							*expr1* *ternary* *E109*
------
 
 expr2 ? expr1 : expr1
 
@@ -867,8 +867,8 @@ You should always put a space before the ':', otherwise it can be mistaken for
 use in a variable such as "a:1".
 
 
+------------------------------------------------------------------------------
 expr2 and expr3						*expr2* *expr3*
----------------
 
 expr3 || expr3 ..	logical OR		*expr-barbar*
 expr4 && expr4 ..	logical AND		*expr-&&*
@@ -906,8 +906,8 @@ This is valid whether "b" has been defined or not.  The second clause will
 only be evaluated if "b" has been defined.
 
 
+------------------------------------------------------------------------------
 expr4							*expr4*
------
 
 expr5 {cmp} expr5
 
@@ -1010,8 +1010,9 @@ can be matched like an ordinary character.  Examples:
 	"foo\nbar" =~ "\\n"	evaluates to 0
 
 
+------------------------------------------------------------------------------
 expr5 and expr6						*expr5* *expr6*
----------------
+
 expr6 + expr6   Number addition, |List| or |Blob| concatenation	*expr-+*
 expr6 - expr6   Number subtraction				*expr--*
 expr6 . expr6   String concatenation				*expr-.*
@@ -1064,8 +1065,9 @@ None of these work for |Funcref|s.
 . and % do not work for Float. *E804*
 
 
+------------------------------------------------------------------------------
 expr7							*expr7*
------
+
 ! expr7			logical NOT		*expr-!*
 - expr7			unary minus		*expr-unary--*
 + expr7			unary plus		*expr-unary-+*
@@ -1082,8 +1084,9 @@ These three can be repeated and mixed.  Examples:
 	--9	    == 9
 
 
+------------------------------------------------------------------------------
 expr8							*expr8*
------
+
 This expression is either |expr9| or a sequence of the alternatives below,
 in any order.  E.g., these are all possible:
 	expr8[expr1].name
@@ -1234,8 +1237,9 @@ When using the lambda form there must be no white space between the } and the
 
 
 							*expr9*
+------------------------------------------------------------------------------
 number
-------
+
 number			number constant			*expr-number*
 
 			*0x* *hex-number* *0o* *octal-number* *binary-number*
@@ -1297,9 +1301,9 @@ function.  Example: >
 <	7.853981633974483e-01
 
 
-
+------------------------------------------------------------------------------
 string					*string* *String* *expr-string* *E114*
-------
+
 "string"		string constant		*expr-quote*
 
 Note that double quotes are used.
@@ -1338,16 +1342,17 @@ encodings.  Use "\u00ff" to store character 255 correctly as UTF-8.
 Note that "\000" and "\x00" force the end of the string.
 
 
+------------------------------------------------------------------------------
 blob-literal				*blob-literal* *E973*
-------------
 
 Hexadecimal starting with 0z or 0Z, with an arbitrary number of bytes.
 The sequence must be an even number of hex characters.  Example: >
 	:let b = 0zFF00ED015DAF
 
 
+------------------------------------------------------------------------------
 literal-string						*literal-string* *E115*
----------------
+
 'string'		string constant			*expr-'*
 
 Note that single quotes are used.
@@ -1361,8 +1366,9 @@ to be doubled.  These two commands are equivalent: >
 	if a =~ '\s*'
 
 
+------------------------------------------------------------------------------
 option						*expr-option* *E112* *E113*
-------
+
 &option			option value, local value if possible
 &g:option		global option value
 &l:option		local option value
@@ -1376,8 +1382,9 @@ and there is no buffer-local or window-local value, the global value is used
 anyway.
 
 
+------------------------------------------------------------------------------
 register						*expr-register* *@r*
---------
+
 @r			contents of register 'r'
 
 The result is the contents of the named register, as a single string.
@@ -1394,8 +1401,9 @@ nesting							*expr-nesting* *E110*
 (expr1)			nested expression
 
 
+------------------------------------------------------------------------------
 environment variable					*expr-env*
---------------------
+
 $VAR			environment variable
 
 The String value of any environment variable.  When it is not defined, the
@@ -1420,20 +1428,23 @@ The first one probably doesn't echo anything, the second echoes the $shell
 variable (if your shell supports it).
 
 
+------------------------------------------------------------------------------
 internal variable					*expr-variable*
------------------
+
 variable		internal variable
 See below |internal-variables|.
 
 
+------------------------------------------------------------------------------
 function call		*expr-function* *E116* *E118* *E119* *E120*
--------------
+
 function(expr1, ...)	function call
 See below |functions|.
 
 
+------------------------------------------------------------------------------
 lambda expression				*expr-lambda* *lambda*
------------------
+
 {args -> expr1}		lambda expression
 
 A lambda expression creates a new unnamed function which returns the result of
@@ -1524,7 +1535,7 @@ specified by what is prepended:
 |tabpage-variable|   t:	  Local to the current tab page.
 |global-variable|    g:	  Global.
 |local-variable|     l:	  Local to a function.
-|script-variable|    s:	  Local to a |:source|'ed Vim script.
+|script-variable|    s:	  Local to a |:source|d Vim script.
 |function-argument|  a:	  Function argument (only inside a function).
 |vim-variable|       v:	  Global, predefined by Vim.
 
@@ -1922,10 +1933,10 @@ v:fname_in	The name of the input file.  Valid while evaluating:
 v:fname_out	The name of the output file.  Only valid while
 		evaluating:
 			option		used for ~
-			'charconvert'	resulting converted file (*)
+			'charconvert'	resulting converted file [1]
 			'diffexpr'	output of diff
 			'patchexpr'	resulting patched file
-		(*) When doing conversion for a write command (e.g., ":w
+		[1] When doing conversion for a write command (e.g., ":w
 		file") it will be equal to v:fname_in.  When doing conversion
 		for a read command (e.g., ":e file") it will be a temporary
 		file and different from v:fname_in.
diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt
index ccb1499371..21a244e67a 100644
--- a/runtime/doc/ft_sql.txt
+++ b/runtime/doc/ft_sql.txt
@@ -37,8 +37,9 @@ The SQL ftplugin provides a number of options to assist with file
 navigation.
 
 
+------------------------------------------------------------------------------
 1.1 Matchit					*sql-matchit*
------------
+
 The matchit plugin (https://www.vim.org/scripts/script.php?script_id=39)
 provides many additional features and can be customized for different
 languages.  The matchit plugin is configured by defining a local
@@ -85,8 +86,9 @@ The following keywords are supported: >
     returns
 
 
+------------------------------------------------------------------------------
 1.2 Text Object Motions				*sql-object-motions*
------------------------
+
 Vim has a number of predefined keys for working with text |object-motions|.
 This filetype plugin attempts to translate these keys to maps which make sense
 for the SQL language.
@@ -99,8 +101,9 @@ file): >
     []		    move backwards to the previous 'end'
 
 
+------------------------------------------------------------------------------
 1.3 Predefined Object Motions			*sql-predefined-objects*
------------------------------
+
 Most relational databases support various standard features, tables, indices,
 triggers and stored procedures.  Each vendor also has a variety of proprietary
 objects.  The next set of maps have been created to help move between these
@@ -166,8 +169,9 @@ with comments: >
 
 
 
+------------------------------------------------------------------------------
 1.4 Macros					   *sql-macros*
-----------
+
 Vim's feature to find macro definitions, |'define'|, is supported using this
 regular expression: >
     \c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>
@@ -230,8 +234,9 @@ The majority of people work with only one vendor's database product, it would
 be nice to specify a default in your |init.vim|.
 
 
+------------------------------------------------------------------------------
 2.1 SQLSetType					*sqlsettype* *SQLSetType*
---------------
+
 For the people that work with many different databases, it is nice to be
 able to flip between the various vendors rules (indent, syntax) on a per
 buffer basis, at any time.  The ftplugin/sql.vim file defines this function: >
@@ -259,8 +264,9 @@ of available Vim script names: >
     :SQL
 
 
+------------------------------------------------------------------------------
 2.2 SQLGetType					*sqlgettype* *SQLGetType*
---------------
+
 At anytime you can determine which SQL dialect you are using by calling the
 SQLGetType command.  The ftplugin/sql.vim file defines this function: >
     SQLGetType
@@ -269,8 +275,9 @@ This will echo: >
     Current SQL dialect in use:sqlanywhere
 
 
+------------------------------------------------------------------------------
 2.3 SQL Dialect Default				*sql-type-default*
------------------------
+
 As mentioned earlier, the default syntax rules for Vim is based on Oracle
 (PL/SQL).  You can override this default by placing one of the following in
 your |init.vim|: >
@@ -325,8 +332,9 @@ highlight rules.  The dynamic mode populates the popups with data retrieved
 directly from a database.  This includes, table lists, column lists,
 procedures names and more.
 
+------------------------------------------------------------------------------
 4.1 Static Mode					*sql-completion-static*
----------------
+
 The static popups created contain items defined by the active syntax rules
 while editing a file with a filetype of SQL.  The plugin defines (by default)
 various maps to help the user refine the list of items to be displayed.
@@ -399,8 +407,9 @@ Here are some examples of the entries which are pulled from the syntax files: >
 	 - Integer, Char, Varchar, Date, DateTime, Timestamp, ...
 
 
+------------------------------------------------------------------------------
 4.2 Dynamic Mode				*sql-completion-dynamic*
-----------------
+
 Dynamic mode populates the popups with data directly from a database.  In
 order for the dynamic feature to be enabled you must have the dbext.vim
 plugin installed, (https://vim.sourceforge.net/script.php?script_id=356).
@@ -448,8 +457,8 @@ necessary to clear the plugins cache.  The default map for this is: >
     imap  R :call sqlcomplete#Map('ResetCache')
 
 
+------------------------------------------------------------------------------
 4.3 SQL Tutorial				*sql-completion-tutorial*
-----------------
 
 This tutorial is designed to take you through the common features of the SQL
 completion plugin so that: >
@@ -462,8 +471,8 @@ First, create a new buffer: >
      :e tutorial.sql
 
 
-Static features
----------------
+Static features ~
+
 To take you through the various lists, simply enter insert mode, hit:
     s   (show SQL statements)
 At this point, you can page down through the list until you find "select".
@@ -484,8 +493,8 @@ depending on the syntax file you are using.  The SQL Anywhere syntax file
 	DECLARE customer_id T <-- Choose a type from the list
 
 
-Dynamic features
-----------------
+Dynamic features ~
+
 To take advantage of the dynamic features you must first install the
 dbext.vim plugin (https://vim.sourceforge.net/script.php?script_id=356).  It
 also comes with a tutorial.  From the SQL completion plugin's perspective,
@@ -597,8 +606,8 @@ Similar to the table list, v, will display a list of views in the
 database.
 
 
+------------------------------------------------------------------------------
 4.4 Completion Customization			*sql-completion-customization*
-----------------------------
 
 The SQL completion plugin can be customized through various options set in
 your |init.vim|: >
@@ -657,14 +666,14 @@ your |init.vim|: >
 	  option.
 >
 
+------------------------------------------------------------------------------
 4.5 SQL Maps					*sql-completion-maps*
-------------
 
 The default SQL maps have been described in other sections of this document in
 greater detail.  Here is a list of the maps with a brief description of each.
 
-Static Maps
------------
+Static Maps ~
+
 These are maps which use populate the completion list using Vim's syntax
 highlighting rules. >
     a
@@ -680,8 +689,8 @@ highlighting rules. >
     s
 <       - Displays all SQL syntax items defined as 'sqlStatement'. >
 
-Dynamic Maps
-------------
+Dynamic Maps ~
+
 These are maps which use populate the completion list using the dbext.vim
 plugin. >
     t
@@ -713,8 +722,8 @@ plugin. >
 <	- This maps removes all cached items and forces the SQL completion
 	  to regenerate the list of items.
 
-Customizing Maps
-----------------
+Customizing Maps ~
+
 You can create as many additional key maps as you like.  Generally, the maps
 will be specifying different syntax highlight groups.
 
@@ -733,8 +742,8 @@ chosen since it will work on both Windows and *nix platforms.  On the windows
 platform you can also use  or ALT keys.
 
 
+------------------------------------------------------------------------------
 4.6 Using with other filetypes			*sql-completion-filetypes*
-------------------------------
 
 Many times SQL can be used with different filetypes.  For example Perl, Java,
 PHP, Javascript can all interact with a database.  Often you need both the SQL
@@ -746,8 +755,8 @@ This can be enabled easily with the following steps (assuming a Perl file): >
     2.  :set filetype=sql
     3.  :set ft=perl
 
-Step 1
-------
+Step 1 ~
+
 Begins by editing a Perl file.  Vim automatically sets the filetype to
 "perl".  By default, Vim runs the appropriate filetype file
 ftplugin/perl.vim.  If you are using the syntax completion plugin by following
@@ -755,8 +764,8 @@ the directions at |ft-syntax-omni| then the |'omnifunc'| option has been set to
 "syntax#Complete".  Pressing  will display the omni popup containing
 the syntax items for Perl.
 
-Step 2
-------
+Step 2 ~
+
 Manually setting the filetype to "sql" will also fire the appropriate filetype
 files ftplugin/sql.vim.  This file will define a number of buffer specific
 maps for SQL completion, see |sql-completion-maps|.  Now these maps have
@@ -767,8 +776,8 @@ begin with , the maps will toggle the |'omnifunc'| when in use.  So you
 can use  to continue using the completion for Perl (using the syntax
 completion plugin) and  to use the SQL completion features.
 
-Step 3
-------
+Step 3 ~
+
 Setting the filetype back to Perl sets all the usual "perl" related items back
 as they were.
 
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 1fda624fc6..1fce9fa491 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -44,8 +44,8 @@ Scrollbars						*gui-scrollbars*
 There are vertical scrollbars and a horizontal scrollbar.  You may
 configure which ones appear with the 'guioptions' option.
 
-The interface looks like this (with ":set guioptions=mlrb"):
-
+The interface looks like this (with `:set guioptions=mlrb`):
+>
 		       +------------------------------+ `
 		       | File  Edit		 Help | <- Menu bar (m) `
 		       +-+--------------------------+-+ `
@@ -66,7 +66,7 @@ The interface looks like this (with ":set guioptions=mlrb"):
 		       +-+--------------------------+-+ `
 		       | |< ####		   >| | <- Bottom `
 		       +-+--------------------------+-+    scrollbar (b) `
-
+<
 Any of the scrollbar or menu components may be turned off by not putting the
 appropriate letter in the 'guioptions' string.  The bottom scrollbar is
 only useful when 'nowrap' is set.
@@ -123,7 +123,7 @@ message).  Keep Shift pressed to change to the directory instead.
 If Vim happens to be editing a command line, the names of the dropped files
 and directories will be inserted at the cursor.  This allows you to use these
 names with any Ex command.  Special characters (space, tab, double quote and
-'|'; backslash on non-MS-Windows systems) will be escaped.
+"|"; backslash on non-MS-Windows systems) will be escaped.
 
 ==============================================================================
 Menus							*menus*
@@ -569,14 +569,14 @@ Tooltips & Menu tips
 See section |42.4| in the user manual.
 
 							*:tmenu*
-:tm[enu] {menupath} {rhs}	Define a tip for a menu or tool.  {only in
-				X11 and Win32 GUI}
+:tm[enu] {menupath} {rhs}	Define a tip for a menu or tool.  (only in
+				X11 and Win32 GUI)
 
-:tm[enu] [menupath]		List menu tips. {only in X11 and Win32 GUI}
+:tm[enu] [menupath]		List menu tips. (only in X11 and Win32 GUI)
 
 							*:tunmenu*
 :tu[nmenu] {menupath}		Remove a tip for a menu or tool.
-				{only in X11 and Win32 GUI}
+				(only in X11 and Win32 GUI)
 
 Note: To create menus for terminal mode, use |:tlmenu| instead.
 
diff --git a/runtime/doc/hebrew.txt b/runtime/doc/hebrew.txt
index 2f4b137bd3..76266d777f 100644
--- a/runtime/doc/hebrew.txt
+++ b/runtime/doc/hebrew.txt
@@ -11,8 +11,9 @@ Lottem.   Ron Aaron  is
 currently helping support these features.
 
 
+------------------------------------------------------------------------------
 Introduction
-------------
+
 Hebrew-specific options are 'hkmap', 'hkmapp' 'keymap'=hebrew and 'aleph'.
 Hebrew-useful options are 'delcombine', 'allowrevins', 'revins', 'rightleft'
 and 'rightleftcmd'.
@@ -22,8 +23,9 @@ from right to left instead of the usual left to right.  This is useful
 primarily when editing Hebrew or other Middle-Eastern languages.
 See |rileft.txt| for further details.
 
+------------------------------------------------------------------------------
 Details
---------------
+
 +  Options:
    +  'rightleft' ('rl') sets window orientation to right-to-left.  This means
       that the logical text 'ABC' will be displayed as 'CBA', and will start
@@ -31,7 +33,7 @@ Details
    +  'hkmap' ('hk') sets keyboard mapping to Hebrew, in insert/replace modes.
    +  'aleph' ('al'), numeric, holds the decimal code of Aleph, for keyboard
       mapping.
-   +  'hkmapp' ('hkp') sets keyboard mapping to 'phonetic hebrew'
+   +  'hkmapp' ('hkp') sets keyboard mapping to "phonetic hebrew"
 
    NOTE: these three ('hkmap', 'hkmapp' and 'aleph') are obsolete.  You should
 	 use ":set keymap=hebrewp" instead.
@@ -51,7 +53,7 @@ Details
       ('deco' does nothing if UTF8 encoding is not active).
 
 +  Vim arguments:
-   +  'vim -H file' starts editing a Hebrew file, i.e. 'rightleft' and 'hkmap'
+   +  `vim -H file` starts editing a Hebrew file, i.e. 'rightleft' and 'hkmap'
       are set.
 
 +  Keyboard:
@@ -116,8 +118,9 @@ when exiting 'revins' via CTRL-_, the cursor moves to the end of the typed
 text (if possible).
 
 
+------------------------------------------------------------------------------
 Pasting when in a rightleft window
-----------------------------------
+
 When cutting text with the mouse and pasting it in a rightleft window
 the text will be reversed, because the characters come from the cut buffer
 from the left to the right, while inserted in the file from the right to
@@ -125,8 +128,9 @@ the left.   In order to avoid it, toggle 'revins' (by typing CTRL-? or CTRL-_)
 before pasting.
 
 
+------------------------------------------------------------------------------
 Hebrew characters and the 'isprint' variable
---------------------------------------------
+
 Sometimes Hebrew character codes are in the non-printable range defined by
 the 'isprint' variable.  For example in the Linux console, the Hebrew font
 encoding starts from 128, while the default 'isprint' variable is @,161-255.
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 4773059586..da307dd241 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -342,7 +342,7 @@ should begin with the name of the Vim plugin.  The tag name is usually right
 aligned on a line.
 
 When referring to an existing help tag and to create a hot-link, place the
-name between two bars (|) eg. |help-writing|.
+name between two bars ("|") eg. |help-writing|.
 
 When referring to a Vim command and to create a hot-link, place the
 name between two backticks, eg. inside `:filetype`.  You will see this is
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 2b86300e7f..f3e196b426 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -35,7 +35,7 @@ The rest of this section describes the 'cindent' option.
 
 Note that 'cindent' indenting does not work for every code scenario.  Vim
 is not a C compiler: it does not recognize all syntax.  One requirement is
-that toplevel functions have a '{' in the first column.  Otherwise they are
+that toplevel functions have a "{" in the first column.  Otherwise they are
 easily confused with declarations.
 
 These five options control C program indenting:
@@ -60,12 +60,12 @@ used instead.  The format of 'cinkeys' and 'indentkeys' is equal.
 The default is "0{,0},0),0],:,0#,!^F,o,O,e" which specifies that indenting
 occurs as follows:
 
-	"0{"	if you type '{' as the first character in a line
-	"0}"	if you type '}' as the first character in a line
-	"0)"	if you type ')' as the first character in a line
-	"0]"	if you type ']' as the first character in a line
-	":"	if you type ':' after a label or case statement
-	"0#"	if you type '#' as the first character in a line
+	"0{"	if you type "{" as the first character in a line
+	"0}"	if you type "}" as the first character in a line
+	"0)"	if you type ")" as the first character in a line
+	"0]"	if you type "]" as the first character in a line
+	":"	if you type ":" after a label or case statement
+	"0#"	if you type "#" as the first character in a line
 	"!^F"	if you type CTRL-F (which is not inserted)
 	"o"	if you type a  anywhere or use the "o" command (not in
 		insert mode!)
@@ -74,21 +74,21 @@ occurs as follows:
 		line
 
 Characters that can precede each key:				*i_CTRL-F*
-!	When a '!' precedes the key, Vim will not insert the key but will
+!	When a "!" precedes the key, Vim will not insert the key but will
 	instead reindent the current line.  This allows you to define a
 	command key for reindenting the current line.  CTRL-F is the default
 	key for this.  Be careful if you define CTRL-I for this because CTRL-I
 	is the ASCII code for .
-*	When a '*' precedes the key, Vim will reindent the line before
+*	When a "*" precedes the key, Vim will reindent the line before
 	inserting the key.  If 'cinkeys' contains "*", Vim reindents
 	the current line before opening a new line.
-0	When a zero precedes the key (but appears after '!' or '*') Vim will
+0	When a zero precedes the key (but appears after "!" or "*") Vim will
 	reindent the line only if the key is the first character you type in
 	the line.  When used before "=" Vim will only reindent the line if
 	there is only white space before the word.
 
-When neither '!' nor '*' precedes the key, Vim reindents the line after you
-type the key.  So ';' sets the indentation of a line which includes the ';'.
+When neither "!" nor "*" precedes the key, Vim reindents the line after you
+type the key.  So ";" sets the indentation of a line which includes the ";".
 
 Special key names:
 <>	Angle brackets mean spelled-out names of keys.  For example: "",
@@ -154,8 +154,8 @@ The examples below assume a 'shiftwidth' of 4.
 	eN    Add N to the prevailing indent inside a set of braces if the
 	      opening brace at the End of the line (more precise: is not the
 	      first character in a line).  This is useful if you want a
-	      different indent when the '{' is at the start of the line from
-	      when '{' is at the end of the line.  (default 0).
+	      different indent when the "{" is at the start of the line from
+	      when "{" is at the end of the line.  (default 0).
 
 		cino=		    cino=e2		cino=e-2 >
 		  if (cond) {	      if (cond) {	  if (cond) {
@@ -169,8 +169,8 @@ The examples below assume a 'shiftwidth' of 4.
 							*cino-n*
 	nN    Add N to the prevailing indent for a statement after an "if",
 	      "while", etc., if it is NOT inside a set of braces.  This is
-	      useful if you want a different indent when there is no '{'
-	      before the statement from when there is a '{' before it.
+	      useful if you want a different indent when there is no "{"
+	      before the statement from when there is a "{" before it.
 	      (default 0).
 
 		cino=		    cino=n2		cino=n-2 >
@@ -193,7 +193,7 @@ The examples below assume a 'shiftwidth' of 4.
 		      int foo;		    int foo;		  int foo;
 <
 							*cino-{*
-	{N    Place opening braces N characters from the prevailing indent.
+	`{N`    Place opening braces N characters from the prevailing indent.
 	      This applies only for opening braces that are inside other
 	      braces.  (default 0).
 
@@ -203,7 +203,7 @@ The examples below assume a 'shiftwidth' of 4.
 		      foo;		  foo;		      foo;
 <
 							*cino-}*
-	}N    Place closing braces N characters from the matching opening
+	`}N`    Place closing braces N characters from the matching opening
 	      brace.  (default 0).
 
 		cino=		    cino={2,}-0.5s	cino=}2 >
@@ -846,7 +846,7 @@ own 'formatoptions'): >
 
 Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be
 added, see |fo-table| for more information.
--------------
+
 
 							*PHP_outdentSLComments*
 To add extra indentation to single-line comments: >
@@ -858,7 +858,7 @@ Only single-line comments will be affected such as: >
     # Comment
     // Comment
     /* Comment */
--------------
+<
 
 							*PHP_default_indenting*
 To add extra indentation to every PHP lines with N being the number of
@@ -878,18 +878,17 @@ For example, with N = 1, this will give:
 	$command_hist = TRUE;
     ?>
 (Notice the extra indentation between the PHP container markers and the code)
--------------
 
 							*PHP_outdentphpescape*
 To indent PHP escape tags as the surrounding non-PHP code (only affects the
 PHP escape tags): >
     :let g:PHP_outdentphpescape = 0
--------------
+<
 
 							*PHP_removeCRwhenUnix*
 To automatically remove '\r' characters when the 'fileformat' is set to Unix: >
     :let g:PHP_removeCRwhenUnix = 1
--------------
+<
 
 							*PHP_BracesAtCodeLevel*
 To indent braces at the same level than the code they contain: >
@@ -908,7 +907,6 @@ Instead of: >
 
 NOTE:	Indenting will be a bit slower if this option is used because some
 	optimizations won't be available.
--------------
 
 					*PHP_vintage_case_default_indent*
 To indent 'case:' and 'default:' statements in switch() blocks: >
@@ -918,7 +916,6 @@ In PHP braces are not required inside 'case/default' blocks therefore 'case:'
 and 'default:' are indented at the same level than the 'switch()' to avoid
 meaningless indentation. You can use the above option to return to the
 traditional way.
--------------
 
 							*PHP_noArrowMatching*
 By default the indent script will indent multi-line chained calls by matching
@@ -927,17 +924,16 @@ the position of the '->': >
     $user_name_very_long->name()
                         ->age()
                         ->info();
-
+<
 You can revert to the classic way of indenting by setting this option to 1: >
     :let g:PHP_noArrowMatching = 1
-
+<
 You will obtain the following result: >
 
     $user_name_very_long->name()
         ->age()
         ->info();
-
--------------
+<
 
 					*PHP_IndentFunctionCallParameters*
 Extra indentation levels to add to parameters in multi-line function calls. >
@@ -954,14 +950,13 @@ Function call arguments will indent 1 extra level. For two-space indentation: >
           $and_that
       );
     }
-
--------------
+<
 
 				*PHP_IndentFunctionDeclarationParameters*
 Extra indentation levels to add to arguments in multi-line function
 definitions. >
     let g:PHP_IndentFunctionDeclarationParameters = 1
-
+<
 Function arguments in declarations will indent 1 extra level. For two-space
 indentation: >
 
@@ -974,7 +969,7 @@ indentation: >
         $and_that
       );
     }
-
+<
 
 PYTHON							*ft-python-indent*
 
@@ -1145,7 +1140,6 @@ to the vimrc file, which causes the previous alignment example to change: >
   );
   END ENTITY sync;
 
-----------------------------------------
 
 Alignment of right-hand side assignment "<=" statements are performed by
 default. This causes the following alignment example: >
@@ -1164,7 +1158,6 @@ to the vimrc file, which causes the previous alignment example to change: >
     (sig_b OR sig_c)) OR
     (bus_a(0) AND sig_d);
 
-----------------------------------------
 
 Full-line comments (lines that begin with "--") are indented to be aligned with
 the very previous line's comment, PROVIDED that a whitespace follows after
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index e25f5901ef..e608b431f2 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -257,8 +257,8 @@ CTRL-]		Trigger abbreviation, without inserting a character.
 
 						*i_*
 	Toggle between Insert and Replace mode.
------------------------------------------------------------------------
 
+-----------------------------------------------------------------------
 						*i_backspacing*
 The effect of the , CTRL-W, and CTRL-U depend on the 'backspace' option
 (unless 'revins' is set).  This is a comma-separated list of items:
@@ -378,6 +378,7 @@ CTRL-G u	close undo sequence, start new change	     *i_CTRL-G_u*
 CTRL-G U	don't start a new undo block with the next   *i_CTRL-G_U*
 		left/right cursor movement, if the cursor
 		stays within the same line
+
 -----------------------------------------------------------------------
 
 The CTRL-O command sometimes has a side effect: If the cursor was beyond the
@@ -1450,13 +1451,13 @@ At the moment (beginning of 2006) there are two main browsers - MS Internet
 Explorer and Mozilla Firefox. These two applications are covering over 90% of
 market. Theoretically standards are created by W3C organisation
 (https://www.w3.org/) but they are not always followed/implemented.
-
+>
 		IE	FF	W3C  Omni completion ~
 		+/-	+/-	+    +		     ~
 		+	+	-    +		     ~
 		+	-	-    -		     ~
 		-	+	-    -		     ~
-
+<
 Regardless from state of implementation in browsers but if element is defined
 in standards, completion plugin will place element in suggestion list. When
 both major engines implemented element, even if this is not in standards it
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 4722982ab5..6bf6850ccf 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -520,12 +520,12 @@ CTRL-O in Insert mode you get a beep but you are still in Insert mode, type
 		TO mode						    ~
 		Normal	Visual	Select	Insert	  Replace   Cmd-line  Ex ~
 FROM mode								 ~
-Normal			v V ^V	  *4	 *1	   R gR     : / ? !   Q
-Visual		 *2		  ^G	 c C	    --	      :       --
-Select		 *5	^O ^G		 *6	    --	      --      --
+Normal			v V ^V	  `*4`	 *1	   R gR     : / ? !   Q
+Visual		 `*2`		  ^G	 c C	    --	      :       --
+Select		 `*5`	^O ^G		 `*6`	    --	      --      --
 Insert		 	  --	  --		      --      --
 Replace		 	  --	  --		      --      --
-Command-line	 *3	  --	  --	 :start	    --		      --
+Command-line	 `*3`	  --	  --	 :start	    --		      --
 Ex		 :vi	  --	  --	 --	    --	      --
 
 -- not possible
@@ -589,26 +589,26 @@ Lines longer than the window width will wrap, unless the 'wrap' option is off
 
 If the window has room after the last line of the buffer, Vim will show '~' in
 the first column of the last lines in the window, like this:
-
+>
 	+-----------------------+
 	|some line		|
 	|last line		|
 	|~			|
 	|~			|
 	+-----------------------+
-
+<
 Thus the '~' lines indicate that the end of the buffer was reached.
 
 If the last line in a window doesn't fit, Vim will indicate this with a '@' in
 the first column of the last lines in the window, like this:
-
+>
 	+-----------------------+
 	|first line		|
 	|second line		|
 	|@			|
 	|@			|
 	+-----------------------+
-
+<
 Thus the '@' lines indicate that there is a line that doesn't fit in the
 window.
 
@@ -616,14 +616,14 @@ When the "lastline" flag is present in the 'display' option, you will not see
 '@' characters at the left side of window.  If the last line doesn't fit
 completely, only the part that fits is shown, and the last three characters of
 the last line are replaced with "@@@", like this:
-
+>
 	+-----------------------+
 	|first line		|
 	|second line		|
 	|a very long line that d|
 	|oesn't fit in the wi@@@|
 	+-----------------------+
-
+<
 If there is a single line that is too long to fit in the window, this is a
 special situation.  Vim will show only part of the line, around where the
 cursor is.  There are no special characters shown, so that you can edit all
@@ -704,9 +704,9 @@ Definitions						*definitions* *jargon*
 
 A screen contains one or more windows, separated by status lines and with the
 command line at the bottom.
-
+>
 	+-------------------------------+
-screen	| window 1	| window 2	|
+ screen	| window 1	| window 2	|
 	|		|		|
 	|		|		|
 	|= status line =|= status line =|
@@ -716,7 +716,7 @@ screen	| window 1	| window 2	|
 	|==== status line ==============|
 	|command line			|
 	+-------------------------------+
-
+<
 The command line is also used for messages.  It scrolls up the screen when
 there is not enough room in the command line.
 
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index b7656211c6..e262b7b82a 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -666,9 +666,9 @@ This is useful to specify a (multibyte) character in a 'keymap' file.
 Upper and lowercase differences are ignored.
 
 							*map-comments*
-It is not possible to put a comment after these commands, because the '"'
+It is not possible to put a comment after these commands, because the `"`
 character is considered to be part of the {lhs} or {rhs}. However, one can
-use |", since this starts a new, empty command with a comment.
+use `|"`, since this starts a new, empty command with a comment.
 
 							*map_bar* *map-bar*
 Since the '|' character is used to separate a map command from the next
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index 72adbe6023..99dfa54218 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -625,7 +625,7 @@ and what the keymaps are to get those characters:
 
 glyph   encoding	   keymap ~
 Char UTF-8 cp1255  hebrew  hebrewp  name ~
-א    0x5d0  0xe0     t	      a     'alef
+א    0x5d0  0xe0     t	      a     ´alef
 ב    0x5d1  0xe1     c	      b     bet
 ג    0x5d2  0xe2     d	      g     gimel
 ד    0x5d3  0xe3     s	      d     dalet
@@ -706,7 +706,7 @@ Char UTF-8 hebrew name
 
 Combining forms:
 ﬠ    0xfb20  X`   Alternative `ayin
-ﬡ    0xfb21  X'   Alternative 'alef
+ﬡ    0xfb21  X'   Alternative ´alef
 ﬢ    0xfb22  X-d  Alternative dalet
 ﬣ    0xfb23  X-h  Alternative he
 ﬤ    0xfb24  X-k  Alternative kaf
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index f4127448ec..929efee19f 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -312,7 +312,7 @@ g			[count] display lines downward.  |exclusive| motion.
 `-`  		[count] lines upward, on the first non-blank
 			character |linewise|.
 
-+		or					*+*
+`+`		or					*+*
 CTRL-M		or					*CTRL-M* **
 			[count] lines downward, on the first non-blank
 			character |linewise|.
@@ -438,9 +438,9 @@ between Vi and Vim.
 }			[count] |paragraph|s forward.  |exclusive| motion.
 
 							*]]*
-]]			[count] |section|s forward or to the next '{' in the
+]]			[count] |section|s forward or to the next "{" in the
 			first column.  When used after an operator, then also
-			stops below a '}' in the first column.  |exclusive|
+			stops below a "}" in the first column.  |exclusive|
 			Note that |exclusive-linewise| often applies.
 
 							*][*
@@ -449,12 +449,12 @@ between Vi and Vim.
 			Note that |exclusive-linewise| often applies.
 
 							*[[*
-[[			[count] |section|s backward or to the previous '{' in
+[[			[count] |section|s backward or to the previous "{" in
 			the first column.  |exclusive|
 			Note that |exclusive-linewise| often applies.
 
 							*[]*
-[]			[count] |section|s backward or to the previous '}' in
+[]			[count] |section|s backward or to the previous "}" in
 			the first column.  |exclusive|
 			Note that |exclusive-linewise| often applies.
 
@@ -1004,8 +1004,8 @@ These commands are not marks themselves, but jump to a mark:
 			Note that ":keepjumps" must be used for every command.
 			When invoking a function the commands in that function
 			can still change the jumplist.  Also, for
-			":keepjumps exe 'command '" the "command" won't keep
-			jumps.  Instead use: ":exe 'keepjumps command'"
+			`:keepjumps exe 'command '` the "command" won't keep
+			jumps.  Instead use: `:exe 'keepjumps command'`
 
 ==============================================================================
 8. Jumps					*jump-motions*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 657d4bc06e..f4eb49953d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -145,7 +145,7 @@ This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
 
 Similarly, the double quote character starts a comment.  To include the '"' in
 the option value, use '\"' instead.  This example sets the 'titlestring'
-option to 'hi "there"': >
+option to "hi "there"": >
    :set titlestring=hi\ \"there\"
 
 For Win32 backslashes in file names are mostly not removed.  More precise: For
@@ -1325,7 +1325,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	These names are recognized:
 
 						*clipboard-unnamed*
-	unnamed		When included, Vim will use the clipboard register '*'
+	unnamed		When included, Vim will use the clipboard register "*"
 			for all yank, delete, change and put operations which
 			would normally go to the unnamed register.  When a
 			register is explicitly specified, it will always be
@@ -1336,8 +1336,8 @@ A jump table for the options with a short description can be found at |Q_op|.
 
 						*clipboard-unnamedplus*
 	unnamedplus	A variant of the "unnamed" flag which uses the
-			clipboard register '+' (|quoteplus|) instead of
-			register '*' for all yank, delete, change and put
+			clipboard register "+" (|quoteplus|) instead of
+			register "*" for all yank, delete, change and put
 			operations which would normally go to the unnamed
 			register.  When "unnamed" is also included to the
 			option, yank and delete operations (but not put)
@@ -4357,7 +4357,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	w x	updown		up-down sizing arrows
 	w x	leftright	left-right sizing arrows
 	w x	busy		The system's usual busy pointer
-	w x	no		The system's usual 'no input' pointer
+	w x	no		The system's usual "no input" pointer
 	  x	udsizing	indicates up-down resizing
 	  x	lrsizing	indicates left-right resizing
 	  x	crosshair	like a big thin +
@@ -4434,12 +4434,12 @@ A jump table for the options with a short description can be found at |Q_op|.
 
 		'nonu'          'nu'            'nonu'          'nu'
 		'nornu'         'nornu'         'rnu'           'rnu'
-
+>
 	    |apple          |  1 apple      |  2 apple      |  2 apple
 	    |pear           |  2 pear       |  1 pear       |  1 pear
 	    |nobody         |  3 nobody     |  0 nobody     |3   nobody
 	    |there          |  4 there      |  1 there      |  1 there
-
+<
 						*'numberwidth'* *'nuw'*
 'numberwidth' 'nuw'	number	(default: 4)
 			local to window
@@ -5798,11 +5798,11 @@ A jump table for the options with a short description can be found at |Q_op|.
 	alternative.
 	Normally 'autoindent' should also be on when using 'smartindent'.
 	An indent is automatically inserted:
-	- After a line ending in '{'.
+	- After a line ending in "{".
 	- After a line starting with a keyword from 'cinwords'.
-	- Before a line starting with '}' (only with the "O" command).
+	- Before a line starting with "}" (only with the "O" command).
 	When typing '}' as the first character in a new line, that line is
-	given the same indent as the matching '{'.
+	given the same indent as the matching "{".
 	When typing '#' as the first character in a new line, the indent for
 	that line is removed, the '#' is put in the first column.  The indent
 	is restored for the next line.  If you don't want this, use this
@@ -6085,12 +6085,12 @@ A jump table for the options with a short description can be found at |Q_op|.
 	field	    meaning ~
 	-	    Left justify the item.  The default is right justified
 		    when minwid is larger than the length of the item.
-	0	    Leading zeroes in numeric items.  Overridden by '-'.
-	minwid	    Minimum width of the item, padding as set by '-' & '0'.
+	0	    Leading zeroes in numeric items.  Overridden by "-".
+	minwid	    Minimum width of the item, padding as set by "-" & "0".
 		    Value must be 50 or less.
-	maxwid	    Maximum width of the item.  Truncation occurs with a '<'
+	maxwid	    Maximum width of the item.  Truncation occurs with a "<"
 		    on the left for text items.  Numeric items will be
-		    shifted down to maxwid-2 digits followed by '>'number
+		    shifted down to maxwid-2 digits followed by ">"number
 		    where number is the amount of missing digits, much like
 		    an exponential notation.
 	item	    A one letter code as described below.
@@ -6139,22 +6139,22 @@ A jump table for the options with a short description can be found at |Q_op|.
 	S S   'showcmd' content, see 'showcmdloc'.
 	a S   Argument list status as in default title.  ({current} of {max})
 	      Empty if the argument file count is zero or one.
-	{ NF  Evaluate expression between '%{' and '}' and substitute result.
-	      Note that there is no '%' before the closing '}'.  The
-	      expression cannot contain a '}' character, call a function to
+	{ NF  Evaluate expression between "%{" and "}" and substitute result.
+	      Note that there is no "%" before the closing "}".  The
+	      expression cannot contain a "}" character, call a function to
 	      work around that.  See |stl-%{| below.
-	{% -  This is almost same as { except the result of the expression is
+	`{%` -  This is almost same as "{" except the result of the expression is
 	      re-evaluated as a statusline format string.  Thus if the
-	      return value of expr contains % items they will get expanded.
-	      The expression can contain the } character, the end of
-	      expression is denoted by %}.
+	      return value of expr contains "%" items they will get expanded.
+	      The expression can contain the "}" character, the end of
+	      expression is denoted by "%}".
 	      For example: >
 		func! Stl_filename() abort
 		    return "%t"
 		endfunc
 <	        `stl=%{Stl_filename()}`   results in `"%t"`
 	        `stl=%{%Stl_filename()%}` results in `"Name of current file"`
-	%} -  End of `{%` expression
+	%} -  End of "{%" expression
 	( -   Start of item group.  Can be used for setting the width and
 	      alignment of a section.  Must be followed by %) somewhere.
 	) -   End of item group.  No width fields allowed.
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 972c42107c..9de1233979 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -2821,12 +2821,12 @@ your browsing preferences.  (see also: |netrw-settings|)
 				function 'netrw_gitignore#Hide() automatically
 				hiding all gitignored files.
 				For more details see |netrw-gitignore|.
+				 default: ""
 
-				Examples:
-				 let g:netrw_list_hide= '.*\.swp$'
-				 let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
-				default: ""
-
+				Examples: >
+				  let g:netrw_list_hide= '.*\.swp$'
+				  let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
+<
   *g:netrw_localcopycmd*	="cp"           Linux/Unix/MacOS/Cygwin
 				=expand("$COMSPEC")             Windows
 				Copies marked files (|netrw-mf|) to target
@@ -3268,7 +3268,7 @@ If there are marked files:  (see |netrw-mf|)
     	mr  [query: reply with *.c]
 	R   [query: reply with s/^\(.*\)\.c$/\1.cpp/]
 <
-    This example will mark all *.c files and then rename them to *.cpp
+    This example will mark all "*.c" files and then rename them to "*.cpp"
     files.  Netrw will protect you from overwriting local files without
     confirmation, but not remote ones.
 
@@ -3280,7 +3280,7 @@ If there are marked files:  (see |netrw-mf|)
 	 : a pair of contiguous ctrl-x's tells netrw to ignore any
 		     portion of the string preceding the double ctrl-x's.
 <
-    WARNING:~
+    WARNING: ~
 
     Note that moving files is a dangerous operation; copies are safer.  That's
     because a "move" for remote files is actually a copy + delete -- and if
@@ -3776,9 +3776,9 @@ Example: Clear netrw's marked file list via a mapping on gu >
 <
 								*netrw-P22*
 	P22. I get an error message when I try to copy or move a file:      {{{2
-
+>
 		**error** (netrw) tried using g:netrw_localcopycmd; it doesn't work!
-
+<
 	     What's wrong?
 
 	     Netrw uses several system level commands to do things (see
@@ -4001,9 +4001,9 @@ netrw:
 		Nov 22, 2016	* (glacambre) reported that files containing
 				  spaces weren't being obtained properly via
 				  scp.  Fix: apparently using single quotes
-				  such as with 'file name' wasn't enough; the
+				  such as with "file name" wasn't enough; the
 				  spaces inside the quotes also had to be
-				  escaped (ie. 'file\ name').
+				  escaped (ie. "file\ name").
 				* Also fixed obtain (|netrw-O|) to be able to
 				  obtain files with spaces in their names
 		Dec 20, 2016	* (xc1427) Reported that using "I" (|netrw-I|)
diff --git a/runtime/doc/pi_spec.txt b/runtime/doc/pi_spec.txt
index 6d45a0f064..d485d6ad49 100644
--- a/runtime/doc/pi_spec.txt
+++ b/runtime/doc/pi_spec.txt
@@ -34,8 +34,8 @@ also check if the name, version and release matches.  The plugin is smart
 enough to ask you if it should update the package release, if you have not
 done so.
 
+------------------------------------------------------------------------------
 Setting a map					*spec-setting-a-map*
--------------
 
 As you should know, you can easily set a map to access any Vim command (or
 anything, for that matter).  If you don't like the default map of
@@ -54,8 +54,8 @@ This command will add a map only in the spec file buffers.
 ==============================================================================
 2. Customizing					*spec-customizing*
 
+------------------------------------------------------------------------------
 The format string				*spec_chglog_format*
------------------
 
 You can easily customize how your spec file entry will look like.  To do
 this just set the variable "spec_chglog_format" in your vimrc file like
@@ -72,8 +72,8 @@ address once.
 To discover which format options you can use, take a look at the strftime()
 function man page.
 
+------------------------------------------------------------------------------
 Where to insert new items			*spec_chglog_prepend*
--------------------------
 
 The plugin will usually insert new %changelog entry items (note that it's
 not the entry itself) after the existing ones.  If you set the
@@ -83,8 +83,8 @@ spec_chglog_prepend variable >
 
 it will insert new items before the existing ones.
 
+------------------------------------------------------------------------------
 Inserting release info				*spec_chglog_release_info*
-----------------------
 
 If you want, the plugin may automatically insert release information
 on each changelog entry.  One advantage of turning this feature on is
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index e79d79ba1b..a30f32b75e 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1585,8 +1585,9 @@ A call of |:clist| writes them accordingly with their correct filenames:
 
 Unlike the other prefixes that all match against whole lines, %P, %Q and %O
 can be used to match several patterns in the same line.  Thus it is possible
-to parse even nested files like in the following line:
+to parse even nested files like in the following line: >
   {"file1" {"file2" error1} error2 {"file3" error3 {"file4" error4 error5}}}
+<
 The %O then parses over strings that do not contain any push/pop file name
 information.  See |errorformat-LaTeX| for an extended example.
 
@@ -1946,9 +1947,9 @@ by Vim.
 
 The default format for the lines displayed in the quickfix window and location
 list window is:
-
+>
     | col |
-
+<
 The values displayed in each line correspond to the "bufnr", "lnum", "col" and
 "text" fields returned by the |getqflist()| function.
 
diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt
index aa11462595..4f68ab562c 100644
--- a/runtime/doc/rileft.txt
+++ b/runtime/doc/rileft.txt
@@ -12,8 +12,9 @@ These functions were originally created by Avner Lottem:
    E-mail: alottem@iil.intel.com
    Phone:  +972-4-8307322
 
+------------------------------------------------------------------------------
 Introduction
-------------
+
 Some languages such as Arabic, Farsi, Hebrew (among others) require the
 ability to display their text from right-to-left.  Files in those languages
 are stored conventionally and the right-to-left requirement is only a
@@ -32,8 +33,9 @@ as this kind of support is out of the scope of a simple addition to an
 existing editor (and it's not sanctioned by Unicode either).
 
 
+------------------------------------------------------------------------------
 Highlights
-----------
+
 o  Editing left-to-right files as in the original Vim, no change.
 
 o  Viewing and editing files in right-to-left windows.  File orientation
@@ -56,11 +58,11 @@ o  Many languages use and require right-to-left support.  These languages
    current supported languages include - |arabic.txt| and |hebrew.txt|.
 
 
+------------------------------------------------------------------------------
 Of Interest...
---------------
 
 o  Invocations
-   -----------
+
    + 'rightleft' ('rl') sets window orientation to right-to-left.
    + 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages,
      allows one to remove a composing character which gets superimposed
@@ -69,7 +71,7 @@ o  Invocations
      (such as search) to be utilized in right-to-left orientation as well.
 
 o  Typing backwards					*ins-reverse*
-   ----------------
+
    In lieu of using the full-fledged 'rightleft' option, one can opt for
    reverse insertion.  When the 'revins' (reverse insert) option is set,
    inserting happens backwards.  This can be used to type right-to-left
@@ -85,15 +87,16 @@ o  Typing backwards					*ins-reverse*
    in the status line when reverse Insert mode is active.
 
 o  Pasting when in a rightleft window
-   ----------------------------------
+
    When cutting text with the mouse and pasting it in a rightleft window
    the text will be reversed, because the characters come from the cut buffer
    from the left to the right, while inserted in the file from the right to
    the left.   In order to avoid it, toggle 'revins' before pasting.
 
 
+------------------------------------------------------------------------------
 Bugs
-----
+
 o  Does not handle CTRL-A and CTRL-X commands (add and subtract) correctly
    when in rightleft window.
 
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 1a7b73601e..8b662ab1bf 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -483,13 +483,13 @@ accordingly, proceeding as follows:
 	However, directories in 'runtimepath' ending in "after" are skipped
 	here and only loaded after packages, see below.
 	Loading plugins won't be done when:
-	- The 'loadplugins' option was reset in a vimrc file.
+	- The |'loadplugins'| option was reset in a vimrc file.
 	- The |--noplugin| command line argument is used.
 	- The |--clean| command line argument is used.
 	- The "-u NONE" command line argument is used |-u|.
-	Note that using "-c 'set noloadplugins'" doesn't work, because the
+	Note that using `-c 'set noloadplugins'` doesn't work, because the
 	commands from the command line have not been executed yet.  You can
-	use "--cmd 'set noloadplugins'" or "--cmd 'set loadplugins'" |--cmd|.
+	use `--cmd 'set noloadplugins'` or `--cmd 'set loadplugins'` |--cmd|.
 
 	Packages are loaded.  These are plugins, as above, but found in the
 	"start" directory of each entry in 'packpath'.  Every plugin directory
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 49ca7e38f6..b4afc3f233 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -2475,7 +2475,7 @@ from the rest of the name (like 'PkgName::' in '$PkgName::VarName'): >
 (In Vim 6.x it was the other way around: "perl_want_scope_in_variables"
 enabled it.)
 
-If you do not want complex things like '@{${"foo"}}' to be parsed: >
+If you do not want complex things like `@{${"foo"}}` to be parsed: >
 
 	:let perl_no_extended_vars = 1
 
@@ -5042,7 +5042,7 @@ ctermbg={color-nr}				*ctermbg*
 	a number instead of a color name.
 
 	Note that for 16 color ansi style terminals (including xterms), the
-	numbers in the NR-8 column is used.  Here '*' means 'add 8' so that 
+	numbers in the NR-8 column is used.  Here "*" means "add 8" so that 
 	Blue is 12, DarkGray is 8 etc.
 
 	Note that for some color terminals these names may result in the wrong
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index 539ded07ee..0f785dd1eb 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -59,9 +59,9 @@ CTRL-]			Jump to the definition of the keyword under the
 CTRL-] is the default telnet escape key.  When you type CTRL-] to jump to a
 tag, you will get the telnet prompt instead.  Most versions of telnet allow
 changing or disabling the default escape key.  See the telnet man page.  You
-can 'telnet -E {Hostname}' to disable the escape character, or 'telnet -e
-{EscapeCharacter} {Hostname}' to specify another escape character.  If
-possible, try to use "ssh" instead of "telnet" to avoid this problem.
+can `telnet -E {Hostname}` to disable the escape character, or
+`telnet -e {EscapeCharacter} {Hostname}` to specify another escape character.
+If possible, try to use "ssh" instead of "telnet" to avoid this problem.
 
 							*tag-priority*
 When there are multiple matches for a tag, this priority is used:
@@ -404,7 +404,7 @@ is added to the command and on the 'autowrite' option:
 
   tag in       file	   autowrite			~
 current file  changed	!   option	  action	~
------------------------------------------------------------------------------
+ ---------------------------------------------------------------------------
     yes		 x	x     x	  goto tag
     no		 no	x     x	  read other file, goto tag
     no		yes    yes    x   abandon current file, read other file, goto
@@ -412,7 +412,7 @@ current file  changed	!   option	  action	~
     no		yes	no    on  write current file, read other file, goto
 				  tag
     no		yes	no   off  fail
------------------------------------------------------------------------------
+ ---------------------------------------------------------------------------
 
 - If the tag is in the current file, the command will always work.
 - If the tag is in another file and the current file was not changed, the
@@ -561,8 +561,8 @@ ctags).
 		with Vi, it ignores the following fields. Example:
 			APP	file	/^static int APP;$/;"	v
 		When {tagaddress} is not a line number or search pattern, then
-		{term} must be |;".  Here the bar ends the command (excluding
-		the bar) and ;" is used to have Vi ignore the rest of the
+		{term} must be `|;"`.  Here the bar ends the command (excluding
+		the bar) and `;"` is used to have Vi ignore the rest of the
 		line.  Example:
 			APP	file.c	call cursor(3, 4)|;"	v
 
@@ -848,9 +848,9 @@ Common arguments for the commands above:
 	a comment (even though syntax highlighting does recognize it).
 	Note: Since a macro definition mostly doesn't look like a comment, the
 	[!] makes no difference for ":dlist", ":dsearch" and ":djump".
-[/]	A pattern can be surrounded by '/'.  Without '/' only whole words are
-	matched, using the pattern "\".  Only after the second '/' a
-	next command can be appended with '|'.  Example: >
+[/]	A pattern can be surrounded by "/".  Without "/" only whole words are
+	matched, using the pattern "\".  Only after the second "/" a
+	next command can be appended with "|".  Example: >
 	:isearch /string/ | echo "the last one"
 <	For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern
 	is used as a literal string, not as a search pattern.
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index 559f31eb2d..5d5e89da77 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -297,7 +297,7 @@ be able to give comments to the parts of the mapping. >
 (<> notation |<>|.  Note that this is all typed literally.  ^W is "^" "W", not
 CTRL-W.)
 
-Note that the last comment starts with |", because the ":execute" command
+Note that the last comment starts with `|"`, because the ":execute" command
 doesn't accept a comment directly.
 
 You also need to set 'textwidth' to a non-zero value, e.g., >
diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt
index 641c95b06e..4d000efc1e 100644
--- a/runtime/doc/userfunc.txt
+++ b/runtime/doc/userfunc.txt
@@ -343,7 +343,6 @@ is used as a method: >
 
 
 ==============================================================================
-
 3. Automatically loading functions ~
 							*autoload-functions*
 When using many or large functions, it's possible to automatically define them
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index e7c58b00a0..61f5013f47 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -284,8 +284,8 @@ Opens a vertically split, full-height window on the "tags" file at the far
 left of the Vim window.
 
 
+------------------------------------------------------------------------------
 Closing a window
-----------------
 
 :q[uit]
 :{count}q[uit]						*:count_quit*
@@ -693,8 +693,8 @@ Note: ":next" is an exception, because it must accept a list of file names
 for compatibility with Vi.
 
 
+------------------------------------------------------------------------------
 The argument list and multiple windows
---------------------------------------
 
 The current position in the argument list can be different for each window.
 Remember that when doing ":e file", the position in the argument list stays
-- 
cgit 


From 9cc37e057a7afa02dcb9f384aa43217d82b9d479 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Wed, 28 Dec 2022 14:08:17 +0100
Subject: docs(api): fix treesitter parsing errors

---
 runtime/doc/api.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 26679f0330..32c7ba67a5 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2535,8 +2535,8 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
     Region can be given as (row,col) tuples, or valid extmark ids (whose
     positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1)
     respectively, thus the following are equivalent: >lua
-      nvim_buf_get_extmarks(0, my_ns, 0, -1, {})
-      nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {})
+      vim.api.nvim_buf_get_extmarks(0, my_ns, 0, -1, {})
+      vim.api.nvim_buf_get_extmarks(0, my_ns, {0,0}, {-1,-1}, {})
 <
 
     If `end` is less than `start`, traversal works backwards. (Useful with
@@ -3071,8 +3071,8 @@ nvim_open_win({buffer}, {enter}, {*config})                  *nvim_open_win()*
                       borders but not horizontal ones. By default,
                       `FloatBorder` highlight is used, which links to
                       `WinSeparator` when not defined. It could also be
-                      specified by character: [ {"+", "MyCorner"}, {"x",
-                      "MyBorder"} ].
+                      specified by character: [ ["+", "MyCorner"], ["x",
+                      "MyBorder"] ].
 
                   • title: Title (optional) in window border, String or list.
                     List is [text, highlight] tuples. if is string the default
-- 
cgit 


From dfb840970c36056584e9a55d77a2030b4e403e9d Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Wed, 28 Dec 2022 14:20:42 +0100
Subject: docs(lua): fix treesitter parsing errors

---
 runtime/doc/lua.txt | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 25d7fa2f35..074cb863f0 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1502,8 +1502,7 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive})         *vim.region()*
                      end-inclusive
 
     Return: ~
-        table region lua table of the form {linenr =
-        {startcol,endcol}}
+        (table) region Table of the form `{linenr = {startcol,endcol}}`
 
 schedule_wrap({cb})                                      *vim.schedule_wrap()*
     Defers callback `cb` until the Nvim API is safe to call.
@@ -1711,8 +1710,7 @@ split({s}, {sep}, {kwargs})                                      *vim.split()*
     Parameters: ~
       • {s}       (string) String to split
       • {sep}     (string) Separator or pattern
-      • {kwargs}  ({plain: boolean, trimempty: boolean}|nil) Keyword
-                  arguments:
+      • {kwargs}  (table|nil) Keyword arguments:
                   • plain: (boolean) If `true` use `sep` literally (passed to
                     string.find)
                   • trimempty: (boolean) If `true` remove empty items from the
-- 
cgit 


From ad184b213d6087ac90b4ebd75749a5337a3423c6 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Wed, 28 Dec 2022 14:21:42 +0100
Subject: docs(luvref): fix treesitter parsing errors

---
 runtime/doc/luvref.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt
index b0d1b6764a..859e75e4af 100644
--- a/runtime/doc/luvref.txt
+++ b/runtime/doc/luvref.txt
@@ -2626,7 +2626,7 @@ uv.fs_read({fd}, {size} [, {offset} [, {callback}]])              *uv.fs_read()*
                 indicates EOF.
 
                 If `offset` is nil or omitted, it will default to `-1`, which
-                indicates 'use and update the current file offset.'
+                indicates "use and update the current file offset."
 
                 Note: When `offset` is >= 0, the current file offset will not
                 be updated by the read.
@@ -2665,7 +2665,7 @@ uv.fs_write({fd}, {data} [, {offset} [, {callback}]])            *uv.fs_write()*
                 written.
 
                 If `offset` is nil or omitted, it will default to `-1`, which
-                indicates 'use and update the current file offset.'
+                indicates "use and update the current file offset."
 
                 Note: When `offset` is >= 0, the current file offset will not
                 be updated by the write.
-- 
cgit 


From 2f0c023f520544432af56805bc1ad5785fcfdc61 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 31 Dec 2022 14:40:47 +0100
Subject: docs(manual): fix treesitter parsing errors

---
 runtime/doc/usr_02.txt | 24 ++++++++++++------------
 runtime/doc/usr_05.txt |  4 ++--
 runtime/doc/usr_08.txt | 44 ++++++++++++++++++++++----------------------
 runtime/doc/usr_10.txt |  6 +++---
 runtime/doc/usr_20.txt |  4 ++--
 runtime/doc/usr_21.txt |  6 +++---
 runtime/doc/usr_25.txt | 35 ++++++++++++++++++-----------------
 runtime/doc/usr_29.txt | 16 ++++++++--------
 runtime/doc/usr_30.txt |  4 ++--
 runtime/doc/usr_32.txt |  6 +++---
 runtime/doc/usr_40.txt |  8 ++++----
 runtime/doc/usr_42.txt | 14 +++++++-------
 12 files changed, 86 insertions(+), 85 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt
index f822e7d4b8..11afe39742 100644
--- a/runtime/doc/usr_02.txt
+++ b/runtime/doc/usr_02.txt
@@ -33,7 +33,7 @@ On Unix you can type this at any command prompt.  If you are running Microsoft
 Windows, open a Command Prompt and enter the command.  In either case, Vim
 starts editing a file called file.txt.  Because this is a new file, you get a
 blank window. This is what your screen will look like:
-
+>
 	+---------------------------------------+
 	|#					|
 	|~					|
@@ -43,7 +43,7 @@ blank window. This is what your screen will look like:
 	|"file.txt" [New file]			|
 	+---------------------------------------+
 		('#' is the cursor position.)
-
+<
 The tilde (~) lines indicate lines not in the file.  In other words, when Vim
 runs out of file to display, it displays tilde lines.  At the bottom of the
 screen, a message line indicates the file is named file.txt and shows that you
@@ -83,7 +83,7 @@ limerick, this is what you type: >
 After typing "turtle" you press the  key to start a new line.  Finally
 you press the  key to stop Insert mode and go back to Normal mode.  You
 now have two lines of text in your Vim window:
-
+>
 	+---------------------------------------+
 	|A very intelligent turtle		|
 	|Found programming Unix a hurdle	|
@@ -91,7 +91,7 @@ now have two lines of text in your Vim window:
 	|~					|
 	|					|
 	+---------------------------------------+
-
+<
 
 WHAT IS THE MODE?
 
@@ -105,7 +105,7 @@ with a colon).  Finish this command by pressing the  key (all commands
 that start with a colon are finished this way).
    Now, if you type the "i" command Vim will display --INSERT-- at the bottom
 of the window.  This indicates you are in Insert mode.
-
+>
 	+---------------------------------------+
 	|A very intelligent turtle		|
 	|Found programming Unix a hurdle	|
@@ -113,7 +113,7 @@ of the window.  This indicates you are in Insert mode.
 	|~					|
 	|-- INSERT --				|
 	+---------------------------------------+
-
+<
 If you press  to go back to Normal mode the last line will be made blank.
 
 
@@ -182,7 +182,7 @@ throwback to the old days of the typewriter, when you deleted things by typing
 xxxx over them.)  Move the cursor to the beginning of the first line, for
 example, and type xxxxxxx (seven x's) to delete "A very ".  The result should
 look like this:
-
+>
 	+---------------------------------------+
 	|intelligent turtle			|
 	|Found programming Unix a hurdle	|
@@ -190,14 +190,14 @@ look like this:
 	|~					|
 	|					|
 	+---------------------------------------+
-
+<
 Now you can insert new text, for example by typing: >
 
 	iA young 
 
 This begins an insert (the i), inserts the words "A young", and then exits
 insert mode (the final ).	The result:
-
+>
 	+---------------------------------------+
 	|A young intelligent turtle		|
 	|Found programming Unix a hurdle	|
@@ -205,13 +205,13 @@ insert mode (the final ).	The result:
 	|~					|
 	|					|
 	+---------------------------------------+
-
+<
 
 DELETING A LINE
 
 To delete a whole line use the "dd" command.  The following line will
 then move up to fill the gap:
-
+>
 	+---------------------------------------+
 	|Found programming Unix a hurdle	|
 	|~					|
@@ -219,7 +219,7 @@ then move up to fill the gap:
 	|~					|
 	|					|
 	+---------------------------------------+
-
+<
 
 DELETING A LINE BREAK
 
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index 944eb1fc80..24d6185eae 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -107,7 +107,7 @@ Display an incomplete command in the lower right corner of the Vim window,
 left of the ruler.  For example, when you type "2f", Vim is waiting for you to
 type the character to find and "2f" is displayed.  When you press "w" next,
 the "2fw" command is executed and the displayed "2f" is removed.
-
+>
 	+-------------------------------------------------+
 	|text in the Vim window				  |
 	|~						  |
@@ -119,7 +119,7 @@ the "2fw" command is executed and the displayed "2f" is removed.
 
 >
 	set incsearch
-
+<
 Display matches for a search pattern while you type.
 
 >
diff --git a/runtime/doc/usr_08.txt b/runtime/doc/usr_08.txt
index 1d20913a14..0ba03a4861 100644
--- a/runtime/doc/usr_08.txt
+++ b/runtime/doc/usr_08.txt
@@ -32,7 +32,7 @@ The easiest way to open a new window is to use the following command: >
 
 This command splits the screen into two windows and leaves the cursor in the
 top one:
-
+>
 	+----------------------------------+
 	|/* file one.c */		   |
 	|~				   |
@@ -43,7 +43,7 @@ top one:
 	|one.c=============================|
 	|				   |
 	+----------------------------------+
-
+<
 What you see here is two windows on the same file.  The line with "====" is
 the status line.  It displays information about the window above it.  (In
 practice the status line will be in reverse video.)
@@ -87,7 +87,7 @@ The following command opens a second window and starts editing the given file:
 	:split two.c
 
 If you were editing one.c, then the result looks like this:
-
+>
 	+----------------------------------+
 	|/* file two.c */		   |
 	|~				   |
@@ -98,7 +98,7 @@ If you were editing one.c, then the result looks like this:
 	|one.c=============================|
 	|				   |
 	+----------------------------------+
-
+<
 To open a window on a new, empty file, use this: >
 
 	:new
@@ -170,7 +170,7 @@ or: >
 	:vsplit two.c
 
 The result looks something like this:
-
+>
 	+--------------------------------------+
 	|/* file two.c */   |/* file one.c */  |
 	|~		    |~		       |
@@ -179,7 +179,7 @@ The result looks something like this:
 	|two.c===============one.c=============|
 	|				       |
 	+--------------------------------------+
-
+<
 Actually, the | lines in the middle will be in reverse video.  This is called
 the vertical separator.  It separates the two windows left and right of it.
 
@@ -218,7 +218,7 @@ cursor keys can also be used, if you like.
 You have split a few windows, but now they are in the wrong place.  Then you
 need a command to move the window somewhere else.  For example, you have three
 windows like this:
-
+>
 	+----------------------------------+
 	|/* file two.c */		   |
 	|~				   |
@@ -233,7 +233,7 @@ windows like this:
 	|one.c=============================|
 	|				   |
 	+----------------------------------+
-
+<
 Clearly the last one should be at the top.  Go to that window (using CTRL-W w)
 and then type this command: >
 
@@ -244,7 +244,7 @@ the very top.  You will notice that K is again used for moving upwards.
    When you have vertical splits, CTRL-W K will move the current window to the
 top and make it occupy the full width of the Vim window.  If this is your
 layout:
-
+>
 	+-------------------------------------------+
 	|/* two.c */  |/* three.c */  |/* one.c */  |
 	|~	      |~	      |~	    |
@@ -255,9 +255,9 @@ layout:
 	|two.c=========three.c=========one.c========|
 	|					    |
 	+-------------------------------------------+
-
+<
 Then using CTRL-W K in the middle window (three.c) will result in:
-
+>
 	+-------------------------------------------+
 	|/* three.c */				    |
 	|~					    |
@@ -268,7 +268,7 @@ Then using CTRL-W K in the middle window (three.c) will result in:
 	|two.c==================one.c===============|
 	|					    |
 	+-------------------------------------------+
-
+<
 The other three similar commands (you can probably guess these now):
 
 	CTRL-W H	move window to the far left
@@ -316,7 +316,7 @@ To make Vim open a window for each file, start it with the "-o" argument: >
 	vim -o one.txt two.txt three.txt
 
 This results in:
-
+>
 	+-------------------------------+
 	|file one.txt			|
 	|~				|
@@ -329,7 +329,7 @@ This results in:
 	|three.txt======================|
 	|				|
 	+-------------------------------+
-
+<
 The "-O" argument is used to get vertically split windows.
    When Vim is already running, the ":all" command opens a window for each
 file in the argument list.  ":vertical all" does it with vertical splits.
@@ -347,7 +347,7 @@ Type this command in a shell to start Nvim in diff mode: >
 
 Vim will start, with two windows side by side.  You will only see the line
 in which you added characters, and a few lines above and below it.
-
+>
 	 VV		      VV
 	+-----------------------------------------+
 	|+ +--123 lines: /* a|+ +--123 lines: /* a|  <- fold
@@ -366,7 +366,7 @@ in which you added characters, and a few lines above and below it.
 	|main.c~==============main.c==============|
 	|					  |
 	+-----------------------------------------+
-
+<
 (This picture doesn't show the highlighting, use "nvim -d" for that.)
 
 The lines that were not modified have been collapsed into one line.  This is
@@ -519,7 +519,7 @@ Assume you are editing "thisfile".  To create a new tab page use this command: >
 
 This will edit the file "thatfile" in a window that occupies the whole Vim
 window.  And you will notice a bar at the top with the two file names:
-
+>
 	+----------------------------------+
 	| thisfile | /thatfile/ __________X|    (thatfile is bold)
 	|/* thatfile */			   |
@@ -530,13 +530,13 @@ window.  And you will notice a bar at the top with the two file names:
 	|~				   |
 	|				   |
 	+----------------------------------+
-
+<
 You now have two tab pages.  The first one has a window for "thisfile" and the
 second one a window for "thatfile".  It's like two pages that are on top of
 each other, with a tab sticking out of each page showing the file name.
 
 Now use the mouse to click on "thisfile" in the top line.  The result is
-
+>
 	+----------------------------------+
 	| /thisfile/ | thatfile __________X|    (thisfile is bold)
 	|/* thisfile */			   |
@@ -547,7 +547,7 @@ Now use the mouse to click on "thisfile" in the top line.  The result is
 	|~				   |
 	|				   |
 	+----------------------------------+
-
+<
 Thus you can switch between tab pages by clicking on the label in the top
 line.  If you don't have a mouse or don't want to use it, you can use the "gt"
 command.  Mnemonic: Goto Tab.
@@ -558,7 +558,7 @@ Now let's create another tab page with the command: >
 
 This makes a new tab page with one window that is editing the same buffer as
 the window we were in:
-
+>
 	+-------------------------------------+
 	| thisfile | /thisfile/ | thatfile __X|   (thisfile is bold)
 	|/* thisfile */			      |
@@ -569,7 +569,7 @@ the window we were in:
 	|~				      |
 	|				      |
 	+-------------------------------------+
-
+<
 You can put ":tab" before any Ex command that opens a window.  The window will
 be opened in a new tab page.  Another example: >
 
diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt
index 8844671e01..3e45fda882 100644
--- a/runtime/doc/usr_10.txt
+++ b/runtime/doc/usr_10.txt
@@ -813,10 +813,10 @@ REDRAWING THE SCREEN
 If the external command produced an error message, the display may have been
 messed up.  Vim is very efficient and only redraws those parts of the screen
 that it knows need redrawing.  But it can't know about what another program
-has written.  To tell Vim to redraw the screen: >
-
+has written.  To tell Vim to redraw the screen:
+>
 	CTRL-L
-
+<
 ==============================================================================
 
 Next chapter: |usr_11.txt|  Recovering from a crash
diff --git a/runtime/doc/usr_20.txt b/runtime/doc/usr_20.txt
index 6a8836c8e8..2b69862fe1 100644
--- a/runtime/doc/usr_20.txt
+++ b/runtime/doc/usr_20.txt
@@ -338,7 +338,7 @@ Open the command line window with this command: >
 
 Vim now opens a (small) window at the bottom.  It contains the command line
 history, and an empty line at the end:
-
+>
 	+-------------------------------------+
 	|other window			      |
 	|~				      |
@@ -353,7 +353,7 @@ history, and an empty line at the end:
 	|command-line=========================|
 	|				      |
 	+-------------------------------------+
-
+<
 You are now in Normal mode.  You can use the "hjkl" keys to move around.  For
 example, move up with "5k" to the ":e config.h.in" line.  Type "$h" to go to
 the "i" of "in" and type "cwout".  Now you have changed the line to:
diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt
index beb09c13df..191d333f3d 100644
--- a/runtime/doc/usr_21.txt
+++ b/runtime/doc/usr_21.txt
@@ -302,7 +302,7 @@ session file as a starting point.
 use, and save this in a session.  Then you can go back to this layout whenever
 you want.
    For example, this is a nice layout to use:
-
+>
 	+----------------------------------------+
 	|		   VIM - main help file  |
 	|					 |
@@ -318,7 +318,7 @@ you want.
 	|~/=========|[No File]===================|
 	|					 |
 	+----------------------------------------+
-
+<
 This has a help window at the top, so that you can read this text.  The narrow
 vertical window on the left contains a file explorer.  This is a Vim plugin
 that lists the contents of a directory.  You can select files to edit there.
@@ -454,7 +454,7 @@ Use this format for the modeline:
 
 The "any-text" indicates that you can put any text before and after the part
 that Vim will use.  This allows making it look like a comment, like what was
-done above with /* and */.
+done above with "/*" and "*/".
    The " vim:" part is what makes Vim recognize this line.  There must be
 white space before "vim", or "vim" must be at the start of the line.  Thus
 using something like "gvim:" will not work.
diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt
index 2efb67e55f..955d2ae5f0 100644
--- a/runtime/doc/usr_25.txt
+++ b/runtime/doc/usr_25.txt
@@ -325,16 +325,16 @@ Let's attempt to show this with one line of text.  The cursor is on the "w" of
 currently visible.  The "window"s below the text indicate the text that is
 visible after the command left of it.
 
-			      |<-- current window -->|
+			      `|<-- current window -->|`
 		some long text, part of which is visible in the window ~
-	ze	  |<--	   window     -->|
-	zH	   |<--     window     -->|
-	4zh		  |<--	   window     -->|
-	zh		     |<--     window	 -->|
-	zl		       |<--	window	   -->|
-	4zl			  |<--	   window     -->|
-	zL				|<--	 window     -->|
-	zs			       |<--	window	   -->|
+	ze	  `|<--	   window     -->|`
+	zH	   `|<--     window     -->|`
+	4zh		  `|<--	   window     -->|`
+	zh		     `|<--     window	 -->|`
+	zl		       `|<--	window	   -->|`
+	4zl			  `|<--	   window     -->|`
+	zL				`|<--	 window     -->|`
+	zs			       `|<--	window	   -->|`
 
 
 MOVING WITH WRAP OFF
@@ -350,7 +350,7 @@ scroll:
 	gM		to middle of the text in this line
 	g$		to last visible character in this line
 
-		|<--	  window     -->|
+		`|<--	  window     -->|`
 	some long    text, part of which is visible in one line ~
 		 g0  g^    gm	   gM g$
 
@@ -365,7 +365,7 @@ broken halfway, which makes them hard to read.
 'linebreak' option.  Vim then breaks lines at an appropriate place when
 displaying the line.  The text in the file remains unchanged.
    Without 'linebreak' text might look like this:
-
+>
 	+---------------------------------+
 	|letter generation program for a b|
 	|ank.  They wanted to send out a s|
@@ -373,12 +373,13 @@ displaying the line.  The text in the file remains unchanged.
 	|eir richest 1000 customers.  Unfo|
 	|rtunately for the programmer, he |
 	+---------------------------------+
+<
 After: >
 
 	:set linebreak
 
 it looks like this:
-
+>
 	+---------------------------------+
 	|letter generation program for a  |
 	|bank.  They wanted to send out a |
@@ -386,7 +387,7 @@ it looks like this:
 	|their richest 1000 customers.    |
 	|Unfortunately for the programmer,|
 	+---------------------------------+
-
+<
 Related options:
 'breakat' specifies the characters where a break can be inserted.
 'showbreak' specifies a string to show at the start of broken line.
@@ -425,7 +426,7 @@ That looks complicated.  Let's break it up in pieces:
 			into one line.
 
 Starting with this text, containing eight lines broken at column 30:
-
+>
 	+----------------------------------+
 	|A letter generation program	   |
 	|for a bank.  They wanted to	   |
@@ -436,9 +437,9 @@ Starting with this text, containing eight lines broken at column 30:
 	|customers.  Unfortunately for	   |
 	|the programmer,		   |
 	+----------------------------------+
-
+<
 You end up with two lines:
-
+>
 	+----------------------------------+
 	|A letter generation program for a |
 	|bank.	They wanted to send out a s|
@@ -446,7 +447,7 @@ You end up with two lines:
 	|To their richest 1000 customers.  |
 	|Unfortunately for the programmer, |
 	+----------------------------------+
-
+<
 Note that this doesn't work when the separating line is blank but not empty;
 when it contains spaces and/or tabs.  This command does work with blank lines:
 >
diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt
index 87981a8ce0..751cb9a902 100644
--- a/runtime/doc/usr_29.txt
+++ b/runtime/doc/usr_29.txt
@@ -53,7 +53,7 @@ function.
    The "write_line" function calls "write_char".  You need to figure out what
 it does.  So you position the cursor over the call to "write_char" and press
 CTRL-].  Now you are at the definition of "write_char".
-
+>
 	+-------------------------------------+
 	|void write_block(char **s; int cnt)  |
 	|{				      |
@@ -79,7 +79,7 @@ CTRL-].  Now you are at the definition of "write_char".
 				       |    putchar((int)(unsigned char)c); |
 				       |}				    |
 				       +------------------------------------+
-
+<
 The ":tags" command shows the list of tags that you traversed through:
 
 	:tags
@@ -425,7 +425,7 @@ MOVING IN COMMENTS
 
 To move back to the start of a comment use "[/".  Move forward to the end of a
 comment with "]/".  This only works for /* - */ comments.
-
+>
 	  +->	  +-> /*
 	  |    [/ |    * A comment about      --+
        [/ |	  +--  * wonderful life.	| ]/
@@ -434,7 +434,7 @@ comment with "]/".  This only works for /* - */ comments.
 	  +--	       foo = bar * 3;	      --+
 						| ]/
 		       /* a short comment */  <-+
-
+<
 ==============================================================================
 *29.4*	Finding global identifiers
 
@@ -575,7 +575,7 @@ and jump to the first place where the word under the cursor is used: >
 Hint: Goto Definition.  This command is very useful to find a variable or
 function that was declared locally ("static", in C terms).  Example (cursor on
 "counter"):
-
+>
 	   +->   static int counter = 0;
 	   |
 	   |     int get_counter(void)
@@ -583,7 +583,7 @@ function that was declared locally ("static", in C terms).  Example (cursor on
 	   |	     ++counter;
 	   +--	     return counter;
 		 }
-
+<
 To restrict the search even further, and look only in the current function,
 use this command: >
 
@@ -593,7 +593,7 @@ This will go back to the start of the current function and find the first
 occurrence of the word under the cursor.  Actually, it searches backwards to
 an empty line above a "{" in the first column.  From there it searches forward
 for the identifier.  Example (cursor on "idx"):
-
+>
 		int find_entry(char *name)
 		{
 	   +->	    int idx;
@@ -602,7 +602,7 @@ for the identifier.  Example (cursor on "idx"):
 	   |		if (strcmp(table[idx].name, name) == 0)
 	   +--		    return idx;
 		}
-
+<
 ==============================================================================
 
 Next chapter: |usr_30.txt|  Editing programs
diff --git a/runtime/doc/usr_30.txt b/runtime/doc/usr_30.txt
index 98d1780cc4..7e7b3b21f4 100644
--- a/runtime/doc/usr_30.txt
+++ b/runtime/doc/usr_30.txt
@@ -56,7 +56,7 @@ From this you can see that you have errors in the file "main.c".  When you
 press , Vim displays the file "main.c", with the cursor positioned on
 line 6, the first line with an error.  You did not need to specify the file or
 the line number, Vim knew where to go by looking in the error messages.
-
+>
 		+---------------------------------------------------+
 		|int main()					    |
 		|{						    |
@@ -69,7 +69,7 @@ the line number, Vim knew where to go by looking in the error messages.
 		| ~						    |
 		|(3 of 12): too many arguments to function 'do_sub' |
 		+---------------------------------------------------+
-
+<
 The following command goes to where the next error occurs: >
 
 	:cnext
diff --git a/runtime/doc/usr_32.txt b/runtime/doc/usr_32.txt
index 8b489ea1e0..324efccf25 100644
--- a/runtime/doc/usr_32.txt
+++ b/runtime/doc/usr_32.txt
@@ -169,10 +169,10 @@ To travel forward in time again use the |:later| command: >
 The arguments are "s", "m" and "h", just like with |:earlier|.
 
 If you want even more details, or want to manipulate the information, you can
-use the |undotree()| function.  To see what it returns: >
-
+use the |undotree()| function.  To see what it returns:
+>
 	:echo undotree()
-
+<
 ==============================================================================
 
 Next chapter: |usr_40.txt|  Make new commands
diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt
index f47c933124..8befb15528 100644
--- a/runtime/doc/usr_40.txt
+++ b/runtime/doc/usr_40.txt
@@ -226,7 +226,7 @@ When using a space inside a mapping, use  (seven characters): >
 This makes the spacebar move a blank-separated word forward.
 
 It is not possible to put a comment directly after a mapping, because the "
-character is considered to be part of the mapping.  You can use |", this
+character is considered to be part of the mapping.  You can use `|"`, this
 starts a new, empty command with a comment.  Example: >
 
 	:map  W|     " Use spacebar to move forward a word
@@ -657,10 +657,10 @@ To ignore all events, use the following command: >
 
 	:set eventignore=all
 
-To set it back to the normal behavior, make 'eventignore' empty: >
-
+To set it back to the normal behavior, make 'eventignore' empty:
+>
 	:set eventignore=
-
+<
 ==============================================================================
 
 Next chapter: |usr_41.txt|  Write a Vim script
diff --git a/runtime/doc/usr_42.txt b/runtime/doc/usr_42.txt
index 470f4e0fe5..9c5e3db72c 100644
--- a/runtime/doc/usr_42.txt
+++ b/runtime/doc/usr_42.txt
@@ -81,7 +81,7 @@ the far right.
    The second number (340) determines the location of the item within the
 pull-down menu.  Lower numbers go on top, higher number on the bottom.  These
 are the priorities in the File menu:
-
+>
 			+-----------------+
 	    10.310	|Open...	  |
 	    10.320	|Split-Open...	  |
@@ -99,7 +99,7 @@ are the priorities in the File menu:
 	    10.610	|Save-Exit	  |
 	    10.620	|Exit		  |
 			+-----------------+
-
+<
 Notice that there is room in between the numbers.  This is where you can
 insert your own items, if you really want to (it's often better to leave the
 standard menus alone and add a new menu for your own items).
@@ -168,11 +168,11 @@ inserts a CTRL-C or CTRL-O for you.  For example, if you use this command:
 
 Then the resulting menu commands will be:
 
-	Normal mode:		*
-	Visual mode:		CTRL-C *
-	Operator-pending mode:	CTRL-C *
-	Insert mode:		CTRL-O *
-	Command-line mode:	CTRL-C *
+	Normal mode:		`*`
+	Visual mode:		CTRL-C `*`
+	Operator-pending mode:	CTRL-C `*`
+	Insert mode:		CTRL-O `*`
+	Command-line mode:	CTRL-C `*`
 
 When in Command-line mode the CTRL-C will abandon the command typed so far.
 In Visual and Operator-pending mode CTRL-C will stop the mode.  The CTRL-O in
-- 
cgit 


From 5841a97500bffa5a2b9eed2eb41025f5587790ba Mon Sep 17 00:00:00 2001
From: Lewis Russell 
Date: Tue, 3 Jan 2023 10:07:43 +0000
Subject: feat!: remove hardcopy

Co-authored-by: Justin M. Keyes 
---
 runtime/doc/eval.txt     |  19 +-
 runtime/doc/help.txt     |   5 -
 runtime/doc/index.txt    |   1 -
 runtime/doc/news.txt     |  11 +
 runtime/doc/options.txt  |  58 +----
 runtime/doc/pi_netrw.txt |   9 -
 runtime/doc/print.txt    | 629 -----------------------------------------------
 runtime/doc/quickref.txt |   8 -
 runtime/doc/usr_06.txt   |  57 +----
 runtime/doc/usr_toc.txt  |   3 +-
 runtime/doc/various.txt  |   4 +-
 runtime/doc/vi_diff.txt  |   4 -
 runtime/doc/vim_diff.txt |  12 +
 13 files changed, 36 insertions(+), 784 deletions(-)
 delete mode 100644 runtime/doc/print.txt

(limited to 'runtime/doc')

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 8dd79d45a4..151036529d 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1718,17 +1718,13 @@ v:charconvert_to
 		Only valid while evaluating the 'charconvert' option.
 
 					*v:cmdarg* *cmdarg-variable*
-v:cmdarg	This variable is used for two purposes:
-		1. The extra arguments ("++p", "++enc=", "++ff=") given to
-		   a file read/write command.  This is set before an
-		   autocommand event for a file read/write command is
-		   triggered.  There is a leading space to make it possible to
-		   append this variable directly after the read/write command.
-		   Note: "+cmd" isn't included here, because it will be
-		   executed anyway.
-		2. When printing a PostScript file with ":hardcopy" this is
-		   the argument for the ":hardcopy" command.  This can be used
-		   in 'printexpr'.
+v:cmdarg
+		The extra arguments ("++p", "++enc=", "++ff=") given to a file
+		read/write command.  This is set before an autocommand event
+		for a file read/write command is triggered.  There is a
+		leading space to make it possible to append this variable
+		directly after the read/write command. Note: "+cmd" isn't
+		included here, because it will be executed anyway.
 
 						*v:collate* *collate-variable*
 v:collate	The current locale setting for collation order of the runtime
@@ -1926,7 +1922,6 @@ v:fname_in	The name of the input file.  Valid while evaluating:
 			'charconvert'	file to be converted
 			'diffexpr'	original file
 			'patchexpr'	original file
-			'printexpr'	file to be printed
 		And set to the swap file name for |SwapExists|.
 
 					*v:fname_out* *fname_out-variable*
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 9cf0ea69f2..07f898f99c 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -169,11 +169,6 @@ DEVELOPING NVIM
 |dev-style|		Development style guidelines
 |debug.txt|		Debugging Vim itself
 
-------------------------------------------------------------------------------
-OTHER
-
-|print.txt|		For your briefcase and fax machine
-
 						*standard-plugin-list*
 Standard plugins ~
 |matchit.txt|		Extended |%| matching
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 66353e05f3..a6aa036b55 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1310,7 +1310,6 @@ tag		command		action ~
 |:grepadd|	:grepa[dd]	like :grep, but append to current list
 |:gui|		:gu[i]		start the GUI
 |:gvim|		:gv[im]		start the GUI
-|:hardcopy|	:ha[rdcopy]	send text to the printer
 |:help|		:h[elp]		open a help window
 |:helpclose|	:helpc[lose]	close one help window
 |:helpgrep|	:helpg[rep]	like ":grep" but searches help files
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 1a242e9128..ffc8ce2c88 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -34,6 +34,17 @@ The following changes may require adaptations in user config or plugins.
 
   See https://github.com/neovim/neovim/pull/20545 for more information.
 
+• `:hardcopy` is now removed (see |hardcopy| and |nvim-features-removed|):
+  - Commands removed:
+    - `:hardcopy`
+  - Options removed:
+    - `printdevice`
+    - `printencoding`
+    - `printexpr`
+    - `printfont`
+    - `printheader`
+    - `printmbcharset`
+
 ==============================================================================
 NEW FEATURES                                                    *news-features*
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index f4eb49953d..ee6c14e73f 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -163,7 +163,7 @@ halved and when you expect the backslashes to be kept.  The third gives a
 result which is probably not what you want.  Avoid it.
 
 				*add-option-flags* *remove-option-flags*
-				*E539* *E550* *E551* *E552*
+				*E539*
 Some options are a list of flags.  When you want to add a flag to such an
 option, without changing the existing ones, you can do it like this: >
    :set guioptions+=a
@@ -4681,58 +4681,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 	set.  It's normally not set directly, but by using one of the commands
 	|:ptag|, |:pedit|, etc.
 
-						*'printdevice'* *'pdev'*
-'printdevice' 'pdev'	string	(default empty)
-			global
-	The name of the printer to be used for |:hardcopy|.
-	See |pdev-option|.
-	This option cannot be set from a |modeline| or in the |sandbox|, for
-	security reasons.
-
-						*'printencoding'* *'penc'*
-'printencoding' 'penc'	string	(default empty, except for some systems)
-			global
-	Sets the character encoding used when printing.
-	See |penc-option|.
-
-						*'printexpr'* *'pexpr'*
-'printexpr' 'pexpr'	string	(default: see below)
-			global
-	Expression used to print the PostScript produced with |:hardcopy|.
-	See |pexpr-option|.
-	This option cannot be set from a |modeline| or in the |sandbox|, for
-	security reasons.
-
-						*'printfont'* *'pfn'*
-'printfont' 'pfn'	string	(default "courier")
-			global
-	The name of the font that will be used for |:hardcopy|.
-	See |pfn-option|.
-
-						*'printheader'* *'pheader'*
-'printheader' 'pheader'  string  (default "%<%f%h%m%=Page %N")
-			global
-	The format of the header produced in |:hardcopy| output.
-	See |pheader-option|.
-
-						*'printmbcharset'* *'pmbcs'*
-'printmbcharset' 'pmbcs'  string (default "")
-			global
-	The CJK character set to be used for CJK output from |:hardcopy|.
-	See |pmbcs-option|.
-
-						*'printmbfont'* *'pmbfn'*
-'printmbfont' 'pmbfn'	string (default "")
-			global
-	List of font names to be used for CJK output from |:hardcopy|.
-	See |pmbfn-option|.
-
-						*'printoptions'* *'popt'*
-'printoptions' 'popt' string (default "")
-			global
-	List of items that control the format of the output of |:hardcopy|.
-	See |popt-option|.
-
 						*'pumblend'* *'pb'*
 'pumblend' 'pb'		number	(default 0)
 			global
@@ -5004,7 +4952,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 	  pack/		packages |:packadd|
 	  parser/	|treesitter| syntax parsers
 	  plugin/	plugin scripts |write-plugin|
-	  print/	files for printing |postscript-print-encoding|
 	  query/	|treesitter| queries
 	  rplugin/	|remote-plugin| scripts
 	  spell/	spell checking files |spell|
@@ -6126,7 +6073,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 	o N   Byte number in file of byte under cursor, first byte is 1.
 	      Mnemonic: Offset from start of file (with one added)
 	O N   As above, in hexadecimal.
-	N N   Printer page number.  (Only works in the 'printheader' option.)
 	l N   Line number.
 	L N   Number of lines in buffer.
 	c N   Column number (byte index).
@@ -6407,7 +6353,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	the |:retab| command, and the 'softtabstop' option.
 
 	Note: Setting 'tabstop' to any other value than 8 can make your file
-	appear wrong in many places, e.g., when printing it.
+	appear wrong in many places.
 	The value must be more than 0 and less than 10000.
 
 	There are four main ways to use tabs in Vim:
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 9de1233979..5167b4baf7 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -2419,15 +2419,6 @@ from the current window (where one does the mf) to the target.
 
 Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
 
-MARKED FILES: PRINTING						*netrw-mp* {{{2
-	    (See |netrw-mf| and |netrw-mr| for how to mark files)
-		      (uses the local marked file list)
-
-When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
-What netrw does is open each file in a one-line window, execute hardcopy, then
-close the one-line window.
-
-
 MARKED FILES: SOURCING						*netrw-ms* {{{2
 	    (See |netrw-mf| and |netrw-mr| for how to mark files)
 		      (uses the local marked file list)
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
deleted file mode 100644
index ef3e47d32c..0000000000
--- a/runtime/doc/print.txt
+++ /dev/null
@@ -1,629 +0,0 @@
-*print.txt*     Nvim
-
-
-		  VIM REFERENCE MANUAL    by Bram Moolenaar
-
-
-Printing						*printing*
-
-                                      Type |gO| to see the table of contents.
-
-==============================================================================
-1. Introduction						*print-intro*
-
-On MS-Windows Vim can print your text on any installed printer.  On other
-systems a PostScript file is produced.  This can be directly sent to a
-PostScript printer.  For other printers a program like ghostscript needs to be
-used.
-
-Note: If you have problems printing with |:hardcopy|, an alternative is to use
-|:TOhtml| and print the resulting html file from a browser.
-
-					*:ha* *:hardcopy* *E237* *E238* *E324*
-:[range]ha[rdcopy][!] [arguments]
-			Send [range] lines (default whole file) to the
-			printer.
-
-			On MS-Windows a dialog is displayed to allow selection
-			of printer, paper size etc.  To skip the dialog, use
-			the [!].  In this case the printer defined by
-			'printdevice' is used, or, if 'printdevice' is empty,
-			the system default printer.
-
-			For systems other than MS-Windows, PostScript is
-			written in a temp file and 'printexpr' is used to
-			actually print it.  Then [arguments] can be used by
-			'printexpr' through |v:cmdarg|.  Otherwise [arguments]
-			is ignored.  'printoptions' can be used to specify
-			paper size, duplex, etc.
-			Note: If you want PDF, there are tools such as
-			"ps2pdf" that can convert the PostScript to PDF.
-
-:[range]ha[rdcopy][!] >{filename}
-			As above, but write the resulting PostScript in file
-			{filename}.
-			Things like "%" are expanded |cmdline-special|
-			Careful: An existing file is silently overwritten.
-			On MS-Windows use the "print to file" feature of the
-			printer driver.
-
-Progress is displayed during printing as a page number and a percentage.  To
-abort printing use the interrupt key (CTRL-C or, on MS-systems, CTRL-Break).
-
-Printer output is controlled by the 'printfont' and 'printoptions' options.
-'printheader' specifies the format of a page header.
-
-The printed file is always limited to the selected margins, irrespective of
-the current window's 'wrap' or 'linebreak' settings.  The "wrap" item in
-'printoptions' can be used to switch wrapping off.
-The current highlighting colors are used in the printout, with the following
-considerations:
-1) The normal background is always rendered as white (i.e. blank paper).
-2) White text or the default foreground is rendered as black, so that it shows
-   up!
-3) If 'background' is "dark", then the colours are darkened to compensate for
-   the fact that otherwise they would be too bright to show up clearly on
-   white paper.
-
-==============================================================================
-2. Print options					*print-options*
-
-Here are the details for the options that change the way printing is done.
-For generic info about setting options see |options.txt|.
-
-							*pdev-option*
-'printdevice' 'pdev'	string	(default empty)
-			global
-This defines the name of the printer to be used when the |:hardcopy| command
-is issued with a bang (!) to skip the printer selection dialog.  On Win32, it
-should be the printer name exactly as it appears in the standard printer
-dialog.
-If the option is empty, then vim will use the system default printer for
-":hardcopy!"
-
-							*penc-option* *E620*
-'printencoding' 'penc'	String	(default empty, except for:
-					Windows: cp1252,
-					Macintosh: mac-roman,
-					HPUX: hp-roman8)
-			global
-Sets the character encoding used when printing.  This option tells Vim which
-print character encoding file from the "print" directory in 'runtimepath' to
-use.
-
-This option will accept any value from |encoding-names|.  Any recognized names
-are converted to Vim standard names - see 'encoding' for more details.  Names
-not recognized by Vim will just be converted to lower case and underscores
-replaced with '-' signs.
-
-If 'printencoding' is empty or Vim cannot find the file then it will use
-'encoding' (if it is set an 8-bit encoding) to find the print character
-encoding file.  If Vim is unable to find a character encoding file then it
-will use the "latin1" print character encoding file.
-
-When 'encoding' is set to a multibyte encoding, Vim will try to convert
-characters to the printing encoding for printing (if 'printencoding' is empty
-then the conversion will be to latin1). If no conversion is possible then
-printing will fail.  Any characters that cannot be converted will be replaced
-with upside down question marks.
-
-Two print character encoding files are provided to support default Mac and
-HPUX character encodings and are used by default on these platforms. Code page
-1252 print character encoding is used by default on the Windows platform.
-
-							*pexpr-option*
-'printexpr' 'pexpr'	String	(default: see below)
-			global
-Expression that is evaluated to print the PostScript produced with
-|:hardcopy|.
-The file name to be printed is in |v:fname_in|.
-The arguments to the ":hardcopy" command are in |v:cmdarg|.
-The expression must take care of deleting the file after printing it.
-When there is an error, the expression must return a non-zero number.
-If there is no error, return zero or an empty string.
-The default for non MS-Windows systems is to simply use "lpr" to print the
-file: >
-
-    system(['lpr']
-           + (empty(&printdevice)?[]:['-P', &printdevice])
-           + [v:fname_in])
-    .. delete(v:fname_in)
-    + v:shell_error
-
-On MS-Dos and MS-Windows machines the default is to copy the file to the
-currently specified printdevice: >
-
-    system(['copy', v:fname_in, empty(&printdevice)?'LPT1':&printdevice])
-    .. delete(v:fname_in)
-
-If you change this option, using a function is an easy way to avoid having to
-escape all the spaces.  Example: >
-
-	:set printexpr=PrintFile(v:fname_in)
-	:function PrintFile(fname)
-	:  call system("ghostview " .. a:fname)
-	:  call delete(a:fname)
-	:  return v:shell_error
-	:endfunc
-
-Be aware that some print programs return control before they have read the
-file.  If you delete the file too soon it will not be printed.  These programs
-usually offer an option to have them remove the file when printing is done.
-							*E365*
-If evaluating the expression fails or it results in a non-zero number, you get
-an error message.  In that case Vim will delete the file.  In the default
-value for non-MS-Windows a trick is used: Adding "v:shell_error" will result
-in a non-zero number when the system() call fails.
-
-If the expression starts with s: or ||, then it is replaced with the
-script ID (|local-function|). Example: >
-		set printexpr=s:MyPrintFile()
-		set printexpr=SomePrintFile()
-<
-This option cannot be set from a |modeline| or in the |sandbox|, for security
-reasons.
-
-							*pfn-option* *E613*
-'printfont' 'pfn'	string	(default "courier")
-			global
-This is the name of the font that will be used for the |:hardcopy| command's
-output.  It has the same format as the 'guifont' option, except that only one
-font may be named, and the special "guifont=*" syntax is not available.
-
-In the Win32 GUI version this specifies a font name with its extra attributes,
-as with the 'guifont' option.
-
-For other systems, only ":h11" is recognized, where "11" is the point size of
-the font.  When omitted, the point size is 10.
-
-							*pheader-option*
-'printheader' 'pheader'  string  (default "%<%f%h%m%=Page %N")
-			 global
-This defines the format of the header produced in |:hardcopy| output.  The
-option is defined in the same way as the 'statusline' option.  The same simple
-header is used when this option is empty.
-
-							*pmbcs-option*
-'printmbcharset' 'pmbcs'  string (default "")
-			  global
-Sets the CJK character set to be used when generating CJK output from
-|:hardcopy|.  The following predefined values are currently recognised by Vim:
-
-		Value		Description ~
-  Chinese	GB_2312-80
-  (Simplified)	GBT_12345-90
-		MAC		Apple Mac Simplified Chinese
-		GBT-90_MAC	GB/T 12345-90 Apple Mac Simplified
-				  Chinese
-		GBK		GBK (GB 13000.1-93)
-		ISO10646	ISO 10646-1:1993
-
-  Chinese	CNS_1993	CNS 11643-1993, Planes 1 & 2
-  (Traditional)	BIG5
-		ETEN		Big5 with ETen extensions
-		ISO10646	ISO 10646-1:1993
-
-  Japanese	JIS_C_1978
-		JIS_X_1983
-		JIS_X_1990
-		MSWINDOWS	Win3.1/95J (JIS X 1997 + NEC +
-				  IBM extensions)
-		KANJITALK6	Apple Mac KanjiTalk V6.x
-		KANJITALK7	Apple Mac KanjiTalk V7.x
-
-  Korean	KS_X_1992
-		MAC		Apple Macintosh Korean
-		MSWINDOWS	KS X 1992 with MS extensions
-		ISO10646	ISO 10646-1:1993
-
-Only certain combinations of the above values and 'printencoding' are
-possible.  The following tables show the valid combinations:
-
-				euc-cn	 gbk	ucs-2	utf-8 ~
-  Chinese	GB_2312-80	   x
-  (Simplified)	GBT_12345-90	   x
-		MAC		   x
-		GBT-90_MAC	   x
-		GBK			   x
-		ISO10646			  x	  x
-
-				euc-tw	 big5	ucs-2	utf-8 ~
-  Chinese	CNS_1993	   x
-  (Traditional)	BIG5			   x
-		ETEN			   x
-		ISO10646			  x	  x
-
-				euc-jp	 sjis	ucs-2	utf-8 ~
-  Japanese	JIS_C_1978	   x	   x
-		JIS_X_1983	   x	   x
-		JIS_X_1990	   x		  x	  x
-		MSWINDOWS		   x
-		KANJITALK6		   x
-		KANJITALK7		   x
-
-				euc-kr	 cp949	ucs-2	utf-8 ~
-  Korean	KS_X_1992	   x
-		MAC		   x
-		MSWINDOWS		   x
-		ISO10646			  x	  x
-
-To set up the correct encoding and character set for printing some
-Japanese text you would do the following; >
-	:set printencoding=euc-jp
-	:set printmbcharset=JIS_X_1983
-
-If 'printmbcharset' is not one of the above values then it is assumed to
-specify a custom multibyte character set and no check will be made that it is
-compatible with the value for 'printencoding'.  Vim will look for a file
-defining the character set in the "print" directory in 'runtimepath'.
-
-							*pmbfn-option*
-'printmbfont' 'pmbfn'	string (default "")
-			global
-This is a comma-separated list of fields for font names to be used when
-generating CJK output from |:hardcopy|.  Each font name has to be preceded
-with a letter indicating the style the font is to be used for as follows:
-
-  r:{font-name}		font to use for normal characters
-  b:{font-name}		font to use for bold characters
-  i:{font-name}		font to use for italic characters
-  o:{font-name}		font to use for bold-italic characters
-
-A field with the r: prefix must be specified when doing CJK printing.  The
-other fontname specifiers are optional.  If a specifier is missing then
-another font will be used as follows:
-
-  if b: is missing, then use r:
-  if i: is missing, then use r:
-  if o: is missing, then use b:
-
-Some CJK fonts do not contain characters for codes in the ASCII code range.
-Also, some characters in the CJK ASCII code ranges differ in a few code points
-from traditional ASCII characters.  There are two additional fields to control
-printing of characters in the ASCII code range.
-
-  c:yes			Use Courier font for characters in the ASCII
-  c:no (default)	code range.
-
-  a:yes			Use ASCII character set for codes in the ASCII
-  a:no (default)	code range.
-
-The following is an example of specifying two multibyte fonts, one for normal
-and italic printing and one for bold and bold-italic printing, and using
-Courier to print codes in the ASCII code range but using the national
-character set: >
-	:set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,c:yes
-<
-							*popt-option*
-'printoptions' 'popt'	string (default "")
-			global
-This is a comma-separated list of items that control the format of the output
-of |:hardcopy|:
-
-  left:{spec}		left margin (default: 10pc)
-  right:{spec}		right margin (default: 5pc)
-  top:{spec}		top margin (default: 5pc)
-  bottom:{spec}		bottom margin (default: 5pc)
-			{spec} is a number followed by "in" for inches, "pt"
-			for points (1 point is 1/72 of an inch), "mm" for
-			millimeters or "pc" for a percentage of the media
-			size.
-			Weird example:
-			    left:2in,top:30pt,right:16mm,bottom:3pc
-			If the unit is not recognized there is no error and
-			the default value is used.
-
-  header:{nr}		Number of lines to reserve for the header.
-			Only the first line is actually filled, thus when {nr}
-			is 2 there is one empty line.  The header is formatted
-			according to 'printheader'.
-  header:0		Do not print a header.
-  header:2  (default)	Use two lines for the header
-
-  syntax:n		Do not use syntax highlighting.  This is faster and
-			thus useful when printing large files.
-  syntax:y		Do syntax highlighting.
-  syntax:a  (default)	Use syntax highlighting if the printer appears to be
-			able to print color or grey.
-
-  number:y		Include line numbers in the printed output.
-  number:n  (default)	No line numbers.
-
-  wrap:y    (default)	Wrap long lines.
-  wrap:n		Truncate long lines.
-
-  duplex:off		Print on one side.
-  duplex:long (default)	Print on both sides (when possible), bind on long
-			side.
-  duplex:short		Print on both sides (when possible), bind on short
-			side.
-
-  collate:y  (default)	Collating: 1 2 3, 1 2 3, 1 2 3
-  collate:n		No collating: 1 1 1, 2 2 2, 3 3 3
-
-  jobsplit:n (default)	Do all copies in one print job
-  jobsplit:y		Do each copy as a separate print job.  Useful when
-			doing N-up postprocessing.
-
-  portrait:y (default)	Orientation is portrait.
-  portrait:n		Orientation is landscape.
-						*a4* *letter*
-  paper:A4   (default)	Paper size: A4
-  paper:{name}		Paper size from this table:
-			{name}	    size in cm	     size in inch ~
-			10x14	    25.4  x 35.57    10    x 14
-			A3	    29.7  x 42	     11.69 x 16.54
-			A4	    21	  x 29.7      8.27 x 11.69
-			A5	    14.8  x 21	      5.83 x  8.27
-			B4	    25	  x 35.3     10.12 x 14.33
-			B5	    17.6  x 25	      7.17 x 10.12
-			executive   18.42 x 26.67     7.25 x 10.5
-			folio	    21	  x 33	      8.27 x 13
-			ledger	    43.13 x 27.96    17    x 11
-			legal	    21.59 x 35.57     8.5  x 14
-			letter	    21.59 x 27.96     8.5  x 11
-			quarto	    21.59 x 27.5      8.5  x 10.83
-			statement   13.97 x 21.59     5.5  x  8.5
-			tabloid     27.96 x 43.13    11    x 17
-
-  formfeed:n (default)	Treat form feed characters (0x0c) as a normal print
-			character.
-  formfeed:y		When a form feed character is encountered, continue
-			printing of the current line at the beginning of the
-			first line on a new page.
-
-The item indicated with (default) is used when the item is not present.  The
-values are not always used, especially when using a dialog to select the
-printer and options.
-Example: >
-	:set printoptions=paper:letter,duplex:off
-
-==============================================================================
-3. PostScript Printing					*postscript-printing*
-						*E455* *E456* *E457* *E624*
-Provided you have enough disk space there should be no problems generating a
-PostScript file.  You need to have the runtime files correctly installed (if
-you can find the help files, they probably are).
-
-There are currently a number of limitations with PostScript printing:
-
-- 'printfont' - The font name is ignored (the Courier family is always used -
-  it should be available on all PostScript printers) but the font size is
-  used.
-
-- 'printoptions' - The duplex setting is used when generating PostScript
-  output, but it is up to the printer to take notice of the setting.  If the
-  printer does not support duplex printing then it should be silently ignored.
-  Some printers, however, don't print at all.
-
-- 8-bit support - While a number of 8-bit print character encodings are
-  supported it is possible that some characters will not print.  Whether a
-  character will print depends on the font in the printer knowing the
-  character.  Missing characters will be replaced with an upside down question
-  mark, or a space if that character is also not known by the font.  It may be
-  possible to get all the characters in an encoding to print by installing a
-  new version of the Courier font family.
-
-- Multi-byte support - Currently Vim will try to convert multibyte characters
-  to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
-  empty).  Any characters that are not successfully converted are shown as
-  unknown characters.  Printing will fail if Vim cannot convert the multibyte
-  to the 8-bit encoding.
-
-==============================================================================
-4. Custom 8-bit Print Character Encodings	*postscript-print-encoding*
-								*E618* *E619*
-To use your own print character encoding when printing 8-bit character data
-you need to define your own PostScript font encoding vector.  Details on how
-to define a font encoding vector is beyond the scope of this help file, but
-you can find details in the PostScript Language Reference Manual, 3rd Edition,
-published by Addison-Wesley and available in PDF form at
-https://www.adobe.com/.  The following describes what you need to do for Vim to
-locate and use your print character encoding.
-
-i.   Decide on a unique name for your encoding vector, one that does not clash
-     with any of the recognized or standard encoding names that Vim uses (see
-     |encoding-names| for a list), and that no one else is likely to use.
-ii.  Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
-     'runtimepath' and rename it with your unique name.
-iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
-     with your unique name (don't forget the line starting %%Title:), and
-     modify the array of glyph names to define your new encoding vector.  The
-     array must have exactly 256 entries or you will not be able to print!
-iv.  Within Vim, set 'printencoding' to your unique encoding name and then
-     print your file.  Vim will now use your custom print character encoding.
-
-Vim will report an error with the resource file if you change the order or
-content of the first 3 lines, other than the name of the encoding on the line
-starting %%Title: or the version number on the line starting %%Version:.
-
-[Technical explanation for those that know PostScript - Vim looks for a file
-with the same name as the encoding it will use when printing.  The file
-defines a new PostScript Encoding resource called /VIM-name, where name is the
-print character encoding Vim will use.]
-
-==============================================================================
-5. PostScript CJK Printing			*postscript-cjk-printing*
-							*E673* *E674* *E675*
-
-Vim supports printing of Chinese, Japanese, and Korean files.  Setting up Vim
-to correctly print CJK files requires setting up a few more options.
-
-Each of these countries has many standard character sets and encodings which
-require that both be specified when printing.  In addition, CJK fonts normally
-do not have the concept of italic glyphs and use different weight or stroke
-style to achieve emphasis when printing.  This in turn requires a different
-approach to specifying fonts to use when printing.
-
-The encoding and character set are specified with the 'printencoding' and
-'printmbcharset' options.  If 'printencoding' is not specified then 'encoding'
-is used as normal.  If 'printencoding' is specified then characters will be
-translated to this encoding for printing.  You should ensure that the encoding
-is compatible with the character set needed for the file contents or some
-characters may not appear when printed.
-
-The fonts to use for CJK printing are specified with 'printmbfont'.  This
-option allows you to specify different fonts to use when printing characters
-which are syntax highlighted with the font styles normal, italic, bold and
-bold-italic.
-
-Please read your printer documentation on how to install new fonts.
-
-CJK fonts can be large containing several thousand glyphs, and it is not
-uncommon to find that they only contain a subset of a national standard.  It
-is not unusual to find the fonts to not include characters for codes in the
-ASCII code range.  If you find half-width Roman characters are not appearing
-in your printout then you should configure Vim to use the Courier font the
-half-width ASCII characters with 'printmbfont'.  If your font does not include
-other characters then you will need to find another font that does.
-
-Another issue with ASCII characters, is that the various national character
-sets specify a couple of different glyphs in the ASCII code range.  If you
-print ASCII text using the national character set you may see some unexpected
-characters.  If you want true ASCII code printing then you need to configure
-Vim to output ASCII characters for the ASCII code range with 'printmbfont'.
-
-It is possible to define your own multibyte character set although this
-should not be attempted lightly.  A discussion on the process if beyond the
-scope of these help files.  You can find details on CMap (character map) files
-in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0',
-available from https://www.adobe.com as a PDF file.
-
-==============================================================================
-6. PostScript Printing Troubleshooting		*postscript-print-trouble*
-									*E621*
-Usually the only sign of a problem when printing with PostScript is that your
-printout does not appear.  If you are lucky you may get a printed page that
-tells you the PostScript operator that generated the error that prevented the
-print job completing.
-
-There are a number of possible causes as to why the printing may have failed:
-
-- Wrong version of the prolog resource file.  The prolog resource file
-  contains some PostScript that Vim needs to be able to print.  Each version
-  of Vim needs one particular version.  Make sure you have correctly installed
-  the runtime files, and don't have any old versions of a file called prolog
-  in the print directory in your 'runtimepath' directory.
-
-- Paper size.  Some PostScript printers will abort printing a file if they do
-  not support the requested paper size.  By default Vim uses A4 paper.  Find
-  out what size paper your printer normally uses and set the appropriate paper
-  size with 'printoptions'.  If you cannot find the name of the paper used,
-  measure a sheet and compare it with the table of supported paper sizes listed
-  for 'printoptions', using the paper that is closest in both width AND height.
-  Note: The dimensions of actual paper may vary slightly from the ones listed.
-  If there is no paper listed close enough, then you may want to try psresize
-  from PSUtils, discussed below.
-
-- Two-sided printing (duplex).  Normally a PostScript printer that does not
-  support two-sided printing will ignore any request to do it.  However, some
-  printers may abort the job altogether.  Try printing with duplex turned off.
-  Note: Duplex prints can be achieved manually using PS utils - see below.
-
-- Collated printing.  As with Duplex printing, most PostScript printers that
-  do not support collating printouts will ignore a request to do so.  Some may
-  not.  Try printing with collation turned off.
-
-- Syntax highlighting.  Some print management code may prevent the generated
-  PostScript file from being printed on a black and white printer when syntax
-  highlighting is turned on, even if solid black is the only color used.  Try
-  printing with syntax highlighting turned off.
-
-A safe printoptions setting to try is: >
-
-	:set printoptions=paper:A4,duplex:off,collate:n,syntax:n
-
-Replace "A4" with the paper size that best matches your printer paper.
-
-==============================================================================
-7. PostScript Utilities				*postscript-print-util*
-
-7.1 Ghostscript
-
-Ghostscript is a PostScript and PDF interpreter that can be used to display
-and print on non-PostScript printers PostScript and PDF files.  It can also
-generate PDF files from PostScript.
-
-Ghostscript will run on a wide variety of platforms. Information on
-Ghostscript can be found at:
-
-  http://www.ghostscript.com/
-
-Support for a number of non PostScript printers is provided in the
-distribution as standard, but if you cannot find support for your printer
-check the Ghostscript site for other printers not included by default.
-
-
-7.2 Ghostscript Previewers.
-
-The interface to Ghostscript is very primitive so a number of graphical front
-ends have been created.  These allow easier PostScript file selection,
-previewing at different zoom levels, and printing.  Check supplied
-documentation for full details.
-
-ALTERNATE DUPLEX PRINTING
-
-It is possible to achieve a poor man's version of duplex printing using the PS
-utility psselect.  This utility has options -e and -o for printing just the
-even or odd pages of a PS file respectively.
-
-First generate a PS file with the ":hardcopy" command, then generate new
-files with all the odd and even numbered pages with: >
-
-	psselect -o test.ps odd.ps
-	psselect -e test.ps even.ps
-
-Next print odd.ps with your platform's normal print command.  Then take the
-print output, turn it over and place it back in the paper feeder.  Now print
-even.ps with your platform's print command.  All the even pages should now
-appear on the back of the odd pages.
-
-There are a couple of points to bear in mind:
-
-1. Position of the first page.  If the first page is on top of the printout
-   when printing the odd pages then you need to reverse the order that the odd
-   pages are printed.  This can be done with the -r option to psselect.  This
-   will ensure page 2 is printed on the back of page 1.
-   Note: it is better to reverse the odd numbered pages rather than the even
-   numbered in case there are an odd number of pages in the original PS file.
-
-2. Paper flipping.  When turning over the paper with the odd pages printed on
-   them you may have to either flip them horizontally (along the long edge) or
-   vertically (along the short edge), as well as possibly rotating them 180
-   degrees.  All this depends on the printer - it will be more obvious for
-   desktop ink jets than for small office laser printers where the paper path
-   is hidden from view.
-
-
-==============================================================================
-8. Formfeed Characters					*printing-formfeed*
-
-By default Vim does not do any special processing of formfeed control
-characters.  Setting the 'printoptions' formfeed item will make Vim recognize
-formfeed characters and continue printing the current line at the beginning
-of the first line on a new page.  The use of formfeed characters provides
-rudimentary print control but there are certain things to be aware of.
-
-Vim will always start printing a line (including a line number if enabled)
-containing a formfeed character, even if it is the first character on the
-line.  This means if a line starting with a formfeed character is the first
-line of a page then Vim will print a blank page.
-
-Since the line number is printed at the start of printing the line containing
-the formfeed character, the remainder of the line printed on the new page
-will not have a line number printed for it (in the same way as the wrapped
-lines of a long line when wrap in 'printoptions' is enabled).
-
-If the formfeed character is the last character on a line, then printing will
-continue on the second line of the new page, not the first.  This is due to
-Vim processing the end of the line after the formfeed character and moving
-down a line to continue printing.
-
-Due to the points made above it is recommended that when formfeed character
-processing is enabled, printing of line numbers is disabled, and that form
-feed characters are not the last character on a line.  Even then you may need
-to adjust the number of lines before a formfeed character to prevent
-accidental blank pages.
-
-==============================================================================
- vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index da136ade16..d0088f5b9b 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -821,14 +821,6 @@ Short explanation of each option:		*option-list*
 'previewheight'   'pvh'     height of the preview window
 'previewpopup'    'pvp'     use popup window for preview
 'previewwindow'   'pvw'     identifies the preview window
-'printdevice'	  'pdev'    name of the printer to be used for :hardcopy
-'printencoding'   'penc'    encoding to be used for printing
-'printexpr'	  'pexpr'   expression used to print PostScript for :hardcopy
-'printfont'	  'pfn'     name of the font to be used for :hardcopy
-'printheader'	  'pheader' format of the header used for :hardcopy
-'printmbcharset'  'pmbcs'   CJK character set to be used for :hardcopy
-'printmbfont'	  'pmbfn'   font names to be used for CJK output of :hardcopy
-'printoptions'	  'popt'    controls the format of :hardcopy output
 'pumheight'	  'ph'	    maximum number of items to show in the popup menu
 'pumwidth'	  'pw'	    minimum width of the popup menu
 'pyxversion'	  'pyx'	    Python version used for pyx* commands
diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt
index 8eda33b4f0..755e6e816a 100644
--- a/runtime/doc/usr_06.txt
+++ b/runtime/doc/usr_06.txt
@@ -14,8 +14,7 @@ screen.
 |06.2|	No or wrong colors?
 |06.3|	Different colors
 |06.4|	With colors or without colors
-|06.5|	Printing with colors
-|06.6|	Further reading
+|06.5|	Further reading
 
      Next chapter: |usr_07.txt|  Editing more than one file
  Previous chapter: |usr_05.txt|  Set your settings
@@ -191,59 +190,7 @@ buffer, set the 'syntax' option: >
 	:set syntax=ON
 <
 ==============================================================================
-*06.5*	Printing with colors				*syntax-printing*
-
-In the MS-Windows version you can print the current file with this command: >
-
-	:hardcopy
-
-You will get the usual printer dialog, where you can select the printer and a
-few settings.  If you have a color printer, the paper output should look the
-same as what you see inside Vim.  But when you use a dark background the
-colors will be adjusted to look good on white paper.
-
-There are several options that change the way Vim prints:
-	'printdevice'
-	'printheader'
-	'printfont'
-	'printoptions'
-
-To print only a range of lines,  use Visual mode to select the lines and then
-type the command: >
-
-	v100j:hardcopy
-
-"v" starts Visual mode.  "100j" moves a hundred lines down, they will be
-highlighted.  Then ":hardcopy" will print those lines.  You can use other
-commands to move in Visual mode, of course.
-
-This also works on Unix, if you have a PostScript printer.  Otherwise, you
-will have to do a bit more work.  You need to convert the text to HTML first,
-and then print it from a web browser.
-
-Convert the current file to HTML with this command: >
-
-	:TOhtml
-
-In case that doesn't work: >
-
-	:source $VIMRUNTIME/syntax/2html.vim
-
-You will see it crunching away, this can take quite a while for a large file.
-Some time later another window shows the HTML code.  Now write this somewhere
-(doesn't matter where, you throw it away later):
->
-	:write main.c.html
-
-Open this file in your favorite browser and print it from there.  If all goes
-well, the output should look exactly as it does in Vim.  See |2html.vim| for
-details.  Don't forget to delete the HTML file when you are done with it.
-
-Instead of printing, you could also put the HTML file on a web server, and let
-others look at the colored text.
-
-==============================================================================
-*06.6*	Further reading
+*06.5*	Further reading
 
 |usr_44.txt|  Your own syntax highlighted.
 |syntax|      All the details.
diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt
index c61bb55c26..dd0d5784f5 100644
--- a/runtime/doc/usr_toc.txt
+++ b/runtime/doc/usr_toc.txt
@@ -111,8 +111,7 @@ Read this from start to end to learn the essential commands.
 		|06.2|	No or wrong colors?
 		|06.3|	Different colors
 		|06.4|	With colors or without colors
-		|06.5|	Printing with colors
-		|06.6|	Further reading
+		|06.5|	Further reading
 
 |usr_07.txt|  Editing more than one file
 		|07.1|	Edit another file
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index cd178cfbbb..e13d892fd6 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -102,9 +102,7 @@ g8			Print the hex values of the bytes used in the
 						*:p* *:pr* *:print* *E749*
 :[range]p[rint] [flags]
 			Print [range] lines (default current line).
-			Note: If you are looking for a way to print your text
-			on paper see |:hardcopy|.  In the GUI you can use the
-			File.Print menu entry.
+			In the GUI you can use the File.Print menu entry.
 			See |ex-flags| for [flags].
 			The |:filter| command can be used to only show lines
 			matching a pattern.
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index cef2859eb5..afabddb7f9 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -337,10 +337,6 @@ Viminfo.
 	The 'viminfo' option can be set to select which items to store in the
 	.viminfo file.  This is off by default.
 
-Printing.						|printing|
-	The |:hardcopy| command sends text to the printer.  This can include
-	syntax highlighting.
-
 Mouse support.						|mouse-using|
 	The mouse is supported in the GUI version, in an xterm for Unix, for
 	BSDs with sysmouse, for Linux with gpm, and for Win32.  It can be used
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 46d620e461..bb3b670b24 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -549,6 +549,7 @@ Aliases:
 
 Commands:
   :fixdel
+  :hardcopy
   :helpfind
   :mode (no longer accepts an argument)
   :open
@@ -655,6 +656,12 @@ Options:
     Use |g8| or |ga|.  See |mbyte-combining|.
   *'maxmem'* Nvim delegates memory-management to the OS.
   *'maxmemtot'* Nvim delegates memory-management to the OS.
+  *'printdevice'*
+  *'printencoding'*
+  *'printexpr'*
+  *'printfont'*
+  *'printheader'*
+  *'printmbcharset'*
   *'prompt'* *'noprompt'*
   *'remap'* *'noremap'*
   *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
@@ -732,5 +739,10 @@ Cscope:
                                                                       *cscope*
   Cscope support has been removed in favour of LSP based solutions.
 
+Hardcopy:
+                                                                     *hardcopy*
+  `:hardcopy` was removed. Instead, use `:TOhtml` and print the resulting HTML
+  using a web browser or some other HTML viewer.
+
 ==============================================================================
  vim:tw=78:ts=8:sw=2:et:ft=help:norl:
-- 
cgit 


From 6663c5fabd6bef147904d820b6365b3e6092df94 Mon Sep 17 00:00:00 2001
From: Gregory Anders 
Date: Tue, 3 Jan 2023 09:25:16 -0700
Subject: docs(editorconfig): update news.txt

---
 runtime/doc/news.txt | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index ffc8ce2c88..e5d65b55dd 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -50,6 +50,13 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• EditorConfig support is now builtin. This is enabled by default and happens
+  automatically. To disable it, users should add >vim
+
+    vim.g.editorconfig_enable = false
+<
+  (or the Vimscript equivalent) to their |config| file.
+
 • Added a |vim.lsp.codelens.clear()| function to clear codelenses.
 
 • |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items
-- 
cgit 


From c951236d638af242626ffc1bc23df5a57549c0f5 Mon Sep 17 00:00:00 2001
From: Gregory Anders 
Date: Tue, 3 Jan 2023 11:08:58 -0700
Subject: docs(editorconfig): add editorconfig.txt

---
 runtime/doc/editorconfig.txt | 89 ++++++++++++++++++++++++++++++++++++++++++++
 runtime/doc/news.txt         |  2 +-
 2 files changed, 90 insertions(+), 1 deletion(-)
 create mode 100644 runtime/doc/editorconfig.txt

(limited to 'runtime/doc')

diff --git a/runtime/doc/editorconfig.txt b/runtime/doc/editorconfig.txt
new file mode 100644
index 0000000000..e93713e5ff
--- /dev/null
+++ b/runtime/doc/editorconfig.txt
@@ -0,0 +1,89 @@
+*editorconfig.txt*  Nvim
+
+
+                            NVIM REFERENCE MANUAL
+
+
+EditorConfig integration                                        *editorconfig*
+
+Nvim natively supports EditorConfig. When a file is opened, Nvim searches
+upward through all of the parent directories of that file looking for
+".editorconfig" files. Each of these is parsed and any properties that match
+the opened file are applied.
+
+For more information on EditorConfig, see https://editorconfig.org/.
+
+                                                       *g:editorconfig_enable*
+EditorConfig integration can be disabled by adding >lua
+
+    vim.g.editorconfig_enable = false
+<
+to the user's |init.lua| file (or the Vimscript equivalent to |init.vim|).
+
+                                                              *b:editorconfig*
+When Nvim finds a valid .editorconfig file it will store the applied
+properties in the buffer variable |b:editorconfig|.
+
+                                                     *editorconfig-properties*
+The following properties are supported by default:
+
+                                                           *editorconfig_root*
+root                    If "true", then stop searching for .editorconfig files
+                        in parent directories. This property must be at the
+                        top-level of the .editorconfig file (i.e. it must not
+                        be within a glob section).
+
+                                                        *editorconfig_charset*
+charset                 One of "utf-8", "utf-8-bom", "latin1", "utf-16be", or
+                        "utf-16le". Sets the 'fileencoding' and 'bomb'
+                        options.
+
+                                                    *editorconfig_end_of_line*
+end_of_line             One of "lf", "crlf", or "cr". These correspond to
+                        setting 'fileformat' to "unix", "dos", or "mac",
+                        respectively.
+
+                                                   *editorconfig_indent_style*
+indent_style            One of "tab" or "space". Sets the 'expandtab' option.
+
+                                                    *editorconfig_indent_size*
+indent_size             A number indicating the size of a single indent.
+                        Alternatively, use the value "tab" to use the value of
+                        the tab_width property. Sets the 'shiftwidth' and
+                        'softtabstop'.
+
+                                           *editorconfig_insert_final_newline*
+insert_final_newline    "true" or "false" to ensure the file always has a
+                        trailing newline as its last byte. Sets the
+                        'fixendofline' and 'endofline' options.
+
+                                                *editorconfig_max_line_length*
+max_line_length         A number indicating the maximum length of a single
+                        line. Sets the 'textwidth' option.
+
+                                                      *editorconfig_tab_width*
+tab_width               The display size of a single tab character. Sets the
+                        'tabstop' option.
+
+                                       *editorconfig_trim_trailing_whitespace*
+trim_trailing_whitespace
+                        When "true", trailing whitespace is automatically
+                        removed when the buffer is written.
+
+                                              *editorconfig-custom-properties*
+New properties can be added by adding a new entry to the "properties" table.
+The table key is a property name and the value is a callback function which
+accepts the number of the buffer to be modified, the value of the property
+in the .editorconfig file, and (optionally) a table containing all of the
+other properties and their values (useful for properties which depend on other
+properties). The value is always a string and must be coerced if necessary.
+Example: >lua
+
+    require('editorconfig').properties.foo = function(bufnr, val, opts)
+      if opts.charset and opts.charset ~= "utf-8" then
+        error("foo can only be set when charset is utf-8", 0)
+      end
+      vim.b[bufnr].foo = val
+    end
+<
+ vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index e5d65b55dd..03bbf1567b 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -51,7 +51,7 @@ NEW FEATURES                                                    *news-features*
 The following new APIs or features were added.
 
 • EditorConfig support is now builtin. This is enabled by default and happens
-  automatically. To disable it, users should add >vim
+  automatically. To disable it, users should add >lua
 
     vim.g.editorconfig_enable = false
 <
-- 
cgit 


From 936e191fef9865600af211c29ea4959ffbce81dd Mon Sep 17 00:00:00 2001
From: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date: Wed, 4 Jan 2023 00:38:48 +0100
Subject: docs: fix typos (#21427)

Co-authored-by: Gustavo Sampaio 
Co-authored-by: C.D. MacEachern 
Co-authored-by: Sean Dewar 
Co-authored-by: Tomas Nemec 
---
 runtime/doc/api.txt       |  4 ++--
 runtime/doc/lua-guide.txt | 16 ++++++++--------
 runtime/doc/news.txt      |  6 +++---
 runtime/doc/quickfix.txt  |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index 32c7ba67a5..fcd9bd0fe5 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -728,7 +728,7 @@ nvim_echo({chunks}, {history}, {*opts})                          *nvim_echo()*
       • {opts}     Optional parameters.
                    • verbose: Message was printed as a result of 'verbose'
                      option if Nvim was invoked with -V3log_file, the message
-                     will be redirected to the log_file and surpressed from
+                     will be redirected to the log_file and suppressed from
                      direct output.
 
 nvim_err_write({str})                                       *nvim_err_write()*
@@ -2549,7 +2549,7 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts})
       -- Create new extmark at line 1, column 1.
       local m1  = a.nvim_buf_set_extmark(0, ns, 0, 0, {})
       -- Create new extmark at line 3, column 1.
-      local m2  = a.nvim_buf_set_extmark(0, ns, 0, 2, {})
+      local m2  = a.nvim_buf_set_extmark(0, ns, 2, 0, {})
       -- Get extmarks only from line 3.
       local ms  = a.nvim_buf_get_extmarks(0, ns, {2,0}, {2,0}, {})
       -- Get all marks in this buffer + namespace.
diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt
index b0b2857300..71dc48b715 100644
--- a/runtime/doc/lua-guide.txt
+++ b/runtime/doc/lua-guide.txt
@@ -285,7 +285,7 @@ work:
 Instead, you need to create an intermediate Lua table and change this:
 >lua
     local temp_table = vim.g.some_global_variable
-    temp_table = keys = 400
+    temp_table.key2 = 400
     vim.g.some_global_variable = temp_table
     vim.pretty_print(vim.g.some_global_variable)
     --> { key1 = "value", key2 = 400 }
@@ -408,7 +408,7 @@ mandatory arguments:
 • {lhs} is a string with the key sequences that should trigger the mapping.
   An empty string is equivalent to ||, which disables a key.
 • {rhs} is either a string with a Vim command or a Lua function that should
-  be execucted when the {lhs} is entered.
+  be executed when the {lhs} is entered.
 
 Examples:
 >lua
@@ -608,25 +608,25 @@ may be reloaded is
 This is equivalent to the following Lua code:
 >lua
     local mygroup = vim.api.nvim_create_augroup('vimrc', { clear = true })
-    vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
+    vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
       pattern = '*.html',
       group = mygroup,
-      cmd = 'set shiftwidth=4',
+      command = 'set shiftwidth=4',
     })
-    vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
+    vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
       pattern = '*.html',
       group = 'vimrc',  -- equivalent to group=mygroup
-      cmd = 'set expandtab',
+      command = 'set expandtab',
     })
 <
 Autocommand groups are unique for a given name, so you can reuse them, e.g.,
 in a different file:
 >lua
     local mygroup = vim.api.nvim_create_augroup('vimrc', { clear = false })
-    vim.api.nvim_create_autocmd( {'BufNewFile', 'BufRead' }, {
+    vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
       pattern = '*.html',
       group = mygroup,
-      cmd = 'set shiftwidth=4',
+      command = 'set shiftwidth=4',
     })
 <
 ------------------------------------------------------------------------------
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 03bbf1567b..a764b2b882 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -60,7 +60,7 @@ The following new APIs or features were added.
 • Added a |vim.lsp.codelens.clear()| function to clear codelenses.
 
 • |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items
-  at a given buffer postion. Currently this includes treesitter captures,
+  at a given buffer position. Currently this includes treesitter captures,
   semantic tokens, syntax groups and extmarks.
 
 • Added support for semantic token highlighting to the LSP client. This
@@ -124,7 +124,7 @@ The following new APIs or features were added.
 • |--remote-ui| option was added to connect to a remote instance and display
   in it in a |TUI| in the local terminal. This can be used run a headless nvim
   instance in the background and display its UI on demand, which previously
-  only was possible usiing a external UI implementation.
+  only was possible using an external UI implementation.
 
 ==============================================================================
 CHANGED FEATURES                                                 *news-changes*
@@ -140,7 +140,7 @@ The following changes to existing APIs or features add new behavior.
 
   Previously, the TUI could be disabled as a build time feature (+tui/-tui),
   resulting in a nvim binary which only could be run headless or embedded
-  in an external process. As of this version, TUI is always avalibale.
+  in an external process. As of this version, TUI is always available.
 
 ==============================================================================
 REMOVED FEATURES                                                 *news-removed*
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index a30f32b75e..b1f7c927cc 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1265,7 +1265,7 @@ The .NET CLI compiler outputs both errors and warnings by default. The output
 may be limited to include only errors, by setting the g:dotnet_errors_only
 variable to |v:true|.
 
-The associated project name is included in each error and warning. To supress
+The associated project name is included in each error and warning. To suppress
 the project name, set the g:dotnet_show_project_file variable to |v:false|.
 
 Example: limit output to only display errors, and suppress the project name: >
-- 
cgit 


From e35b9020b16985eee26e942f9a3f6b045bc3809b Mon Sep 17 00:00:00 2001
From: notomo 
Date: Wed, 4 Jan 2023 20:48:41 +0900
Subject: docs(lua): adjust some type annotations

---
 runtime/doc/lsp.txt | 10 +++++-----
 runtime/doc/lua.txt |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 705d7675e5..cf82cbf204 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -974,7 +974,7 @@ stop_client({client_id}, {force})                      *vim.lsp.stop_client()*
     Parameters: ~
       • {client_id}  number|table id or |vim.lsp.client| object, or list
                      thereof
-      • {force}      (boolean) (optional) shutdown forcefully
+      • {force}      (boolean|nil) shutdown forcefully
 
 tagfunc({...})                                             *vim.lsp.tagfunc()*
     Provides an interface between the built-in client and 'tagfunc'.
@@ -1174,7 +1174,7 @@ references({context}, {options})                    *vim.lsp.buf.references()*
     window.
 
     Parameters: ~
-      • {context}  (table) Context for the request
+      • {context}  (table|nil) Context for the request
       • {options}  (table|nil) additional options
                    • on_list: (function) handler for list results. See
                      |lsp-on-list-handler|
@@ -1566,7 +1566,7 @@ jump_to_location({location}, {offset_encoding}, {reuse_win})
     Parameters: ~
       • {location}         (table) (`Location`|`LocationLink`)
       • {offset_encoding}  "utf-8" | "utf-16" | "utf-32"
-      • {reuse_win}        (boolean) Jump to existing window if buffer is
+      • {reuse_win}        (boolean|nil) Jump to existing window if buffer is
                            already open.
 
     Return: ~
@@ -1657,7 +1657,7 @@ make_position_params({window}, {offset_encoding})
     Parameters: ~
       • {window}           (number|nil) window handle or 0 for current,
                            defaults to current
-      • {offset_encoding}  (string) utf-8|utf-16|utf-32|nil defaults to
+      • {offset_encoding}  (string|nil) utf-8|utf-16|utf-32|nil defaults to
                            `offset_encoding` of first client of buffer of
                            `window`
 
@@ -1788,7 +1788,7 @@ show_document({location}, {offset_encoding}, {opts})
     Parameters: ~
       • {location}         (table) (`Location`|`LocationLink`)
       • {offset_encoding}  "utf-8" | "utf-16" | "utf-32"
-      • {opts}             (table) options
+      • {opts}             (table|nil) options
                            • reuse_win (boolean) Jump to existing window if
                              buffer is already open.
                            • focus (boolean) Whether to focus/jump to location
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 074cb863f0..9cb189b927 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1678,8 +1678,8 @@ list_slice({list}, {start}, {finish})                       *vim.list_slice()*
 
     Parameters: ~
       • {list}    (list) Table
-      • {start}   (number) Start range of slice
-      • {finish}  (number) End range of slice
+      • {start}   (number|nil) Start range of slice
+      • {finish}  (number|nil) End range of slice
 
     Return: ~
         (list) Copy of table sliced from start to finish (inclusive)
-- 
cgit 


From 7c94bcd2d77e2e54b8836ab8325460a367b79eae Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Mon, 20 Sep 2021 19:00:50 -0700
Subject: feat(lua)!: execute Lua with "nvim -l"

Problem:
Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua
scripts, especially scripts that take arguments or produce output.

Solution:
- support "nvim -l [args...]" for running scripts. closes #15749
- exit without +q
- remove lua2dox_filter
- remove Doxyfile. This wasn't used anyway, because the doxygen config
  is inlined in gen_vimdoc.py (`Doxyfile` variable).
- use "nvim -l" in docs-gen CI job

Examples:

    $ nvim -l scripts/lua2dox.lua --help
    Lua2DoX (0.2 20130128)
    ...

    $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2
    $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l -

TODO?
  -e executes Lua code
  -l loads a module
  -i enters REPL _after running the other arguments_.
---
 runtime/doc/lua.txt      | 34 ++++++++++++++++------------------
 runtime/doc/news.txt     |  5 +++++
 runtime/doc/starting.txt | 47 +++++++++++++++++++++++++++++++----------------
 3 files changed, 52 insertions(+), 34 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 9cb189b927..16d0bcb612 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -21,15 +21,19 @@ Nvim includes a "standard library" |lua-stdlib| for Lua.  It complements the
 which can be used from Lua code (|lua-vimscript| |vim.api|). Together these
 "namespaces" form the Nvim programming interface.
 
-See the |lua-guide| for an introduction to using Lua in Neovim.
+Lua plugins and user config are automatically discovered and loaded, just like
+Vimscript. See |lua-guide| for practical guidance.
 
+You can also run Lua scripts from your shell using the |-l| argument: >
+    nvim -l foo.lua [args...]
+<
                                                                   *lua-compat*
 Lua 5.1 is the permanent interface for Nvim Lua.  Plugins need only consider
 Lua 5.1, not worry about forward-compatibility with future Lua versions.  If
 Nvim ever ships with Lua 5.4+, a Lua 5.1 compatibility shim will be provided
 so that old plugins continue to work transparently.
 
-------------------------------------------------------------------------------
+==============================================================================
 LUA CONCEPTS AND IDIOMS                                         *lua-concepts*
 
 Lua is very simple: this means that, while there are some quirks, once you
@@ -73,25 +77,24 @@ In Lua, any missing arguments are passed as `nil`. Example: >lua
 Furthermore it is not an error if extra parameters are passed, they are just
 discarded.
 
-It is also allowed to omit the parentheses (only) if the function takes
-exactly one string (`"foo"`) or table literal (`{1,2,3}`). The latter is often
-used to approximate the "named parameters" feature of languages like Python
-("kwargs" or "keyword args"). Example: >lua
+                                                                      *kwargs*
+When calling a function, you can omit the parentheses if the function takes
+exactly one string literal (`"foo"`) or table literal (`{1,2,3}`). The latter
+is often used to approximate "named parameters" ("kwargs" or "keyword args")
+as in languages like Python and C#. Example: >lua
     local func_with_opts = function(opts)
         local will_do_foo = opts.foo
         local filename = opts.filename
-
         ...
     end
 
     func_with_opts { foo = true, filename = "hello.world" }
 <
-There is nothing special going on here except that parentheses are treated as
+There's nothing special going on here except that parentheses are treated as
 whitespace. But visually, this small bit of sugar gets reasonably close to
 a "keyword args" interface.
 
 It is of course also valid to call the function with parentheses: >lua
-
     func_with_opts({ foo = true, filename = "hello.world" })
 <
 Nvim tends to prefer the keyword args style.
@@ -100,25 +103,20 @@ Nvim tends to prefer the keyword args style.
 LUA PATTERNS                                                    *lua-patterns*
 
 Lua intentionally does not support regular expressions, instead it has limited
-"patterns" which avoid the performance pitfalls of extended regex.
-|luaref-patterns|
+"patterns" |luaref-patterns| which avoid the performance pitfalls of extended
+regex. Lua scripts can also use Vim regex via |vim.regex()|.
 
-Examples using |string.match()|: >lua
+These examples use |string.match()| to demonstrate Lua patterns: >lua
 
     print(string.match("foo123bar123", "%d+"))
     -- 123
-
     print(string.match("foo123bar123", "[^%d]+"))
     -- foo
-
     print(string.match("foo123bar123", "[abc]+"))
     -- ba
-
     print(string.match("foo.bar", "%.bar"))
     -- .bar
 
-For more complex matching you can use Vim regex from Lua via |vim.regex()|.
-
 ==============================================================================
 IMPORTING LUA MODULES                                  *require()* *lua-require*
 
@@ -389,7 +387,7 @@ For example consider the following Lua omnifunc handler: >lua
     vim.api.nvim_buf_set_option(0, 'omnifunc', 'v:lua.mymod.omnifunc')
 
 Note: The module ("mymod" in the above example) must either be a Lua global,
-or use the require syntax as specified above to access it from a package.
+or use require() as shown above to access it from a package.
 
 Note: `v:lua` without a call is not allowed in a Vimscript expression:
 |Funcref|s cannot represent Lua functions. The following are errors: >vim
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index a764b2b882..3e291e59c9 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -57,6 +57,11 @@ The following new APIs or features were added.
 <
   (or the Vimscript equivalent) to their |config| file.
 
+• Run Lua scripts from your shell using |-l|. >
+      nvim -l foo.lua --arg1 --arg2
+<  Also works with stdin: >
+      echo "print(42)" | nvim -l -
+
 • Added a |vim.lsp.codelens.clear()| function to clear codelenses.
 
 • |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 8b662ab1bf..a99be4ab93 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -9,7 +9,7 @@ Starting Vim						*starting*
                                       Type |gO| to see the table of contents.
 
 ==============================================================================
-Nvim arguments						*vim-arguments*
+Nvim arguments						*cli-arguments*
 
 Most often, Nvim is started to edit a single file with the command: >
 
@@ -31,8 +31,8 @@ filename	One or more file names.  The first one will be the current
 		To avoid a file name starting with a '-' being interpreted as
 		an option, precede the arglist with "--", e.g.: >
 			nvim -- -filename
-<		All arguments after the "--" will be interpreted as file names,
-		no other options or "+command" argument can follow.
+<		All arguments after "--" are interpreted as file names, no
+		other options or "+command" argument can follow.
 
 							*--*
 `-`		Alias for stdin (standard input).
@@ -143,15 +143,13 @@ argument.
 		these commands, independently from "-c" commands.
 
 							*-S*
--S {file}	Vimscript or Lua (".lua") {file} will be |:source|d after the
-		first file has been read. Equivalent to: >
+-S [file]	Vimscript or Lua (".lua") [file] will be |:source|d after the
+		first file has been read or "Session.vim" if [file] is not
+		given. Equivalent to: >
 			-c "source {file}"
 <		Can be repeated like "-c", subject to the same limit of 10
 		"-c" arguments. {file} cannot start with a "-".
 
--S		Works like "-S Session.vim".  Only when used as the last
-		argument or when another "-" option follows.
-
 -L							*-L* *-r*
 -r		Recovery mode.  Without a file name argument, a list of
 		existing swap files is given.  With a file name, a swap file
@@ -211,10 +209,30 @@ argument.
 			nvim -es +":verbose echo 'foo'"
 			nvim -V1 -es +foo
 
-<		User |config| is skipped (unless given with |-u|).
+<		User |config| is skipped unless |-u| was given.
 		Swap file is skipped (like |-n|).
 		User |shada| is loaded (unless "-i NONE" is given).
 
+							*-l*
+-l {script} [args]
+		Executes Lua {script} file and exits. All [args] (up to "--"
+		|---|) are treated as {script} args, not Nvim args: by Lua
+		convention they are set in the `_G.arg` global table.  *lua-args*
+		On {script} error, Nvim exits with code 1.
+
+		Sets 'verbose' to 1 (like "-V1"), so Lua `print()` writes to
+		output.
+
+		Any |cli-arguments| before "-l" are processed before executing
+		{script}. For example this quits before executing "foo.lua": >
+			nvim +q -l foo.lua
+<		This loads Lua module "bar" before executing "foo.lua": >
+			nvim +"lua require('bar')" -l foo.lua
+<
+		User |config| is skipped unless |-u| was given.
+		User |shada| is skipped unless |-i| was given.
+		Swap file is skipped (like |-n|).
+
 							*-b*
 -b		Binary mode.  File I/O will only recognize  to separate
 		lines.  The 'expandtab' option will be reset.  The 'textwidth'
@@ -222,9 +240,6 @@ argument.
 		is set.  This is done after reading the |vimrc| but before
 		reading any file in the arglist.  See also |edit-binary|.
 
-							*-l*
--l		Lisp mode.  Sets the 'lisp' and 'showmatch' options on.
-
 							*-A*
 -A		Arabic mode.  Sets the 'arabic' option on.
 
@@ -239,10 +254,10 @@ argument.
 		Example: >
 			nvim -V8
 
--V[N]{filename}
-		Like -V and set 'verbosefile' to {filename}.  Messages are not
-		displayed; instead they are written to the file {filename}.
-		{filename} must not start with a digit.
+-V[N]{file}
+		Like -V and sets 'verbosefile' to {file} (must not start with
+		a digit).  Messages are not displayed; instead they are
+		written to {file}.
 		Example: >
 			nvim -V20vimlog
 <
-- 
cgit 


From 45549f031ee52a01601c33acc411f3111cfc4e95 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Sun, 1 Jan 2023 03:14:13 +0100
Subject: feat(lua): send "--" literally to Lua "-l" script

Problem:
When "-l" is followed by "--", we stop sending args to the Lua script
and treat "--" in the usual way. This was for flexibility but didn't
have a strong use-case, and has these problems:
- prevents Lua "-l" scripts from handling "--" in their own way.
- complicates the startup logic (must call nlua_init before command_line_scan)

Solution:
Don't treat "--" specially if it follows "-l".
---
 runtime/doc/starting.txt | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index a99be4ab93..8dd083e4a3 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -32,7 +32,7 @@ filename	One or more file names.  The first one will be the current
 		an option, precede the arglist with "--", e.g.: >
 			nvim -- -filename
 <		All arguments after "--" are interpreted as file names, no
-		other options or "+command" argument can follow.
+		other options or "+command" arguments can follow.
 
 							*--*
 `-`		Alias for stdin (standard input).
@@ -143,9 +143,9 @@ argument.
 		these commands, independently from "-c" commands.
 
 							*-S*
--S [file]	Vimscript or Lua (".lua") [file] will be |:source|d after the
-		first file has been read or "Session.vim" if [file] is not
-		given. Equivalent to: >
+-S [file]	Executes Vimscript or Lua (".lua") [file] after the first file
+		has been read. See also |:source|. If [file] is not given,
+		defaults to "Session.vim". Equivalent to: >
 			-c "source {file}"
 <		Can be repeated like "-c", subject to the same limit of 10
 		"-c" arguments. {file} cannot start with a "-".
@@ -190,8 +190,9 @@ argument.
 		  -E reads stdin as text (into buffer 1).
 
 -es						*-es* *-Es* *-s-ex* *silent-mode*
--Es		Silent mode (no UI), for scripting.  Unrelated to |-s|.
-		Disables most prompts, messages, warnings and errors.
+-Es		Script mode, aka "silent mode", aka "batch mode". No UI,
+		disables most prompts and messages. Unrelated to |-s|.
+		See also |-S| to run script files.
 
 		-es reads/executes stdin as Ex commands. >
 			printf "put ='foo'\n%%print\n" | nvim -es
@@ -215,16 +216,22 @@ argument.
 
 							*-l*
 -l {script} [args]
-		Executes Lua {script} file and exits. All [args] (up to "--"
-		|---|) are treated as {script} args, not Nvim args: by Lua
-		convention they are set in the `_G.arg` global table.  *lua-args*
-		On {script} error, Nvim exits with code 1.
+		Executes Lua {script} non-interactively (no UI) with optional
+		[args] after processing any preceding Nvim |cli-arguments|,
+		then exits. See |-S| to run multiple Lua scripts without args,
+		or in an interactive session.
+								    *lua-args*
+		All [args] are treated as {script} arguments and passed
+		literally to Lua (in the conventional `_G.arg` global table),
+		thus "-l" ends processing of Nvim arguments.
+		
+		Exits with code 1 on Lua error.
 
 		Sets 'verbose' to 1 (like "-V1"), so Lua `print()` writes to
 		output.
 
-		Any |cli-arguments| before "-l" are processed before executing
-		{script}. For example this quits before executing "foo.lua": >
+		Arguments before "-l" are processed before executing {script}.
+		This example quits before executing "foo.lua": >
 			nvim +q -l foo.lua
 <		This loads Lua module "bar" before executing "foo.lua": >
 			nvim +"lua require('bar')" -l foo.lua
@@ -256,7 +263,7 @@ argument.
 
 -V[N]{file}
 		Like -V and sets 'verbosefile' to {file} (must not start with
-		a digit).  Messages are not displayed; instead they are
+		a digit).  Messages are not displayed, instead they are
 		written to {file}.
 		Example: >
 			nvim -V20vimlog
-- 
cgit 


From f43de742e881e54a3602e00c8c247cecca65a266 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Tue, 3 Jan 2023 02:54:53 +0100
Subject: feat(lua): execute stdin ("-") as Lua

---
 runtime/doc/starting.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 8dd083e4a3..fa9e23eb00 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -236,9 +236,10 @@ argument.
 <		This loads Lua module "bar" before executing "foo.lua": >
 			nvim +"lua require('bar')" -l foo.lua
 <
-		User |config| is skipped unless |-u| was given.
-		User |shada| is skipped unless |-i| was given.
-		Swap file is skipped (like |-n|).
+		Skips user |config| unless |-u| was given.
+		Disables plugins unless 'loadplugins' was set.
+		Disables |shada| unless |-i| was given.
+		Disables swapfile (like |-n|).
 
 							*-b*
 -b		Binary mode.  File I/O will only recognize  to separate
-- 
cgit 


From e17430c1cd97db5624e27515a4f5da17f9d926d6 Mon Sep 17 00:00:00 2001
From: "Justin M. Keyes" 
Date: Sat, 7 Jan 2023 02:12:54 +0100
Subject: feat(lua): store "nvim -l" scriptname in _G.arg[0]

---
 runtime/doc/starting.txt | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index fa9e23eb00..179bacdb24 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -218,15 +218,13 @@ argument.
 -l {script} [args]
 		Executes Lua {script} non-interactively (no UI) with optional
 		[args] after processing any preceding Nvim |cli-arguments|,
-		then exits. See |-S| to run multiple Lua scripts without args,
-		or in an interactive session.
+		then exits. Exits 1 on Lua error. See |-S| to run multiple Lua
+		scripts without args, with a UI.
 								    *lua-args*
-		All [args] are treated as {script} arguments and passed
-		literally to Lua (in the conventional `_G.arg` global table),
-		thus "-l" ends processing of Nvim arguments.
+		All [args] are treated as {script} arguments and stored in the
+		Lua `_G.arg` global table, thus "-l" ends processing of Nvim
+		arguments. The {script} name is stored at `_G.arg[0]`.
 		
-		Exits with code 1 on Lua error.
-
 		Sets 'verbose' to 1 (like "-V1"), so Lua `print()` writes to
 		output.
 
-- 
cgit 


From 6ffa434f0b1c6e82fb6c1445d5d7382e0ef22e07 Mon Sep 17 00:00:00 2001
From: Gregory Anders 
Date: Wed, 4 Jan 2023 15:10:19 -0700
Subject: refactor(editorconfig)!: change editorconfig_enable to editorconfig

---
 runtime/doc/editorconfig.txt | 14 ++++++++------
 runtime/doc/news.txt         |  2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/editorconfig.txt b/runtime/doc/editorconfig.txt
index e93713e5ff..04a057e5ff 100644
--- a/runtime/doc/editorconfig.txt
+++ b/runtime/doc/editorconfig.txt
@@ -13,16 +13,18 @@ the opened file are applied.
 
 For more information on EditorConfig, see https://editorconfig.org/.
 
-                                                       *g:editorconfig_enable*
-EditorConfig integration can be disabled by adding >lua
+                                               *g:editorconfig* *b:editorconfig*
+EditorConfig integration can be disabled globally by adding >lua
 
-    vim.g.editorconfig_enable = false
+    vim.g.editorconfig = false
 <
-to the user's |init.lua| file (or the Vimscript equivalent to |init.vim|).
+to the user's |init.lua| file (or the Vimscript equivalent to |init.vim|). It
+can also be disabled per-buffer by setting the |b:editorconfig| buffer-local
+variable to `false`.
 
-                                                              *b:editorconfig*
 When Nvim finds a valid .editorconfig file it will store the applied
-properties in the buffer variable |b:editorconfig|.
+properties in the buffer variable |b:editorconfig| if it was not already set to
+`false` by the user.
 
                                                      *editorconfig-properties*
 The following properties are supported by default:
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 3e291e59c9..33ac9ddd20 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -53,7 +53,7 @@ The following new APIs or features were added.
 • EditorConfig support is now builtin. This is enabled by default and happens
   automatically. To disable it, users should add >lua
 
-    vim.g.editorconfig_enable = false
+    vim.g.editorconfig = false
 <
   (or the Vimscript equivalent) to their |config| file.
 
-- 
cgit 


From 364b131f42509326c912c9b0fef5dfc94ed23b41 Mon Sep 17 00:00:00 2001
From: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
Date: Mon, 9 Jan 2023 18:12:06 +0100
Subject: feat(ui): add 'statuscolumn' option

Problem:    Unable to customize the column next to a window ('gutter').
Solution:   Add 'statuscolumn' option that follows the 'statusline' syntax,
	    allowing to customize the status column. Also supporting the %@
	    click execute function label. Adds new items @C and @s which
	    will print the fold and sign columns. Line numbers and signs
	    can be clicked, highlighted, aligned, transformed, margined etc.
---
 runtime/doc/eval.txt     | 17 +++++++++++++----
 runtime/doc/news.txt     |  5 +++++
 runtime/doc/options.txt  | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 runtime/doc/quickref.txt |  1 +
 4 files changed, 65 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 151036529d..6feb5cbb49 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2001,10 +2001,10 @@ v:lc_time	The current locale setting for time messages of the runtime
 		command.  See |multi-lang|.
 
 						*v:lnum* *lnum-variable*
-v:lnum		Line number for the 'foldexpr' |fold-expr|, 'formatexpr' and
-		'indentexpr' expressions, tab page number for 'guitablabel'
-		and 'guitabtooltip'.  Only valid while one of these
-		expressions is being evaluated.  Read-only when in the
+v:lnum		Line number for the 'foldexpr' |fold-expr|, 'formatexpr',
+		'indentexpr' and 'statuscolumn' expressions, tab page number
+		for 'guitablabel' and 'guitabtooltip'.  Only valid while one of
+		these expressions is being evaluated.  Read-only when in the
 		|sandbox|.
 
 						*v:lua* *lua-variable*
@@ -2138,6 +2138,10 @@ v:register	The name of the register in effect for the current normal mode
 		'*' or '+'.
 		Also see |getreg()| and |setreg()|
 
+					*v:relnum* *relnum-variable*
+v:relnum	Relative line number for the 'statuscolumn' expression.
+		Read-only.
+
 					*v:scrollstart* *scrollstart-variable*
 v:scrollstart	String describing the script or function that caused the
 		screen to scroll up.  It's only set when it is empty, thus the
@@ -2293,6 +2297,11 @@ v:version	Vim version number: major version times 100 plus minor
 
 				*v:vim_did_enter* *vim_did_enter-variable*
 v:vim_did_enter	0 during startup, 1 just before |VimEnter|.
+		Read-only.
+
+						*v:wrap* *wrap-variable*
+v:wrap		Boolean indicating whether 'statuscolumn' is being evaluated
+		for the wrapped part of a line.
 		Read-only.
 
 					*v:warningmsg* *warningmsg-variable*
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 33ac9ddd20..88bad1b7df 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -118,6 +118,11 @@ The following new APIs or features were added.
 
 • |'splitkeep'| option to control the scroll behavior of horizontal splits.
 
+• |'statuscolumn'| option to customize the area to the side of a window,
+  normally containing the fold, sign and number columns. This new option follows
+  the 'statusline' syntax and can be used to transform the line numbers, create
+  mouse click callbacks for |signs|, introduce a custom margin or separator etc.
+
 • |nvim_select_popupmenu_item()| now supports |cmdline-completion| popup menu.
 
 • |'diffopt'| now includes a `linematch` option to enable a second-stage diff
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index ee6c14e73f..aa2f528d1b 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6001,6 +6001,52 @@ A jump table for the options with a short description can be found at |Q_op|.
 	In case of buffer changing commands the cursor is placed at the column
 	where it was the last time the buffer was edited.
 
+				*'statuscolumn'* *'stc'*
+'statuscolumn' 'stc'	string	(default: empty)
+			local to window
+	EXPERIMENTAL
+	When non-empty, this option determines the content of the area to the
+	side of a window, normally containing the fold, sign and number columns.
+	The format of this option is like that of 'statusline'.
+
+	Some of the items from the 'statusline' format are different for
+	'statuscolumn':
+
+	%l	line number of currently drawn line
+	%r	relative line number of currently drawn line
+	%s	sign column for currently drawn line
+	%C	fold column for currently drawn line
+
+	To draw the sign and fold columns, they must be included in
+	'statuscolumn'.
+
+	The |v:lnum|   variable holds the line number to be drawn.
+	The |v:relnum| variable holds the relative line number to be drawn.
+	The |v:wrap|   variable holds true for the wrapped part of a line.
+
+	Examples: >vim
+		" Relative number with bar separator and click handlers:
+		:set statuscolumn=%@SignCb@%s%=%T%@NumCb@%r│%T
+
+		" Right aligned relative cursor line number:
+		:let &stc='%=%{v:relnum?v:relnum:v:lnum} '
+
+		" Line numbers in hexadecimal for non wrapped part of lines:
+		:let &stc='%=%{v:wrap?"":printf("%x",v:lnum)} '
+
+		" Human readable line numbers with thousands separator:
+		:let &stc='%{substitute(v:lnum,"\\d\\zs\\ze\\'
+			   . '%(\\d\\d\\d\\)\\+$",",","g")}'
+
+		" Both relative and absolute line numbers with different
+		" highlighting for odd and even relative numbers:
+		:let &stc='%#NonText#%{&nu?v:lnum:""}' .
+		 '%=%{&rnu&&(v:lnum%2)?"\ ".v:relnum:""}' .
+		 '%#LineNr#%{&rnu&&!(v:lnum%2)?"\ ".v:relnum:""}'
+
+<	WARNING: this expression is evaluated for each screen line so defining
+	an expensive expression can negatively affect render performance.
+
 			   *'statusline'* *'stl'* *E540* *E542*
 'statusline' 'stl'	string	(default empty)
 			global or local to window |global-local|
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index d0088f5b9b..d17df3cd61 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -883,6 +883,7 @@ Short explanation of each option:		*option-list*
 'splitkeep'	  'spk'     determines scroll behavior for split windows
 'splitright'	  'spr'     new window is put right of the current one
 'startofline'	  'sol'     commands move cursor to first non-blank in line
+'statuscolumn'	  'stc'	    custom format for the status column
 'statusline'	  'stl'     custom format for the status line
 'suffixes'	  'su'	    suffixes that are ignored with multiple match
 'suffixesadd'	  'sua'     suffixes added when searching for a file
-- 
cgit 


From 87cfe50944ef2c84de98eb6b124fe312eef31313 Mon Sep 17 00:00:00 2001
From: Raphael 
Date: Tue, 10 Jan 2023 17:36:48 +0800
Subject: fix(ui): set stc to empty in floatwin with minimal style (#21720)

fix(ui): set stc to emtpy in floatwin with minimal style
---
 runtime/doc/api.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index fcd9bd0fe5..c827da4554 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3042,10 +3042,10 @@ nvim_open_win({buffer}, {enter}, {*config})                  *nvim_open_win()*
                       Disables 'number', 'relativenumber', 'cursorline',
                       'cursorcolumn', 'foldcolumn', 'spell' and 'list'
                       options. 'signcolumn' is changed to `auto` and
-                      'colorcolumn' is cleared. The end-of-buffer region is
-                      hidden by setting `eob` flag of 'fillchars' to a space
-                      char, and clearing the |hl-EndOfBuffer| region in
-                      'winhighlight'.
+                      'colorcolumn' is cleared. 'statuscolumn' is changed to
+                      empty. The end-of-buffer region is hidden by setting
+                      `eob` flag of 'fillchars' to a space char, and clearing
+                      the |hl-EndOfBuffer| region in 'winhighlight'.
 
                   • border: Style of (optional) window border. This can either
                     be a string or an array. The string values are
-- 
cgit 


From d6cb3328f7e7286fb4aac116ea1bb0e6377fa803 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 10 Jan 2023 11:02:00 +0100
Subject: vim-patch:1b5f03ec9c55 (#21715)

Update runtime files

https://github.com/vim/vim/commit/1b5f03ec9c5551047d5de8d845541dd3201abe7c

Co-authored-by: Bram Moolenaar 
---
 runtime/doc/map.txt      |  4 ++--
 runtime/doc/options.txt  |  2 ++
 runtime/doc/userfunc.txt | 11 ++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index e262b7b82a..ccd48a8959 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -698,8 +698,8 @@ To avoid mapping of the characters you type in insert or Command-line mode,
 type a CTRL-V first.  The mapping in Insert mode is disabled if the 'paste'
 option is on.
 							*map-error*
-Note that when an error is encountered (that causes an error message or beep)
-the rest of the mapping is not executed.  This is Vi-compatible.
+Note that when an error is encountered (that causes an error message or might
+cause a beep) the rest of the mapping is not executed.  This is Vi-compatible.
 
 Note that the second character (argument) of the commands @zZtTfF[]rm'`"v
 and CTRL-X is not mapped.  This was done to be able to use all the named
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index aa2f528d1b..4498dda300 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6071,6 +6071,8 @@ A jump table for the options with a short description can be found at |Q_op|.
 
 	When there is error while evaluating the option then it will be made
 	empty to avoid further errors.  Otherwise screen updating would loop.
+	When the result contains unprintable characters the result is
+	unpredictable.
 
 	Note that the only effect of 'ruler' when this option is set (and
 	'laststatus' is 2 or 3) is controlling the output of |CTRL-G|.
diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt
index 4d000efc1e..9c428175bb 100644
--- a/runtime/doc/userfunc.txt
+++ b/runtime/doc/userfunc.txt
@@ -180,7 +180,16 @@ See |:verbose-cmd| for more information.
 			the number 0 is returned.
 			Note that there is no check for unreachable lines,
 			thus there is no warning if commands follow ":return".
-
+			Also, there is no check if the following
+			line contains a valid command.  Forgetting the line
+			continuation backslash may go unnoticed: >
+				return 'some text'
+				       .. ' some more text'
+<			Will happily return "some text" without an error.  It
+			should have been: >
+				return 'some text'
+				       \ .. ' some more text'
+<
 			If the ":return" is used after a |:try| but before the
 			matching |:finally| (if present), the commands
 			following the ":finally" up to the matching |:endtry|
-- 
cgit 


From 870ca1de52b240926b88f01afa697cd9b119bdac Mon Sep 17 00:00:00 2001
From: Sebastian Lyng Johansen 
Date: Tue, 10 Jan 2023 11:22:41 +0100
Subject: feat(float): open float relative to mouse #21531

Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line < col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return ''
    end, { expr = true })
    ```
---
 runtime/doc/api.txt  | 1 +
 runtime/doc/lsp.txt  | 1 +
 runtime/doc/news.txt | 4 ++++
 3 files changed, 6 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index c827da4554..d74657dc8e 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2995,6 +2995,7 @@ nvim_open_win({buffer}, {enter}, {*config})                  *nvim_open_win()*
                     • "win" Window given by the `win` field, or current
                       window.
                     • "cursor" Cursor position in current window.
+                    • "mouse" Mouse position
 
                   • win: |window-ID| for relative="win".
                   • anchor: Decides which corner of the float to place at
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index cf82cbf204..aff0f9a793 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1612,6 +1612,7 @@ make_floating_popup_options({width}, {height}, {opts})
                   • border (string or table) override `border`
                   • focusable (string or table) override `focusable`
                   • zindex (string or table) override `zindex`, defaults to 50
+                  • relative ("mouse"|"cursor") defaults to "cursor"
 
     Return: ~
         (table) Options
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 88bad1b7df..7dceaa3318 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -50,6 +50,10 @@ NEW FEATURES                                                    *news-features*
 
 The following new APIs or features were added.
 
+• |nvim_open_win()| now accepts a relative `mouse` option to open a floating win
+  relative to the mouse. Note that the mouse doesn't update frequently without
+  setting `vim.o.mousemoveevent = true`
+
 • EditorConfig support is now builtin. This is enabled by default and happens
   automatically. To disable it, users should add >lua
 
-- 
cgit 


From a37c686d21c1ad4e50f455e989642d38435d41ba Mon Sep 17 00:00:00 2001
From: Chris Kipp 
Date: Wed, 11 Jan 2023 20:17:10 +0100
Subject: docs(lsp): update buf_notify and rpc.notify params types (#21753)

Small, but I was getting warnings about my usage of
`vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs
say that `params` must be a string, however this can really be anything
when it's passed to `rpc.notify` since we just end up calling
`vim.json.encode(payload)` on it. This fixes the docs in those two
places and regenerates them.
---
 runtime/doc/lsp.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index aff0f9a793..703c0b9d03 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -566,7 +566,7 @@ buf_notify({bufnr}, {method}, {params})                 *vim.lsp.buf_notify()*
     Parameters: ~
       • {bufnr}   (number|nil) The number of the buffer
       • {method}  (string) Name of the request method
-      • {params}  (string) Arguments to send to the server
+      • {params}  (any) Arguments to send to the server
 
     Return: ~
         true if any client returns true; false otherwise
-- 
cgit 


From 443bbfd59e2818aeee72d2ed77af1cb24617e46f Mon Sep 17 00:00:00 2001
From: Chris Kipp 
Date: Thu, 12 Jan 2023 15:51:19 +0100
Subject: docs(lsp): fix type annotation on convert_input_to_markdown_lines
 (#21772)

This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.
---
 runtime/doc/lsp.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 703c0b9d03..46cfa60529 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1508,8 +1508,8 @@ convert_input_to_markdown_lines({input}, {contents})
 
     Parameters: ~
       • {input}     (`MarkedString` | `MarkedString[]` | `MarkupContent`)
-      • {contents}  (table, optional, default `{}`) List of strings to extend
-                    with converted lines
+      • {contents}  (table|nil) List of strings to extend with converted
+                    lines. Defaults to {}.
 
     Return: ~
         {contents}, extended with lines of converted markdown.
-- 
cgit 


From 572cd8031dd7c91ac9e17cbdfab16d87f1fed6b7 Mon Sep 17 00:00:00 2001
From: Raphael 
Date: Fri, 13 Jan 2023 00:57:39 +0800
Subject: feat(diagnostic): vim.diagnostic.is_disabled() #21527

---
 runtime/doc/diagnostic.txt | 12 ++++++++++++
 runtime/doc/news.txt       |  3 +++
 2 files changed, 15 insertions(+)

(limited to 'runtime/doc')

diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt
index 66ac2170e3..7066a3739a 100644
--- a/runtime/doc/diagnostic.txt
+++ b/runtime/doc/diagnostic.txt
@@ -565,6 +565,18 @@ hide({namespace}, {bufnr})                             *vim.diagnostic.hide()*
       • {bufnr}      (number|nil) Buffer number, or 0 for current buffer. When
                      omitted, hide diagnostics in all buffers.
 
+is_disabled({bufnr}, {namespace})               *vim.diagnostic.is_disabled()*
+    Check whether diagnostics are disabled in a given buffer.
+
+    Parameters: ~
+      • {bufnr}      (number|nil) Buffer number, or 0 for current buffer.
+      • {namespace}  (number|nil) Diagnostic namespace. When omitted, checks if all diagnostics are
+                     disabled in {bufnr}. Otherwise, only checks if
+                     diagnostics from {namespace} are disabled.
+
+    Return: ~
+        (boolean)
+
                                                       *vim.diagnostic.match()*
 match({str}, {pat}, {groups}, {severity_map}, {defaults})
     Parse a diagnostic from a string.
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 7dceaa3318..ce07c3035c 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -135,6 +135,9 @@ The following new APIs or features were added.
 
   See https://github.com/neovim/neovim/pull/14537.
 
+• |vim.diagnostic.is_disabled()| checks if diagnostics are disabled in a given
+  buffer or namespace.
+
 • |--remote-ui| option was added to connect to a remote instance and display
   in it in a |TUI| in the local terminal. This can be used run a headless nvim
   instance in the background and display its UI on demand, which previously
-- 
cgit 


From 7af2c52ef051ebe801f153a2775966fb3c69b439 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sun, 15 Jan 2023 05:24:19 +0800
Subject: docs: builtin TUI is no longer channel 0 (#21794)

---
 runtime/doc/api.txt     | 2 +-
 runtime/doc/autocmd.txt | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index d74657dc8e..0e1cc3c28c 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -1133,7 +1133,7 @@ nvim_list_uis()                                              *nvim_list_uis()*
         • "width" Requested width of the UI
         • "rgb" true if the UI uses RGB colors (false implies |cterm-colors|)
         • "ext_..." Requested UI extensions, see |ui-option|
-        • "chan" Channel id of remote UI or 0 for TUI
+        • "chan" |channel-id| of remote UI
 
 nvim_list_wins()                                            *nvim_list_wins()*
     Gets the current list of window handles.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index a39407aeca..8cc4754880 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -681,16 +681,12 @@ FuncUndefined			When a user function is used but it isn't
 UIEnter				After a UI connects via |nvim_ui_attach()|, or
 				after builtin TUI is started, after |VimEnter|.
 				Sets these |v:event| keys:
-				    chan: 0 for builtin TUI
-				          1 for |--embed|
-				          |channel-id| of the UI otherwise
+				    chan: |channel-id| of the UI
 							*UILeave*
 UILeave				After a UI disconnects from Nvim, or after
 				builtin TUI is stopped, after |VimLeave|.
 				Sets these |v:event| keys:
-				    chan: 0 for builtin TUI
-				          1 for |--embed|
-				          |channel-id| of the UI otherwise
+				    chan: |channel-id| of the UI
 							*InsertChange*
 InsertChange			When typing  while in Insert or
 				Replace mode.  The |v:insertmode| variable
-- 
cgit 


From f2056e4045a667447392f5e17c27b0f72ec7b8e0 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sun, 15 Jan 2023 06:20:01 +0800
Subject: vim-patch:8.2.4565: no command line completion for :breakadd and
 :breakdel

Problem:    No command line completion for :breakadd and :breakdel.
Solution:   Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan,
            closes vim/vim#9950)

https://github.com/vim/vim/commit/6e2e2cc95b913e33145047e0fade5193da6e4379
---
 runtime/doc/builtin.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'runtime/doc')

diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index cc1d1b568d..3dc21c0d73 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -2958,7 +2958,8 @@ getcompletion({pat}, {type} [, {filtered}])		*getcompletion()*
 		arglist		file names in argument list
 		augroup		autocmd groups
 		buffer		buffer names
-		behave		:behave suboptions
+		behave		|:behave| suboptions
+		breakpoint	|:breakadd| and |:breakdel| suboptions
 		cmdline		|cmdline-completion| result
 		color		color schemes
 		command		Ex command
@@ -2974,7 +2975,7 @@ getcompletion({pat}, {type} [, {filtered}])		*getcompletion()*
 		function	function name
 		help		help subjects
 		highlight	highlight groups
-		history		:history suboptions
+		history		|:history| suboptions
 		locale		locale names (as output of locale -a)
 		mapclear	buffer argument
 		mapping		mapping name
-- 
cgit