commit 45209207a62f3b2b14a8d8df71643a3ca249d508
parent 11ca8c871e0311e773bdd1cd97496af7fcdc6b1d
Author: Byron Torres <b@torresjrjr.com>
Date: Thu, 12 Nov 2020 20:13:16 +0000
Inital syntax and ftdetect files
Diffstat:
4 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,2 @@
+_*
+test*
diff --git a/README.md b/README.md
@@ -1,2 +1,9 @@
vim-gemini
==========
+
+Vim syntax highlighting plugin for Gemini Text, the text/gemini media type,
+as defined in the *Gemini protocol specification v0.14.12, July 2nd 2020*
+([gemini][1], [http][2]).
+
+[1]: gemini://gemini.circumlunar.space/docs/specification.gmi
+[2]: https://gemini.circumlunar.space/docs/specification.html
diff --git a/ftdetect/gemini.vim b/ftdetect/gemini.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.{gemini,gmi} set filetype=gemini
diff --git a/syntax/gemini.vim b/syntax/gemini.vim
@@ -0,0 +1,43 @@
+" Vim syntax file
+" Language: Gemini Text
+" Maintainer: Byron Torres (@torresjrjr) <b@torresjrjr.com>
+" Last Change: 2020-11-12
+" Filenames: *.{gemini,gmi}
+
+if exists("b:current_syntax")
+ finish
+endif
+
+" Matches
+syn match link_prefix /^=>\s*/ nextgroup=link
+syn match link /\S*/ nextgroup=link_comment contained
+syn match link_comment /.*$/ contained
+
+syn match heading_prefix /^##\?#\?/ nextgroup=heading_text
+syn match heading_text /.*$/ contained
+
+syn match pre_toggle /^```.*/ contained
+
+syn match ul_prefix /^* /
+syn match quote_prefix /^>/
+
+" Regions
+syn region pre_block start=/^```/ end=/^```/ fold contains=pre_toggle keepend
+
+" Highlighting
+let b:current_syntax = "gemini"
+
+hi def link link_prefix Special
+hi def link link Underlined
+hi def link link_comment Comment
+
+hi def link pre_block PreProc
+hi def link pre_toggle Comment
+
+hi def link heading_prefix Special
+hi def link heading_text Constant
+
+hi def link ul_prefix Statement
+hi def link quote_prefix Comment
+
+" @torresjrjr