-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend syntax highlighting in emacs + Vim config (#1890)
Changes include: - Refactor `swarm-mode.el` - Everything doesn't need to be in one `let` binding inside a `setq` function. I've split into `defvar`s depending on the type. Eg: `swarm-mode-commands-regexp` defines all the commands in swarm game with `regex-opt` on them. - Add syntax highlighting for operators like `->`, `=`, `+`, `:` etc. This is Haskell-ish. - Make syntax highlighting respect case sensitivity. - Add `autoload` macro to `define-derived-mode` since it defines the syntax table and syntax related variables. - Add `commentary` section in top level comments as emacs convention. - Update Vim config in order for syntax highlighting to be case sensitive for types. Before: ![CleanShot 2024-06-02 at 20 55 47@2x](https://github.com/swarm-game/swarm/assets/15181803/251f85bb-e97e-4e9a-9157-34d2b8d0d4bf) After: ![CleanShot 2024-06-02 at 20 52 12@2x](https://github.com/swarm-game/swarm/assets/15181803/7873847f-ebea-4143-8843-64a7cf8ebd09) In order to test locally: 1. Open `swarm-mode.el` in emacs. Then `M-x eval-buffer` 2. Then open up any `.sw` file and `M-x swarm-mode`
- Loading branch information
1 parent
ca4a2b8
commit 4e7b2f4
Showing
2 changed files
with
151 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters