Awesome Open Source
Awesome Open Source

asyncomplete-clang.vim

NOT READY FOR GENERAL USE!

Provide C, C++, Objective-C and Objective-C++ support for asyncomplete.vim.

Requirements

  • Vim 8 or Neovim
  • Clang
  • async.vim and asyncomplete.vim

Installation

  • Install this plugin with your preferred Vim plugin manager.
  • Append your Vim configuration file:
autocmd User asyncomplete_setup call asyncomplete#register_source(
    \ asyncomplete#sources#clang#get_source_options())

Configuration

This plugin can be further configured by passing a dictionary to asyncomplete#sources#clang#get_source_options() like this:

autocmd User asyncomplete_setup call asyncomplete#register_source(
    \ asyncomplete#sources#clang#get_source_options({
    \     'config': {
    \         'clang_path': '/opt/llvm/bin/clang',
    \         'clang_args': {
    \             'default': ['-I/opt/llvm/include'],
    \             'cpp': ['-std=c++11', '-I/opt/llvm/include']
    \         }
    \     }
    \ }))
Option Explanation
config.clang_path Path to the clang binary. If clang cannot be found in PATH, you must specify this manually.
config.clang_args Map where the key is a file type name and its value is a list of Clang arguments to be used with that file type. If there is no entry for a particular file type, 'default' is used instead.

.clang_complete

Should you wish to pass extra arguments to Clang, you can create a file named .clang_complete in the root directory of your project. Each line in this file will be treated as a single argument and the directory in which .clang_complete resides will be used as the working directory (for Clang).

Example:

-std=c++14
-I/usr/local/include
-I/usr/include

License

See LICENSE.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Plus Plus (238,542
C (181,846
Plugin (113,900
Vim (18,660
Vim Script (11,511
Completion (5,121
Autocomplete (3,793
Clang (3,786
Autocompletion (1,189
Asyncomplete (22