From 473a216a21fdc086ef71e0ca7d40c2fdf5346245 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 11 Jun 2023 12:40:22 +0100 Subject: vim-patch:10e8ff9b2607 (#23977) Update runtime files https://github.com/vim/vim/commit/10e8ff9b26078994cae57c2422b145d37aaf714e Also: - fix a missing `<` in builtin.txt. - edit `:function` `{name}` wording to match the change made for the docs above by Justin in #10619. - link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua` may also be used). Co-authored-by: Bram Moolenaar --- runtime/doc/autocmd.txt | 3 +++ runtime/doc/builtin.txt | 8 ++++---- runtime/doc/cmdline.txt | 7 ++++--- runtime/doc/eval.txt | 2 +- runtime/doc/map.txt | 2 +- runtime/doc/nvim_terminal_emulator.txt | 4 ++-- runtime/doc/options.txt | 26 ++++++++++++++++++++------ runtime/doc/repeat.txt | 4 ++-- runtime/doc/spell.txt | 4 ++-- runtime/doc/starting.txt | 4 +++- runtime/doc/userfunc.txt | 10 ++++++++-- 11 files changed, 50 insertions(+), 24 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 94a529930e..b64938ee9e 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -774,6 +774,9 @@ OptionSet After setting an option (except during the option. Similarly |v:option_oldglobal| is only set when |:set| or |:setglobal| was used. + This does not set ||, you could use + |bufnr()|. + Note that when setting a |global-local| string option with |:set|, then |v:option_old| is the old global value. However, for all other kinds diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index bdd9f2fd3a..5f10607fc0 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1233,7 +1233,7 @@ clearmatches([{win}]) *clearmatches()* Can also be used as a |method|: > GetWin()->clearmatches() < -col({expr} [, {winid}) *col()* +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 @@ -1296,7 +1296,7 @@ complete({startcol}, {matches}) *complete()* *E785* Example: > inoremap =ListMonths() - func! ListMonths() + func ListMonths() call complete(col('.'), ['January', 'February', 'March', \ 'April', 'May', 'June', 'July', 'August', 'September', \ 'October', 'November', 'December']) @@ -1540,7 +1540,7 @@ cursor({list}) This is like the return value of |getpos()| or |getcurpos()|, but without the first item. - To position the cursor using the character count, use + To position the cursor using {col} as the character count, use |setcursorcharpos()|. Does not change the jumplist. @@ -5626,7 +5626,7 @@ mkdir({name} [, {flags} [, {prot}]]) < and "subdir" already exists then "subdir/tmp" will be scheduled for deletion, like with: > defer delete('subdir/tmp', 'rf') - +< If {prot} is given it is used to set the protection bits of the new directory. The default is 0o755 (rwxr-xr-x: r/w for the user, readable for others). Use 0o700 to make it diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index c43d1caa0e..a8f07dd6c5 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -902,9 +902,10 @@ Note: these are typed literally, they are not special keys! write. *E495* *:* ** When executing autocommands, is replaced with the currently - effective buffer number (for ":r file" and ":so file" it is - the current buffer, the file being read/sourced is not in a - buffer). *E496* + effective buffer number. It is not set for all events, + also see |bufnr()|. For ":r file" and ":so file" it is the + current buffer, the file being read/sourced is not in a + buffer. *E496* *:* ** When executing autocommands, is replaced with the match for which this autocommand was executed. *E497* diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index aa53244dc8..5cee668b39 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2799,7 +2799,7 @@ text... let mylist = [1, 2, 3] lockvar 0 mylist let mylist[0] = 77 " OK - call add(mylist, 4] " OK + call add(mylist, 4) " OK let mylist = [7, 8, 9] " Error! < *E743* For unlimited depth use [!] and omit [depth]. diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index ad7901b962..9613092ba9 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -349,7 +349,7 @@ Note: - The command is not echo'ed, no need for . - The {rhs} is not subject to abbreviations nor to other mappings, even if the mapping is recursive. -- In Visual mode you can use `line('v')` and `col('v')` to get one end of the +- In Visual mode you can use `line('v')` and `col('v')` to get one end of the Visual area, the cursor is at the other end. *E1255* *E1136* diff --git a/runtime/doc/nvim_terminal_emulator.txt b/runtime/doc/nvim_terminal_emulator.txt index b98c96ec87..aa37161d34 100644 --- a/runtime/doc/nvim_terminal_emulator.txt +++ b/runtime/doc/nvim_terminal_emulator.txt @@ -392,8 +392,8 @@ 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: >vim +If you want the Asm window shown by default, set the "disasm_window" flag to +1. 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: >vim diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7729ec5d38..ff346e878d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1361,7 +1361,7 @@ A jump table for the options with a short description can be found at |Q_op|. The screen column can be an absolute number, or a number preceded with '+' or '-', which is added to or subtracted from 'textwidth'. > - :set cc=+1 " highlight column after 'textwidth' + :set cc=+1 " highlight column after 'textwidth' :set cc=+1,+2,+3 " highlight three columns after 'textwidth' :hi ColorColumn ctermbg=lightgrey guibg=lightgrey < @@ -5386,7 +5386,7 @@ A jump table for the options with a short description can be found at |Q_op|. local to buffer Number of spaces to use for each step of (auto)indent. Used for |'cindent'|, |>>|, |<<|, etc. - When zero the 'ts' value will be used. Use the |shiftwidth()| + When zero the 'tabstop' value will be used. Use the |shiftwidth()| function to get the effective shiftwidth value. *'shortmess'* *'shm'* @@ -5662,6 +5662,8 @@ A jump table for the options with a short description can be found at |Q_op|. line in the window wraps part of it may not be visible, as if it is above the window. "<<<" is displayed at the start of the first line, highlighted with |hl-NonText|. + You may also want to add "lastline" to the 'display' option to show as + much of the last line as possible. NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y and scrolling with the mouse. @@ -6313,13 +6315,25 @@ A jump table for the options with a short description can be found at |Q_op|. (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim will use a mix of tabs and spaces, but typing and will behave like a tab appears every 4 (or 3) characters. - 2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use + This is the recommended way, the file will look the same with other + tools and when listing it in a terminal. + 2. Set 'softtabstop' and 'shiftwidth' to whatever you prefer and use + 'expandtab'. This way you will always insert spaces. The + formatting will never be messed up when 'tabstop' is changed (leave + it at 8 just in case). The file will be a bit larger. + You do need to check if no Tabs exist in the file. You can get rid + of them by first setting 'expandtab' and using `%retab!`, making + sure the value of 'tabstop' is set correctly. + 3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use 'expandtab'. This way you will always insert spaces. The formatting will never be messed up when 'tabstop' is changed. - 3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a + You do need to check if no Tabs exist in the file, just like in the + item just above. + 4. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a |modeline| to set these values when editing the file again. Only - works when using Vim to edit the file. - 4. Always set 'tabstop' and 'shiftwidth' to the same value, and + works when using Vim to edit the file, other tools assume a tabstop + is worth 8 spaces. + 5. Always set 'tabstop' and 'shiftwidth' to the same value, and 'noexpandtab'. This should then work (for initial indents only) for any tabstop setting that people use. It might be nice to have tabs after the first non-blank inserted as spaces if you do this diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 071b062957..558cc75d65 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -260,8 +260,8 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|. 'runtimepath'. If the filetype detection was already enabled (this - is usually done with a "syntax enable" or "filetype - on" command in your |init.vim|, or automatically during + is usually done with a `syntax enable` or `filetype on` + command in your |vimrc|, or automatically during |initialization|), and the package was found in "pack/*/opt/{name}", this command will also look for "{name}/ftdetect/*.vim" files. diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 75e4767743..29e4a7b0aa 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -111,7 +111,7 @@ zuG Undo |zW| and |zG|, remove the word from the internal list, like with |zW|. *:spellra* *:spellrare* -:[count]spellr[are] {word} +:[count]spellra[re] {word} Add {word} as a rare word to 'spellfile', similar to |zw|. Without count the first name is used, with a count of two the second entry, etc. @@ -124,7 +124,7 @@ zuG Undo |zW| and |zG|, remove the word from the internal nnoremap z/ :exe ':spellrare! ' .. expand('') < |:spellundo|, |zuw|, or |zuW| can be used to undo this. -:spellr[rare]! {word} Add {word} as a rare word to the internal word +:spellra[re]! {word} Add {word} as a rare word to the internal word list, similar to |zW|. :[count]spellu[ndo] {word} *:spellu* *:spellundo* diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index b3a30b20e8..2c7b7ed61b 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -426,9 +426,11 @@ accordingly, proceeding as follows: 2. Process the arguments The options and file names from the command that start Vim are - inspected. Buffers are created for all files (but not loaded yet). + inspected. The |-V| argument can be used to display or log what happens next, useful for debugging the initializations. + The |--cmd| arguments are executed. + Buffers are created for all files (but not loaded yet). 3. Start a server (unless |--listen| was given) and set |v:servername|. diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt index db0127df95..8b6462911d 100644 --- a/runtime/doc/userfunc.txt +++ b/runtime/doc/userfunc.txt @@ -44,6 +44,13 @@ functions. unless "!" is given. {name} may be a |Dictionary| |Funcref| entry: > :function dict.init +< Note that {name} is not an expression, you cannot use + a variable that is a function reference. You can use + this dirty trick to list the function referred to with + variable "Funcref": > + let g:MyFuncref = Funcref + func g:MyFuncref + unlet g:MyFuncref :fu[nction] /{pattern} List functions with a name matching {pattern}. Example that lists all functions ending with "File": > @@ -72,8 +79,7 @@ See |:verbose-cmd| for more information. 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|: > + {name} may be a |Dictionary| |Funcref| entry: > :function dict.init(arg) < "dict" must be an existing dictionary. The entry "init" is added if it didn't exist yet. Otherwise [!] -- cgit