• Stars
    star
    309
  • Rank 130,661 (Top 3 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created about 2 years ago
  • Updated 24 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The lightning-fast plugin manager, alternative to vim-plug

Jetpack.vim

Jetpack.vim is a plugin manager for Vim, Neovim, and 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.

154419764 d246c45c 8940 4e60 9658 9ed3424cbeaa

Features

  • Single file installation

    • You need to just download a single file and put it.

  • First-class Lua support

    • This plugin is not written in Lua but we provide a Lua API.

  • Fancy User Interface

    • You can see a progress of installation with a graphical progress bar.

  • pack/*/start -free installation

    • You can install plugins without pack/*/start directory.

  • Git-free installation

    • You can optionally install plugins without git.

Installation

The installation is very simple. You just need to download a single file and put it on the runtimepath.

https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim

The following is an example of installation with cURL command.

Vim for Linux and macOS
curl -fLo ~/.vim/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim --create-dirs https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim
Neovim for Linux and macOS
curl -fLo ~/.local/share/nvim/site/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim --create-dirs https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim
Vim for Windows
curl -fLo %USERPROFILE%\vimfiles\pack\jetpack\opt\vim-jetpack\plugin\jetpack.vim --create-dirs https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim
Neovim for Windows
curl -fLo %USERPROFILE%\AppData\Local\nvim-data\site\pack\jetpack\opt\vim-jetpack\plugin\jetpack.vim --create-dirs https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim
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

packadd vim-jetpack
call jetpack#begin()
Jetpack 'tani/vim-jetpack', {'opt': 1} "bootstrap
Jetpack 'https://github.com/dense-analysis/ale'
Jetpack 'junegunn/fzf.vim'
Jetpack 'junegunn/fzf', { 'do': {-> fzf#install()} }
Jetpack 'neoclide/coc.nvim', { 'branch': 'release' }
Jetpack 'neoclide/coc.nvim', { 'branch': 'master', 'do': 'yarn install --frozen-lockfile' }
Jetpack 'vlime/vlime', { 'rtp': 'vim' }
Jetpack 'dracula/vim', { 'as': 'dracula' }
Jetpack 'tpope/vim-fireplace', { 'for': 'clojure' }
call jetpack#end()

Dein.vim style

packadd vim-jetpack
call jetpack#begin()
call jetpack#load_toml('path/to/dein.toml')
call jetpack#add('tani/vim-jetpack', {'opt': 1}) "bootstrap
call jetpack#add('https://github.com/dense-analysis/ale')
call jetpack#add('junegunn/fzf.vim')
call jetpack#add('junegunn/fzf', { 'build': './install' })
call jetpack#add('neoclide/coc.nvim', { 'branch': 'release' })
call jetpack#add('neoclide/coc.nvim', { 'branch': 'master', 'build': 'yarn install --frozen-lockfile' })
call jetpack#add('vlime/vlime', { 'rtp': 'vim' })
call jetpack#add('dracula/vim', { 'name': 'dracula' })
call jetpack#add('tpope/vim-fireplace', { 'on_ft': 'clojure' })
call jetpack#end()
[[plugins]]
repo = 'tani/vim-jetpack'

[[plugins]]
repo = 'tpope/vim-fugitive'
on_cmd = 'Git'
hook_source = '''
let g:fugitive_no_mappings = 1
'''
hook_post_source = '''
echom 'fugitive is loaded'
'''

Legacy packer.nvim style

-- Packer.nvim v1
vim.cmd('packadd vim-jetpack')
require('jetpack.packer').startup(function(use)
  use { 'tani/vim-jetpack' } -- bootstrap
  use 'https://github.com/dense-analysis/ale'
  use 'junegunn/fzf.vim'
  use {'junegunn/fzf', run = 'call fzf#install()' }
  use {'neoclide/coc.nvim', branch = 'release'}
  use {'neoclide/coc.nvim', branch = 'master', run = 'yarn install --frozen-lockfile'}
  use {'vlime/vlime', rtp = 'vim' }
  use {'dracula/vim', as = 'dracula' }
  use {'tpope/vim-fireplace', ft = 'clojure' },
  use {'nvim-treesitter/nvim-treesitter',
    run = ':TSUpdate',
    config = function()
      require'nvim-treesitter.configs'.setup {
        ensure_installed = 'maintained',
        highlight = { enable = true }
      }
    end
  }
end)

Modern packer.nvim/ paq.nvim style

-- Packer.nvim v2
vim.cmd('packadd vim-jetpack')
require('jetpack.packer').add {
  {'tani/vim-jetpack'}, -- bootstrap
  'https://github.com/dense-analysis/ale',
  'junegunn/fzf.vim',
  {'junegunn/fzf', run = 'call fzf#install()' },
  {'neoclide/coc.nvim', branch = 'release'},
  {'neoclide/coc.nvim', branch = 'master', run = 'yarn install --frozen-lockfile'},
  {'vlime/vlime', rtp = 'vim' },
  {'dracula/vim', as = 'dracula' },
  {'tpope/vim-fireplace', ft = 'clojure' },
  {'nvim-treesitter/nvim-treesitter',
    run = ':TSUpdate',
    config = function()
      require'nvim-treesitter.configs'.setup {
        ensure_installed = 'maintained',
        highlight = { enable = true }
      }
    end
  }
}
-- Paq.nvim
vim.cmd('packadd vim-jetpack')
require('jetpack.paq') {
  {'tani/vim-jetpack'}, -- bootstrap
  'https://github.com/dense-analysis/ale',
  'junegunn/fzf.vim',
  {'junegunn/fzf', run = './install' },
  {'neoclide/coc.nvim', branch = 'release'},
  {'neoclide/coc.nvim', branch = 'master', run = 'yarn install --frozen-lockfile'},
  {'dracula/vim', as = 'dracula' },
}

Configuration

Configuration Variables

We provides 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.

Tip
iVim does not have git command.

We recommend the following configuration to avoid the external commands except cURL.

let g:jetpack_download_method = 'curl'

Configuration Prameters

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.

Jetpack 'tani/vim-jetpack', { 'as': 'jetpack' }

The following is a list of configuration parameters for vim-plug style.

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.

call jetpack#add('tani/vim-jetpack', { 'name': 'jetpack' })

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.

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.

use { 'tani/vim-jetpack', as = 'jetpack' }

Note that we do not support full features of packer.nvim. We are welcome to your pull requests to improve the compatibility.

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
Mordern 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.

{ 'tani/vim-jetpack', as = 'jetpack' }

Note that we do not support full features of packer.nvim. We are welcome to your pull requests to improve the compatibility.

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

Vim
let s:jetpackfile = expand('<sfile>:p:h') .. '/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim'
let s:jetpackurl = "https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim"
if !filereadable(s:jetpackfile)
  call system(printf('curl -fsSLo %s --create-dirs %s', s:jetpackfile, s:jetpackurl))
endif
Neovim
"neovim + vim
let s:jetpackfile = stdpath('data') .. '/site/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim'
let s:jetpackurl = "https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim"
if !filereadable(s:jetpackfile)
  call system(printf('curl -fsSLo %s --create-dirs %s', s:jetpackfile, s:jetpackurl))
endif
Neovim with Lua
local jetpackfile = vim.fn.stdpath('data') .. '/site/pack/jetpack/opt/vim-jetpack/plugin/jetpack.vim'
local jetpackurl = "https://raw.githubusercontent.com/tani/vim-jetpack/master/plugin/jetpack.vim"
if vim.fn.filereadable(jetpackfile) == 0 then
  vim.fn.system(string.format('curl -fsSLo %s --create-dirs %s', jetpackfile, jetpackurl))
end

Automatic plugin installation on startup

Vim and Neovim
for name in jetpack#names()
  if !jetpack#tap(name)
    call jetpack#sync()
    break
  endif
endfor
Neovim with Lua
local jetpack = require('jetpack')
for _, name in ipairs(jetpack.names()) do
  if not jetpack.tap(name) then
    jetpack.sync()
    break
  end
end

Build cache of treesitter parsrs

local parser_install_dir = vim.fn.stdpath "data" .. "/treesitter"
vim.opt.runtimepath:append(parser_install_dir)

require("nvim-treesitter.configs").setup {
    parser_install_dir = 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.

      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.

More Repositories

1

cheeriogs

Cheerio for Google Apps Script
JavaScript
293
star
2

ddc-fuzzy

Fuzzy matcher, sorter, and conveter for ddc.vim
TypeScript
66
star
3

jsonup

compile-time json-parser
TypeScript
50
star
4

yomu

英和辞書付きPDF閲覧ソフト
JavaScript
48
star
5

dmacro.nvim

neovim version of dmacro.el, which makes a key macro on-the-fly.
Lua
43
star
6

vim-glance

Preview document wrtting in YOUR markdown and asciidoc, POD.
TypeScript
37
star
7

ts-match

A **true** pattern matching library for JavaScript/ TypeScript
TypeScript
31
star
8

papyrus

A Literate Programming Tool
Common Lisp
26
star
9

lib.deno.dev

TypeScript
26
star
10

cl-skkserv

Common LispによるSKK辞書サーバーとその拡張
Lex
22
star
11

markdown-it-mathjax3

Add Math to your Markdown with a MathJax plugin for Markdown-it
TypeScript
21
star
12

podium

The documentation tools from POD to Markdown/ HTML/ vimdoc/ LaTeX
Lua
20
star
13

vim-artemis

Compatibility layer for Vim/ Neovim configuration in Lua
Lua
19
star
14

hey.vim

hey.vim is a Vim plugin that utilizes the OpenAI API to edit text.
TypeScript
18
star
15

pkgbrew

non-root package manager based on pkgsrc
Shell
17
star
16

vim-typo

Vim-typo is an autocorrection plugin for Vim/Neovim that relies on a syntax file to provide intelligent corrections while typing.
Vim Script
16
star
17

hyper-tunnel

HTTPS tunnel over WSS
JavaScript
16
star
18

gas-minimal-boilerplate

A minimal boilerplate with webpack for Google Apps Script
JavaScript
15
star
19

ddc-path

Path completion for ddc.vim. This source collects path names with GNU find or sharkdp/fd.
TypeScript
14
star
20

cl-emoji

cl-emoji provides the Unicode emoji characters.
Common Lisp
14
star
21

UFO

Roswell Script Manager
Common Lisp
13
star
22

cl-pov

CommonLisp binding of the Persistence of Vision Raytracer, or POV-Ray.
Common Lisp
13
star
23

regex

regular expression engine for CommonLisp
Common Lisp
12
star
24

ddc-git

Git managed files completion for ddc.vim
TypeScript
9
star
25

unasync

Synchronously execute asynchronous functions on browsers, Node.js, and Deno
JavaScript
9
star
26

geo-mirror

This service redirects to the nearest mirror of given distribution
JavaScript
8
star
27

plog

A simple markdown based blog engine
PHP
6
star
28

prose-language-server

A Language server for LanguageTool and write-good
JavaScript
6
star
29

textlint-rule-spelling

A textlint rule for spellings of languages as much as possible
JavaScript
6
star
30

typography

Project logo generator
HTML
6
star
31

textlint-rule-lsp

textlint rule for langauge server protocol
TypeScript
5
star
32

artistic-code-pro

Artistic Code Pro = Mgen+ + FiraCode + NerdFonts
Python
5
star
33

s2.js

LISP to JavaScript. Self-hosting.
JavaScript
5
star
34

wikibox

Modern and Simple CMS inspired by MDWiki
HTML
4
star
35

get-element-by

JavaScript like selector for cl-html-parse
Common Lisp
4
star
36

ddc-onp

DDC filters for An O(NP) Sequence Comparison Algorithm by Sun Wu, Udi Manber and Gene Myers.
TypeScript
4
star
37

pickup.nvim

tani's fuzzy finder
Lua
3
star
38

vim-pdfpreview

TypeScript
3
star
39

acl2-kernel

Jupyter Kernel for ACL2
Jupyter Notebook
3
star
40

bfjit

The esoteric programming language interpreter powered by TCC
Zig
3
star
41

ddc-oldfiles

v:oldfiles completion for ddc.vim You can jump any files in history.
TypeScript
3
star
42

ctrlp-matchfzy

Fast CtrlP matcher using Lua matchfzy() as a replacement of mattn/ctrlp-matchuzzy.
Lua
3
star
43

skkservd

skkserv in Deno
TypeScript
3
star
44

CSIL

LISP implemented in C++
C++
2
star
45

genei-fonts-mirror

The unofficial mirror of GenEi font families
2
star
46

skk-jisyo-latex

SKK JISYO for LaTeX symbols
TypeScript
2
star
47

vip

VIP is a vim plugin manager
TypeScript
2
star
48

BISL

LISP on BEAM
Elixir
2
star
49

rehype-template

JavaScript
2
star
50

tidy-tabs

JavaScript
2
star
51

solv

IPC/CPC theorem prover in Prolog
Prolog
1
star
52

scholar-plus

JavaScript
1
star
53

ob-acl2

Emacs Lisp
1
star
54

homebrew-linux

Experimental packages for homebrew/linuxbrew
Ruby
1
star
55

clj-imshow

A implementation of OpenCV's imshow
Clojure
1
star
56

hyper-everforest

JavaScript
1
star
57

docs

Vue
1
star
58

hyper-rigel

JavaScript
1
star
59

deno-template

ejs in sandbox
TypeScript
1
star
60

asciidoctor-shiki

JavaScript
1
star
61

markdown-it-pfm

JavaScript
1
star
62

tau

A trivial typed LISP
Racket
1
star
63

wasser

LISP ❤️ WebAssembly
1
star
64

rehype-inline-css

TypeScript
1
star
65

wikir

to search and view wikipedia
HTML
1
star
66

PDF.gs

extract text from PDF in Google Apps Script
JavaScript
1
star
67

qpdfgrep

Python
1
star