clang-faces
clang-faces copied to clipboard
Syntax Highlighting based on LibClang Tokens for Emacs
Table of Contents
- 1. clang-faces
- 1.1. Quick Install
- 1.2. Emacs Setup
- 1.3. How It Works
- 1.4. Contribute
- 1.5. Author
Intelligent syntax higlighting through libclang w/emacs!
Quick Install
-
Clone the repository
mkdir build; cd build cmake .. make
Emacs Setup
(setq clang-faces-client-exec "~/path/clang-faces/build/emacs-clang-syntaxhl")
(add-to-list 'c-mode-common-hook #'(lambda () (clang-faces-mode t)))
or enable/disable manually with:
M-x clang-faces-mode
How It Works
It works together w/the font-lock infrastructure, mimicing [most of] its faces with syntax highlighting enhancements to statement-level syntax that font-lock cannot (at least that I'm aware of) parse and colorize.
The primary difference is that references to variables and functions throughout the code (not just the declaration) are syntax higlighted.
It operates through a separate daemon process that constantly reparses the source code and updates the modified (delta) regions' `font-lock-face' attributes.
Contribute
Your feedback is greatly appreciated. The current state of clang-faces is alpha and there are issues related to recoloring (you might get rainbows of colors across one identifier). If you can contribute a minimum test case, or better a pull request w/a test case, I will add your name to the contributors list and you will be overcome with pride and great satisfication knowing you have advanced the sum of human knowledge another infinitesimal amount.
Author
Brian Fransioli