mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
docs: vim.pack
This commit is contained in:
@@ -22,8 +22,8 @@ plugins, a package can...
|
|||||||
|
|
||||||
*runtime-search-path*
|
*runtime-search-path*
|
||||||
Nvim searches for |:runtime| files in:
|
Nvim searches for |:runtime| files in:
|
||||||
1. all paths in 'runtimepath'
|
- 1. all paths in 'runtimepath'
|
||||||
2. all "pack/*/start/*" dirs
|
- 2. all "pack/*/start/*" dirs
|
||||||
|
|
||||||
Note that the "pack/*/start/*" paths are not explicitly included in
|
Note that the "pack/*/start/*" paths are not explicitly included in
|
||||||
'runtimepath', so they will not be reported by ":set rtp" or "echo &rtp".
|
'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.
|
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/README.txt
|
||||||
pack/foo/start/foobar/plugin/foo.vim
|
pack/foo/start/foobar/plugin/foo.vim
|
||||||
pack/foo/start/foobar/syntax/some.vim
|
pack/foo/start/foobar/syntax/some.vim
|
||||||
@@ -90,7 +90,7 @@ directory level: >
|
|||||||
% cd ~/.local/share/nvim/site/pack/foo/start/foobar
|
% cd ~/.local/share/nvim/site/pack/foo/start/foobar
|
||||||
% unzip /tmp/someplugin.zip
|
% 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/plugin/foo.vim
|
||||||
pack/foo/start/foobar/syntax/some.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.
|
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.
|
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/foo.vim " always loaded, defines commands
|
||||||
start/foobar/plugin/bar.vim " always loaded, defines commands
|
start/foobar/plugin/bar.vim " always loaded, defines commands
|
||||||
start/foobar/autoload/foo.vim " loaded when foo command used
|
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/autoload/extra.vim " loaded when extra command used
|
||||||
opt/fooextra/doc/extra.txt " help for extra.vim
|
opt/fooextra/doc/extra.txt " help for extra.vim
|
||||||
opt/fooextra/doc/tags " help tags
|
opt/fooextra/doc/tags " help tags
|
||||||
|
<
|
||||||
This allows for the user to do: >
|
This allows for the user to do: >
|
||||||
mkdir ~/.local/share/nvim/site/pack
|
mkdir ~/.local/share/nvim/site/pack
|
||||||
cd ~/.local/share/nvim/site/pack
|
cd ~/.local/share/nvim/site/pack
|
||||||
@@ -196,9 +196,9 @@ 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()
|
call foolib#getit()
|
||||||
< pack/foo/start/two/plugin/two.vim >
|
pack/foo/start/two/plugin/two.vim >
|
||||||
call foolib#getit()
|
call foolib#getit()
|
||||||
< pack/foo/start/lib/autoload/foolib.vim >
|
pack/foo/start/lib/autoload/foolib.vim >
|
||||||
func foolib#getit()
|
func foolib#getit()
|
||||||
|
|
||||||
This works, because start packages will be searched for autoload files, when
|
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.10.txt'] = true,
|
||||||
['news-0.11.txt'] = true,
|
['news-0.11.txt'] = true,
|
||||||
['nvim.txt'] = true,
|
['nvim.txt'] = true,
|
||||||
|
['pack.txt'] = true,
|
||||||
['provider.txt'] = true,
|
['provider.txt'] = true,
|
||||||
['tui.txt'] = true,
|
['tui.txt'] = true,
|
||||||
['ui.txt'] = true,
|
['ui.txt'] = true,
|
||||||
|
Reference in New Issue
Block a user