2017年11月17日 星期五

vim plugin manager : vim-plug


1. Automatic Installation (load plug.vim to ~/.vim/autoload/plug.vim )
Place the following code in your .vimrc before plug#begin() call
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
Note that --sync flag is used to block the execution until the installer finishes.

2. Migrating from other plugin managers
Download plug.vim in autoload directory
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
and update your .vimrc as needed.
With Vundle.vimEquivalent vim-plug configuration
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'junegunn/seoul256.vim'
Plugin 'junegunn/goyo.vim'
Plugin 'junegunn/limelight.vim'
call vundle#end()
filetype plugin indent on
syntax enable
call plug#begin('~/.vim/plugged')
Plug 'junegunn/seoul256.vim'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
call plug#end()
vim-plug does not require any extra statement other than plug#begin() and plug#end(). You can remove filetype offfiletype plugin indent on and syntax on from your .vimrc as they are automatically handled by plug#begin() and plug#end().




Refer to:
  https://github.com/junegunn/vim-plug/wiki/faq





沒有留言:

張貼留言