dotfiles

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

commit b85f61deaae9501f891f037c886f0b1d9bfbcf0f
parent 18ad731bae10e70deadd0a6731853bc596d5748d
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue, 10 Nov 2020 21:29:53 -0500

Add gemini syntax highlighting vim plugin

Diffstat:
A.config/nvim/bundle/gemini-vim-syntax/LICENSE | 24++++++++++++++++++++++++
A.config/nvim/bundle/gemini-vim-syntax/ftdetect/gmi.vim | 3+++
A.config/nvim/bundle/gemini-vim-syntax/syntax/gmi.vim | 48++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/.config/nvim/bundle/gemini-vim-syntax/LICENSE b/.config/nvim/bundle/gemini-vim-syntax/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/> diff --git a/.config/nvim/bundle/gemini-vim-syntax/ftdetect/gmi.vim b/.config/nvim/bundle/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/bundle/gemini-vim-syntax/syntax/gmi.vim b/.config/nvim/bundle/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 +