dotfiles

Configuration for the software I use.
git clone https://git.sr.ht/~jbauer/dotfiles
Log | Files | Refs | README | LICENSE

commit 8cf8dd824d587d196e6bd77dff04af6e5f4f937f
parent 040ab21df84bd6f4911b820ebb3abec8f0095a58
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Mon, 27 Dec 2021 15:21:29 -0500

Add gemini sytax highlighting

Diffstat:
A.config/nvim/pack/bundle/start/gemini-vim-syntax/ftdetect/gmi.vim | 3+++
A.config/nvim/pack/bundle/start/gemini-vim-syntax/syntax/gmi.vim | 48++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/.config/nvim/pack/bundle/start/gemini-vim-syntax/ftdetect/gmi.vim b/.config/nvim/pack/bundle/start/gemini-vim-syntax/ftdetect/gmi.vim @@ -0,0 +1,3 @@ +au BufRead,BufNewFile *.gmi,*.gemini set filetype=gmi +" Gemini protocol syntax for text/gemini files (*.gmi) +" will also work for *.gemini files diff --git a/.config/nvim/pack/bundle/start/gemini-vim-syntax/syntax/gmi.vim b/.config/nvim/pack/bundle/start/gemini-vim-syntax/syntax/gmi.vim @@ -0,0 +1,48 @@ +" Vim syntax file +" " Language: gemini +" " Maintainer: sloum < sloum AT rawtext.club > +" " Latest Revision: 08 Jun 2020 + +" +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Handle monospaced blocks +syn region gmiMono start=/^```/ end=/^```/ + +" Handle between one and three heading levels +syn match gmiHeader /^#\{1,3}[^#].*$/ + +" Start a link line +syn match gmiLinkStart /^=>/ nextgroup=gmiLinkUrl skipwhite + +" An extremely naive way of handling the URL portion of the link line +" This is left naive in a deliberate attempt to be unambiguous about +" what part of a link line gemini considers to be the URL, regardless +" of whether or not it is a valid URL +syn match gmiLinkUrl /\S\+/ contained nextgroup=gmiLinkTitle skipwhite + +" Skipping whitespace from the URL match all text, including whitespace, +" until the end of the line +syn match gmiLinkTitle /.*$/ contained + +" Handle list items +syn match gmiListItem /^\* .*$/ + +" Handle quotes +syn match gmiQuoteLine /^>.*/ + +let b:current_syntax = "gmi" + +hi def link gmiMono Special +hi def link gmiHeader Constant +hi def link gmiLinkStart Todo +hi def link gmiLinkUrl Underlined +hi def link gmiLinkTitle String +hi def link gmiListItem Identifier +hi def link gmiQuoteLine Comment