-
Notifications
You must be signed in to change notification settings - Fork 11
Home
By default, operators are no font locked (to avoid the christmas tree effect). However, you could argue they can be overloaded and it could make sense to highlight all/some of them. It is a perfect example to show you how to customize this minor-mode:
With c++-mode
and modern-c++-font-lock-mode
enabled, you will see by default:
Add (add-to-list 'modern-c++-operators "=")
in your init file to enable extra font locking for operators. Now, =
is highlighted:
You do not like some part of the font-locking? Fair enough. Let's disable the syntax highlighting for C++ attributes.
With c++-mode
and modern-c++-font-lock-mode
enabled, you will see by default:
Add (setq modern-c++-attributes nil)
in your init file to disable font locking for C++ attributes. Now, [[maybe_unused]]
is no more highlighted:
With modern-c++-literal-string
set to t
, string literals will be displayed correctly with cc-mode >= 5.33
.