neovim

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

commit ff777f9a858a5f360e220596c63bc69e19a1d5c1
parent e7ff13270824402e24fb60a584621d7b28cb0dd0
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Tue, 16 Sep 2025 11:41:36 +0800

docs: small fixes (#35791)

Close #34938
Close #35030
Close #35233
Close #35259
Close #35290
Close #35433
Close #35541
Close #35766
Close #35792

Co-authored-by: huylg <45591413+huylg@users.noreply.github.com>
Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com>
Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com>
Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com>
Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com>
Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com>
Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com>
Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com>
Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
Diffstat:
MBUILD.md | 4++--
MINSTALL.md | 2+-
MREADME.md | 2+-
Mruntime/doc/api-ui-events.txt | 2+-
Mruntime/doc/diff.txt | 2+-
Mruntime/doc/insert.txt | 3---
Mruntime/doc/lua.txt | 10+++++-----
Mruntime/doc/news.txt | 8++++----
Mruntime/doc/options.txt | 2+-
Mruntime/doc/provider.txt | 2+-
Mruntime/doc/vimfn.txt | 4++--
Mruntime/lua/vim/_defaults.lua | 2+-
Mruntime/lua/vim/_meta/options.lua | 2+-
Mruntime/lua/vim/_meta/vimfn.lua | 4++--
Mruntime/lua/vim/_system.lua | 2+-
Mruntime/lua/vim/lsp/buf.lua | 2+-
Mruntime/lua/vim/net.lua | 4++--
Mruntime/lua/vim/range.lua | 2+-
Mruntime/lua/vim/snippet.lua | 2+-
Msrc/nvim/eval.lua | 4++--
Msrc/nvim/insexpand.c | 2+-
Msrc/nvim/lua/executor.h | 2+-
Msrc/nvim/message.c | 2+-
Msrc/nvim/options.lua | 2+-
Mtest/functional/editor/mode_insert_spec.lua | 2+-
Mtest/functional/legacy/prompt_buffer_spec.lua | 4++--
Mtest/old/testdir/test_ins_complete.vim | 4++--
27 files changed, 40 insertions(+), 43 deletions(-)

diff --git a/BUILD.md b/BUILD.md @@ -295,14 +295,14 @@ cmake --build build In case you are not using Alpine Linux you can use a container to do the build the binary: -```bash +```sh podman run \ --rm \ -it \ -v "$PWD:/workdir" \ -w /workdir \ alpine:latest \ - bash -c 'apk add build-base cmake coreutils curl gettext-tiny-dev git && make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"' + sh -c 'apk add build-base cmake coreutils curl gettext-tiny-dev git && make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"' ``` The resulting binary in `build/bin/nvim` will have all the dependencies statically linked: diff --git a/INSTALL.md b/INSTALL.md @@ -111,7 +111,7 @@ The [Releases](https://github.com/neovim/neovim/releases) page provides pre-buil ```sh curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz -sudo rm -rf /opt/nvim +sudo rm -rf /opt/nvim-linux-x86_64 sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz ``` diff --git a/README.md b/README.md @@ -15,7 +15,7 @@ Neovim is a project that seeks to aggressively refactor [Vim](https://www.vim.or - Simplify maintenance and encourage [contributions](CONTRIBUTING.md) - Split the work between multiple developers - Enable [advanced UIs] without modifications to the core -- Maximize [extensibility](https://neovim.io/doc/user/ui.html) +- Maximize [extensibility](https://neovim.io/doc/user/api-ui-events.html#api-ui-events) See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap] for more information. diff --git a/runtime/doc/api-ui-events.txt b/runtime/doc/api-ui-events.txt @@ -880,7 +880,7 @@ must handle. True if the message was added to the |:messages| history. append - True if the message should be appeneded to the previous message, + True if the message should be appended to the previous message, rather than started on a new line. Is set for |:echon|. msg_id diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt @@ -338,7 +338,7 @@ hard to see what the actual edit on it was. You can use diff anchors to pin that function so the diff algorithm will align based on it. To use it, set anchors using 'diffanchors' which is a comma-separated list of -{address} in each file, and then add "anchor" to 'diffopt'. Internaly, Vim +{address} in each file, and then add "anchor" to 'diffopt'. Internally, Vim splits each file up into sections split by the anchors. It performs the diff on each pair of sections separately before merging the results back. diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt @@ -282,9 +282,6 @@ nostop like start, except CTRL-W and CTRL-U do not stop at the start of When 'backspace' is empty, Vi compatible backspacing is used. You cannot backspace over autoindent, before column 1 or before where insert started. -For backwards compatibility the values "0", "1", "2" and "3" are also allowed, -see 'backspace'. - If the 'backspace' option does contain "eol" and the cursor is in column 1 when one of the three keys is used, the current line is joined with the previous line. This effectively deletes the <EOL> in front of the cursor. diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt @@ -3947,7 +3947,7 @@ vim.net.request({url}, {opts}, {on_response}) *vim.net.request()* This function operates in one mode: • Asynchronous (non-blocking): Returns immediately and passes the response - object to the provided `on_response` handler on completetion. + object to the provided `on_response` handler on completion. Parameters: ~ • {url} (`string`) The URL for the request. @@ -3960,7 +3960,7 @@ vim.net.request({url}, {opts}, {on_response}) *vim.net.request()* Response Object will be `true` instead of the response body. • {on_response} (`fun(err?: string, response?: { body: string|boolean })`) - Callback invoked on request completetion. The `body` + Callback invoked on request completion. The `body` field in the response object contains the raw response data (text or binary). Called with (err, nil) on failure, or (nil, { body = string|boolean }) on @@ -4111,7 +4111,7 @@ Provides operations to compare, calculate, and convert ranges represented by -- Create a range from two positions. local range1 = vim.range(pos1, pos2) - -- Or createa range from four integers representing start and end positions. + -- Or create a range from four integers representing start and end positions. local range2 = vim.range(3, 5, 4, 0) -- Because `vim.Range` is end exclusive, `range1` and `range2` both represent @@ -4421,7 +4421,7 @@ vim.snippet.jump({direction}) *vim.snippet.jump()* else return '<Tab>' end - end, { descr = '...', expr = true, silent = true }) + end, { desc = '...', expr = true, silent = true }) < Parameters: ~ @@ -4621,7 +4621,7 @@ vim.system({cmd}, {opts}, {on_exit}) *vim.system()* return of SystemObj:wait(). Overloads: ~ - • `fun(cmd: string, on_exit: fun(out: vim.SystemCompleted)): vim.SystemObj` + • `fun(cmd: string[], on_exit: fun(out: vim.SystemCompleted)): vim.SystemObj` Return: ~ (`vim.SystemObj`) See |vim.SystemObj|. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt @@ -77,7 +77,7 @@ EVENTS • |ui-messages| no longer emits the `msg_show.return_prompt`, and `msg_history_clear` events. The `msg_clear` event was repurposed and is now emitted after the screen is cleared. These events arbitrarily assumed a - message UI that mimicks the legacy message grid. Benefit: reduced UI event + message UI that mimics the legacy message grid. Benefit: reduced UI event traffic and more flexibility for UIs. The `msg_history_show` event has an additional "prev_cmd" argument. • A new `empty` message kind is emitted for an empty (e.g. `:echo ""`) message. @@ -201,8 +201,8 @@ EVENTS • |CmdlineLeave| sets |v:char| to the character that stops the Cmdline mode. • |CmdlineLeavePre| triggered before preparing to leave the command line. -• New `append` paremeter for |ui-messages| `msg_show` event. -• New `msg_id` paremeter for |ui-messages| `msg_show` event. +• New `append` parameter for |ui-messages| `msg_show` event. +• New `msg_id` parameter for |ui-messages| `msg_show` event. • 'rulerformat' is emitted as `msg_ruler` when not part of the statusline. • Creating or updating a progress message with |nvim_echo()| triggers a |Progress| event. @@ -282,7 +282,7 @@ OPTIONS • "F" complete using 'completefunc' • "o" complete using 'omnifunc' • 'complete' allows limiting matches for sources using "{flag}^<limit>". -• 'completeopt' flag "nearset" sorts completion results by distance to cursor. +• 'completeopt' flag "nearest" sorts completion results by distance to cursor. • 'diffanchors' specifies addresses to anchor a diff. • 'diffopt' `inline:` configures diff highlighting for changes within a line. • 'grepformat' is now a |global-local| option. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt @@ -2161,7 +2161,7 @@ A jump table for the options with a short description can be found at |Q_op|. Each anchor line splits the buffer (the split happens above the anchor), with each part being diff'ed separately before the final result is joined. When more than one {address} are provided, the - anchors will be sorted interally by line number. If using buffer + anchors will be sorted internally by line number. If using buffer local options, each buffer should have the same number of anchors (extra anchors will be ignored). This option is only used when 'diffopt' has "anchor" set. See |diff-anchors| for more details and diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt @@ -192,7 +192,7 @@ registers. Nvim supports these clipboard tools, in order of priority: - "win32yank" : *win32yank* (Windows) - "putclip" : putclip, getclip (Windows) https://cygwin.com/packages/summary/cygutils.html - "clip" : clip, powershell (Windows) https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/clip -- "termux" : termux (via termux-clipboard-set, termux-clipboard-set) +- "termux" : termux (via termux-clipboard-set, termux-clipboard-get) - "tmux" : tmux (if $TMUX is set) - "osc52" : |clipboard-osc52| (if supported by your terminal) diff --git a/runtime/doc/vimfn.txt b/runtime/doc/vimfn.txt @@ -3430,7 +3430,7 @@ getcmdtype() *getcmdtype()* Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|. Return: ~ - (`':'|'>'|'/'|'?'|'@'|'-'|'='`) + (`':'|'>'|'/'|'?'|'@'|'-'|'='|''`) getcmdwintype() *getcmdwintype()* Return the current |command-line-window| type. Possible return @@ -3438,7 +3438,7 @@ getcmdwintype() *getcmdwintype()* when not in the command-line window. Return: ~ - (`':'|'>'|'/'|'?'|'@'|'-'|'='`) + (`':'|'>'|'/'|'?'|'@'|'-'|'='|''`) getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* Return a list of command-line completion matches. The String diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua @@ -405,7 +405,7 @@ do vim.keymap.set('n', '[<C-T>', function() -- count doesn't work with :ptprevious, must use range. See #30641. cmd({ cmd = 'ptprevious', range = { vim.v.count1 } }) - end, { desc = ' :ptprevious' }) + end, { desc = ':ptprevious' }) vim.keymap.set('n', ']<C-T>', function() -- count doesn't work with :ptnext, must use range. See #30641. diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua @@ -1771,7 +1771,7 @@ vim.wo.diff = vim.o.diff --- Each anchor line splits the buffer (the split happens above the --- anchor), with each part being diff'ed separately before the final --- result is joined. When more than one {address} are provided, the ---- anchors will be sorted interally by line number. If using buffer +--- anchors will be sorted internally by line number. If using buffer --- local options, each buffer should have the same number of anchors --- (extra anchors will be ignored). This option is only used when --- 'diffopt' has "anchor" set. See `diff-anchors` for more details and diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua @@ -3075,14 +3075,14 @@ function vim.fn.getcmdscreenpos() end --- Returns an empty string otherwise. --- Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|. --- ---- @return ':'|'>'|'/'|'?'|'@'|'-'|'=' +--- @return ':'|'>'|'/'|'?'|'@'|'-'|'='|'' function vim.fn.getcmdtype() end --- Return the current |command-line-window| type. Possible return --- values are the same as |getcmdtype()|. Returns an empty string --- when not in the command-line window. --- ---- @return ':'|'>'|'/'|'?'|'@'|'-'|'=' +--- @return ':'|'>'|'/'|'?'|'@'|'-'|'='|'' function vim.fn.getcmdwintype() end --- Return a list of command-line completion matches. The String diff --git a/runtime/lua/vim/_system.lua b/runtime/lua/vim/_system.lua @@ -503,7 +503,7 @@ end --- asynchronously. See return of SystemObj:wait(). --- --- @return vim.SystemObj ---- @overload fun(cmd: string, on_exit: fun(out: vim.SystemCompleted)): vim.SystemObj +--- @overload fun(cmd: string[], on_exit: fun(out: vim.SystemCompleted)): vim.SystemObj function vim.system(cmd, opts, on_exit) if type(opts) == 'function' then on_exit = opts diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua @@ -1446,7 +1446,7 @@ function M.selection_range(direction) if not response then return end - -- We only requested one range, thus we get the first and only reponse here. + -- We only requested one range, thus we get the first and only response here. response = response[1] local ranges = {} ---@type lsp.Range[] local lines = api.nvim_buf_get_lines(0, 0, -1, false) diff --git a/runtime/lua/vim/net.lua b/runtime/lua/vim/net.lua @@ -4,7 +4,7 @@ local M = {} --- --- This function operates in one mode: --- - Asynchronous (non-blocking): Returns immediately and passes the response object to the ---- provided `on_response` handler on completetion. +--- provided `on_response` handler on completion. --- --- @param url string The URL for the request. --- @param opts? table Optional parameters: @@ -12,7 +12,7 @@ local M = {} --- - `retry` (integer|nil): Number of retries on transient failures (default: 3). --- - `outpath` (string|nil): File path to save the response body to. If set, the `body` value in the Response Object will be `true` instead of the response body. --- @param on_response fun(err?: string, response?: { body: string|boolean }) Callback invoked on request ---- completetion. The `body` field in the response object contains the raw response data (text or binary). +--- completion. The `body` field in the response object contains the raw response data (text or binary). --- Called with (err, nil) on failure, or (nil, { body = string|boolean }) on success. function M.request(url, opts, on_response) vim.validate({ diff --git a/runtime/lua/vim/range.lua b/runtime/lua/vim/range.lua @@ -22,7 +22,7 @@ local validate = vim.validate --- --- -- Create a range from two positions. --- local range1 = vim.range(pos1, pos2) ---- -- Or createa range from four integers representing start and end positions. +--- -- Or create a range from four integers representing start and end positions. --- local range2 = vim.range(3, 5, 4, 0) --- --- -- Because `vim.Range` is end exclusive, `range1` and `range2` both represent diff --git a/runtime/lua/vim/snippet.lua b/runtime/lua/vim/snippet.lua @@ -613,7 +613,7 @@ end --- else --- return '<Tab>' --- end ---- end, { descr = '...', expr = true, silent = true }) +--- end, { desc = '...', expr = true, silent = true }) --- ``` --- --- @param direction (vim.snippet.Direction) Navigation direction. -1 for previous, 1 for next. diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua @@ -3854,7 +3854,7 @@ M.funcs = { ]=], name = 'getcmdtype', params = {}, - returns = "':'|'>'|'/'|'?'|'@'|'-'|'='", + returns = "':'|'>'|'/'|'?'|'@'|'-'|'='|''", signature = 'getcmdtype()', }, getcmdwintype = { @@ -3865,7 +3865,7 @@ M.funcs = { ]=], name = 'getcmdwintype', params = {}, - returns = "':'|'>'|'/'|'?'|'@'|'-'|'='", + returns = "':'|'>'|'/'|'?'|'@'|'-'|'='|''", signature = 'getcmdwintype()', }, getcompletion = { diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c @@ -3026,7 +3026,7 @@ int set_cpt_callbacks(optset_T *args) } } - if (!local) { // ':set' used insted of ':setlocal' + if (!local) { // ':set' used instead of ':setlocal' // Cache the callback array copy_cpt_callbacks(&cpt_cb, &cpt_cb_count, curbuf->b_p_cpt_cb, curbuf->b_p_cpt_count); diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h @@ -42,7 +42,7 @@ typedef enum { kRetNilBool, ///< NIL preserved as such, other values return their booleanness ///< Should also be used when return value is ignored, as it is allocation-free kRetLuaref, ///< return value becomes a single Luaref, regardless of type (except NIL) - kRetMulti, ///< like kRetObject but return muliple return values as an Array + kRetMulti, ///< like kRetObject but return multiple return values as an Array } LuaRetMode; /// Maximum number of errors in vim.ui_attach() and decor provider callbacks. diff --git a/src/nvim/message.c b/src/nvim/message.c @@ -3290,7 +3290,7 @@ void msg_ext_ui_flush(void) ui_call_msg_show(cstr_as_string(msg_ext_kind), *tofree, msg_ext_overwrite, msg_ext_history, msg_ext_append, msg_ext_id); - // clear info after emiting message. + // clear info after emitting message. if (msg_ext_history) { api_free_array(*tofree); } else { diff --git a/src/nvim/options.lua b/src/nvim/options.lua @@ -2334,7 +2334,7 @@ local options = { Each anchor line splits the buffer (the split happens above the anchor), with each part being diff'ed separately before the final result is joined. When more than one {address} are provided, the - anchors will be sorted interally by line number. If using buffer + anchors will be sorted internally by line number. If using buffer local options, each buffer should have the same number of anchors (extra anchors will be ignored). This option is only used when 'diffopt' has "anchor" set. See |diff-anchors| for more details and diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua @@ -86,7 +86,7 @@ describe('insert-mode', function() it('inserts named/clipboard registers literally', function() local screen = Screen.new(50, 6) - -- regular text without special charecter command + -- regular text without special character command command('let @a = "test"') feed('i<C-R>a<ESC>') screen:expect([[ diff --git a/test/functional/legacy/prompt_buffer_spec.lua b/test/functional/legacy/prompt_buffer_spec.lua @@ -272,7 +272,7 @@ describe('prompt buffer', function() eq('line 1\nline 2\nline 3', fn('prompt_getinput', buf)) feed('<cr>') - -- submiting multiline text works + -- submitting multiline text works screen:expect([[ Result: "line 1 | line 2 | @@ -396,7 +396,7 @@ describe('prompt buffer', function() source_script() local buf = api.nvim_get_current_buf() - -- text editiing alowed in current prompt + -- text editing allowed in current prompt feed('tests-initial<esc>') feed('bimiddle-<esc>') screen:expect([[ diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim @@ -5135,7 +5135,7 @@ func Test_nonkeyword_trigger() call assert_equal('a#', getline('.')) set completeopt& - " Test 2: Filter nonkeyword and keyword matches with differet startpos + " Test 2: Filter nonkeyword and keyword matches with different startpos set completeopt+=menuone,noselect call feedkeys("S#a\<C-N>b\<F2>\<F3>\<Esc>0", 'tx!') call assert_equal(['abc', 'abcd', '#abar'], b:matches->mapnew('v:val.word')) @@ -5256,7 +5256,7 @@ func Test_autocomplete_trigger() call assert_equal(2, g:CallCount) call assert_equal('a#', getline('.')) - " Test 2: Filter nonkeyword and keyword matches with differet startpos + " Test 2: Filter nonkeyword and keyword matches with different startpos for fuzzy in range(2) if fuzzy set completeopt+=fuzzy