Theme-D

Editor support

General

Syntax highlighting and indentation are implemented for Theme-D code in Visual Studio Code and GNU Emacs.

Visual Studio Code

To install the language support do the following:

  1. Install the paredit-theme-d.js node package. The newest version of this package is 1.0.3. You have to take care that the package gets installed to a correct directory so that VSCode can access it. For Linux, use the following commands:
                    cd ˜
                    npm install https://github.com/tohoyn/paredit-theme-d.js
                
  2. Install VSCode extension “Theme-D Language”.
  3. Install VSCode extension “Strict Paredit Theme-D”.

The extensions can be installed with VSCode command “Extensions: Install Extensions”.

If you don't want to use the strict editing mode configure VSCode setting paredit_theme_d.defaultKeyMap to original or none.

If you indent a single line or a small selection you can use command “Indent Without Message” or key ctrl+alt+j. For large selections or whole large files you should use command “Indent“, key ctrl+alt+i, and wait until the message window for the completed indentation appears.

If you don't want the brackets in your source code to be colourized switch off the configuration variable editor.bracketPairColorization.enabled.

The source code repositories of the VSCode support packages can be found at the following locations:

I recommend you to read the README.md files in the repositories.

The VSIX packages of the extensions can be found here:

GNU Emacs

The Emacs mode for Theme-D has been implemented in file theme-d.el. If you have Theme-D installed on a UNIX system the file can be also found at /usr/share/theme-d/tools/theme-d.el.

Compile the file theme-d.el to bytecode in Emacs and copy the generated file theme-d.elc into your home directory. Add the following lines to your Emacs configuration file .emacs:

                  (load (expand-file-name "theme-d.elc" "~"))
        
                  (setq auto-mode-alist
                        (append auto-mode-alist
                          (mapcar
                           (lambda (elt)
                             (cons (purecopy (car elt)) (cdr elt)))
                             `(("\\.thp\\'" . theme-d-mode)
                               ("\\.ths\\'" . theme-d-mode)  
                               ("\\.thi\\'" . theme-d-mode)  
                               ("\\.thb\\'" . theme-d-mode)))))          
          

Back to the main page

Last updated: October 3, 2024

Copyright © 2020-2023 Tommi Höynälänmaa

tommi.hoynalanmaa@REMOVETHISiki.fi