Yet another Plugin Manager for Vim
apt-vim
aims to serve as a fully-automated, cross-platform plugin management tool for Vim including dependency installation, using Pathogen at its core to load plugins. Plugins and their dependencies can be installed, removed, and updated using this one tool.
Plugin installation recipes can be saved and shared, allowing users to create portable configuration files (here's one), and allowing plugin developers to create an automated installation process for their users. Installation recipes can be made cross-platform by setting recipes for linux
, darwin
(Mac), or windows
(cygwin). Recipes you create will be saved under your current platform automatically.
For an example plugin recipe, see tern_for_vim. If you'd like to have a recipe created for your plugin, please open an issue :-)
Note: apt-vim
is under active development. Please report any issues, questions, or suggestions, however minor you feel they may be, by opening an issue. Please also open a new issue to create a feature request. Adding tags and thorough descriptions will be of great help!
Don't worry:
bundle
directory is created at ~/.vim/bundle.bak
.~/.vim/bundle
will persist. If an existing plugin was cloned with git
, the plugin will automatically be tracked with apt-vim
..vim
directory will not be altered aside from bundle
(which is backed up automatically before installation), which will be soft-linked to ~/.vimpkg/bundle
.curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh
Note: you may need to close and reopen your terminal
git clone https://github.com/egalpin/apt-vim.git
cd apt-vim
./apt-vim init
sudo
password during installation if you are missing dependencies such as git
or vim
~/.vimpkg/bin
to your PATH
export PATH=$PATH:~/.vimpkg/bin
to ~/.bashrc
or ~/.bash_profile
or equivalent shell configuration file~/.vimpkg/bin
is where all Vim plugin dependencies will be installedexecute pathogen#infect()
and then call pathogen#helptags()
to ~/.vimrc
~/.vimrc
doesn't exist, create a new ~/.vimrc
file containing at least the above 2 commandssource
your shell profile.
PATH
variable in the current shellPATH
automaticallyapt-vim install
In general: apt-vim <mode> [options] [URLs]
where mode is one of : init, install, list, add, remove, delete, update
The file ~/.vimpkg/vim_config.json
is used to store configurations for plugins that you use. For a simple example, take a look at vim_config.json in this repo. For an advanced example, look here.
apt-vim init
This command sets up vital files and settings to allow apt-vim
to do its thing. This command should only be run as part of the manual installation process, and only needs to be run once.
apt-vim install [options] [URLs]
URLs: URLs of Git repositories separated by whitespace
Allows you to add a plugin and its configuration to your vim_config.json
file, with installation. This will install any declared dependencies, clone the specified URL, and run any post-install commands.
Most plugins--those without dependencies--can simply be installed with apt-vim install -y <git-url>
. Other plugins, such as tern_for_vim and this fork of YouCompleteMe have apt-vim
recipes built-in. These plugins, along with their dependencies, can be installed with a simple apt-vim install -y <git-url>
.
There are a number of cases to consider when installing a plugin, as an installation recipe can come from many places:
vim_config.json
for a specified URL, that configuration will be used.json
with @vimpkg
on the first line. See tern_for_vim./install.sh
after cloningTo edit the configuration for a given plugin after installation, directly edit the file ~/.vimpkg/vim_config.json
or remove
and then install
that specific URL.
If no URLs are provided, you will be walked through installing any plugins in vim_config.json
that are not already installed. You will be prompted with a choice of whether or not to install each package. Use --assume-yes
to select all packages in vim_config.json
.
Using the --json
option allows you to install a plugin and specify its configuration. This is useful for installing a new plugin to your Vim setup that someone has created a configuration for. See above for an example.
apt-vim list
Displays a list of packages you have actually installed, and a list of packages that are in your ~/.vimpkg/vim_config.json
file but not yet installed.
Note: This is not an exhaustive list of all of the plugins that can be installed using apt-vim
. Any plugin on GitHub (or other Git repository that you have access to) can be installed using apt-vim
by supplying the corresponding URL.
apt-vim add [options] URLs
URLs (required): URLs of Git repositories separated by whitespace. At least one URL must be specified to add a plugin.
Allows you to add a plugin and its configuration to your vim_config.json
file, without installing. This command mode is useful when creating a portable vim_config.json
while not wanting to change your own system's settings.
apt-vim remove [options] URLs
URLs (required): URLs of Git repositories separated by whitespace
Removes a plugin and all of its dependencies, but KEEPS the installation recipe. A dependency (Ex. ctags
) is ONLY removed if no other plugins in your configuration have the same dependency. This feature can be helpful if trying a few similar plugins to compare features. A plugin's installation recipe can be later deleted
if desired.
apt-vim delete [options] URLs
URLs (required): URLs of Git repositories separated by whitespace
The same as remove
, but also DELETES the installation recipe from your vim_config.json
.
apt-vim update [options] [URLs]
URLs: URLs of Git repositories separated by whitespace
Update first removes a plugin's files (but not its configuration), then re-clones and re-executes the configuration for that plugin.
Use --assume-yes
to tell apt-vim that you want all default options to be used. Any choice that you would typically be presented with (Ex. 'Confirm remove package pathogen
') will not be presented and it will be assumed that you selected yes. Good for automation, but potentially dangerous.
Using the --json
option allows you to add/install an entire configuration for a plugin. This is useful for installing a new plugin to your Vim setup that someone has created a configuration for. For example, you could add Tagbar and its dependency, ctags
like so:
apt-vim install -jy
{
"depends-on": [
{
"name": "ctags",
"recipe": {
"darwin": [
"curl -LSso ctags-5.8.tar.gz 'http://sourceforge.net/projects/ctags/files/ctags/5.8/ctags-5.8.tar.gz/download?use_mirror=iweb'",
"tar xzf ctags-5.8.tar.gz",
"cd ctags-5.8",
"sudo ./configure",
"sudo make",
"sudo make install"
],
"linux": [
"curl -LSso ctags-5.8.tar.gz 'http://sourceforge.net/projects/ctags/files/ctags/5.8/ctags-5.8.tar.gz/download?use_mirror=iweb'",
"tar xzf ctags-5.8.tar.gz",
"cd ctags-5.8",
"sudo ./configure",
"sudo make",
"sudo make install"
]
}
}
],
"name": "tagbar",
"pkg-url": "https://github.com/majutsushi/tagbar.git",
"recipe": {}
}
pip
installerbrew
installer