So I am trying to get into the header-only-lib game and I wonder how to deal with the fact that neovim grays out all my implementation code? I temporarily do a #define MY_COOL_LIB_IMPLEMENTATION so that I get nice colors. But I have to comment/uncomment on any change-compile. Obviously not ideal. Any suggestions?
Oh now that I write it I guess I can just split the to files in classic header-file c-file for development. Wow, sometimes I am slow.
@pythno maybe neovim or whatever handles the syntax coloring for it allows something like
#if __in_editor__
#define MY_COOL_LIB_IMPLEMENTATION
#endif
@pythno or do it the other way around:
#ifndef ACTUALLY_BUILDING
#define MY_...
#endif
and pass -DACTUALLY_BUILDING=1 to the compiler commandline (and probably don't commit that part of the code, as it's just a hack for development)

@pythno Assuming you use nvim's LSP integration with clangd, you can drop a file `.clangd` in your root folder with additional compile definitions it uses when analyzing your code.

The syntax can look pretty arcane at times, but its documented at https://clangd.llvm.org/config#compileflags.

Configuration