Vim plugin that use clang for completing C/C++ code.
Python Vim script Makefile
Clone or download
Latest commit 0918788 Jan 18, 2018
xaizek committed Jan 18, 2018 Merge pull request #542 from bbaldino/fix_single_quote_escape_in_results
Fix the way single quotes are escaped to match what VimScript expects.

This plugin uses clang for accurately completing C and C++ code.


  • To build and install in one step, type: $ make install

  • To build and install in two steps, type:

$ make
$ vim clang_complete.vmb -c 'so %' -c 'q'
  • Alternatively, you can also put the files in ~/.vim/

You need Vim 7.3 or higher, compiled with python support and ideally, with the conceal feature.

Minimum Configuration

  • Set the clang_library_path to the directory containing file named libclang.{dll,so,dylib} (for Windows, Unix variants and OS X respectively) or the file itself, example:
 " path to directory where library can be found
 let g:clang_library_path='/usr/lib/llvm-3.8/lib'
 " or path directly to the library file
 let g:clang_library_path='/usr/lib64/'
  • Compiler options can be configured in a .clang_complete file in each project root. Example of .clang_complete file:
-include ../config.h


The plugin provides list of matches, after that you pick completion from a generic completion menu where Ctrl+N, Ctrl+P and alike work and wrap around ends of list.


See doc/clang_complete.txt for help and license.


The first step is to check values of 'omnifunc' and 'completefunc' options in a C++ buffer where completion doesn't work (the value should be ClangComplete). This can be done with the following command: :set omnifunc? completefunc?

Output of :messages command after startup could also show something useful in case there were problems with plugin initialization.

If everything is fine, next step might be to load only clang_complete plugin and see if anything changes.