zoukankan      html  css  js  c++  java
  • Vim插件管理 -- Vundle


    1 插件目录  ~/.vim/bundle/ 没有可自行创建

    2 安装Vundle

       $ git clone https://github.com/VundleVim/Vundle.vim.git   ~/.vim/bundle/Vundle.vim 

    3 配置插件

       vi ~/.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()
    " alternatively, pass a path where Vundle should install plugins
    "call vundle#begin('~/some/path/here')
    
    " let Vundle manage Vundle, required
    Plugin 'VundleVim/Vundle.vim'
    
    " plugin on GitHub repo
    Plugin 'rkulla/pydiction'     "Python Tab自动补全
    Plugin 'scrooloose/nerdtree' "可以显示资源列表
    Plugin 'tomasr/molokai' "molokai主题
    " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " 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

    4 安装插件

      保存上面配置文件,进入vim(或vi打开任意文件),执行:

       :PluginInstall ,会自动从github获取安装配置文件中添加的插件。

       :PluginList 可以查看已经安装的插件

    5 卸载插件

      将.vimrc中安装插件行注释或删除,执行 :PluginClean 


    常用插件

    NERD Tree

      功能:

      安装:在.vimrc中添加  Plugin 'scrooloose/nerdtree' , 执行 :PluginInstall 

      配置:为了方便,可以在.vimrc中配置开关快捷键 

            map <F3> :NERDTreeToggle<CR> 

         配置当只剩NERDTree时,自动关闭vim:

                 autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif 

      用法:

        F3(上面配置的)  --  打开/关闭 NERDTree

        s  --  水平分割式打开文件(光标所在行的文件)

        i  --   竖直方向...

      

      

    2 pydiction

      功能:python的Tab键自动补全

      安装:同上

      配置:在.vimrc中添加以下    

    filetype plugin on   
    
    let g:pydiction_location = '/home/user/.vim/bundle/pydiction/complete-dict'   
    
    let g:pydiction_menu_height = 4   "显示匹配结果的行数,默认为8

      用法:

    <Space>              -- 接受当前匹配,并添加一个空格
    CTRL-Y               -- 接受当前匹配,但不添加空格
    <Enter>              -- 接受当前匹配,并转到下一行
    CTRL-E            -- 取消当前匹配

      

    3 molokai

    一个比较舒服的主题
    molokai.vim拷贝到~/.vim/colors/ 或者/usr/share/vim/vim74/colors/目录中
    在.vimrc中配置  
    syntax enable
    
    set to_Co=256
    
    set background=dark
    
    colorscheme molokai

        

    KEEP LEARNING!
  • 相关阅读:
    Can you answer these queries?(HDU4027+势能线段树)
    Tunnel Warfare(HDU1540+线段树+区间合并)
    Computer(HDU2196+树形dp+树的直径)
    Anniversary party(树上dp+HDU1520)
    2018 Multi-University Training Contest 1-1002 -Balanced Sequence(括号匹配+贪心)
    暑假集训——cf热身赛部分题有感加其题解
    Educational Codeforces Round 47 (Rated for Div. 2) 题解
    计蒜客 Goldbach Miller_Rabin判别法(大素数判别法)
    多种方法过Codeforces Round #270的A题(奇偶法、打表法和Miller_Rabin(这个方法才是重点))
    Codeforces Round #494 (Div. 3)
  • 原文地址:https://www.cnblogs.com/roronoa-sqd/p/4969576.html
Copyright © 2011-2022 走看看