mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
docs: vim.pack
This commit is contained in:
@@ -22,8 +22,8 @@ plugins, a package can...
|
||||
|
||||
*runtime-search-path*
|
||||
Nvim searches for |:runtime| files in:
|
||||
1. all paths in 'runtimepath'
|
||||
2. all "pack/*/start/*" dirs
|
||||
- 1. all paths in 'runtimepath'
|
||||
- 2. all "pack/*/start/*" dirs
|
||||
|
||||
Note that the "pack/*/start/*" paths are not explicitly included in
|
||||
'runtimepath', so they will not be reported by ":set rtp" or "echo &rtp".
|
||||
@@ -43,7 +43,7 @@ add a package from a zip archive "/tmp/foopack.zip": >
|
||||
|
||||
The directory name "foo" is arbitrary, you can pick anything you like.
|
||||
|
||||
You would now have these files under ~/.local/share/nvim/site:
|
||||
You would now have these files under ~/.local/share/nvim/site: >
|
||||
pack/foo/README.txt
|
||||
pack/foo/start/foobar/plugin/foo.vim
|
||||
pack/foo/start/foobar/syntax/some.vim
|
||||
@@ -90,7 +90,7 @@ directory level: >
|
||||
% cd ~/.local/share/nvim/site/pack/foo/start/foobar
|
||||
% unzip /tmp/someplugin.zip
|
||||
|
||||
You would now have these files:
|
||||
You would now have these files: >
|
||||
pack/foo/start/foobar/plugin/foo.vim
|
||||
pack/foo/start/foobar/syntax/some.vim
|
||||
|
||||
@@ -154,7 +154,7 @@ bit harder to update to a new version. A repository can usually be kept
|
||||
up-to-date easily, but it requires a program like "git" to be available.
|
||||
You can do both, github can automatically create an archive for a release.
|
||||
|
||||
Your directory layout would be like this:
|
||||
Your directory layout would be like this: >
|
||||
start/foobar/plugin/foo.vim " always loaded, defines commands
|
||||
start/foobar/plugin/bar.vim " always loaded, defines commands
|
||||
start/foobar/autoload/foo.vim " loaded when foo command used
|
||||
@@ -164,7 +164,7 @@ Your directory layout would be like this:
|
||||
opt/fooextra/autoload/extra.vim " loaded when extra command used
|
||||
opt/fooextra/doc/extra.txt " help for extra.vim
|
||||
opt/fooextra/doc/tags " help tags
|
||||
|
||||
<
|
||||
This allows for the user to do: >
|
||||
mkdir ~/.local/share/nvim/site/pack
|
||||
cd ~/.local/share/nvim/site/pack
|
||||
@@ -194,11 +194,11 @@ 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:
|
||||
|
||||
pack/foo/start/one/plugin/one.vim >
|
||||
pack/foo/start/one/plugin/one.vim >
|
||||
call foolib#getit()
|
||||
< pack/foo/start/two/plugin/two.vim >
|
||||
pack/foo/start/two/plugin/two.vim >
|
||||
call foolib#getit()
|
||||
< pack/foo/start/lib/autoload/foolib.vim >
|
||||
pack/foo/start/lib/autoload/foolib.vim >
|
||||
func foolib#getit()
|
||||
|
||||
This works, because start packages will be searched for autoload files, when
|
||||
|
@@ -79,6 +79,7 @@ local new_layout = {
|
||||
['news-0.10.txt'] = true,
|
||||
['news-0.11.txt'] = true,
|
||||
['nvim.txt'] = true,
|
||||
['pack.txt'] = true,
|
||||
['provider.txt'] = true,
|
||||
['tui.txt'] = true,
|
||||
['ui.txt'] = true,
|
||||
|
Reference in New Issue
Block a user