Last active
December 13, 2015 20:48
-
-
Save vderyagin/4972096 to your computer and use it in GitHub Desktop.
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
;;;###autoload | |
(define-derived-mode conf-dwarf-fortress-mode fundamental-mode | |
"Mode for editing dwarf fortress configuration files." | |
:syntax-table text-mode-syntax-table | |
(setq font-lock-defaults | |
'(( | |
("^\s*\\(\\[[^:]+:\\)\\(.*\\)\\(\\]\\)$" | |
(1 font-lock-type-face) | |
(2 font-lock-constant-face) | |
(3 font-lock-type-face)) | |
("^[^\\[].*$" . font-lock-comment-face)) | |
nil t)) | |
(setq mode-name "Conf[Dwarf Fortress]")) | |
;;;###autoload | |
(mapc | |
(lambda (f) | |
(add-to-list 'auto-mode-alist | |
(cons (concat "/data/init/" f "\\'") | |
'conf-dwarf-fortress-mode))) | |
'("announcements.txt" | |
"colors.txt" | |
"d_init.txt" | |
"init.txt" | |
"interface.txt" | |
"embark_profiles.txt" | |
"world_gen.txt")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment