diff options
author | Brian Evans <bevans@formulafolios.com> | 2020-03-03 10:52:50 -0800 |
---|---|---|
committer | Brian Evans <bevans@formulafolios.com> | 2020-03-03 10:52:50 -0800 |
commit | 81b7c93c963a17cb4984b0f382c2869f0ea3af06 (patch) | |
tree | 4c79650263295b03fc1178d738e651b7aeb0071d /syntax | |
parent | cb077c34b553991ca4e82d2fa16a13c7fc471ed9 (diff) |
Adds a makefile for local install and cleans up some of the code
Diffstat (limited to 'syntax')
-rw-r--r-- | syntax/gmi.vim | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/syntax/gmi.vim b/syntax/gmi.vim index 842e665..cf0dccd 100644 --- a/syntax/gmi.vim +++ b/syntax/gmi.vim @@ -3,32 +3,39 @@ " " Maintainer: sloum < sloum AT rawtext.club > " " Latest Revision: 02 February 2020 -if exists("b:current_syntax") +" +" 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 Special start="```" end="```" +syn region gmiMono start="```" end="```" " Handle between one and three heading levels -syn match Constant /^#\{1,3}.*$/ +syn match gmiHeader /^#\{1,3}.*$/ " Start a link line -syn match Todo /^=>/ nextgroup=Underlined skipwhite +syn match gmiLinkStart /^=>/ nextgroup=gmiLinkUrl 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 gmiLinkUrl /\S\+/ contained nextgroup=gmiLinkTitle skipwhite -syn match String /.*$/ contained +syn match gmiLinkTitle /.*$/ contained " Handle list items -syn match Identifier /^\*.*$/ - -syn match Ignore /^77/ -syn match String /^88/ -syn match Comment /^99/ +syn match gmiListItem /^\*.*$/ +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 -let b:current_syntax = "gmi" |