runtime(doc): Whitespace updates
Use double sentence spacing and wrap lines at 'textwidth'. Code examples and tables were not wrapped unless this had already been done locally. closes: #18453 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
2a33b499a3
commit
c58f91c035
@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 9.1. Last change: 2025 Jul 15
|
||||
*repeat.txt* For Vim version 9.1. Last change: 2025 Oct 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -86,7 +86,7 @@ line is aborted and the global command continues with the next marked or
|
||||
unmarked line.
|
||||
*E147*
|
||||
When the command is used recursively, it only works on one line. Giving a
|
||||
range is then not allowed. This is useful to find all lines that match a
|
||||
range is then not allowed. This is useful to find all lines that match a
|
||||
pattern and do not match another pattern: >
|
||||
:g/found/v/notfound/{cmd}
|
||||
This first finds all lines containing "found", but only executes {cmd} when
|
||||
@ -157,18 +157,18 @@ q Stops recording. (Implementation note: The 'q' that
|
||||
@@ Repeat the previous @{0-9a-z":*} [count] times.
|
||||
|
||||
*:@*
|
||||
:[addr]@{0-9a-z".=*+} Execute the contents of register {0-9a-z".=*+} as an Ex
|
||||
command. First set cursor at line [addr] (default is
|
||||
current line). When the last line in the register does
|
||||
not have a <CR> it will be added automatically when
|
||||
the 'e' flag is present in 'cpoptions'.
|
||||
:[addr]@{0-9a-z".=*+} Execute the contents of register {0-9a-z".=*+} as an
|
||||
Ex command. First set cursor at line [addr] (default
|
||||
is current line). When the last line in the register
|
||||
does not have a <CR> it will be added automatically
|
||||
when the 'e' flag is present in 'cpoptions'.
|
||||
For ":@=" the last used expression is used. The
|
||||
result of evaluating the expression is executed as an
|
||||
Ex command.
|
||||
Mappings are not recognized in these commands.
|
||||
When the |line-continuation| character (\) is present
|
||||
at the beginning of a line in a linewise register,
|
||||
then it is combined with the previous line. This is
|
||||
then it is combined with the previous line. This is
|
||||
useful for yanking and executing parts of a Vim
|
||||
script.
|
||||
Future: Will execute the register for each line in the
|
||||
@ -206,7 +206,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
|
||||
When sourcing commands from the current buffer, the
|
||||
same script-ID |<SID>| is used even if the buffer is
|
||||
sourced multiple times. If a buffer is sourced more
|
||||
sourced multiple times. If a buffer is sourced more
|
||||
than once, then the functions in the buffer are
|
||||
defined again.
|
||||
|
||||
@ -226,9 +226,9 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
This works like the range started with the
|
||||
":vim9script noclear" command. The "++clear" argument
|
||||
can be used to clear the script-local variables and
|
||||
functions before sourcing the script. This works like
|
||||
functions before sourcing the script. This works like
|
||||
the range started with the `:vim9script` command
|
||||
without the "noclear" argument. See |vim9-reload| for
|
||||
without the "noclear" argument. See |vim9-reload| for
|
||||
more information.
|
||||
Examples: >
|
||||
:4,5source
|
||||
@ -390,7 +390,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
to use ":scriptencoding utf-8" then.
|
||||
|
||||
If you set the 'encoding' option in your |.vimrc|,
|
||||
`:scriptencoding` must be placed after that. E.g.: >
|
||||
`:scriptencoding` must be placed after that. E.g.: >
|
||||
set encoding=utf-8
|
||||
scriptencoding utf-8
|
||||
<
|
||||
@ -615,8 +615,8 @@ advantages over normal plugins:
|
||||
|
||||
Using a package and loading automatically ~
|
||||
|
||||
Let's assume your Vim files are in the "~/.vim" directory and you want to add a
|
||||
package from a zip archive "/tmp/foopack.zip": >
|
||||
Let's assume your Vim files are in the "~/.vim" directory and you want to add
|
||||
a package from a zip archive "/tmp/foopack.zip": >
|
||||
% mkdir -p ~/.vim/pack/foo
|
||||
% cd ~/.vim/pack/foo
|
||||
% unzip /tmp/foopack.zip
|
||||
@ -647,9 +647,9 @@ find the syntax/some.vim file, because its directory is in 'runtimepath'.
|
||||
|
||||
Vim will also load ftdetect files, if there are any.
|
||||
|
||||
Note that the files under "pack/foo/opt" are not loaded automatically, only the
|
||||
ones under "pack/foo/start". See |pack-add| below for how the "opt" directory
|
||||
is used.
|
||||
Note that the files under "pack/foo/opt" are not loaded automatically, only
|
||||
the ones under "pack/foo/start". See |pack-add| below for how the "opt"
|
||||
directory is used.
|
||||
|
||||
Loading packages automatically will not happen if loading plugins is disabled,
|
||||
see |load-plugins|.
|
||||
@ -725,8 +725,8 @@ This assumes you write one or more plugins that you distribute as a package.
|
||||
|
||||
If you have two unrelated plugins you would use two packages, so that Vim
|
||||
users can choose what they include or not. Or you can decide to use one
|
||||
package with optional plugins, and tell the user to add the preferred ones with
|
||||
`:packadd`.
|
||||
package with optional plugins, and tell the user to add the preferred ones
|
||||
with `:packadd`.
|
||||
|
||||
Decide how you want to distribute the package. You can create an archive or
|
||||
you could use a repository. An archive can be used by more users, but is a
|
||||
@ -790,7 +790,7 @@ Where:
|
||||
|
||||
The directory structure where the message translation files should be placed
|
||||
is (from the top-level directory of the package):
|
||||
"lang/<lang_id>/LC_MESSAGES". For the format of <lang_id> see |multi-lang|.
|
||||
"lang/<lang_id>/LC_MESSAGES". For the format of <lang_id> see |multi-lang|.
|
||||
This function needs to be called only once during the initialization of the
|
||||
plugin.
|
||||
Once this is done, the |gettext()| function can be used to retrieve translated
|
||||
@ -818,27 +818,28 @@ PLUGPACKAGE A variable containing the name of the package that we
|
||||
|gettext()| functions, for example, "foobar".
|
||||
PO_PLUG_INPUTLIST A variable containing scripts that have strings
|
||||
to translate, i.e. where we specified the |gettext()|
|
||||
function. Scripts are specified with an absolute
|
||||
or relative path. Example: start/foobar/plugin/bar.vim
|
||||
function. Scripts are specified with an absolute
|
||||
or relative path. Example:
|
||||
start/foobar/plugin/bar.vim
|
||||
use blanks to separate scripts.
|
||||
POT_PLUGPACKAGE_PATH A variable containing the directory where the prepared
|
||||
POT file will be saved. This is not a required variable,
|
||||
if no directory is specified, then the POT file will
|
||||
be placed in the "src/po" directory.
|
||||
POT file will be saved. This is not a required
|
||||
variable, if no directory is specified, then the POT
|
||||
file will be placed in the "src/po" directory.
|
||||
VIMPROG A variable containing a directory with a working Vim.
|
||||
If the Vim editor is already built and installed, and
|
||||
is contained in the $PATH environment variable,
|
||||
then you can specify just the name of the vim
|
||||
executable.
|
||||
{package}.pot This is the Target. It is specified as the name of
|
||||
{package}.pot This is the Target. It is specified as the name of
|
||||
the package, for example, "foobar" with the addition
|
||||
of the .pot extension.
|
||||
Once a POT file is created, its contents are copied into separate PO files for
|
||||
each language for which the translation will be prepared.
|
||||
|
||||
When the translation is finished, it is necessary to convert the PO files into
|
||||
binary MO-files format and place these MO-files into the "lang/" directory, the
|
||||
structure of which we created earlier.
|
||||
binary MO-files format and place these MO-files into the "lang/" directory,
|
||||
the structure of which we created earlier.
|
||||
To do this, run the following commands:
|
||||
>
|
||||
cd ~/forkvim/src/po
|
||||
@ -851,15 +852,16 @@ Where:
|
||||
PLUGPACKAGE A variable containing the name of the package that we
|
||||
specified in the |bindtextdomain()| and |gettext()|
|
||||
functions, for example, "foobar".
|
||||
PO_PLUGPACKAGE A variable containing a PO file. The file is specified
|
||||
with an absolute or relative path. For example,
|
||||
"~/myproject/translate/en.po"
|
||||
PO_PLUGPACKAGE A variable containing a PO file. The file is
|
||||
specified with an absolute or relative path. For
|
||||
example, "~/myproject/translate/en.po"
|
||||
MO_PLUGPACKAGE_PATH A variable containing the structure of the "lang/"
|
||||
directory, where the file with translations will be
|
||||
placed, for example, "foobar.mo". This is not
|
||||
a required variable, if the directory is not specified,
|
||||
the MO file will be saved in the "src/po" directory.
|
||||
{package}.mo This is the Target. It is specified as the name of
|
||||
placed, for example, "foobar.mo". This is not
|
||||
a required variable, if the directory is not
|
||||
specified, the MO file will be saved in the "src/po"
|
||||
directory.
|
||||
{package}.mo This is the Target. It is specified as the name of
|
||||
the package, for example, "foobar" with the addition
|
||||
of the .mo extension.
|
||||
|
||||
@ -978,7 +980,7 @@ And the PO file in German:
|
||||
msgstr "Alle Dateien (*)\t*\n"~
|
||||
|
||||
Now convert these files into MO files so that |gettext()| can display message
|
||||
translations. Note that since this is not a specialized plugin package, we
|
||||
translations. Note that since this is not a specialized plugin package, we
|
||||
will put the MO files in the "lang/" directory of the Vim editor.
|
||||
Type the following commands:
|
||||
>
|
||||
@ -998,7 +1000,7 @@ Type the following commands:
|
||||
That's it, the translations are ready and you can see the plugin's messages
|
||||
in your native language.
|
||||
|
||||
Let's also try to translate a plugin package. For example, when a package
|
||||
Let's also try to translate a plugin package. For example, when a package
|
||||
contains several scripts containing strings that need to be translated.
|
||||
For example, let's translate the "netrw" package into Japanese.
|
||||
For this example, we will translate only a few lines from this package.
|
||||
@ -1096,7 +1098,7 @@ plug-in packages.
|
||||
|
||||
Dependencies between plugins ~
|
||||
*packload-two-steps*
|
||||
Suppose you have two plugins that depend on the same functionality. You can
|
||||
Suppose you have two plugins that depend on the same functionality. You can
|
||||
put the common functionality in an autoload directory, so that it will be
|
||||
found automatically. Your package would have these files:
|
||||
|
||||
@ -1284,7 +1286,7 @@ DEFINING BREAKPOINTS
|
||||
|
||||
:breaka[dd] expr {expression}
|
||||
Sets a breakpoint, that will break whenever the {expression}
|
||||
evaluates to a different value. Example: >
|
||||
evaluates to a different value. Example: >
|
||||
:breakadd expr g:lnum
|
||||
< Will break, whenever the global variable lnum changes.
|
||||
|
||||
@ -1399,7 +1401,7 @@ For example, to profile the one_script.vim script file: >
|
||||
|
||||
:prof[ile] stop
|
||||
Write the collected profiling information to the logfile and
|
||||
stop profiling. You can use the `:profile start` command to
|
||||
stop profiling. You can use the `:profile start` command to
|
||||
clear the profiling statistics and start profiling again.
|
||||
|
||||
:prof[ile] pause
|
||||
@ -1431,8 +1433,8 @@ For example, to profile the one_script.vim script file: >
|
||||
collect the profiling statistics.
|
||||
|
||||
:profd[el] ... *:profd* *:profdel*
|
||||
Stop profiling for the arguments specified. See |:breakdel|
|
||||
for the arguments. Examples: >
|
||||
Stop profiling for the arguments specified. See |:breakdel|
|
||||
for the arguments. Examples: >
|
||||
profdel func MyFunc
|
||||
profdel file MyScript.vim
|
||||
profdel here
|
||||
@ -1480,9 +1482,9 @@ Profiling should give a good indication of where time is spent, but keep in
|
||||
mind there are various things that may clobber the results:
|
||||
|
||||
- The accuracy of the time measured depends on the gettimeofday(), or
|
||||
clock_gettime() if available, system function. The accuracy ranges from
|
||||
1/100 second to nanoseconds. With clock_gettime() the times are displayed in
|
||||
nanoseconds, otherwise microseconds. You can use `has("prof_nsec")`.
|
||||
clock_gettime() if available, system function. The accuracy ranges from
|
||||
1/100 second to nanoseconds. With clock_gettime() the times are displayed
|
||||
in nanoseconds, otherwise microseconds. You can use `has("prof_nsec")`.
|
||||
|
||||
- Real elapsed time is measured, if other processes are busy they may cause
|
||||
delays at unpredictable moments. You may want to run the profiling several
|
||||
|
||||
Reference in New Issue
Block a user