ubuntu下vim安装YCM的记录

1.安装依赖

sudo apt-get install build-essential cmake python3-dev git

2.安装vunble

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

3.在~/.vimrc中添加

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

call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'Valloric/YouCompleteMe' 

call vundle#end()

filetype plugin indent on 

4.在vim中执行

:PluginInstall

5.

cd ~/.vim/bundle/YouCompleteMe/

6.

./install.py --clang-completer --system-libclang --no-regex

失败时的处理

执行下列命令,成功后再次执行6

/usr/bin/python3 /home/jy/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py --clang-completer --verbose

上面命令执行失败,写入后再次执行

~/.ycm_c-c++_conf.py中写入

import os import ycm_core flags = [
    '-Wall',  
    '-Wextra',  
    '-Werror', 
    '-Wno-long-long', 
    '-Wno-variadic-macros', 
    '-fexceptions',  
    '-ferror-limit=10000',  
    '-DNDEBUG', 
    '-std=c99',  
    '-xc',  
    '-isystem/usr/include/',  
    ]
SOURCE_EXTENSIONS = [
                         '.cpp',
                         '.cxx',
                         '.cc',
                         '.c',
                         ]
def FlagsForFile( filename, **kwargs ):  
    return {
        'flags': flags,  
        'do_cache': True  
    }

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值