zoukankan      html  css  js  c++  java
  • vim安装与配置(进阶版)

    vim安装与配置(进阶版)

    之前写的vim文章是刚开始使用vim的时候做的简单配置,最近深入学习了两天vim的安装与配置,在此做一个总结。

    安装

    1.编译安装

    注意让vim支持python,vim的插件有时需要这个

    • git clone https://github.com/vim/vim.git
    • cd /vim/src
    • ./configure --with-features=huge --enable-pythoninterp --enable-python3interp --enable-luainterp --enable-multibyte --enable-sniff --enable-fontset
    • make && make install

    2.插件及其配置

    • Vundle

    Vundle是vim bundle,是一个vim的插件管理工具

    获取
    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    
    配置

    • tagbar

    tagbar是用来显示函数名和变量的列表

    先配置

    在.vimrc中添加

    Plugin 'majutsushi/tagbar'
    
    再安装

    打开vim,输入:PluginInstall,开始安装,安装完成后会返回“Done!”,退出即可。

    • NERD_tree

    NERD_tree:树形文件目录列表

    Plugin 'scrooloose/nerdtree'
    

    安装方式同上

    • vim-powerline

    vim-powerline:状态栏

    Plugin 'Lokaltog/vim-powerline'
    

    安装方式同上

    • markdown插件

    tabular:Vim script for text filtering and alignment
    语法高亮插件vim-markdown,实时预览插件vim-instant-markdown

    Plugin 'godlygeek/tabular'
    Plugin 'plasticboy/vim-markdown'
    

    安装方式同上

    vim-instant-markdown安装之前需要:

    sudo add-apt-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs
    
    sudo npm -g install instant-markdown-d
    

    然后:

    Plugin 'suan/vim-instant-markdown'
    

    接着和上面的插件一样安装就行。

    • ctags

    Ctags工具是用来遍历源代码文件生成tags文件,这些tags文件能被编辑器或其它工具用来快速查找定位源代码中的符号(tag/symbol),如变量名,函数名等

        1)从 http://ctags.sourceforge.net/ 下载源代码包后,解压缩生成源代码目录,
        2)然后进入源代码根目录执行./configure,
        3)然后执行make,
        4)编译成功后执行make install。
    

    然后在.vimrc配置:

    set tags=tags
    set tags+=./tags
    set tags+=~/.vim/systags
    set autochdir
    

    接着为系统头文件目录生成tags,终端输入:

    ctags -I __THROW --file-scope=yes --langmap=c:+.h --languages=c,c++ --links=yes --c-kinds=+p --fields=+S  -R -f ~/.vim/systags /usr/include /usr/local/include
    

    基本配置

    就直接上.vimrc配置代码了,有注释


  • 相关阅读:
    【MM 】采购合同成批维护
    【FICO 汇率】汇率
    【S4 MM】S4中继续使用MB系统事务代码(转)
    【MM 交货成本】Unplanned Delivery Cost
    Tracer Deployment UVALive
    The Best Path HDU
    Artwork Gym
    PTA 银行排队问题之单队列多窗口加VIP服务 队列+模拟
    Counting Cliques HDU
    Do not pour out HDU
  • 原文地址:https://www.cnblogs.com/Star_Sky/p/6538725.html
Copyright © 2011-2022 走看看