From 05ec6e923ef4d7cc90762678b2ecdeaa3f83e1ee Mon Sep 17 00:00:00 2001 From: lee2sman Date: Tue, 3 May 2022 00:03:51 -0400 Subject: [PATCH] add gemtext.sublime-syntax --- gemtext.sublime-syntax | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 gemtext.sublime-syntax diff --git a/gemtext.sublime-syntax b/gemtext.sublime-syntax new file mode 100644 index 0000000..d7a21b9 --- /dev/null +++ b/gemtext.sublime-syntax @@ -0,0 +1,33 @@ +# by lettuce 2022, cc0 +# gemini://gemini.ctrl-c.club/~lettuce +# syntax info: http://www.sublimetext.com/docs/3/syntax.html +name: Gemtext +file_extensions: [gmi] +scope: source.txt +contexts: + main: + # Line starting with #* + - match: '^\#.*' + push: + - meta_scope: meta.separator + - match: '$\n?' + pop: true + + # Line starting with * + - match: '^\*.*' + push: + - meta_scope: meta.separator + - match: '$\n?' + pop: true + # Line starting with => + - match: '^\=\>.*' + push: + - meta_scope: meta.separator + - match: '$\n?' + pop: true + # Line starting with a number + - match: '^[1-9_]+\b.*' + push: + - meta_scope: markup.heading + - match: '$\n?' + pop: true