summaryrefslogtreecommitdiffstats
path: root/misc/ninja-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ninja-mode.el')
-rw-r--r--misc/ninja-mode.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/misc/ninja-mode.el b/misc/ninja-mode.el
new file mode 100644
index 0000000..ddbcfd8
--- /dev/null
+++ b/misc/ninja-mode.el
@@ -0,0 +1,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))
+ )