Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An autocompletion daemon for the C programming language (vim, libclang, omnifunc)
C Other
branch: master

Chdir before autocompletion.

When we do autocompletion for file X, we need to chdir to X's directory.
That way relative includes (e.g. -I../..) work if defined in .ccode
file.
latest commit f5bdd039d2
@nsf authored
Failed to load latest commit information.
vim Fix stupid args parsing, use absolute path always.
LICENSE
README.md Update screenshot links, due to a new domain for nsf.github.com.
client.c
main.c First major refactoring for all the code. Separate server and client.
misc.c Sync with strstr library.
proto.c First major refactoring for all the code. Separate server and client.
server.c Chdir before autocompletion.
shared.h
strstr.c Sync with strstr library.
strstr.h Sync with strstr library.
tpl.c Initial commit.
tpl.h Initial commit.
update.bash First major refactoring for all the code. Separate server and client.

README.md

CCode - An autocompletion daemon for the C programming language.

  1. Linux only, don't ask me to port it somewhere. If you need that - do it. But kinda works on Mac too.
  2. Relies on the C99 compliance (flexible array members, snprintf behaviour, etc).
  3. Mostly done, but has few quirks.
  4. Can be used to complete C++/ObjC, but I'm not targeting these languages. Don't report C++/ObjC specific bugs.
  5. Currently only per directory CFLAGS configuration (just dump your CFLAGS to .ccode file). CCode supports shell expansion, e.g. echo "\$(pkg-config --cflags sdl)" > .ccode will execute pkg-config with each autocompletion request.
  6. Should work on both 32 and 64 bit machines.

CCode in vim

CCode in vim 2

Something that should look like a usage guide

  1. Build everything (see update.bash).
  2. Place it somewhere on your $PATH.
  3. Copy vim plugin to your .vim/plugin dir.
  4. Daemon starts automatically, everything should work out of the box.
  5. Use for autocompletion.

FAQ

Q: My linux distribution contains broken LLVM/clang build and clang doesn't see its include directory (/usr/lib/clang/2.8/include). What should I do?

A: In your project dir: echo " -I/usr/lib/clang/2.8/include" >> .ccode.

Something went wrong with that request. Please try again.