zoukankan      html  css  js  c++  java
  • 安装vim的ycm

    环境centos 6.7 vim 7.3

    安装vundle

    Vundle(Vim bundle)是一个Vim的插件管理器。它是把git操作整合进去,用户需要做的只是去GitHub上找到自己想要的插件的名字,安装、更新和卸载都可有vundle来完成了。

    GitHub:https://github.com/gmarik/Vundle.vim

    git clone https://github.com/gmarik/vundle.git .vim/bundle/vundle

    然后在用户主目录下新建一个名为 .vimrc的文件,我的文件内容如下:

    set nu

    set fileencoding=utf-8

    set fileencodings=utf-8,gb18030,gb2312,gbk,big5

    set ts=4

    set expandtab

    set autoindent

    set nocompatible

    set syntax=on  

    filetype off   " required!  

    set rtp+=~/.vim/bundle/vundle/

    call vundle#rc()  

    " let Vundle manage Vundle

    " required! 

    Bundle 'gmarik/vundle'

    Bundle 'mattn/emmet-vim'

    Bundle 'Auto-Pairs'

    Bundle 'php-doc'

    Bundle 'PHPDoc-Script-PDocS'

    let g:user_emmet_expandabbr_key = '<Tab>'

    let g:user_emmet_settings = {'indentation': '    '}

    filetype plugin indent on     " required!  

    这样Vundle的安装就完毕了。

    要使用Vundle,可以在上面创建的 _vimrc中添加 Bundle ‘bundle_name’。然后打开vim,运行Vundle相关的命令来执行:

    安装插件: :BundleInstall 更新插件: :BundleInstall! 卸载插件: :BundleClean

    至于有什么样的插件可以添加,可以到vim-scripts.org查找。除此之外,还可以添加git管理的repo(包括GitHub上的,不在GitHub上的,以及本地repo)

    如果安装完之后,就可以在~/.vimrc中配置啦

    加上下面的代码,就行啦:

    let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'   “配置默认的ycm_extra_conf.py nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>   “按,jd 会跳转到定义 let g:ycm_confirm_extra_conf=0    “打开vim时不再询问是否加载ycm_extra_conf.py配置 let g:ycm_collect_identifiers_from_tag_files = 1 "使用ctags生成的tags文件

  • 相关阅读:
    HDU 4472 Count DP题
    HDU 1878 欧拉回路 图论
    CSUST 1503 ZZ买衣服
    HDU 2085 核反应堆
    HDU 1029 Ignatius and the Princess IV
    UVa 11462 Age Sort
    UVa 11384
    UVa 11210
    LA 3401
    解决学一会儿累了的问题
  • 原文地址:https://www.cnblogs.com/heqiuyu/p/5630111.html
Copyright © 2011-2022 走看看