diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-10-17 11:34:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-17 11:34:02 -0400 |
| commit | 0851e7dabed9fc9c019e22088029f36e9f3ec3e3 (patch) | |
| tree | 35a1abb6a3d08b49e6a45ad3de089b622e1605ae /runtime/doc/various.txt | |
| parent | f8b704e019ed8194a5e873773670b263abd3dedf (diff) | |
| download | rneovim-master.tar.gz rneovim-master.tar.bz2 rneovim-master.zip | |
docs(help): specify h4 "function signature" format #42434master
Work towards enabling ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88)
in all `:help` files.
Problem:
The final boss of vimdoc pseudo-structure: Vim's quasi-headings on
function signatures and excmd docs is visually distinctive but too
inconsistent for a nice parse rule.
Solution:
- Define the quasi-heading format as an "h4" variant, specified at
`:help help-tag-heading`.
- For simplicity and predictability, it is defined as any line that
ends with a help tag(s) preceded by 2 or more spaces (or 1 tab).
- Update existing docs.
- This one-time update has a lot of changes, but is very unlikely to
conflict with ported Vim-patches because (1) Vim rarely adds new
*excmds* that we want, and (2) *function* docs are auto-generated.
ref https://github.com/neovim/tree-sitter-vimdoc/issues/110
Diffstat (limited to 'runtime/doc/various.txt')
| -rw-r--r-- | runtime/doc/various.txt | 152 |
1 files changed, 74 insertions, 78 deletions
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index a71b877f02..fc4663be5a 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -11,8 +11,8 @@ Various commands *various* ============================================================================== 1. Various commands *various-cmds* - *CTRL-C* -CTRL-C Interrupt the current command, script, mapping, +CTRL-C *CTRL-C* + Interrupt the current command, script, mapping, prompt, or search. In Normal mode, any pending command is aborted. During @@ -21,8 +21,8 @@ CTRL-C Interrupt the current command, script, mapping, Lua code cannot be interrupted unless it "yields" via |vim.wait()|. - *CTRL-L* -CTRL-L Clears and redraws the screen. The redraw may happen +CTRL-L *CTRL-L* + Clears and redraws the screen. The redraw may happen later, after processing typeahead. See also |nvim__redraw()|. *CTRL-L-default* @@ -30,28 +30,28 @@ CTRL-L Clears and redraws the screen. The redraw may happen |:nohlsearch|, removes |multicursor|s, and updates diffs |:diffupdate|. |default-mappings| - *:mod* *:mode* *E359* -:mod[e] Clears and redraws the screen. +:mod[e] *:mod* *:mode* *E359* + Clears and redraws the screen. See also |nvim__redraw()|. - *:redr* *:redraw* -:redr[aw][!] Redraws pending screen updates now, or the entire +:redr[aw][!] *:redr* *:redraw* + Redraws pending screen updates now, or the entire screen if "!" is included. To CLEAR the screen use |:mode| or |CTRL-L|. It can be used to redraw the screen in a script or function (or a mapping if 'lazyredraw' is set). See also |nvim__redraw()|. - *:redraws* *:redrawstatus* -:redraws[tatus][!] Redraws the status line and window bar of the current +:redraws[tatus][!] *:redraws* *:redrawstatus* + Redraws the status line and window bar of the current window, or all status lines and window bars if "!" is included. Redraws the commandline instead if it contains the 'ruler'. Useful if 'statusline' or 'winbar' includes an item that doesn't cause automatic updating. See also |nvim__redraw()|. - *:redrawt* *:redrawtabline* -:redrawt[abline] Redraw the tabline. Useful to update the tabline when +:redrawt[abline] *:redrawt* *:redrawtabline* + Redraw the tabline. Useful to update the tabline when 'tabline' includes an item that doesn't trigger automatic updating. See also |nvim__redraw()|. @@ -61,8 +61,9 @@ CTRL-L Clears and redraws the screen. The redraw may happen mapping to your vimrc: > :map CTRL-V <BS> CTRL-V <Del> < -:as[cii] or *ga* *:as* *:ascii* -ga Print the ascii value of the character under the +:as[cii] *:as* *:ascii* +ga *ga* + Print the ascii value of the character under the cursor in decimal, hexadecimal and octal. Mnemonic: Get Ascii value. @@ -91,16 +92,16 @@ ga Print the ascii value of the character under the <ö> 246, Hex 00f6, Oct 366, Digr o: ~ This shows you can type CTRL-K o : to insert ö. - *g8* -g8 Print the hex values of the bytes used in the +g8 *g8* + Print the hex values of the bytes used in the character under the cursor, assuming it is in |UTF-8| encoding. This also shows composing characters. The value of 'maxcombine' doesn't matter. Example of a character with two composing characters: > e0 b8 81 + e0 b8 b9 + e0 b9 89 < - *8g8* -8g8 Find an illegal UTF-8 byte sequence at or after the +8g8 *8g8* + Find an illegal UTF-8 byte sequence at or after the cursor. Can be used when editing a file that was supposed to be UTF-8 but was read as if it is an 8-bit encoding @@ -110,8 +111,8 @@ g8 Print the hex values of the bytes used in the cursor is halfway through a multibyte character the command won't move the cursor. - *gx* -gx Opens the current filepath, URL (decided by +gx *gx* + Opens the current filepath, URL (decided by |<cfile>|, 'isfname'), or |LSP| "documentLink" at cursor using the system default handler. @@ -120,12 +121,11 @@ gx Opens the current filepath, URL (decided by Mapped to |vim.ui.open()|. - *v_gx* -{Visual}gx Opens the selected text using the system default +{Visual}gx *v_gx* + Opens the selected text using the system default handler. Mapped to |vim.ui.open()|. - *:p* *:pr* *:print* *E749* -:[range]p[rint] [flags] +:[range]p[rint] [flags] *:p* *:pr* *:print* *E749* Print [range] lines (default current line). Can also be spelled `:[range]|` due to Vi compatibility (see |:bar|). Gives an error in an empty buffer. @@ -139,21 +139,18 @@ gx Opens the current filepath, URL (decided by current line |cmdline-ranges|). See |ex-flags| for [flags]. - *:l* *:list* -:[range]l[ist] [count] [flags] +:[range]l[ist] [count] [flags] *:l* *:list* Same as :print, but show tabs as ">", trailing spaces as "-", and non-breakable space characters as "+" by default. Further changed by the 'listchars' option. See |ex-flags| for [flags]. - *:nu* *:number* -:[range]nu[mber] [count] [flags] +:[range]nu[mber] [count] [flags] *:nu* *:number* Same as :print, but precede each line with its line number. (See also |hl-LineNr| and 'numberwidth'). See |ex-flags| for [flags]. - *:#* -:[range]# [count] [flags] +:[range]# [count] [flags] *:#* synonym for :number. *:#!* *vim-shebang* @@ -168,8 +165,8 @@ gx Opens the current filepath, URL (decided by Make that script executable and run it to create a new diary entry. - *:z* *E144* -:[range]z[+-^.=][count] Display several lines of text surrounding the line +:[range]z[+-^.=][count] *:z* *E144* + Display several lines of text surrounding the line specified with [range], or around the current line if there is no [range]. @@ -200,16 +197,15 @@ gx Opens the current filepath, URL (decided by If the 'number' option is set, absolute line numbers will be included in the output. - *:z!* -:[range]z![+-^.=][count] +:[range]z![+-^.=][count] *:z!* Like ":z", but when [count] is not specified, it defaults to the Vim window height minus one. :[range]z[!]#[+-^.=][count] *:z#* Like ":z" or ":z!", but number the lines. - *:=* -:= [args] Without [args]: prints the last line number. +:= [args] *:=* + Without [args]: prints the last line number. With [args]: equivalent to `:lua ={expr}`. see |:lua| :{range}= Prints the last line number in {range}. For example, @@ -262,11 +258,11 @@ gx Opens the current filepath, URL (decided by for each line. Otherwise it's the same as the ":normal" command without a range. - *:sh* *:shell* *E371* *E360* -:sh[ell] Removed. |vim-differences| +:sh[ell] *:sh* *:shell* *E371* *E360* + Removed. |vim-differences| - *:terminal* *:te* -:te[rminal][!] [cmd] Run [cmd] in a non-interactive 'shell' in a new +:te[rminal][!] [cmd] *:terminal* *:te* + Run [cmd] in a non-interactive 'shell' in a new |terminal-emulator| buffer. Without [cmd], start an interactive 'shell'. @@ -290,8 +286,8 @@ gx Opens the current filepath, URL (decided by To enter |Terminal-mode| automatically: > autocmd TermOpen * startinsert < - *:!cmd* *:!* -:!{cmd} Execute {cmd} with 'shell'. See also |:terminal|. +:!{cmd} *:!cmd* *:!* + Execute {cmd} with 'shell'. See also |:terminal|. For the filter command, see |:range!|. The command runs in a non-interactive shell connected @@ -348,15 +344,15 @@ gx Opens the current filepath, URL (decided by To avoid the hit-enter prompt use: > :silent !{cmd} < - *:!!* -:!! Repeat last ":!{cmd}". +:!! *:!!* + Repeat last ":!{cmd}". - *:ve* *:ver* *:version* -:ve[rsion] Print editor version and build information. +:ve[rsion] *:ve* *:ver* *:version* + Print editor version and build information. See also |feature-compile|. - *:redi* *:redir* -:redi[r][!] > {file} Redirect messages to file {file}. The messages which +:redi[r][!] > {file} *:redi* *:redir* + Redirect messages to file {file}. The messages which are the output of commands are written to that file, until redirection ends. The messages are also still shown on the screen. When [!] is included, an @@ -417,9 +413,9 @@ gx Opens the current filepath, URL (decided by :redi[r] END End redirecting messages. - *:filt* *:filter* -:filt[er][!] {pattern} {command} +:filt[er][!] {pattern} {command} *:filt* *:filter* :filt[er][!] /{pattern}/ {command} + Restrict the output of {command} to lines matching with {pattern}. For example, to list only xml files: > :filter /\.xml$/ oldfiles @@ -457,8 +453,8 @@ gx Opens the current filepath, URL (decided by Only normal messages are filtered, error messages are not. - *:sil* *:silent* *:silent!* -:sil[ent][!] {command} Execute {command} silently. Normal messages will not +:sil[ent][!] {command} *:sil* *:silent* *:silent!* + Execute {command} silently. Normal messages will not be given or added to the message history. When [!] is added, error messages will also be skipped, and commands and mappings will not be aborted @@ -486,8 +482,8 @@ gx Opens the current filepath, URL (decided by Dialogs that prompt for user input (|confirm()|, 'swapfile', …) are never silent. - *:uns* *:unsilent* -:uns[ilent] {command} Execute {command} not silently. Only makes a +:uns[ilent] {command} *:uns* *:unsilent* + Execute {command} not silently. Only makes a difference when |:silent| was used to get to this command. Use this for giving a message even when |:silent| was @@ -497,8 +493,7 @@ gx Opens the current filepath, URL (decided by :silent argdo unsilent echo expand('%') .. ": " .. getline(1) < - *:verb* *:verbose* -:[count]verb[ose] {command} +:[count]verb[ose] {command} *:verb* *:verbose* Execute {command} with 'verbose' set to [count]. If [count] is omitted one is used. ":0verbose" can be used to set 'verbose' to zero. @@ -529,8 +524,8 @@ nvim with -V1 arg to see them. If it was defined manually then there will be no "Last set" message. When it was defined while executing a function, user command or autocommand, the script in which it was defined is reported. - *K* -[count]K Runs the program given by 'keywordprg' to lookup the +[count]K *K* + Runs the program given by 'keywordprg' to lookup the |word| (defined by 'iskeyword') under or right of the cursor. Default is "man". Works like this: > :tabnew | terminal {program} {keyword} @@ -551,21 +546,22 @@ user command or autocommand, the script in which it was defined is reported. - The Nvim |LSP| client sets K to show LSP "hover" feature. |lsp-defaults| - *v_K* -{Visual}K Like "K", but use the visually highlighted text for +{Visual}K *v_K* + Like "K", but use the visually highlighted text for the keyword. Only works when the highlighted text is not more than one line. - *gO* -gO Show a filetype-specific, navigable "outline" of the +gO *gO* + Show a filetype-specific, navigable "outline" of the current buffer. For example, in a |help| buffer this shows the table of contents. Works in |help| and |:Man| buffers, or any buffer with an active |LSP| client (|lsp-defaults|). -[N]gs *gs* *:sl* *:sleep* -:[N]sl[eep] [N][m] Do nothing for [N] seconds, or [N] milliseconds if [m] +[N]gs *gs* +:[N]sl[eep] [N][m] *:sl* *:sleep* + Do nothing for [N] seconds, or [N] milliseconds if [m] was given. "gs" always uses seconds. Default is one second. > :sleep "sleep for one second @@ -578,16 +574,16 @@ gO Show a filetype-specific, navigable "outline" of the if at a visible position. Queued messages are processed during the sleep. - *:sl!* *:sleep!* -:[N]sl[eep]! [N][m] Same as above, but hide the cursor. +:[N]sl[eep]! [N][m] *:sl!* *:sleep!* + Same as above, but hide the cursor. - *g==* -g== Executes the current code block. +g== *g==* + Executes the current code block. Works in |help| buffers. - *:upt* *:uptime* -:upt[ime] Shows Nvim's uptime. +:upt[ime] *:upt* *:uptime* + Shows Nvim's uptime. See also |v:starttime|. ============================================================================== @@ -644,17 +640,17 @@ to look up the value of 'commentstring' corresponding to the cursor position. The following |default-mappings| are defined: - *gc* *gc-default* -gc{motion} Comment or uncomment lines covered by {motion}. +gc{motion} *gc* *gc-default* + Comment or uncomment lines covered by {motion}. - *gcc* *gcc-default* -gcc Comment or uncomment [count] lines starting at cursor. +gcc *gcc* *gcc-default* + Comment or uncomment [count] lines starting at cursor. - *v_gc* *v_gc-default* -{Visual}gc Comment or uncomment the selected line(s). +{Visual}gc *v_gc* *v_gc-default* + Comment or uncomment the selected line(s). - *o_gc* *o_gc-default* -gc Text object for the largest contiguous block of +gc *o_gc* *o_gc-default* + Text object for the largest contiguous block of non-blank commented lines around the cursor (e.g. `gcgc` uncomments a comment block; `dgc` deletes it). Works only in Operator-pending mode. |