Neovim Pack

https://news.ycombinator.com/rss Hits: 16
Summary

Pack Nvim :help pages, generated from source using the tree-sitter-vimdoc parser. Extending Nvim Using Vim packages A Vim "package" is a directory that contains plugins. Compared to normal plugins, a package can... be downloaded as an archive and unpacked in its own directory, so the files are not mixed with files of other plugins. be a git, mercurial, etc. repository, thus easy to update. contain multiple plugins that depend on each other. contain plugins that are automatically loaded on startup ("start" packages, located in "pack/*/start/*") and ones that are only loaded when needed with :packadd ("opt" packages, located in "pack/*/opt/*"). Note that the "pack/*/start/*" paths are not explicitly included in 'runtimepath', so they will not be reported by ":set rtp" or "echo &rtp". Scripts can use nvim_list_runtime_paths() to list all used directories, and nvim_get_runtime_file() to query for specific files or sub-folders within the runtime path. Example:" List all runtime dirs and packages with Lua paths. :echo nvim_get_runtime_file("lua/", v:true) Using a package and loading automatically Let's assume your Nvim files are in "~/.local/share/nvim/site" and you want to add a package from a zip archive "/tmp/foopack.zip":% mkdir -p ~/.local/share/nvim/site/pack/foo % cd ~/.local/share/nvim/site/pack/foo % unzip /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:pack/foo/README.txt pack/foo/start/foobar/plugin/foo.vim pack/foo/start/foobar/syntax/some.vim pack/foo/opt/foodebug/plugin/debugger.vim On startup after processing your config, Nvim scans all directories in 'packpath' for plugins in "pack/*/start/*", then loads the plugins. In the example Nvim will find "pack/foo/start/foobar/plugin/foo.vim" and load it. If the "foobar" plugin kicks in and sets the 'filetype' to "some", Nvim will find the syntax/some.vim file, because its directory is in the runtime search path. ...

First seen: 2025-09-04 00:58

Last seen: 2025-09-04 17:01