vim-patch:78c189837ae6 (#27920)

runtime(doc): Recover some missed commas and periods in starting.txt

Also:

- Insert some missing words;
- Strive for consistency with capitalisation of words;
- Improve shell alias examples.

The gvim words were left alone for now, but they deserve to
be treated like proper names, GVim or GUI Vim, unless these
refer to executable filenames (on *nix systems).

closes: vim/vim#14194

78c189837a

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
This commit is contained in:
zeertzjq 2024-03-19 06:55:30 +08:00 committed by GitHub
parent b5e3df37a4
commit 79af4e7e73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,7 +139,7 @@ argument.
--cmd {command} *--cmd* --cmd {command} *--cmd*
{command} will be executed before processing any vimrc file. {command} will be executed before processing any vimrc file.
Otherwise it acts like -c {command}. You can use up to 10 of Otherwise, it acts like -c {command}. You can use up to 10 of
these commands, independently from "-c" commands. these commands, independently from "-c" commands.
*-S* *-S*
@ -306,7 +306,7 @@ argument.
few windows will be editing an empty file. few windows will be editing an empty file.
*-O* *-O*
-O[N] Open N windows, split vertically. Otherwise it's like -o. -O[N] Open N windows, split vertically. Otherwise, it's like -o.
If both the -o and the -O option are given, the last one on If both the -o and the -O option are given, the last one on
the command line determines how the windows will be split. the command line determines how the windows will be split.
@ -325,8 +325,10 @@ argument.
This can be used to start Vim in a special mode, with special This can be used to start Vim in a special mode, with special
mappings and settings. A shell alias can be used to make mappings and settings. A shell alias can be used to make
this easy to use. For example: > this easy to use. For example, in a C shell descendant: >
alias vimc vim -u ~/.config/nvim/c_init.vim !* alias vimc 'nvim -u ~/.config/nvim/c_init.vim \!*'
< And in a Bash shell: >
alias vimc='nvim -u ~/.config/nvim/c_init.vim'
< Also consider using autocommands; see |autocommand|. < Also consider using autocommands; see |autocommand|.
When {vimrc} is "NONE" (all uppercase), all initializations When {vimrc} is "NONE" (all uppercase), all initializations
@ -544,7 +546,7 @@ accordingly, proceeding as follows:
This means that Nvim will figure out the values of 'shellpipe' and This means that Nvim will figure out the values of 'shellpipe' and
'shellredir' for you, unless you have set them yourself. 'shellredir' for you, unless you have set them yourself.
12. Set 'updatecount' to zero, if "-n" command argument used 12. Set 'updatecount' to zero, if "-n" command argument used.
13. Set binary options if the |-b| flag was given. 13. Set binary options if the |-b| flag was given.
@ -581,11 +583,11 @@ Avoiding trojan horses ~
*trojan-horse* *trojan-horse*
While reading the "vimrc" or the "exrc" file in the current directory, some While reading the "vimrc" or the "exrc" file in the current directory, some
commands can be disabled for security reasons by setting the 'secure' option. commands can be disabled for security reasons by setting the 'secure' option.
This is always done when executing the command from a tags file. Otherwise it This is always done when executing the command from a tags file. Otherwise,
would be possible that you accidentally use a vimrc or tags file that somebody it would be possible that you accidentally use a vimrc or tags file that
else created and contains nasty commands. The disabled commands are the ones somebody else created and contains nasty commands. The disabled commands are
that start a shell, the ones that write to a file, and ":autocmd". The ":map" the ones that start a shell, the ones that write to a file, and ":autocmd".
commands are echoed, so you can see which keys are being mapped. The ":map" commands are echoed, so you can see which keys are being mapped.
If you want Vim to execute all commands in a local vimrc file, you If you want Vim to execute all commands in a local vimrc file, you
can reset the 'secure' option in the EXINIT or VIMINIT environment variable or can reset the 'secure' option in the EXINIT or VIMINIT environment variable or
in the global exrc or vimrc file. This is not possible in vimrc or in the global exrc or vimrc file. This is not possible in vimrc or
@ -743,7 +745,7 @@ these are terminal or file dependent.
Note that the options 'binary', 'paste' and 'readonly' are included, this Note that the options 'binary', 'paste' and 'readonly' are included, this
might not always be what you want. might not always be what you want.
When special keys are used in mappings, The 'cpoptions' option will be When special keys are used in mappings, the 'cpoptions' option will be
temporarily set to its Vim default, to avoid the mappings to be temporarily set to its Vim default, to avoid the mappings to be
misinterpreted. This makes the file incompatible with Vi, but makes sure it misinterpreted. This makes the file incompatible with Vi, but makes sure it
can be used with different terminals. can be used with different terminals.
@ -797,8 +799,8 @@ You can quickly start editing with a previously saved View or Session with the
*:mks* *:mksession* *:mks* *:mksession*
:mks[ession][!] [file] Write a Vim script that restores the current editing :mks[ession][!] [file] Write a Vim script that restores the current editing
session. session.
When [!] is included an existing file is overwritten. When [!] is included, an existing file is overwritten.
When [file] is omitted "Session.vim" is used. When [file] is omitted, "Session.vim" is used.
The output of ":mksession" is like ":mkvimrc", but additional commands are The output of ":mksession" is like ":mkvimrc", but additional commands are
added to the file. Which ones depends on the 'sessionoptions' option. The added to the file. Which ones depends on the 'sessionoptions' option. The
@ -810,16 +812,16 @@ resulting file, when executed with a ":source" command:
3. Closes all windows in the current tab page, except the current one; closes 3. Closes all windows in the current tab page, except the current one; closes
all tab pages except the current one (this results in currently loaded all tab pages except the current one (this results in currently loaded
buffers to be unloaded, some may become hidden if 'hidden' is set or buffers to be unloaded, some may become hidden if 'hidden' is set or
otherwise specified); wipes out the current buffer, if it is empty otherwise specified); wipes out the current buffer, if it is empty and
and unnamed. unnamed.
4. Restores the current directory if 'sessionoptions' contains "curdir", or 4. Restores the current directory, if 'sessionoptions' contains "curdir", or
sets the current directory to where the Session file is if 'sessionoptions' sets the current directory to where the Session file is, if
contains "sesdir". 'sessionoptions' contains "sesdir".
5. Restores GUI Vim window position, if 'sessionoptions' contains "winpos". 5. Restores GUI Vim window position, if 'sessionoptions' contains "winpos".
6. Restores screen size, if 'sessionoptions' contains "resize". 6. Restores screen size, if 'sessionoptions' contains "resize".
7. Reloads the buffer list, with the last cursor positions. If 7. Reloads the buffer list, with the last cursor positions. If
'sessionoptions' contains "buffers" then all buffers are restored, 'sessionoptions' contains "buffers" then all buffers are restored,
including hidden and unloaded buffers. Otherwise only buffers in windows including hidden and unloaded buffers. Otherwise, only buffers in windows
are restored. are restored.
8. Restores all windows with the same layout. If 'sessionoptions' contains 8. Restores all windows with the same layout. If 'sessionoptions' contains
"help", help windows are restored. If 'sessionoptions' contains "blank", "help", help windows are restored. If 'sessionoptions' contains "blank",
@ -846,14 +848,14 @@ A session includes all tab pages, unless "tabpages" was removed from
The |SessionLoadPost| autocmd event is triggered after a session file is The |SessionLoadPost| autocmd event is triggered after a session file is
loaded/sourced. loaded/sourced.
*SessionLoad-variable* *SessionLoad-variable*
While the session file is loading the SessionLoad global variable is set to 1. While the session file is loading, the SessionLoad global variable is set to
Plugins can use this to postpone some work until the SessionLoadPost event is 1. Plugins can use this to postpone some work until the SessionLoadPost event
triggered. is triggered.
*:mkvie* *:mkview* *:mkvie* *:mkview*
:mkvie[w][!] [file] Write a Vim script that restores the contents of the :mkvie[w][!] [file] Write a Vim script that restores the contents of the
current window. current window.
When [!] is included an existing file is overwritten. When [!] is included, an existing file is overwritten.
When [file] is omitted or is a number from 1 to 9, a When [file] is omitted or is a number from 1 to 9, a
name is generated and 'viewdir' prepended. When the name is generated and 'viewdir' prepended. When the
last path part of 'viewdir' does not exist, this last path part of 'viewdir' does not exist, this
@ -868,14 +870,13 @@ triggered.
The output of ":mkview" contains these items: The output of ":mkview" contains these items:
1. The argument list used in the window. When the global argument list is 1. The argument list used in the window. When the global argument list is
used it is reset to the global list. used, it is reset to the global list.
The index in the argument list is also restored. The index in the argument list is also restored.
2. The file being edited in the window. If there is no file, the window is 2. The file being edited in the window. If there is no file, the window is
made empty. made empty.
3. Restore mappings, abbreviations and options local to the window if 3. Restore mappings, abbreviations and options local to the window, if
'viewoptions' contains "options" or "localoptions". For the options it 'viewoptions' contains "options" or "localoptions". Only option values
restores only values that are local to the current buffer and values local that are local to the current buffer and the current window are restored.
to the window.
When storing the view as part of a session and "options" is in When storing the view as part of a session and "options" is in
'sessionoptions', global values for local options will be stored too. 'sessionoptions', global values for local options will be stored too.
4. Restore folds when using manual folding and 'viewoptions' contains 4. Restore folds when using manual folding and 'viewoptions' contains
@ -909,7 +910,7 @@ Note that Views and Sessions are not perfect:
The combination of ":mkview" and ":loadview" can be used to store up to ten The combination of ":mkview" and ":loadview" can be used to store up to ten
different views of a file. These are remembered in the directory specified different views of a file. These are remembered in the directory specified
with the 'viewdir' option. The views are stored using the file name. If a with the 'viewdir' option. The views are stored using the file name. If a
file is renamed or accessed through a (symbolic) link the view will not be file is renamed or accessed through a (symbolic) link, the view will not be
found. found.
You might want to clean up your 'viewdir' directory now and then. You might want to clean up your 'viewdir' directory now and then.
@ -969,7 +970,7 @@ Notes for Unix:
allow just anybody to read and write your ShaDa file! allow just anybody to read and write your ShaDa file!
- Vim will not overwrite a ShaDa file that is not writable by the current - Vim will not overwrite a ShaDa file that is not writable by the current
"real" user. This helps for when you did "su" to become root, but your "real" user. This helps for when you did "su" to become root, but your
$HOME is still set to a normal user's home directory. Otherwise Vim would $HOME is still set to a normal user's home directory. Otherwise, Vim would
create a ShaDa file owned by root that nobody else can read. create a ShaDa file owned by root that nobody else can read.
- The ShaDa file cannot be a symbolic link. This is to avoid security - The ShaDa file cannot be a symbolic link. This is to avoid security
issues. issues.
@ -1001,11 +1002,11 @@ using this command: >
vim -c "normal '0" vim -c "normal '0"
In a csh compatible shell you could make an alias for it: > In a C shell descendant, you could make an alias for it: >
alias lvim vim -c '"'normal "'"0'"' alias lvim vim -c '"'normal "'"0'"'
For a bash-like shell: > For a Bash-like shell: >
alias lvim='vim -c "normal '\''0"' alias lvim='vim -c "normal '\''0"'
@ -1099,15 +1100,15 @@ MANUALLY READING AND WRITING *shada-read-write*
Two commands can be used to read and write the ShaDa file manually. This Two commands can be used to read and write the ShaDa file manually. This
can be used to exchange registers between two running Vim programs: First can be used to exchange registers between two running Vim programs: First
type ":wsh" in one and then ":rsh" in the other. Note that if the register type ":wsh" in one and then ":rsh" in the other. Note that if the register
already contained something, then ":rsh!" would be required. Also note already contained something, then ":rsh!" would be required. Also note,
however that this means everything will be overwritten with information from however, that this means everything will be overwritten with information from
the first Vim, including the command line history, etc. the first Vim, including the command line history, etc.
The ShaDa file itself can be edited by hand too, although we suggest you The ShaDa file itself can be edited by hand too, although we suggest you
start with an existing one to get the format right. You need to understand start with an existing one to get the format right. You need to understand
MessagePack (or, more likely, find software that is able to use it) format to MessagePack (or, more likely, find software that is able to use it) format to
do this. This can be useful in order to create a second file, say do this. This can be useful in order to create a second file, say
"~/.my.shada" which could contain certain settings that you always want when "~/.my.shada", which could contain certain settings that you always want when
you first start Nvim. For example, you can preload registers with you first start Nvim. For example, you can preload registers with
particular data, or put certain commands in the command line history. A line particular data, or put certain commands in the command line history. A line
in your |config| file like > in your |config| file like >
@ -1171,8 +1172,8 @@ running) you have additional options:
described in |shada-error-handling|). If 'shada' is described in |shada-error-handling|). If 'shada' is
empty, marks for up to 100 files will be written. empty, marks for up to 100 files will be written.
When you get error "E929: All .tmp.X files exist, When you get error "E929: All .tmp.X files exist,
cannot write ShaDa file!" check that no old temp files cannot write ShaDa file!", check that no old temp
were left behind (e.g. files were left behind (e.g.
~/.local/state/nvim/shada/main.shada.tmp*). ~/.local/state/nvim/shada/main.shada.tmp*).
Note: Executing :wshada will reset all |'quote| marks. Note: Executing :wshada will reset all |'quote| marks.
@ -1192,7 +1193,7 @@ running) you have additional options:
the list is edited. the list is edited.
If you get the |press-enter| prompt you can press "q" If you get the |press-enter| prompt you can press "q"
and still get the prompt to enter a file number. and still get the prompt to enter a file number.
Use ! to abandon a modified buffer. |abandon| Use [!] to abandon a modified buffer. |abandon|
SHADA FILE FORMAT *shada-format* SHADA FILE FORMAT *shada-format*