summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsloum <sloum@colorfield.space>2020-03-03 07:58:31 -0800
committersloum <sloum@colorfield.space>2020-03-03 07:58:31 -0800
commitcb077c34b553991ca4e82d2fa16a13c7fc471ed9 (patch)
tree90e6c60a3ca475448702990e1d0339bdbbfe36c3
Initial commit
-rw-r--r--ftdetect/gmi.vim2
-rw-r--r--syntax/gmi.vim34
2 files changed, 36 insertions, 0 deletions
diff --git a/ftdetect/gmi.vim b/ftdetect/gmi.vim
new file mode 100644
index 0000000..2040f0c
--- /dev/null
+++ b/ftdetect/gmi.vim
@@ -0,0 +1,2 @@
+au BufRead,BufNewFile *.gmi set filetype=gmi
+" Gemini protocol syntax for text/gemini files (*.gmi)
diff --git a/syntax/gmi.vim b/syntax/gmi.vim
new file mode 100644
index 0000000..842e665
--- /dev/null
+++ b/syntax/gmi.vim
@@ -0,0 +1,34 @@
+" Vim syntax file
+" " Language: gemini
+" " Maintainer: sloum < sloum AT rawtext.club >
+" " Latest Revision: 02 February 2020
+
+if exists("b:current_syntax")
+ finish
+endif
+
+" Handle monospaced blocks
+syn region Special start="```" end="```"
+
+" Handle between one and three heading levels
+syn match Constant /^#\{1,3}.*$/
+
+" Start a link line
+syn match Todo /^=>/ nextgroup=Underlined skipwhite
+
+" An extremely naive way of handling the URL portion of the link line
+" TODO think about improving this
+syn match Underlined /\S\+/ contained nextgroup=String skipwhite
+
+syn match String /.*$/ contained
+
+" Handle list items
+syn match Identifier /^\*.*$/
+
+syn match Ignore /^77/
+syn match String /^88/
+syn match Comment /^99/
+
+
+
+let b:current_syntax = "gmi"