All Projects → ludwigpacifici → Modern Cpp Font Lock

ludwigpacifici / Modern Cpp Font Lock

Licence: gpl-3.0
C++ font-lock for Emacs

Programming Languages

elisp
30 projects

Projects that are alternatives of or similar to Modern Cpp Font Lock

Explain Pause Mode
top, but for Emacs.
Stars: ✭ 158 (-0.63%)
Mutual labels:  emacs, melpa
Lsp Dart
lsp-mode ❤️ dart
Stars: ✭ 94 (-40.88%)
Mutual labels:  emacs, melpa
Emacs Datetime
Stars: ✭ 8 (-94.97%)
Mutual labels:  emacs, melpa
Quelpa
Build and install your Emacs Lisp packages on-the-fly directly from source
Stars: ✭ 455 (+186.16%)
Mutual labels:  emacs, melpa
Linum Relative
display relative line number in the left margin in emacs
Stars: ✭ 152 (-4.4%)
Mutual labels:  emacs, melpa
Meghanada Emacs
A Better Java Development Environment for Emacs
Stars: ✭ 582 (+266.04%)
Mutual labels:  emacs, melpa
Exwm Edit
Edit mode for EXWM
Stars: ✭ 92 (-42.14%)
Mutual labels:  emacs, melpa
Emacs Easy Hugo
Emacs major mode for managing hugo
Stars: ✭ 235 (+47.8%)
Mutual labels:  emacs, melpa
Auto Complete
Emacs auto-complete package
Stars: ✭ 1,622 (+920.13%)
Mutual labels:  emacs, melpa
Web Mode
web template editing mode for emacs
Stars: ✭ 1,470 (+824.53%)
Mutual labels:  emacs, melpa
Nord Emacs
An arctic, north-bluish clean and elegant Emacs theme.
Stars: ✭ 379 (+138.36%)
Mutual labels:  emacs, melpa
Nix Mode
An Emacs major mode for editing Nix expressions.
Stars: ✭ 137 (-13.84%)
Mutual labels:  emacs, syntax-highlighting
Use Package
A use-package declaration for simplifying your .emacs
Stars: ✭ 3,748 (+2257.23%)
Mutual labels:  emacs, melpa
Cmake Ide
Use Emacs as a C/C++ IDE
Stars: ✭ 661 (+315.72%)
Mutual labels:  emacs, melpa
Rg.el
Emacs search tool based on ripgrep
Stars: ✭ 277 (+74.21%)
Mutual labels:  emacs, melpa
Dumb Jump
an Emacs "jump to definition" package for 50+ languages
Stars: ✭ 1,256 (+689.94%)
Mutual labels:  emacs, melpa
Evil Multiedit
Multiple cursors for evil-mode, based on iedit
Stars: ✭ 200 (+25.79%)
Mutual labels:  emacs, melpa
Nimbus Theme
The best dark theme for Emacs
Stars: ✭ 102 (-35.85%)
Mutual labels:  emacs, melpa
Emacs Solaire Mode
If only certain buffers could be so grossly incandescent.
Stars: ✭ 129 (-18.87%)
Mutual labels:  emacs, melpa
Prism.el
Disperse Lisp forms (and other languages) into a spectrum of colors by depth
Stars: ✭ 141 (-11.32%)
Mutual labels:  emacs, syntax-highlighting

License GPL 3 MELPA Build Status

Donate Paypal

Syntax highlighting support for "Modern C++" - until C++20 and Technical Specification. This package aims to provide a simple highlight of the C++ language without dependency.

It is recommended to use it in addition with the c++-mode major mode for extra highlighting (user defined types, functions, etc.) and indentation.

Preview

With modern-c++-font-lock-mode:

Using GNU Emacs 27.0.50 and CC Mode version 5.33.2.

Installation

Melpa

modern-cpp-font-lock is available on the major package.el community maintained repo - MELPA.

You can install it with the following command:

M-x package-install [RET] modern-cpp-font-lock [RET]

In your init Emacs file add:

(add-hook 'c++-mode-hook #'modern-c++-font-lock-mode)

or:

(modern-c++-font-lock-global-mode t)

use-package

In your init Emacs file add:

(use-package modern-cpp-font-lock
  :ensure t)

Manual

Global setup

Download modern-cpp-font-lock.el into a directory of your load-path. Place the following lines in a suitable init file:

(require 'modern-cpp-font-lock)
(modern-c++-font-lock-global-mode t)

modern-c++-font-lock-mode will be activated for buffers using the c++-mode major-mode.

Local

For the current buffer, the minor-mode can be turned on/off via the command:

M-x modern-c++-font-lock-mode [RET]

Configuration

C++ Language

You can modify the following lists to recognize more words or set it to nil to partially disable font locking:

  • modern-c++-attributes - [[deprecated]], [[noreturn]], etc.
  • modern-c++-keywords - if, constexpr, noexcept, etc.
  • modern-c++-operators - ...
  • modern-c++-preprocessors - #define, __LINE__, __cplusplus, etc.
  • modern-c++-types - bool, char, double, etc.

Set to t (default value) to enable the following options or otherwise to nil:

  • modern-c++-literal-boolean - false, true
  • modern-c++-literal-integer - 0b101010, 18446744073709550592LLU, 0XdeadBABEu, etc.
  • modern-c++-literal-null-pointer - nullptr
  • modern-c++-literal-string - R"xyz()")xyz", L"hello\ngoodbye", "abcd", etc.

Configure the following list to customize font locking for literal integers:

  • modern-c++-literal-binary-prefix-face
  • modern-c++-literal-binary-infix-face
  • modern-c++-literal-binary-suffix-face
  • modern-c++-literal-octal-prefix-face
  • modern-c++-literal-octal-infix-face
  • modern-c++-literal-octal-suffix-face
  • modern-c++-literal-hex-prefix-face
  • modern-c++-literal-hex-infix-face
  • modern-c++-literal-hex-suffix-face
  • modern-c++-literal-dec-infix-face
  • modern-c++-literal-dec-suffix-face

C++ standard library

Set to t (default value) to enable the following font lock options. Otherwise use nil:

  • modern-c++-stl-cstdint - Define the header <cstdint>

Mode line

When modern-c++-font-lock-mode is activated, mc++fl is displayed.

Wiki

The Wiki is available: https://github.com/ludwigpacifici/modern-cpp-font-lock/wiki

Testing

Font-lock keywords are tested with the faceup package of Anders Lindgren.

Feedback

If you find a bug, please check if you can reproduce with c++-mode only. If it is the case, send your bug upstream to CC Mode

Do not hesitate to ask questions or share suggestions.

Happy coding!

Lud

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].