Set up the utility for a new-style plugin management
Requirements
-
Git 1.7.9 or later
-
Ruby 1.9.2 or later
-
Vim 7.3 or later
Supported platforms
-
Unix-like environments such as Linux, Mac OS X, etc.
-
Though Microsoft Windows is not directly supported, it is possible to manage Vim plugins via Cygwin or other environments.
Installation steps
gem install vim-flavor
Start using vim-flavor
cd $YOUR_REPOSITORY_FOR_DOTFILES
cat >VimFlavor <<'END'
# * Declare using git://github.com/kana/vim-textobj-indent.git
# * vim-flavor fetches a plugin from git://github.com/$USER/$REPO.git
# if the argument is written in '$USER/$REPO' format.
# * kana/vim-textobj-indent requires kana/vim-textobj-user.
# Such dependencies are automatically installed
# if the flavored plugin declares its dependencies with VimFlavor file.
# (FIXME: Resolving dependencies will be implemented later.)
flavor 'kana/vim-textobj-indent'
# * Declare using git://github.com/vim-scripts/fakeclip.git
# * vim-flavor fetches a plugin from git://github.com/vim-scripts/$REPO.git
# if the argument is written in '$REPO' format.
flavor 'fakeclip'
# * Declare using git://github.com/kana/vim-altr.git
# * vim-flavor fetches a plugin from the URI
# if the argument seems to be a URI.
flavor 'git://github.com/kana/vim-altr.git'
# * Declare using kana/vim-smartchr 0.1.0 or later and older than 0.2.0.
flavor 'kana/vim-smartchr', '~> 0.1.0'
# * Declare using kana/vim-smartword 0.1 or later and older than 1.0.
flavor 'kana/vim-smartword', '~> 0.1'
# * Declare using kana/vim-smarttill 0.1.0 or later.
flavor 'kana/vim-smarttill', '>= 0.1.0'
END
# Fetch the plugins declared in the VimFlavor,
# create VimFlavor.lock for a snapshot of all plugins and versions,
# then install the plugins and a bootstrap script into ~/.vim etc.
vim-flavor install
# Add the following line into the first line of your vimrc:
#
# runtime flavors/bootstrap.vim
vim vimrc
git add VimFlavor VimFlavor.lock vimrc
git commit -m 'Use vim-flavor to manage my favorite Vim plugins'
Upgrade all plugins to the latest version
vim-flavor upgrade
git add VimFlavor.lock
git commit -m 'Upgrade my favorite Vim plugins'
Add more plugins into your dotfile repository
cat >>VimFlavor <<'END'
flavor 'kana/vim-operator-replace'
END
# Fetch newly added plugins,
# update VimFlavor.lock for the plugins,
# then install the plugins into ~/.vim etc.
vim-flavor install
git add VimFlavor VimFlavor.lock
git commit -m 'Use kana/vim-operator-replace'
Remove plugins from your dotfile repository
# Remove declarations of unused plugins from VimFlavor.
sed -i~ -e '/vim-smartchr/d' VimFlavor
# Update VimFlavor.lock for the removed plugins,
# then clean up the plugins from ~/.vim etc.
vim-flavor install
git add VimFlavor VimFlavor.lock
git commit -m 'Farewell kana/vim-smartchr'
Install plugins into a non-standard directory
vim-flavor install --vimfiles-path=/cygdrive/c/Users/kana/vimfiles