您的位置:首页 > 其它

How to Manage your vim plugins

2017-07-16 00:32 253 查看

How to manage your vim plugin files?

I think the most popular 2 ways are pathogen and Vundle.Now I will show you both

1.pathogen

links:https://github.com/tpope/vim-pathogen

How to Install pathogen: so easy

step1

mkdir -p ~/.vim/autoload

mkdir -p ~/.vim/bundle

curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

step2

add this to your vimrc

call pathogen#infect()


Now You Have Finished Installation

Let Us Try An Example

It seems every vim plugin has a github url:

for example if you want to install vim-markdown

the url:https://github.com/plasticboy/vim-markdown

step1 cd ~/.vim/bundle

step2 git clone https://github.com/plasticboy/vim-markdown.git

step3 vim a example md to check your installation

2.Vundle

Vundle is short for vim bundle and is a vim plugin manager

link:https://github.com/VundleVim/Vundle.vim

How to Install Vundle:also easy

step1 mkdir -p ~/.vim/bundle

step2 cd ~/.vim/bundle

step3 git clone https://github.com/VundleVim/Vundle.vim.git

step4 add this to your at the top to your vimrc:

set nocompatible              " be iMproved, required
filetype off                  " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

""""""""""""""""""""""""""

Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'file:///home/gmarik/path/to/plugin'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}

"""""""""""""""""""""""""""

call vundle#end()
filetype plugin indent on


The Plugin in “”“”” is the demo you want to install

For example:

If you want to install vim-markdown

You Find the github link is:

https://github.com/plasticboy/vim-markdown

So Your vimrc is like this:

set nocompatible              " be iMproved, required
filetype off                  " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

""""""""""""""""""""""""""

Plugin 'VundleVim/Vundle.vim'
Plugin 'plasticboy/vim-markdown'

"""""""""""""""""""""""""""
call vundle#end()
filetype plugin indent on

... Your other config


And You Save this file And vim without file(Launch vim )and run

:PluginInstall


Then you can see the Installation is beginning.

The disadvantage is that you can not see the progress bar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vim 编辑器