sponsor Vim development Vim logo Vim Book Ad

clang complete : Use of Clang for completing C, C++, Objective-C and Objective-C++

 script karma  Rating 2576/821, Downloaded by 38768  Comments, bugs, improvements  Vim wiki

created by
Xavier Deguillard
 
script type
utility
 
description
This plugin use clang for accurately completing C, C++, Objective-C and Objective-C++ code.

You don't need any ctags for it to work! Only clang is needed. Clang version 2.8 or higher is recommended for c++ completion. After a . , -> and :: it is automatically trying to complete the code. If you want to "force" the completion, use <C-X><C-U> which is the mapping for user defined completion. Because clang is parsing your source file, it can detect errors inside your code, and highlight them! Plus it can open the quickfix window automatically.

Since version 1.4, snippets can be used to complete function arguments. It is triggered after a completion, and you can go to the next argument with the <Tab> key in normal mode.

If you've got special flags for a project (especially -I and -D ones), clang may be unable to complete your code. To overcome this limitation put the flags inside the file .clang_complete at the root of your project.

Latest version will always be on github: http://github.com/Rip-Rip/clang_complete

Do not hesitate to report bugs or ask for features.

For more information about the configuration, look at the help (:h clang_complete)
 
install details
If you have installed vimscript #1520, please remove it, as it is confliting with this one.
To install: vim clang_complete.vmb -c 'so %' -c 'q'
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
clang_complete.vmb 2.0 2013-03-04 7.2 Xavier Deguillard - Last version to support clang binary based completion
- Lots of improvement to the libclang based completion
- Fix lots of bugs.
clang_complete.vmb 1.8 2011-12-09 7.2 Xavier Deguillard - Add support for fast completion with libclang
- Add support for snipmate and ultisnips based snippets
- Fix tons of bugs
- Warning, this is the last version that support clang 2.8 and 2.9
clang_complete.vim 1.4 2010-12-18 7.2 Xavier Deguillard - Improve the snippets engine
- Bug correction
clang_complete.vim 1.2 2010-11-11 7.0 Xavier Deguillard - Added Objective-C and Objective-C++ support
- Correct a lot of bug
- Highlight of errors/warning when completing
- Add snippets on function parameters completion (not finished)
- Drop some system() call
- Add g:ClangUpdateQuickFix function, to be used on a mapping.
clang_complete.vim 1.0 2010-10-27 7.0 Xavier Deguillard Initial upload
ip used for rating: 167.114.118.212

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github