问题描述
所以,玩了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.
我这样做:
-
下载
clang_complete.vmb
新鲜,清洁.vim
dir并执行vim clang_complete.vmb -c'%'-c'q'
。
Download
clang_complete.vmb
, move it to my fresh, clean.vim
dir and executevim 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
- clang 必须安装在您的系统中,并且在PATH
- 不要将(let)g:clang_library_path指向包含libclang.so库的路径
- clang must be installed in your system and be in the PATH
- 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:
- python li>
- vim必须使用python支持构建(执行:version 并查找 + python / dyn 或 + python3 / dyn 包含 libclang.so 的目录路径。 li>
- python installed in your system
- vim must be built with python support (do :version and look for a +python/dyn or +python3/dyn entry)
- set (let) g:clang_library_path to the directory path where libclang.so is contained
这篇关于clang_complete在VIM中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!