diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/autocmd.txt | 43 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 2 | ||||
-rw-r--r-- | runtime/doc/if_lua.txt | 16 | ||||
-rw-r--r-- | runtime/doc/map.txt | 26 | ||||
-rw-r--r-- | runtime/doc/nvim.txt | 10 | ||||
-rw-r--r-- | runtime/doc/options.txt | 19 | ||||
-rw-r--r-- | runtime/doc/remote_plugin.txt | 8 | ||||
-rw-r--r-- | runtime/doc/usr_43.txt | 2 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 5 |
9 files changed, 69 insertions, 62 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index ca10d44467..a4c0107cc9 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -43,7 +43,7 @@ effects. Be careful not to destroy your text. :au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd} Add {cmd} to the list of commands that Vim will execute automatically on {event} for a file matching - {pat} |autocmd-patterns|. + {pat} |autocmd-pattern|. Note: A quote character is seen as argument to the :autocmd and won't start a comment. Nvim always adds {cmd} after existing autocommands so @@ -358,7 +358,7 @@ Name triggered by ~ |CompleteDone| after Insert mode completion is done |User| to be used in combination with ":doautocmd" -|Signal| after the nvim process received a signal +|Signal| after Nvim receives a signal @@ -870,27 +870,27 @@ MenuPopupChanged *MenuPopupChanged* It is not allowed to change the text |textlock|. *OptionSet* -OptionSet After setting an option. The pattern is - matched against the long option name. - The |v:option_old| variable indicates the - old option value, |v:option_new| variable - indicates the newly set value, the - |v:option_type| variable indicates whether - it's global or local scoped and |<amatch>| - indicates what option has been set. +OptionSet After setting an option (except during + |startup|). The |autocmd-pattern| is matched + against the long option name. + |v:option_old| indicates the old option value, + |v:option_new| indicates the new value, + |v:option_type| indicates whether it's global + or local scoped and |<amatch>| indicates which + option was set. Usage example: Check for the existence of the directory in the 'backupdir' and 'undodir' options, create the directory if it doesn't exist yet. - Note: It's a bad idea to reset an option - during this autocommand, this may break a - plugin. You can always use `:noa` to prevent - triggering this autocommand. + Note: Do not reset the same option during this + autocommand, that may break plugins. You can + always use |:noautocmd| to prevent triggering + OptionSet. - When using |:set| in the autocommand the event - is not triggered again. + Recursion is ignored, thus |:set| in the + autocommand does not trigger OptionSet again. *QuickFixCmdPre* QuickFixCmdPre Before a quickfix command is run (|:make|, @@ -943,10 +943,11 @@ ShellCmdPost After executing a shell command with |:!cmd|, For non-blocking shell commands, see |job-control|. *Signal* -Signal After the nvim process received a signal. - The pattern is matched against the name of the - received signal. Only "SIGUSR1" is supported. - *ShellFilterPost* +Signal After Nvim receives a signal. The pattern is + matched against the signal name. Only + "SIGUSR1" is supported. Example: > + autocmd Signal SIGUSR1 call some#func() +< *ShellFilterPost* ShellFilterPost After executing a shell command with ":{range}!cmd", ":w !cmd" or ":r !cmd". Can be used to check for any changed files. @@ -1123,7 +1124,7 @@ WinNew When a new window was created. Not done for Before a WinEnter event. ============================================================================== -6. Patterns *autocmd-patterns* *{pat}* +6. Patterns *autocmd-pattern* *{pat}* The {pat} argument can be a comma separated list. This works as if the command was given with each pattern separately. Thus this command: > diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 020427c66f..85824b1f49 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3782,7 +3782,7 @@ function({name} [, {arglist}] [, {dict}]) same function. When {arglist} or {dict} is present this creates a partial. - That mans the argument list and/or the dictionary is stored in + That means the argument list and/or the dictionary is stored in the Funcref and will be used when the Funcref is called. The arguments are passed to the function in front of other diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index c36aeffa1a..b97341e319 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -16,11 +16,11 @@ an idea of what lurks beneath: > :lua print(vim.inspect(package.loaded)) -Nvim includes a "standard library" |lua-stdlib| for Lua. This library -complements the Nvim editor |functions| and Ex commands (the editor "stdlib"), -which can also be used from Lua code. +Nvim includes a "standard library" |lua-stdlib| for Lua. It complements the +"editor stdlib" (|functions| and Ex commands) and the |API|, all of which can +be used from Lua code. -Nvim resolves module conflicts by "last wins". For example if both of these +Module conflicts are resolved by "last wins". For example if both of these are on 'runtimepath': runtime/lua/foo.lua ~/.config/nvim/lua/foo.lua @@ -260,9 +260,9 @@ position are restricted when the command is executed in the |sandbox|. ============================================================================== vim.* *lua-vim* *lua-stdlib* -The "standard library" (stdlib) of Nvim Lua is the `vim` module, which exposes -various functions and sub-modules. The module is implicitly loaded, thus -require("vim") is unnecessary. +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: > @@ -288,7 +288,7 @@ To find documentation on e.g. the "deepcopy" function: > :help vim.deepcopy -Note: Underscore-prefixed functions (e.g. "_os_proc_children") are +Note that underscore-prefixed functions (e.g. "_os_proc_children") are internal/private and must not be used by plugins. ------------------------------------------------------------------------------ diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index fa5e10b5e5..34d6a15450 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -227,14 +227,14 @@ should not either insert or change the v:char. Be very careful about side effects! The expression is evaluated while obtaining characters, you may very well make the command dysfunctional. -For this reason the following is blocked: +Therefore the following is blocked for <expr> mappings: - Changing the buffer text |textlock|. - Editing another buffer. - The |:normal| command. - Moving the cursor is allowed, but it is restored afterwards. - If the cmdline is changed, the old text and cursor position are restored. If you want the mapping to do any of these let the returned characters do -that. Or use a |<Cmd>| mapping (which doesn't have these restrictions). +that. (Or use a |<Cmd>| mapping instead.) You can use getchar(), it consumes typeahead if there is any. E.g., if you have these mappings: > @@ -274,9 +274,9 @@ Using 0x80 as a single byte before other text does not work, it will be seen as a special key. *<Cmd>* *:map-cmd* -The <Cmd> pseudokey may be used to define a "command mapping", which executes -the command directly (without changing modes, etc.). Where you might use -":...<CR>" in the {lhs} of a mapping, you can instead use "<Cmd>...<CR>". +The <Cmd> pseudokey begins a "command mapping", which executes the command +directly (without changing modes). Where you might use ":...<CR>" in the +{lhs} of a mapping, you can instead use "<Cmd>...<CR>". Example: > noremap x <Cmd>echo mode(1)<cr> < @@ -284,17 +284,21 @@ This is more flexible than `:<C-U>` in visual and operator-pending mode, or `<C-O>:` in insert-mode, because the commands are executed directly in the current mode (instead of always going to normal-mode). Visual-mode is preserved, so tricks with |gv| are not needed. Commands can be invoked -directly in cmdline-mode (which otherwise would require timer hacks). - -Because <Cmd> avoids mode-changes (unlike ":") it does not trigger -|CmdlineEnter| and |CmdlineLeave| events. This helps performance. +directly in cmdline-mode (which would otherwise require timer hacks). Unlike <expr> mappings, there are no special restrictions on the <Cmd> command: it is executed as if an (unrestricted) |autocmd| was invoked or an async event event was processed. -In select-mode, |:map| and |:vmap| command mappings are executed in -visual-mode. Use |:smap| to handle select-mode. +Note: +- Because <Cmd> avoids mode-changes (unlike ":") it does not trigger + |CmdlineEnter| and |CmdlineLeave| events. This helps performance. +- For the same reason, |keycodes| like <C-R><C-W> are interpreted in the + context of the current mode, not cmdline-mode! Thus <C-R><C-W> in a + :nnoremap (normal-mode) mapping does the normal-mode function of <C-R> and + <C-W> rather than the cmdline-mode <C-R><C-W> chord. +- In select-mode, |:map| and |:vmap| command mappings are executed in + visual-mode. Use |:smap| to handle select-mode. *E5520* <Cmd> commands must terminate, that is, they must be followed by <CR> in the diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt index 07eb48aea3..513d27ccad 100644 --- a/runtime/doc/nvim.txt +++ b/runtime/doc/nvim.txt @@ -8,14 +8,14 @@ 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: > - :Tutor<Enter> -If you already use Vim see |nvim-from-vim| for a quickstart. + :Tutor<Enter> -Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim is -maintained where possible. See |vim_diff.txt| for the complete reference of -differences from Vim. +Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim +(especially editor and VimL features) is maintained where possible. See +|vim-differences| for the complete reference of differences from Vim. Type |gO| to see the table of contents. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 361cb3da5c..3c45a3f525 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -694,8 +694,9 @@ A jump table for the options with a short description can be found at |Q_op|. *'background'* *'bg'* 'background' 'bg' string (default "dark") global - When set to "dark" or "light", Nvim will adjust the default color - groups for a dark or light background, respectively. + When set to "dark" or "light", adjusts the default color groups for + that background type. The |TUI| or other UI sets this on startup + (triggering |OptionSet|) if it can detect the background color. This option does NOT change the background color, it tells Nvim what the "inherited" (terminal/GUI) background looks like. @@ -878,7 +879,7 @@ A jump table for the options with a short description can be found at |Q_op|. A list of file patterns. When one of the patterns matches with the name of the file which is written, no backup file is created. Both the specified file name and the full path name of the file are used. - The pattern is used like with |:autocmd|, see |autocmd-patterns|. + The pattern is used like with |:autocmd|, see |autocmd-pattern|. Watch out for special characters, see |option-backslash|. When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the default value. "/tmp/*" is only used for Unix. @@ -1831,9 +1832,9 @@ A jump table for the options with a short description can be found at |Q_op|. name. See |option-backslash| about using backslashes. This has nothing to do with the |Dictionary| variable type. Where to find a list of words? - - On FreeBSD, there is the file "/usr/share/dict/words". - - In the Simtel archive, look in the "msdos/linguist" directory. - - In "miscfiles" of the GNU collection. + - BSD/macOS include the "/usr/share/dict/words" file. + - Try "apt install spell" to get the "/usr/share/dict/words" file on + apt-managed systems (Debian/Ubuntu). The use of |:set+=| and |:set-=| is preferred when adding or removing directories from the list. This avoids problems when a future version uses another default. @@ -4693,6 +4694,7 @@ A jump table for the options with a short description can be found at |Q_op|. pack/ packages |:packadd| plugin/ plugin scripts |write-plugin| print/ files for printing |postscript-print-encoding| + rplugin/ |remote-plugin| scripts spell/ spell checking files |spell| syntax/ syntax files |mysyntaxfile| tutor/ tutorial files |:Tutor| @@ -6127,8 +6129,7 @@ A jump table for the options with a short description can be found at |Q_op|. global When set: Add 's' flag to 'shortmess' option (this makes the message for a search that hits the start or end of the file not being - displayed). When reset: Remove 's' flag from 'shortmess' option. {Vi - shortens a lot of messages} + displayed). When reset: Remove 's' flag from 'shortmess' option. *'textwidth'* *'tw'* 'textwidth' 'tw' number (default 0) @@ -6506,7 +6507,7 @@ A jump table for the options with a short description can be found at |Q_op|. patterns is ignored when expanding |wildcards|, completing file or directory names, and influences the result of |expand()|, |glob()| and |globpath()| unless a flag is passed to disable this. - The pattern is used like with |:autocmd|, see |autocmd-patterns|. + The pattern is used like with |:autocmd|, see |autocmd-pattern|. Also see 'suffixes'. Example: > :set wildignore=*.o,*.obj diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt index 6a9874660b..4cdcbed250 100644 --- a/runtime/doc/remote_plugin.txt +++ b/runtime/doc/remote_plugin.txt @@ -122,10 +122,10 @@ the example, say the Java plugin is a semantic completion engine for Java code. If it defines the autocommand "BufEnter *.java", then the Java host is spawned only when Nvim loads a buffer matching "*.java". -If the explicit call to |:UpdateRemotePlugins| seems incovenient, try to see it -like this: It's a way to provide IDE capabilities in Nvim while still keeping -it fast and lightweight for general use. It's also analogous to the |:helptags| -command. +If the explicit call to |:UpdateRemotePlugins| seems inconvenient, try to see +it like this: It's a way to provide IDE capabilities in Nvim while still +keeping it fast and lightweight for general use. It's also analogous to the +|:helptags| command. *$NVIM_RPLUGIN_MANIFEST* Unless $NVIM_RPLUGIN_MANIFEST is set the manifest will be written to a file diff --git a/runtime/doc/usr_43.txt b/runtime/doc/usr_43.txt index 04e9f9c000..15c94cd15e 100644 --- a/runtime/doc/usr_43.txt +++ b/runtime/doc/usr_43.txt @@ -94,7 +94,7 @@ unless it was set already. This will make sure that 'filetype' isn't set twice. You can use many different patterns to match the name of your file. Directory -names can also be included. See |autocmd-patterns|. For example, the files +names can also be included. See |autocmd-pattern|. For example, the files under "/usr/share/scripts/" are all "ruby" files, but don't have the expected file name extension. Adding this to the example above: > diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 30d7e972c3..7c3f6f9ce8 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -6,8 +6,9 @@ Differences between Nvim and Vim *vim-differences* -Nvim differs from Vim in many ways, big and small. This document is -a complete and centralized reference of those differences. +Nvim differs from Vim in many ways, although editor and VimL features are +mostly identical. This document is a complete and centralized reference of +the differences. Type |gO| to see the table of contents. |