summaryrefslogtreecommitdiffstats
path: root/misc/ninja-mode.el
blob: ddbcfd8ccb6d94ec1cf1d20f7f7188aae5c226b9 (plain)
1
2
3
4
5
6
7
8
9
10
;; Simple emacs mode for editing .ninja files.
;; Just some syntax highlighting for now.

(setq ninja-keywords
      '(("^\\<rule\\>\\|^\\<build\\>\\|^\\<subninja\\>" . font-lock-keyword-face)
        ("\\([[:alnum:]_]+\\) =" . (1 font-lock-variable-name-face))
        ))
(define-derived-mode ninja-mode fundamental-mode "ninja"
  (setq font-lock-defaults '(ninja-keywords))
  )