clang_complete在VIM中 [英] clang_complete in VIM

查看:258
本文介绍了clang_complete在VIM中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,玩了omnicpp,gccsense和clang_complete我不能得到任何他们的工作。所以我 apt-get purge vim - * 并再次尝试安装clang_complete,但没有成功。

So after playing around with omnicpp, gccsense and clang_complete I couldn't get any of them to work. So I apt-get purge vim-* and tried again to install clang_complete, but without success.

我这样做:


  1. 下载 clang_complete.vmb 新鲜,清洁 .vim dir并执行 vim clang_complete.vmb -c'%'-c'q'

  1. Download clang_complete.vmb, move it to my fresh, clean .vim dir and execute vim clang_complete.vmb -c 'so %' -c 'q'.

将此粘贴​​到我的.vimrc中:

Paste this into my .vimrc:

syntax on
set number
filetype plugin on
let g:clang_user_options='|| exit 0'
let g:clang_complete_auto = 1
let g:clang_complete_copen = 1


  • 创建典型示例

  • Create typical example

    #include <iostream>
    #include <string>
    
    int main() { std:: (I get: User defined pattern not found) }
    


  • 还有什么我需要做/安装让它工作吗?和愚蠢的问题,我听说过clang,我需要 apt-get install it?

    Is there anything else I need to do/install to get it working? And silly question I've heard about clang, do I need to apt-get install it?

    推荐答案

    clang_complete 可配置为使用 clang可执行文件 ang库

    clang_complete默认使用clang可执行文件,但clang 库会执行得更快

    clang_complete uses the clang executable by default but the clang library will execute lot faster


    1. clang 必须安装在您的系统中,并且在PATH

    2. 不要将(let)g:clang_library_path指向包含libclang.so库的路径

    1. clang must be installed in your system and be in the PATH
    2. do not set (let) g:clang_library_path to a path containing the libclang.so library



    clang_complete插件(使用clang库)需要:



    clang_complete plugin (using the clang library) needs:


    1. python li>
    2. vim必须使用python支持构建(执行:version 并查找 + python / dyn + python3 / dyn 包含 libclang.so 的目录路径。
    3. li>
    1. python installed in your system
    2. vim must be built with python support (do :version and look for a +python/dyn or +python3/dyn entry)
    3. set (let) g:clang_library_path to the directory path where libclang.so is contained

    这篇关于clang_complete在VIM中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆