Skip to content

Instantly share code, notes, and snippets.

@vderyagin
Last active December 13, 2015 20:48
Show Gist options
  • Save vderyagin/4972096 to your computer and use it in GitHub Desktop.
Save vderyagin/4972096 to your computer and use it in GitHub Desktop.
;;;###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