about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-12-28 20:02:45 -0800
committerKartik Agaram <vc@akkartik.com>2019-12-28 20:02:45 -0800
commitb6e3ce576f1d10848fb37f63bb24d37d9bff0f71 (patch)
tree0e4a864c203271e07fe8917c305bbab89b61c003
parentecd1a406e67cc2b8af9d9fe716c4af81fe8fa3b8 (diff)
downloadmu-b6e3ce576f1d10848fb37f63bb24d37d9bff0f71.tar.gz
5841 - rudimentary syntax highlighting for gedit
-rw-r--r--subx.gedit29
1 files changed, 29 insertions, 0 deletions
diff --git a/subx.gedit b/subx.gedit
new file mode 100644
index 00000000..45ef1337
--- /dev/null
+++ b/subx.gedit
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- copy this file somewhere like ~/.local/share/gtksourceview-3.0/language-specs/subx.lang -->
+<language id="subx" name="SubX" version="2.0" _section="Source">
+  <metadata>
+    <property name="mimetypes">text/x-subx;text/x-subxsrc</property>
+    <property name="globs">*.subx</property>
+  </metadata>
+  <styles>
+    <style id="comment" name="Comment" map-to="def:comment"/>
+    <style id="string" name="String" map-to="def:string"/>
+    <style id="keyword" name="Keyword" map-to="def:keyword"/>
+  </styles>
+  <definitions>
+    <context id="subx">
+      <include>
+        <context id="comment" style-ref="comment">
+          <match>#.*</match>
+        </context>
+        <context id="string" style-ref="string">
+          <match>"[^"]*"</match>
+        </context>
+        <!-- TODO: distinguish functions, globals, tests and internal labels -->
+        <context id="keyword" style-ref="keyword">
+          <match>^[^ ]*:</match>
+        </context>
+      </include>
+    </context>
+  </definitions>
+</language>