diff runtime/doc/repeat.txt @ 8876:47f17f66da3d

commit https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 12 21:07:15 2016 +0200 Updated runtime files.
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Apr 2016 21:15:06 +0200
parents aba2d0a01290
children bc38030aec7d
line wrap: on
line diff
--- 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
 			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
 			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 ~/.
 	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 he
 	: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*