dein.vim


Ⅰ. 插件描述

:zap: Dark powered Vim/Neovim plugin manager

Ⅱ. 基本信息

创建日期:  2016-01-01
使用用户:  61
Github星:  2561
插件作者:  Shougo

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'shougo/dein-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'shougo/dein-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'shougo/dein-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/shougo/dein.vim

Ⅳ. 文档说明

# dein.vim

Join the chat at https://gitter.im/Shougo/dein.vim Build Status

Dein.vim is a dark powered Vim/Neovim plugin manager.

<!-- vim-markdown-toc GFM -->

<!-- vim-markdown-toc -->

Requirements

  • Vim 8.0 or above or NeoVim.
  • "xcopy" command in $PATH (Windows)
  • "git" command in $PATH (if you want to install github or vim.org plugins)

Note: If you use Vim 7.4, please use dein.vim ver.1.5 instead.

If you need vim-plug like install UI, you can use dein-ui.vim.
https://github.com/wsdjeg/dein-ui.vim

Quick start

Note: You must define the installation directory before to use dein. The
directory that you will want to use depends on your usage.

For example, ~/.vim/bundles or ~/.cache/dein or ~/.local/share/dein.
dein.vim does not define a default installation directory.
You must not set the installation directory as ~/.vim/plugin or
~/.config/nvim/plugin.

Unix/Linux or Mac OS X

  1. Run below script.
curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
# For example, we just use `~/.cache/dein` as installation directory
sh ./installer.sh ~/.cache/dein
  1. Edit your .vimrc like this.
if &compatible
  set nocompatible
endif
" Add the dein installation directory into runtimepath
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim

if dein#load_state('~/.cache/dein')
  call dein#begin('~/.cache/dein')

  call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim')
  call dein#add('Shougo/deoplete.nvim')
  if !has('nvim')
    call dein#add('roxma/nvim-yarp')
    call dein#add('roxma/vim-hug-neovim-rpc')
  endif

  call dein#end()
  call dein#save_state()
endif

filetype plugin indent on
syntax enable
  1. Open vim and install dein
:call dein#install()

Features

  • Faster than NeoBundle
  • Simple
  • No commands, Functions only to simplify the implementation
  • Easy to test and maintain
  • No Vundle/NeoBundle compatibility
  • neovim/Vim8 asynchronous API installation support
  • Local plugin support
  • Non github plugins support
  • Go like clone directory name ex:"github.com/{user}/{repository}"
  • Merge the plugins directories automatically to avoid long 'runtimepath'

Future works (TODO)

  • Other types support (zip, svn, hg, ...)
  • Metadata repository support

Options

Some common options. For a more detailed list, run :h dein-options

OptionTypeDescription
namestringThe name for a plugin. If it is omitted, the tail of the repository name will be used
revstringThe revision number or branch/tag name for the repo
buildstringCommand to run after the plugin is installed
on_ftstring or listLoad a plugin for the current filetype
on_cmdstring or listLoad the plugin for these commands
rtpstringYou can use this option when the repository has the Vim plugin in a subdirectory
ifstring or numberIf it is String, dein will eval it.
mergednumberIf set to 0, dein doesn't merge the plugin directory.

添加新评论