Skip to content

radgeRayden/emacs-scopes-mode

Repository files navigation

scopes-mode

Emacs major mode for the Scopes programming language. Highlights all keywords and numbers, along with all symbols defined in core.sc and the default modules.

Usage

For plugin generation, make sure you have initialized the submodule by cloning with --recursive or use git submodule update --init in the already cloned folder. The plugin is partially generated by a scopes program (generator.sc). To generate a new version launch in a shell:

scopes generator.sc > scopes-symbols.el

The elisp library itself is already set up to use that file so no further actions are needed. A pre generated version is already included in the repository for convenience, so generation is only necessary if it's out of date.

Installation

We assume a vanilla emacs installation. Refer to the documentation of your particular distribution or plugin if necessary.

To load scopes-mode, add the following to your init.el or similar startup file:

(load "path/to/scopes-mode.el")

Or if you have a load-path already defined e.g.:

(add-to-list 'load-path "~/.emacs.d/libs")

You can copy or symlink scopes-mode.el and scopes-symbols.el to the ~/.emacs.d/libs folder and add the following line to your config:

(require 'scopes-mode)

To have scopes mode activate automatically when opening a file, add the following:

(add-to-list 'auto-mode-alist '("\\.sc\\'" . scopes-mode))

Screenshots

light theme dark theme

Special thanks

  • @flatwhatson for the help with the comment highlighting regex.
  • @hlissner for general emacs help; The indentation routine was also written while looking at the pug-mode package for reference.