Skip to content

Syntax highlighting

Gonzalo Larumbe edited this page Jun 8, 2023 · 3 revisions

vhdl-ext provides many faces that inherit from existing ones in Emacs 29. This is done in order to avoid having default faces that might not be suitable for different themes. The drawback is that if you are using an older version many of the faces will not be displayed by default.

However this can be customized with very little configuration.

Configuration

First make sure that font-lock has been included in vhdl-ext-feature-list before running vhdl-ext-mode-setup.

There are two methods to configure faces:

  • Via M-x customize-group RET vhdl-ext-font-lock.

    • Customize faces and save configuration once you get the desired result
  • Through elisp code

    • Below there is a snippet with a configuration example that works well with a dark background:
    (set-face-attribute 'vhdl-ext-font-lock-punctuation-face nil :foreground "burlywood")
    (set-face-attribute 'vhdl-ext-font-lock-operator-face nil :inherit 'vhdl-ext-font-lock-punctuation-face :weight 'extra-bold)
    (set-face-attribute 'vhdl-ext-font-lock-brackets-face nil :foreground "goldenrod")
    (set-face-attribute 'vhdl-ext-font-lock-parenthesis-face nil :foreground "dark goldenrod")
    (set-face-attribute 'vhdl-ext-font-lock-curly-braces-face nil :foreground "DarkGoldenrod2")
    (set-face-attribute 'vhdl-ext-font-lock-brackets-content-face nil :foreground "yellow green")
    (set-face-attribute 'vhdl-ext-font-lock-port-connection-face nil :foreground "bisque2")
    (set-face-attribute 'vhdl-ext-font-lock-entity-face nil :foreground "green1")
    (set-face-attribute 'vhdl-ext-font-lock-instance-face nil :foreground "medium spring green")
    (set-face-attribute 'vhdl-ext-font-lock-instance-lib-face nil :foreground "gray70")
    (set-face-attribute 'vhdl-ext-font-lock-translate-off-face nil :background "gray20" :slant 'italic)
Clone this wiki locally