ubuntu16.04 vim插件安装(NERDTree/You

2017-07-14  本文已影响0人  这就是wo吖

安装Vundle插件管理其他插件

set nocompatible               " be iMproved
filetype off                   " required!
"
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"
" let Vundle manage Vundle
" required! 
"
Bundle 'gmarik/vundle'
"
" My Bundles here:
"
filetype plugin indent on     " required!
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..

用Vundle来安装NERDTree插件

安装YouCompleteMe插件

'-isystem',
'/usr/include',
'-isystem',
'usr/include/c++/5.4.0',
'-isystem',
'usr/include/x86_64-linux-gnu/c++',

并注释掉下面这一段

try:
  final_flags.remove( ‘-stdlib-libc++‘ )
except ValueError:
  pass
" YouCompleteMe
    set runtimepath+=~/.vim/bundle/YouCompleteMe
    let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'    " 配置全局路径
    let g:ycm_confirm_extra_conf = 0    " 每次直接加载该文件,不提示是否要加载
    let g:ycm_min_num_of_chars_for_completion=1 " 从第1个键入字符就开始罗列匹配项
    let g:ycm_seed_identifiers_with_syntax = 1  " 语法关键字补全
    let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释与字符串中的内容也要补全
    let g:ycm_complete_in_comments = 1                          " 在注释输入中也能补全
    let g:ycm_complete_in_strings = 1                           " 在字符串输入中也能补
    let g:syntastic_ignore_files=[".*\.py$"]
    " 跳转到定义处
    nnoremap <c-g> :YcmCompleter GoToDefinitionElseDeclaration<CR>
    " 回车即选中当前项
    inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
    " 上下选择的映射按键
    let g:ycm_key_list_select_completion = ['<c-f>', '<Down>']
    let g:ycm_key_list_previous_completion = ['<c-b>', '<Up>']

备注(下载YCM另一种方法)

下载YouCompleteMe时经常会卡住不动,需要等待很长时间,所以网上有人建议如下方法:

然而我在尝试这种方法下载时,在后面执行步骤./install.py --clang-completer时遇到错误

上一篇下一篇

猜你喜欢

热点阅读