Vim Vundle 插件管理器

简介: /********************************************************************** * Vim Vundle 插件管理器 * 说明: * 话说Vim也已经用了挺久了,一直没有使用插件,有些时候不使用插件总 * 感觉缺点什么,当然也是因为没有找到一些好的管理插件的方法,这次不 * 小心找到了Vundle,感觉很不错,尝试用起来,这样效率能提高不少。
/**********************************************************************
 *                      Vim Vundle 插件管理器
 * 说明:
 *     话说Vim也已经用了挺久了,一直没有使用插件,有些时候不使用插件总
 * 感觉缺点什么,当然也是因为没有找到一些好的管理插件的方法,这次不
 * 小心找到了Vundle,感觉很不错,尝试用起来,这样效率能提高不少。
 *
 *                                    2016-4-9 深圳 南山平山村 曾剑锋
 *********************************************************************/

一、参考文档:
    1. Downloading Vim
        http://www.vim.org/download.php#others
    2. Help Maintain Vundle
        https://github.com/VundleVim/Vundle.vim
    3. 所需即所获:像 IDE 一样使用 vim
        https://github.com/yangyangwithgnu/use_vim_as_ide
    4. Vim Scripts
        http://vim-scripts.org/index.html
    5. Vim Scripts Browse all
        http://www.vim.org/scripts/script_search_results.php
    6. Vundle PluginInstall 'Valloric/YouCompleteMe' 卡死在 processing 的可能性有?
        https://www.v2ex.com/t/216549
    7. Linux中源码安装编译Vim
        http://www.linuxidc.com/Linux/2014-04/99717.htm
    8. Vim自动补全神器:YouCompleteMe
        http://blog.jobbole.com/58978/
    9. 像 IDE 一样使用 Vim
        http://www.tuicool.com/articles/f6feae
        

二、Vundle
    1. Vundle安装:
        zengjf@zengjf:~$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
        Cloning into '/home/zengjf/.vim/bundle/Vundle.vim'...
        remote: Counting objects: 3016, done.
        remote: Total 3016 (delta 0), reused 0 (delta 0), pack-reused 3016
        Receiving objects: 100% (3016/3016), 899.90 KiB | 185 KiB/s, done.
        Resolving deltas: 100% (1040/1040), done.
        zengjf@zengjf:~$ 

    2. Configure Plugins(.vimrc) hacking:
        
        " set compatible 就是让 vim 关闭所有扩展的功能,尽量模拟 vi 的行为。
        set nocompatible              " be iMproved, required
        filetype off                  " required

        " set the runtime path to include Vundle and initialize
        " 添加运行时路径,用于包含Vundle和初始相关的工作
        " zengjf@zengjf:~/.vim/bundle/Vundle.vim$ pwd
        " /home/zengjf/.vim/bundle/Vundle.vim
        " zengjf@zengjf:~/.vim/bundle/Vundle.vim$ ls
        " autoload         doc              README.md        syntax
        " changelog.md     ftplugin         README_ZH_CN.md  test
        " CONTRIBUTING.md  LICENSE-MIT.txt  README_ZH_TW.md
        "
        set rtp+=~/.vim/bundle/Vundle.vim
        call vundle#begin()
        " alternatively, pass a path where Vundle should install plugins
        " 当然,也可以通过这里传递参数作为插件安装地址
        "call vundle#begin('~/some/path/here')

        " let Vundle manage Vundle, required
        " 让Vundle管理Vundle,这是必须的
        Plugin 'VundleVim/Vundle.vim'

        " The following are examples of different formats supported.
        " Keep Plugin commands between vundle#begin/end.
        " 下面是一些不同来源的插件的配置案例
        " 请将这些插件配置放置于vundle#begin/end之间

        " plugin on GitHub repo
        " GitHub 仓库插件格式
        Plugin 'tpope/vim-fugitive'
        " plugin from http://vim-scripts.org/vim/scripts.html
        " vim 官方插件配置方法,写入名字就行了
        Plugin 'L9'
        " Git plugin not hosted on GitHub
        " git服务器插件,但不是在GitHub上面
        Plugin 'git://git.wincent.com/command-t.git'
        " git repos on your local machine (i.e. when working on your own plugin)
        " git 仓库在自己的电脑上
        Plugin 'file:///home/gmarik/path/to/plugin'
        " The sparkup vim script is in a subdirectory of this repo called vim.
        " Pass the path to set the runtimepath properly.
        Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
        " Install L9 and avoid a Naming conflict if you've already installed a
        " different version somewhere else.
        " 已经存在一个L9的插件了,另外再安装一个名字叫L9的插件
        Plugin 'ascenator/L9', {'name': 'newL9'}

        " All of your Plugins must be added before the following line
        call vundle#end()            " required
        filetype plugin indent on    " required
        " To ignore plugin indent changes, instead use:
        "filetype plugin on
        "
        " Brief help   简短的帮助说明
        " :PluginList       - lists configured plugins   列出所有的安装了的插件
        " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
        " :PluginSearch foo - searches for foo; append `!` to refresh local cache
        " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
        "
        " see :h vundle for more details or wiki for FAQ
        " Put your non-Plugin stuff after this line
    3. plugin install
        vim中执行":PluginInstall"
    4. plugin clean
        vim中执行":PluginClean"
    5. plugin update
        vim中执行":PluginUpdate"

三、插件问题:
    1. Vim版本太低:
        1. 卸载Vim
            sudo apt-get remove vim  
            sudo apt-get remove vim-runtime  
            sudo apt-get remove gvim  
            sudo apt-get remove vim-tiny  
            sudo apt-get remove vim-common  
            sudo apt-get remove vim-gui-common
        2. 下载Vim源码:
            http://www.vim.org/download.php#unix
        3. ./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/ --enable-perlinterp --enable-gui=gtk2 --enable-cscope --enable-luainterp --enable-perlinterp --enable-multibyte --prefix=/usr
        4. sudo make VIMRUNTIMEDIR=/usr/share/vim/vim74
        5. sudo make install
    2. YouCompleteMe:
        1. 安装时,vim卡在YouCompleteMe那里很久,YouCompleteMe对应的目录有没有文档更新。    
        2. github: https://github.com/Valloric/YouCompleteMe
        3. git clone --recursive https://github.com/Valloric/YouCompleteMe.git
        4. 安装失败:
            zengjf@zengjf:~/.vim/bundle/YouCompleteMe$ ./install.sh --clang-complete
            WARNING: this script is deprecated. Use the install.py script instead.
            CMake Error at CMakeLists.txt:28 (cmake_minimum_required):
              CMake 2.8.11 or higher is required.  You are running version 2.8.7


            -- Configuring incomplete, errors occurred!
            Traceback (most recent call last):
              File "/home/zengjf/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 445, in <module>
                Main()
              File "/home/zengjf/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 434, in Main
                BuildYcmdLib( args )
              File "/home/zengjf/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 331, in BuildYcmdLib
                subprocess.check_call( [ 'cmake' ] + full_cmake_args )
              File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
                raise CalledProcessError(retcode, cmd)
            subprocess.CalledProcessError: Command '['cmake', '-G', 'Unix Makefiles', '-DUSE_CLANG_COMPLETER=ON', '-DUSE_PYTHON2=ON', '/home/zengjf/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp']' returned non-zero exit status 1
            Traceback (most recent call last):
              File "./install.py", line 32, in <module>
                Main()
              File "./install.py", line 21, in Main
                subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
              File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
                raise CalledProcessError(retcode, cmd)
            subprocess.CalledProcessError: Command '['/usr/bin/python2', '/home/zengjf/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py', '--clang-complete']' returned non-zero exit status 1
        5. 目前未解决。

四、.vimrc配置:
    set nocompatible              " be iMproved, required
    filetype off                  " required

    " set the runtime path to include Vundle and initialize
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Plugin 'VundleVim/Vundle.vim'
    Plugin 'scrooloose/nerdcommenter'
    Plugin 'scrooloose/nerdtree'
    Plugin 'fholgado/minibufexpl.vim'
    Plugin 'wesleyche/SrcExpl'
    Plugin 'bufexplorer.zip'
    call vundle#end()            " required
    filetype plugin indent on    " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    "
    " Brief help
    " :PluginList       - lists configured plugins
    " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
    " :PluginSearch foo - searches for foo; append `!` to refresh local cache
    " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
    "
    " see :h vundle for more details or wiki for FAQ
    " Put your non-Plugin stuff after this line
    ......

五、插件情况:
    zengjf@zengjf:~/.vim/bundle$ ls
    bufexplorer.zip  nerdcommenter  SrcExpl      Vundle.vim
    minibufexpl.vim  nerdtree       taglist.vim
    zengjf@zengjf:~/.vim/bundle$ 
    

 

目录
相关文章
|
6月前
|
XML IDE 开发工具
别看你风吹头顶凉但你绝对没有过这样方便的插件Intellij IDEA 自带的 Vim
别看你风吹头顶凉但你绝对没有过这样方便的插件Intellij IDEA 自带的 Vim
123 0
|
API 开发工具 开发者
vim插件开发之python-helloworld插件
vim插件开发之python-helloworld插件
123 0
|
Java API 开发工具
vim插件开发之osc动弹插件
vim插件开发之osc动弹插件
129 0
|
Unix Linux 开发工具
vim插件开发之helloworld插件
vim插件开发之helloworld插件
143 0
|
XML IDE 数据可视化
Vim的三款实用插件
Vim 是 Linux 下的常用文本编辑器,但也经常被称为是一个上古神器,因为它对于初学者而言相当不友好,也不好入门。
335 0
|
Linux 开发工具 Python
vim关于python的自动补全插件
一、克隆代码mkdir -p ~/.vim/toolscd ~/.vim/toolsgit clone https://github.com/rkulla/pydiction.git二、配置Pydiction - UNIX/LINUX/OSX: Put python_pydiction.
1598 0
|
开发工具
强大的vim插件
Vim是一个类似于Vi的著名的功能强大、高度可定制的文本编辑器,在Vi的基础上改进和增加了很多特性。常被称为编辑器之神,也是本人平时最喜欢使用的一款开发者编辑器,插件升级如下:     在终端输入: wget -qO- https://raw.
1096 0
|
开发工具 C++
Vim Vundle YouCompleteMe
/************************************************************************************** * Vim Vundle YouCompleteMe * 说明: * 之前在Vim中安装YCM出了问题,装不了,这次花点时间再折腾一下,可以了。
995 0
|
3月前
|
Unix Linux 开发工具
在Linux中,有哪些基本的 Vim 命令?
在Linux中,有哪些基本的 Vim 命令?
|
1月前
|
Unix Linux 开发工具
Linux Vim的 命令大全
Linux Vim的 命令大全
23 0