メモ

自分に向けて書いたメモを取り扱っています.

clang_completeでopencvの補完を出すようにする

vimの情報を追っていないのでclang_completeが流行っているのかも定かではないけど自分へのメモ。

開発しているディレクトリに.clang_completeというファイルを作る。中身は下のような感じで。*は適宜変える。

-I/*/opencv/*/include/opencv
-I/*/opencv/*/include/opencv2
-I/*/opencv/*/include
-I/*/usr/local/include
-I.
-DLRVTRACK_WITH_OPENCL

っていうかhelp開いてconfigurationの所見たら書いてるのでhelp開く癖つけましょう(自分への戒め)

4. Configuration *clang_complete-configuration*

Each project can have a .clang_complete at his root, containing the compiler
options. This is useful if you're using some non-standard include paths or
need to specify particular architecture type, frameworks to use, path to
precompiled headers, precompiler definitions etc.

Note that as with other option sources, .clang_complete file is loaded and
parsed by the plugin only on buffer loading (or reloading, for example with
:edit! command). Thus no changes made to .clang_complete file after loading
source file into Vim's buffer will take effect until buffer will be closed and
opened again, reloaded or Vim is restarted.

Compiler options should go on individual lines (multiple options on one line
can work sometimes too, but since there are some not obvious conditions for
that, it's better to have one option per line).

Linking isn't performed during completion, so one doesn't need to specify any
of linker arguments in .clang_complete file. They will lead to completion
failure when using clang executable and will be completely ignored by
libclang.

Example .clang_complete file: >
-DDEBUG
-include ../config.h
-I../common
-I/usr/include/c++/4.5.3/
-I/usr/include/c++/4.5.3/x86_64-slackware-linux/