- 11.2.0Latest
- 11.1.0
- 11.0.1
- v11.0.1
- v11.0.1
- 11.0.0
- 11.0.0
- v11.0.0
- 10.5.0
- 10.5.0
- 10.4.0
- 10.3.1
- 10.3.0
- 10.2.28
- 10.2.27
- 10.2.27
- 10.2.26
- 10.2.25
- 10.2.24
- 10.2.23
- 10.2.22
- 10.2.21
- 10.2.21
- 10.2.20
- 10.2.19
- 10.2.18
- 10.2.18
- 10.2.17
- 10.2.16
- 10.2.15
- 10.2.13
- 10.2.13
- 10.2.12
- 10.2.11
- 10.2.10
- 10.2.10
- 10.2.9
- 10.2.8
- 10.2.7
- 10.2.6
- 10.2.6
- 10.2.5
- 10.2.4
- 10.2.3
- 10.2.2
- 10.2.1
- 10.2.0
- 10.2.0
- 10.1.2
- 10.1.1
- 10.1.0
- v10.0.1
- v10.0.0
- v9.2.6
- v9.2.5
- v9.2.4
- v9.2.3
- v9.2.2
- v9.2.1
- v9.2.0
- 9.1.3
- 9.1.2
- 9.1.1
- 9.1.0
- 9.0.1
- 9.0.0
- 9.0.0-alpha.34
- 9.0.0-alpha.34
- 9.0.0-alpha.33
- 9.0.0-alpha.33
- 9.0.0-alpha.32
- 9.0.0-alpha.32
- 9.0.0-alpha.31
- 9.0.0-alpha.31
- 9.0.0-alpha.30
- 9.0.0-alpha.30
- 9.0.0-alpha.29
- 9.0.0-alpha.29
- 9.0.0-alpha.28
- 9.0.0-alpha.27
- 9.0.0-alpha.26
- 9.0.0-alpha.25
- 9.0.0-alpha.24
- 9.0.0-alpha.23
- 9.0.0-alpha.22
- 9.0.0-alpha.21
- 9.0.0-alpha.20
- 9.0.0-alpha.19
- 9.0.0-alpha.19
- 9.0.0-alpha.18
- 9.0.0-alpha.17
- 9.0.0-alpha.17
- 9.0.0-alpha.16
- 9.0.0-alpha.15
- 9.0.0-alpha.15
- 9.0.0-alpha.14
- 9.0.0-alpha.13
- 9.0.0-alpha.11
- 9.0.0-alpha.10
- 9.0.0-alpha.9
- 9.0.0-alpha.9
- 9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 3.7.1
- 3.7.0
- 3.6.1
- 3.6.0
- 3.5.4
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.0
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.1
- 2.0.0
- 2.0.0
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- 0.5.1
- 0.5.0
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.10
- 0.3.9
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.2.0
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
dvpm - Denops Vim/Neovim Plugin Manager !
dvpm is a plugin manager for Vim and Neovim, powered by
denops.vim.
- Vim / Neovim start up very fast!
…but plugins are not loaded yet at startup \(^o^)/
All plugins are loaded lazily.
- You can write all Vim / Neovim settings in TypeScript
Requirement
Sample configuration
Neovim
- ~/.config/nvim/init.lua (Mac / Linux)
- ~/AppData/Local/nvim/init.lua (Windows)
local denops = vim.fn.expand("~/.cache/nvim/dvpm/github.com/vim-denops/denops.vim")
if not vim.loop.fs_stat(denops) then
vim.fn.system({ "git", "clone", "https://github.com/vim-denops/denops.vim", denops })
end
vim.opt.runtimepath:prepend(denops)Vim
~/.vimrc(Mac / Linux)~/_vimrc(Windows)
let s:denops = expand("~/.cache/vim/dvpm/github.com/vim-denops/denops.vim")
if !isdirectory(s:denops)
execute 'silent! !git clone https://github.com/vim-denops/denops.vim ' .. s:denops
endif
execute 'set runtimepath^=' . substitute(fnamemodify(s:denops, ':p') , '[/\\]$', '', '')deno.json
If you use denops.vim v8 or later with imports in deno.json, you must specify workspace.
{
"workspace": [
"./denops/config"
]
}And add dependencies in ./denops/config.
cd ./denops/config
deno add jsr:@denops/std jsr:@yukimemi/dvpmNeovim
- ~/.config/nvim/denops/config/main.ts (Mac / Linux)
- ~/AppData/Local/nvim/denops/config/main.ts (Windows)
Vim
- ~/.vim/denops/config/main.ts (Mac / Linux)
- ~/vimfiles/denops/config/main.ts (Windows)
import type { Denops, Entrypoint } from "@denops/std";
import * as fn from "@denops/std/function";
import * as mapping from "@denops/std/mapping";
import * as vars from "@denops/std/variable";
import { execute } from "@denops/std/helper";
import { Dvpm } from "@yukimemi/dvpm";
export const main: Entrypoint = async (denops: Denops) => {
const base_path = (await fn.has(denops, "nvim")) ? "~/.cache/nvim/dvpm" : "~/.cache/vim/dvpm";
const base = (await fn.expand(denops, base_path)) as string;
// First, call Dvpm.begin with denops object and base path.
const dvpm = await Dvpm.begin(denops, { base });
// URL only (GitHub).
await dvpm.add({ url: "yukimemi/autocursor.vim" });
// URL only (not GitHub).
await dvpm.add({ url: "https://notgithub.com/some/other/plugin" });
// With branch.
// await dvpm.add({ url: "neoclide/coc.nvim", rev: "release" });
// build option. Execute after install or update.
await dvpm.add({
url: "neoclide/coc.nvim",
rev: "master",
build: async ({ info }) => {
if (!info.isUpdate || !info.isLoad) {
// build option is called after git pull, even if there are no changes
// so you need to check for changes
return;
}
const args = ["install", "--frozen-lockfile"];
const cmd = new Deno.Command("yarn", { args, cwd: info.dst });
const output = await cmd.output();
console.log(new TextDecoder().decode(output.stdout));
},
});
// shallow clone.
await dvpm.add({ url: "yukimemi/chronicle.vim", depth: 1 });
// Setting before sourcing.
await dvpm.add({
url: "yukimemi/silentsaver.vim",
before: async ({ denops }) => {
await vars.g.set(
denops,
"silentsaver_dir",
(await fn.expand(denops, "~/.cache/nvim/silentsaver")) as string,
);
},
});
// Setting after sourcing.
await dvpm.add({
url: "folke/which-key.nvim",
after: async ({ denops }) => {
await execute(denops, `lua require("which-key").setup()`);
},
});
// dst setting (for development).
await dvpm.add({
url: "yukimemi/lumiris.vim",
dst: "~/src/github.com/yukimemi/lumiris.vim",
before: async ({ denops }) => {
await mapping.map(denops, "<space>ro", "<cmd>ChangeColorscheme<cr>", {
mode: "n",
});
await mapping.map(
denops,
"<space>rd",
"<cmd>DisableThisColorscheme<cr>",
{ mode: "n" },
);
await mapping.map(denops, "<space>rl", "<cmd>LikeThisColorscheme<cr>", {
mode: "n",
});
await mapping.map(denops, "<space>rh", "<cmd>HateThisColorscheme<cr>", {
mode: "n",
});
},
});
// Disable setting.
await dvpm.add({
url: "yukimemi/hitori.vim",
enabled: false,
});
// Disable with function.
await dvpm.add({
url: "editorconfig/editorconfig-vim",
enabled: async ({ denops }) => !(await fn.has(denops, "nvim")),
});
// With dependencies. dependencies plugin must be added.
await dvpm.add({ url: "lambdalisue/askpass.vim" });
await dvpm.add({ url: "lambdalisue/guise.vim" });
await dvpm.add({
url: "lambdalisue/gin.vim",
dependencies: [
"lambdalisue/askpass.vim",
"lambdalisue/guise.vim",
],
});
// Load from file. ( `.lua` or `.vim` )
await dvpm.add({
url: "rcarriga/nvim-notify",
beforeFile: "~/.config/nvim/rc/before/nvim-notify.lua",
afterFile: "~/.config/nvim/rc/after/nvim-notify.lua",
});
// Finally, call Dvpm.end.
await dvpm.end();
console.log("Load completed !");
};See my dotfiles for more complex examples.
dotfiles/.config/nvim at main · yukimemi/dotfiles · GitHub
API
Dvpm.begin
public static async begin(denops: Denops, dvpmOption: DvpmOption): Promise<Dvpm>export type DvpmOption = {
// Base path for git clone.
base: string;
// Cache file path. See `Cache setting`.
cache?: string;
// If specified in profiles, only plugins that match the profiles specified in `Plug` will be loaded
// See `Profile setting`
profiles?: string[];
// Number of concurrent processes. Default is 8.
// This is used plugin install, update, source.
concurrency?: number;
// Use `vim.notify` for Install and Update log. Default is false. (Neovim only)
notify?: boolean;
// git log arg. Used for :DvpmUpdate command output. Default is [].
logarg?: string[];
};Dvpm.end
public async end(): Promise<void>Add plugins to runtimepath and source plugin/*.vim and plugin/*.lua.
Dvpm.add
public async add(plug: Plug): Promise<void>export type Plug = {
// GitHub `username/repository` or URL that can be cloned with git.
url: string;
// The path to git clone. (Optional)
dst?: string;
// Git branch or revision name. (Optional)
rev?: string;
// clone depth. (Optional)
depth?: number;
// Enable or disable. Default is true.
enabled?: Bool;
// If profiles are specified in DvpmOption, the plugin will be enabled only if the profiles specified here are included in the profiles of DvpmOption.
profiles: string[];
// Processing to be performed before sourcing plugin/*.vim and plugin/*.lua. (Optional)
before?: ({
denops,
info,
}: {
denops: Denops;
info: PlugInfo;
}) => Promise<void>;
// Processing to be performed after sourcing plugin/*.vim and plugin/*.lua. (Optional)
after?: ({
denops,
info,
}: {
denops: Denops;
info: PlugInfo;
}) => Promise<void>;
// File path of processing to be performed before sourcing plugin/*.vim and plugin/*.lua. (Optional)
beforeFile?: string;
// File path of processing to be performed after sourcing plugin/*.vim and plugin/*.lua. (Optional)
afterFile?: string;
// Build option. Execute after install or update. (Optional)
// Executed even if there are no changes in the update.
// Therefore, conditionally branch on `info.isLoad` and `info.isUpdate` as necessary.
build?: ({
denops,
info,
}: {
denops: Denops;
info: PlugInfo;
}) => Promise<void>;
// Cache settings. See `Cache setting`.
cache?: {
enabled?: Bool;
before?: string;
after?: string;
beforeFile?: string;
afterFile?: string;
};
// Whether to git clone and update. Default is true. (Optional)
// If this option is set to false, then `enabled` is also set to false.
clone?: Bool;
// Dependencies. (Optional)
dependencies?: string[];
};export type Bool =
| boolean
| (({
denops,
info,
}: {
denops: Denops;
info: PlugInfo;
}) => Promise<boolean>);PlugInfo type is almost same as Plug.
Contains the calculated results for each variable, such as enabled.
Dvpm.cache
public async cache(arg: { script: string; path: string }): Promise<void>Cache the script to path.
e.g.
await dvpm.cache({
script: `
if !v:vim_did_enter && has('reltime')
let s:startuptime = reltime()
au VimEnter * ++once let s:startuptime = reltime(s:startuptime) | redraw
\\ | echomsg 'startuptime: ' .. reltimestr(s:startuptime)
endif
`,
path: "~/.config/nvim/plugin/dvpm_cache.vim",
});
await dvpm.cache({
script: `
vim.g.loaded_2html_plugin = 1
vim.g.loaded_gzip = 1
vim.g.loaded_man = 1
vim.g.loaded_matchit = 1
vim.g.loaded_matchparen = 1
vim.g.loaded_netrwPlugin = 1
vim.g.loaded_tarPlugin = 1
vim.g.loaded_tutor_mode_plugin = 1
vim.g.loaded_zipPlugin = 1
`,
path: "~/.config/nvim/plugin/dvpm_cache.lua",
});Dvpm.list
public list(): Plugin[]If you want a list of plugin information, you can get it with the dvpm.list() function. The return
value is Plugin[]. See the doc for type information.
Command
:DvpmUpdate [url]Update installed plugins.
If url is specified, update only target plugins, if not specified, update all plugins.
:DvpmListIt outputs the list of plugins to the dvpm://list buffer.
Cache setting
If you want some plugins to be loaded before VimEnter, enable the cache setting. A sample
configuration is shown below.
export const main: Entrypoint = async (denops: Denops) => {
const base_path = (await fn.has(denops, "nvim")) ? "~/.cache/nvim/dvpm" : "~/.cache/vim/dvpm";
const base = (await fn.expand(denops, base_path)) as string;
const cache_path = (await fn.has(denops, "nvim"))
? "~/.config/nvim/plugin/dvpm_plugin_cache.vim"
: "~/.config/vim/plugin/dvpm_plugin_cache.vim";
// This cache path must be prepended to the runtimepath.
// Add it in your vimrc or init.lua yourself, or specify a path already included in
// the runtimepath of Vim / Neovim.
const cache = (await fn.expand(denops, cache_path)) as string;
// Specify `cache` to Dvpm.begin.
const dvpm = await Dvpm.begin(denops, { base, cache });
await dvpm.add({
url: "tani/vim-artemis",
// Just set `cache.enabled` to true if you don't need plugin settings.
cache: { enabled: true },
});
await dvpm.add({
url: "nvim-lua/plenary.nvim",
cache: { enabled: true },
enabled: async ({ denops }) => await fn.has(denops, "nvim"),
});
await dvpm.add({
url: "startup-nvim/startup.nvim",
// deno-lint-ignore require-await
enabled: async ({ denops }) => denops.meta.host === "nvim",
// Specify `before` or `after` if you need to configure the plugin.
// `before` is executed before the plugin is added to the runtimepath.
// `after` is executed after the plugin is added to the runtimepath.
cache: {
before: `echomsg "Load startup !"`,
after: `
lua require("startup").setup({ theme = "startify" })
`,
},
});
await dvpm.add({
url: "rcarriga/nvim-notify",
enabled: async ({ denops }) => await fn.has(denops, "nvim"),
cache: {
// `before` and `after` can be set independently.
after: `
lua << EOB
require("notify").setup({
stages = "slide",
})
vim.notify = require("notify")
EOB
`,
// If you want to read from a separate file, specify it as follows. (.lua and .vim can be used)
// afterFile: "~/.config/nvim/rc/after/notify.lua",
},
});
// Finally, call Dvpm.end.
await dvpm.end();
};After configuring the above settings, starting Vim / Neovim will output the following to
the file specified as cache in Dvpm.begin. The next time Vim / Neovim starts, the plugin
will be enabled before VimEnter.
~/.config/nvim/plugin/dvpm_plugin_cache.vim(for Neovim)
" This file is generated by dvpm.
set runtimepath+=/Users/yukimemi/.cache/nvim/dvpm/github.com/tani/vim-artemis
set runtimepath+=/Users/yukimemi/.cache/nvim/dvpm/github.com/nvim-lua/plenary.nvim
echomsg "Load startup !"
set runtimepath+=/Users/yukimemi/.cache/nvim/dvpm/github.com/startup-nvim/startup.nvim
lua require("startup").setup({theme = "startify"})
set runtimepath+=/Users/yukimemi/.cache/nvim/dvpm/github.com/rcarriga/nvim-notify
lua << EOB
require("notify").setup({
stages = "slide",
})
vim.notify = require("notify")
EOBAutocmd
- DvpmCacheUpdated
Fires after updating the cache.
e.g.
import * as autocmd from "@denops/std/autocmd";
~~~
await autocmd.define(denops, "User", "DvpmCacheUpdated", "echo 'dvpm cache updated !'");Profile setting
If profiles is specified in DvpmOption, the plugins to be enabled can be restricted by the specified profile.
e.g.
~~~
export const main: Entrypoint = async (denops: Denops) => {
const base_path = (await fn.has(denops, "nvim")) ? "~/.cache/nvim/dvpm" : "~/.cache/vim/dvpm";
const base = (await fn.expand(denops, base_path)) as string;
const dvpm = await Dvpm.begin(denops, {
base,
// Use only minimal plugins
profiles: ["minimal"],
});
await dvpm.add({
url: "yukimemi/chronicle.vim",
profiles: ["minimal"],
});
await dvpm.add({
url: "yukimemi/silentsaver.vim",
profiles: ["default"],
});
await dvpm.add({
url: "yukimemi/autocursor.vim",
profiles: ["full"],
});
await dvpm.end();
};In this case, only yukimemi/chronicle.vim is enabled.
e.g.
~~~
export const main: Entrypoint = async (denops: Denops) => {
const base_path = (await fn.has(denops, "nvim")) ? "~/.cache/nvim/dvpm" : "~/.cache/vim/dvpm";
const base = (await fn.expand(denops, base_path)) as string;
const dvpm = await Dvpm.begin(denops, {
base,
// Use only minimal and default plugins
profiles: ["minimal", "default"],
});
await dvpm.add({
url: "yukimemi/chronicle.vim",
profiles: ["minimal"],
});
await dvpm.add({
url: "yukimemi/silentsaver.vim",
profiles: ["default"],
});
await dvpm.add({
url: "yukimemi/autocursor.vim",
profiles: ["full"],
});
await dvpm.end();
};In this case, yukimemi/chronicle.vim and yukimemi/silentsaver.vim are enabled.
If you specify ["minimal", "default", "full"] in DvpmOption.profiles, all three plugins will be enabled.
Debug logging
dvpm uses @std/log for logging.
If you want to see debug logs, you need to setup the logger.
e.g.
import { setup, handlers } from "@std/log";
setup({
handlers: {
console: new handlers.ConsoleHandler("DEBUG"),
},
loggers: {
dvpm: {
level: "DEBUG",
handlers: ["console"],
},
},
});