4 ms·
> I'm also not happy about the fact that I can no longer open large C++ files Regex-based syntax highlighting is usually the culprit in these cases. There’s pr
by G3rn0ti 3y ago
> I'm also not happy about the fact that I can no longer open large C++ files
Regex-based syntax highlighting is usually the culprit in these cases. There’s probably a new RegEx inside c++ mode that burns too many cpu cycles.
You might want to try out the treesitter mode „c++—ts-mode“ that does the syntax highlighting based on a real static parser written in C: https://medium.com/really-learn-programming/setting-up-tree-sitter-in-emacs-29-x-a38a9d3a9f2b https://medium.com/really-learn-programming/setting-up-tree-...
Disclaimer: I’m not a C++ dev so I have never tried that.
- srhtftw 3y ago> https://medium.com/really-learn-programming/setting-up-tree-sitter-in-emacs-29-x-a38a9d3a9f2b https://medium.com/really-learn-programming/setting-up-tree-... The author made this story available to Medium members only. Sign up to read this one for free. /sigh
- G3rn0ti 3y agoYeah, sorry, I was hastily looking for a tutorial. But I got "c++-ts-mode" working for me now, see my other comment below: https://news.ycombinator.com/item?id=37466899 https://news.ycombinator.com/item?id=37466899 I am still not a competent C++ programmer but this is how your basic tree sitter C++ mode is supposed too look with "C-h m": Minor modes enabled in this buffer: Auto-Save Flycheck Flyspell Font-Lock Yas The major mode is C++// mode defined in c-ts-mode.el: Major mode for editing C++, powered by tree-sitter. This mode is independent from the classic cc-mode.el based ‘c++-mode’, so configuration variables of that mode, like ‘c-basic-offset’, don’t affect this mode. To use tree-sitter C/C++ modes by default, evaluate (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode)) (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode))