Ubuntu 14.04 Build Status

C/C++/Objective-C/Objective-C++ source for deoplete.nvim


Deoplete-clang offers asynchronous completion of code written in C, C++, Objective-C and Objective-C++ inside of Neovim. It is built upon the following tools:



The dark powered asynchronous completion framework for Neovim. It offers a fast, fully asynchronous, nonblocking user interface, customizable sources for each languages, and more. The Next generation of word completion.



A Python 3 port of the official clang compiler bindings for Python. The original author is @Anteru, I forked it and follow the latest of llvm clang.


Neovim and neovim/python-client


libclang shared object (dynamic library)

How to install

Install Neovim

See the Neovim wiki.

Install the neovim/python-client

Neovim remote client for Python. See

pip2 install --upgrade neovim
pip3 install --upgrade neovim

Install libclang and clang headers

For GNU/Linux, e.g. apt family,

apt-get install clang

For macOS, use Homebrew:

brew install llvm --with-clang

This has not been tested, it is recommended to build from source. See or try the build-llvm script. You will need cmake, ninja or Xcode.

Build llvm for OS X

Install deoplete and deoplete-clang

" dein.vim (fastest)
call dein#add('Shougo/deoplete.nvim')
call dein#add('zchee/deoplete-clang')
" NeoBundle
NeoBundle 'Shougo/deoplete.nvim'
NeoBundle 'zchee/deoplete-clang'
" vim-plug
Plug 'Shougo/deoplete.nvim'
Plug 'zchee/deoplete-clang'

Available Settings

Setting value Default Required
g:deoplete#sources#clang#libclang_path '' Yes
g:deoplete#sources#clang#clang_header '' Yes
g:deoplete#sources#clang#std See this section No
g:deoplete#sources#clang#flags See this section No
g:deoplete#sources#clang#sort_algo '' No
g:deoplete#sources#clang#clang_complete_database '' No
g:deoplete#sources#clang#include_default_arguments False No
g:deoplete#sources#clang#filter_availability_kinds [] No


Required Yes
Type string
Default -
Example path/to/lib/

The libclang shared object (dynamic library) file path. On GNU/Linux the file name is On macOS it is libclang.dylib. If you cannot find file use instead. is only availible if libclang-dev is installed.

If you have trouble locating the library you can use the find command,

# On GNU/Linux
[sudo] find / -name
# On macOS
mdfind -name libclang.dylib


Required Yes
Type string
Default -
Example path/to/lib/clang

The clang built-in include header directory path; not clang-c, and not the required clang version. Deoplete-clang always use the latest clang version.


ā””ā”€ā”€ 3.9.0
    ā”œā”€ā”€ include
    ā”‚Ā Ā  ā”œā”€ā”€ Intrin.h
    ā”‚Ā Ā  ā”œā”€ā”€ __clang_cuda_cmath.h
    ā”‚Ā Ā  ā”œā”€ā”€ __clang_cuda_runtime_wrapper.h
    ā”‚Ā Ā  ā”œā”€ā”€ __stddef_max_align_t.h
    ā”‚Ā Ā  ā”œā”€ā”€ __wmmintrin_aes.h
    ā”‚Ā Ā  ā”œā”€ā”€ __wmmintrin_pclmul.h
    ā”‚Ā Ā  ā”œā”€ā”€ adxintrin.h
    ā”‚Ā Ā  ā”œā”€ā”€ altivec.h
    ā”‚Ā Ā  ā”œā”€ā”€ ammintrin.h
    ā”‚Ā Ā  ā”œā”€ā”€ arm_acle.h
    ā”‚Ā Ā  ā”œā”€ā”€ arm_neon.h
    ā”‚Ā Ā  ā”œā”€ā”€ stdalign.h
    ā”‚Ā Ā  ā”œā”€ā”€ stdarg.h
    ā”‚Ā Ā  ā”œā”€ā”€ stdatomic.h
    ā”‚Ā Ā  ā”œā”€ā”€ stdbool.h
    ā”‚Ā Ā  ā”œā”€ā”€ stddef.h
    ā”‚Ā Ā  ā”œā”€ā”€ stdint.h
    ā”‚Ā Ā  ā”œā”€ā”€ xsavecintrin.h
    ā”‚Ā Ā  ā”œā”€ā”€ xsaveintrin.h
    ā”‚Ā Ā  ā”œā”€ā”€ xsaveoptintrin.h
    ā”‚Ā Ā  ā”œā”€ā”€ xsavesintrin.h
    ā”‚Ā Ā  ā””ā”€ā”€ xtestintrin.h
    ā”œā”€ā”€ lib
    ā”‚Ā Ā  ā””ā”€ā”€ darwin
    ā””ā”€ā”€ vtables_blacklist.txt


Required No
Type dict
C Default c11
C++ Default c++1z
Objective-C Default c11
Objective-C++ Default c++1z
Example {'c': 'c11', 'cpp': 'c++1z', 'objc': 'c11', 'objcpp': 'c++1z'}

The standard version for each of the C family languages. By default, use the lastest version supported by clang.


Required No
Type list
C Default ['-x', 'c']
C++ Default ['-x', 'c++']
Objective-C Default ['-x', 'objective-c']
Objective-C++ Default ['-x', 'objective-c++']
Example ["-fblocks",]

C(XX)FLAGS for generating completions. Setting value other than default. Does not need -x c or similar.

If you want to know the default clang build flags your of your installation you can try

# C
echo | clang -v -E -x c -
# C++
echo | clang -v -E -x c++ -
# Objective-C
echo | clang -v -E -x objective-c -
# Objective-C++
echo | clang -v -E -x objective-c++ -

For example, on macOS the settings would correspond to:

let g:deoplete#sources#clang#flags = [
      \ "-cc1",
      \ "-triple", "x86_64-apple-macosx10.11.0",
      \ "-isysroot", "/Applications/",
      \ "-fmax-type-align=16",
      \ ]


Required No
Type string
Default ''
Example priority or alphabetical

The sorting algorithm for libclang completion results. Available values are priority or alphabetical.

The default ('') uses the deoplete.nvim sorting algorithm. priority sorts the way libclang determines priority, alphabetical sorts by alphabetical order.


Required No
Type string
Default ''
Example /path/to/neovim/build

Support a clang JSON compilation database format specification; see for more information.

The setting value must be an existing compile_commands.json directory. This setting is optional.

When this setting is used the compilation database file will take precedence over the g:deoplete#sources#clang#flags setting. Parsing the compilation database file will take some time, so please on use this setting if you really need to support a compilation database.

I'm planning the rewrite the parser in Go for faster parsing in the future.


Required No
Type bool
Default False
Example True or False

Include default arguments in function signatures.


Required No
Type list
Default []
Example ['NotAvailable', 'NotAccessible']

Filter candidates to exclude the listed availability kinds. An empty list will does not perform any filtering.

Availability kind strings include:

String Description
'Available' The entity is available
'Deprecated' The entity is available, but has been deprecated
'NotAvailable' The entity is not available, any use of it will be an error
'NotAccessible' The entity is available, but not accessible, any use of it will be an error

For example, using 'NotAccessible' would result in private class members being filtered out from the candidates when they are not accessible from the given context.

Project-specific settings

Deoplete-clang supports compiler-flags local to individual projects. It will search the current working directory for a .clang file; if no such file is found it will try searching the parent directory. The format of the .clang file is either

flags = <flags>


compilation_database = "<path to compilation_database>"

The former requires all compiler flags to be written on one line. For example: flags = -I/path/to/include1 -I/path/to/include2. The format of the latter requires the path (relative to the .clang file) to a clang JSON compilation database format specification as described here:


deoplete-clang does not support completion from header files

This is not supported. You should use the neoinclude plugin instead:

Deoplete Clang

deoplete.nvim source for C/C++/Obj-C/Obj-C++ with clang-python3

Deoplete Clang Info

ā­ Stars 184
šŸ”— Source Code
šŸ•’ Last Update a year ago
šŸ•’ Created 6 years ago
šŸž Open Issues 16
āž— Star-Issue Ratio 12
šŸ˜Ž Author deoplete-plugins