So I spent a bit of time making my own theme for emacs since none of them were quite right for me, and I'm really loving it as a text editor, but I'm wondering if there was a package that would give me better syntax highlighting accuracy, it seems to have a tough time with some things vs others, like how the types HWND UINT WPARAM LPARAM are white, the first template T is white, the SetOnXXXCallback functions don't have the function name color, as the LIB define seems to have stolen them (assumedly because of the templates) and there are other examples in the codebase, I don't know how to explain it, but I don't want anything extra to be highlighted, but I want the things that should be highlighted like variable types, names, function names, etc. to all be consistently highlighted, one thing I was saying was that I would love the accuracy of the syntax highlighting from VS and nothing else, because I switched off of IDEs but the thing that I have to give them was that they had 100% proper accuracy on their syntax highlighting, even if they're all slow and bloated. Oh, also I'm using C/C++ so preferably packages that work best for C/C++. Thanks.
1 Answer
If you're using at least Emacs 29.1 then I suggest reading https://www.masteringemacs.org/article/how-to-get-started-tree-sitter to learn how you can get up and running with the new major modes leveraging third-party tree-sitter parsers for various programming languages.
If (treesit-available-p)
returns t
for you then you can skip the "Building Emacs with Tree-Sitter Support" part.
Be aware that it's new functionality, and so YMMV. (By comparison, many of the old major modes have been maintained and enhanced over decades, so you may find there are both pros and cons to changing.)