= Jetpack.vim
Jetpack.vim is a plugin manager for https://vim.org[Vim], https://neovim.io[Neovim], and https://github.com/terrychou/iVim[iVim].
The lightning-fast minimalist plugin manager for Vim/ Neovim. vim-jetpack is a jetpack for the most of vimmers. Unbelievably, it is faster than vimrc uses the built-in plugin manager only.
image::https://user-images.githubusercontent.com/5019902/154419764-d246c45c-8940-4e60-9658-9ed3424cbeaa.gif[]
== Features
pack/*/start
-free installation
* You can install plugins without `pack//start` directory.== Installation
The installation is very simple. You just need to download a single file and put it on the runtimepath.
The following is an example of installation with cURL command.
====
====
====
====
TIP: There exists an option for automatic installation on startup. Fore more details, see Configuration Snippets.
== Usage
Jetpack was initially implemented as a successor of vim-plug. Nowadays, we also provide compatibility layers for other plugin managers, dein.vim, packer.nvim.nvim, and paq.nvim.nvim. You can use Jetpack as a drop-in replacement of them. In personal opinion, vim-plug style is the most stable and easy to use.
=== Vim-plug style
=== Dein.vim style
[[plugins]] repo = 'tani/vim-jetpack'
=== Legacy packer.nvim style
=== Modern packer.nvim/ paq.nvim style
== Configuration
=== Configuration Variables
We provide configuration variables to change the internal behaviors: copying files, downloading plugins.
g:jetpack_download_method
::
Jetpack downloads plugins with git by default.
Further, Jetpack can download plugins with git, cURL, and wget
This is useful for environments without git.
Non-git options are not recommended because they are slower than git
as jeptack downloads the whole repository as a tar archive.
====
=== Configuration Parameters
CAUTION: You might be able to use another configuration parameters,
you can use on_cmd
in vim-plug style for example,
but it might be going to be removed in the future.
Thus, we recommend you not to use unlisted configuration parameters.
==== Vim-plug style
You can pass the configuration parameters to Jetpack
command as follows.
The following is a list of configuration parameters for vim-plug style.
[%autowidth] |=== |Parameter|Type|Description
|on
|string
or array
| On-demand loading plugins by commands, keymaps.
|for
|string
or array
| On-demand loading plugins by filetypes.
|branch
|string
| Install plugins from the specified branch.
|commit
|string
| Install plugins from the specified commit.
|tag
|string
| Install plugins from the specified tag.
|rtp
|string
| Add the specified directory to the runtimepath.
|do
|string
or function
| Execute the specified command after installation.
|as
|string
| Install plugins as the specified name.
|dir
|string
| Install plugins to the specified directory.
|frozen
|boolean
| Freeze plugins to the current version.
|===
NOTE: Jetpack mechanically distinguishes :SomeCommand
and <Plug>(some-command)
, and the external command, for on
parameters and do
parameters.
==== Dein.vim style
You can pass the configuration parameters to jetpack#add
function as follows.
The following is a list of configuration parameters for dein.vim style. Note that we do not support full features of dein.vim. We are welcome to your pull requests to improve the compatibility.
[%autowidth] |=== |Parameter|Type|Description
|on_cmd
|string
or array
| On-demand loading plugins by commands.
|on_ft
|string
or array
| On-demand loading plugins by filetypes.
|on_map
|string
or array
| On-demand loading plugins by keymaps.
|on_event
|string
or array
| On-demand loading plugins by events.
|branch
|string
| Install plugins from the specified branch.
|commit
|string
| Install plugins from the specified commit.
|tag
|string
| Install plugins from the specified tag.
|path
|string
| Install plugins to the specified directory.
|rtp
|string
| Add the specified directory to the runtimepath.
|build
|string
| Execute the specified external command after installation.
|name
|string
| Install plugins as the specified name.
|merged
|boolean
| Merge plugins to the current runtimepath.
|frozen
|boolean
| Freeze plugins to the current version.
|depends
|string
or array
| Load the specified plugins before the plugin.
|on_source
|string
or array
| Load the plugin before the specified plugins.
|on_post_source
|string
or array
| Load the plugin after the specified plugins.
|hook_add
|string
| Execute the specified Vim script at the end of jetpack#add
function.
|hook_source
|string
| Execute the specified Vim script before loading the plugin.
|hook_post_source
|string
| Execute the specified Vim script after loading the plugin.
|===
==== Legacy packer.nvim style
You can pass the configuration parameters to use
function as follows.
Note that we do not support full features of packer.nvim. We are welcome to your pull requests to improve the compatibility.
[%autowidth] |=== |Parameter|Type|Description
|opt
|boolean
| On-demand loading plugins by packadd
|cmd
|string
or array
| On-demand loading plugins by commands.
|keys
|string
or array
| On-demand loading plugins by keymaps.
|event
|string
or array
| On-demand loading plugins by event.
|ft
|string
or array
| On-demand loading plugins by filetypes.
|branch
|string
| Install plugins from the specified branch.
|commit
|string
| Install plugins from the specified commit.
|tag
|string
| Install plugins from the specified tag.
|rtp
|string
| Add the specified directory to the runtimepath.
|run
|string
or function
| Execute the specified command after installation.
|as
|string
| Install plugins as the specified name.
|requires
|string
or array
| Enable the plugin after the specified plugins.
|after
|string
or array
| Enable the plugin after the specified plugins.
|before
|string
or array
| Enable the plugin before the specified plugins.
|lock
|boolean
| Freeze plugins to the current version.
|config
|function
or string
| Execute the specified function after startup.
|setup
|function
or string
| Execute the specified function before startup.
|===
CAUTION: Note that we do not install the specified plugins automatically.
You have to declare the specified plugins by use
function.
==== Modern packer.nvim/ paq.nvim style
WARNING: Modern packer.nvim style is still experimental. The configuration parameters might be changed in the future.
You can pass the configuration parameters to a table as follows.
Note that we do not support full features of packer.nvim. We are welcome to your pull requests to improve the compatibility.
[%autowidth] |=== |Parameter|Type|Description
|opt
|boolean
| On-demand loading plugins by packadd
|cmd
|string
or array
| On-demand loading plugins by commands.
|keys
|string
or array
| On-demand loading plugins by keymaps.
|event
|string
or array
| On-demand loading plugins by event.
|ft
|string
or array
| On-demand loading plugins by filetypes.
|branch
|string
| Install plugins from the specified branch.
|commit
|string
| Install plugins from the specified commit.
|tag
|string
| Install plugins from the specified tag.
|rtp
|string
| Add the specified directory to the runtimepath.
|run
|string
or function
| Execute the specified command after installation.
|as
|string
| Install plugins as the specified name.
|requires
|string
| Install plugins after the specified plugins.
|lock
|boolean
| Freeze plugins to the current version.
|config
|function
or string
| Execute the specified function after startup.
|setup
|function
or string
| Execute the specified function before startup.
|===
=== Configuration Snippets
==== Automatic installation on startup
==== Automatic plugin installation on startup
==== Build cache of treesitter parsrs
local parser_install_dir = vim.fn.stdpath "data" .. "/treesitter" vim.opt.runtimepath:append(parser_install_dir)
== API
CAUTION: You might be able to use other functions, commands, and events. but it might be going to be removed in the future. Thus, we recommend you not to use unlisted ones.
=== VimL Function
jetpack#begin([path])
** The function setups jetpack plugins. All plugin declarations should be
placed after this function. You can give path
if you want to use another
directory to manage plugins.jetpack#add(repo [, options])
** repo is a pair of string concatenated with /
such as tani/vim-jetpack
.
options
is a dictionary. See below.jetpack#sync()
** The function performs to install, update, and bundle all plugins.
The function is everything all you need to know.
You must run this function after a change of your configuration.jetpack#end()
** The function loads declared plugins. All plugin declarations should be
placed before this function.jetpack#tap(name)
** It returns a truthy value if the plugin is available,
otherwise it returns a falsy value.jetpack#names()
** It returns the list of plugin names registered including unavailable
plugins.jetpack#get(name)
** It returns metadata of the plugin if possible, otherwise it returns {}
.
This is the same as dein#get
of dein.vim
.jetpack#load(name)
** This is a wrapper function for packadd
; since it fires config options,
etc., it is recommended to use this instead of packadd
.jetpack#load_toml(path)
** This function load dein-style toml settings.=== Lua Function
All jetpack#
functions are exported as jetpack
module.
You can call them using require('jetpack')
as you want.
Additionally, functions compatible with packer.nvim and paq.nvim are available.
require('jetpack.paq')(config)
** This function loads plugins described in config like paq.nvim
.require('jetpack.packer').startup(config)
** This function loads plugins described by use
function like packer.nvim
.require('jetpack.packer').add(config)
** This function loads plugins described by use
function like packer.nvim
.require('jetpack.packer').init(option)
** Now supported option is only package_root
.=== Commands
:JetpackSync
** The function performs to install, update, and bundle all plugins.
The function is everything all you need to know.
You must run this function after a change of your configuration.
:Jetpack repo [, options]
** A command version of jetpack#add()
.
It is useful for the vim-plug style declaration of plugins in vimrc.
=== Events
User JetpackPre:{plugin-name}
/ User JetpackPost:{plugin-name}
** Let {plugin-name} be the name of the plugin.
The specified event is fired before/after the plugin is loaded.
User Jetpack{PluginName}Pre
/ User Jetpack{PluginName}Post
** Let {PluginName} be a CamelCase of plugin name.
The specified event is fired before/after the plugin is loaded.
[%autowidth] |=== | plugin-name | EventName
| vim-jetpack | VimJetpack
| goyo.vim | GoyoVim
| vim_foo | VimFoo |===
=== Autocmd Groups
Jetpack
** vim-jetpack's lazy loading system uses autocommands
defined under Jetpack
autocmd-group.== Contributing
== License
Copyright (c) 2022 -- 2023 Masaya Taniguchi
The software is released under the MIT License, see the header of the source code.