Adds a makefile for local install and cleans up some of the code
This commit is contained in:
parent
cb077c34b5
commit
81b7c93c96
|
@ -0,0 +1,22 @@
|
||||||
|
UNAME := $(shell uname -s)
|
||||||
|
|
||||||
|
SYN := /syntax
|
||||||
|
FT := /ftdetect
|
||||||
|
|
||||||
|
ifeq ($(UNAME), Haiku)
|
||||||
|
ROOT = /boot/home/config/settings/vim
|
||||||
|
else
|
||||||
|
ROOT := ~/.vim
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install: ./syntax/gmi.vim ./ftdetect/gmi.vim
|
||||||
|
install -d ${ROOT}${SYN}
|
||||||
|
install -d ${ROOT}${FT}
|
||||||
|
install -m 0644 ./syntax/gmi.vim ${ROOT}${SYN}
|
||||||
|
install -m 0644 ./syntax/gmi.vim ${ROOT}${FT}
|
||||||
|
|
||||||
|
.PHONY: remove
|
||||||
|
remove:
|
||||||
|
rm -rf ${ROOT}${SYN}/gmi.vim
|
||||||
|
rm -rf ${ROOT}${FT}/gmi.vim
|
|
@ -3,32 +3,39 @@
|
||||||
" " Maintainer: sloum < sloum AT rawtext.club >
|
" " Maintainer: sloum < sloum AT rawtext.club >
|
||||||
" " Latest Revision: 02 February 2020
|
" " 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
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Handle monospaced blocks
|
" Handle monospaced blocks
|
||||||
syn region Special start="```" end="```"
|
syn region gmiMono start="```" end="```"
|
||||||
|
|
||||||
" Handle between one and three heading levels
|
" Handle between one and three heading levels
|
||||||
syn match Constant /^#\{1,3}.*$/
|
syn match gmiHeader /^#\{1,3}.*$/
|
||||||
|
|
||||||
" Start a link line
|
" 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
|
" An extremely naive way of handling the URL portion of the link line
|
||||||
" TODO think about improving this
|
" 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
|
" Handle list items
|
||||||
syn match Identifier /^\*.*$/
|
syn match gmiListItem /^\*.*$/
|
||||||
|
|
||||||
syn match Ignore /^77/
|
|
||||||
syn match String /^88/
|
|
||||||
syn match Comment /^99/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let b:current_syntax = "gmi"
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue