summaryrefslogtreecommitdiffstats
path: root/runtime/doc/repeat.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-12 21:07:15 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-12 21:07:15 +0200
commit03413f44167c4b5cd0012def9bb331e2518c83cf (patch)
treee171136509d593ad31b5377f18507c99a4495665 /runtime/doc/repeat.txt
parent73cd8fb3e87e4b29dfc489f58e56dee1839c18e5 (diff)
Updated runtime files.
Diffstat (limited to 'runtime/doc/repeat.txt')
-rw-r--r--runtime/doc/repeat.txt50
1 files changed, 40 insertions, 10 deletions
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index e2c4c2f5f4..92ab58566d 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt* For Vim version 7.4. Last change: 2016 Mar 27
+*repeat.txt* For Vim version 7.4. Last change: 2016 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -72,8 +72,8 @@ examples.
The global commands work by first scanning through the [range] lines and
marking each line where a match occurs (for a multi-line pattern, only the
start of the match matters).
-In a second scan the [cmd] is executed for each marked line with its line
-number prepended. For ":v" and ":g!" the command is executed for each not
+In a second scan the [cmd] is executed for each marked line, as if the cursor
+was in that line. For ":v" and ":g!" the command is executed for each not
marked line. If a line is deleted its mark disappears.
The default for [range] is the whole buffer (1,$). Use "CTRL-C" to interrupt
the command. If an error message is given for a line, the command for that
@@ -234,8 +234,11 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
there yet.
Note that {name} is the directory name, not the name
- of the .vim file. If the "{name}/plugin" directory
- contains more than one file they are all sourced.
+ of the .vim file. All the files matching the pattern
+ pack/*/opt/{name}/plugin/**/*.vim ~
+ will be sourced. This allows for using subdirectories
+ below "plugin", just like with plugins in
+ 'runtimepath'.
If the filetype detection was not enabled yet (this
is usually done with a "syntax enable" or "filetype
@@ -251,15 +254,24 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
Also see |pack-add|.
*:packl* *:packloadall*
-:packloadall[!] Load all packages in the "start" directories under
- 'packpath'. The directories found are added to
- 'runtimepath'.
+:packl[oadall][!] Load all packages in the "start" directory under each
+ entry in 'packpath'.
+
+ First all the directories found are added to
+ 'runtimepath', then the plugins found in the
+ directories are sourced. This allows for a plugin to
+ depend on something of another plugin, e.g. an
+ "autoload" directory. See |packload-two-steps| for
+ how this can be useful.
+
This is normally done automatically during startup,
after loading your .vimrc file. With this command it
can be done earlier.
+
Packages will be loaded only once. After this command
it won't happen again. When the optional ! is added
this command will load packages even when done before.
+
An error only causes sourcing the script where it
happens to be aborted, further plugins will be loaded.
See |packages|.
@@ -471,8 +483,9 @@ You would now have these files under ~/.vim:
pack/foo/opt/foodebug/plugin/debugger.vim
When Vim starts up, after processing your .vimrc, it scans all directories in
-'packpath' for plugins under the "pack/*/start" directory and loads them. The
-directory is added to 'runtimepath'.
+'packpath' for plugins under the "pack/*/start" directory. First all those
+directories are added to 'runtimepath'. Then all the plugins are loaded.
+See |packload-two-steps| for how these two steps can be useful.
In the example Vim will find "pack/foo/start/foobar/plugin/foo.vim" and adds
"~/.vim/pack/foo/start/foobar" to 'runtimepath'.
@@ -599,6 +612,23 @@ the command after changing the plugin help: >
:helptags path/start/foobar/doc
:helptags path/opt/fooextra/doc
+
+Dependencies between plugins ~
+ *packload-two-steps*
+Suppose you have a 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:
+
+ pack/foo/start/one/plugin/one.vim >
+ call foolib#getit()
+< pack/foo/start/two/plugin/two.vim >
+ call foolib#getit()
+< pack/foo/start/lib/autoload/foolib.vim >
+ func foolib#getit()
+
+This works, because loading packages will first add all found directories to
+'runtimepath' before sourcing the plugins.
+
==============================================================================
7. Debugging scripts *debug-scripts*