2018-07-01 04:40:14 +00:00
|
|
|
" SubX syntax file
|
|
|
|
" Language: SubX
|
|
|
|
" Maintainer: Kartik Agaram <mu@akkartik.com>
|
2018-11-30 18:33:34 +00:00
|
|
|
" URL: https://github.com/akkartik/mu
|
2018-07-01 04:40:14 +00:00
|
|
|
" License: public domain
|
|
|
|
"
|
|
|
|
" Copy this into your ftplugin directory, and add the following to your vimrc
|
|
|
|
" or to .vim/ftdetect/subx.vim:
|
|
|
|
" autocmd BufReadPost,BufNewFile *.subx set filetype=subx
|
|
|
|
|
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
|
|
|
" setlocal iskeyword=@,48-57,?,!,_,$,-
|
|
|
|
setlocal formatoptions-=t " allow long lines
|
|
|
|
setlocal formatoptions+=c " but comments should still wrap
|
|
|
|
|
2018-10-06 02:49:47 +00:00
|
|
|
setlocal iskeyword+=-
|
|
|
|
|
2018-11-30 18:33:34 +00:00
|
|
|
"? syntax match subxComment /#.*$/ | highlight link subxComment Comment
|
|
|
|
"? syntax match subxSalientComment /##.*$/ | highlight link subxSalientComment SalientComment
|
2018-11-30 22:20:37 +00:00
|
|
|
syntax match subxH1Comment /# -.*/ | highlight subxH1Comment ctermfg=14
|
|
|
|
syntax match subxComment /#[^ ].*\|# [^.-].*\|# \?$/ | highlight subxComment ctermfg=39
|
2018-11-30 18:33:34 +00:00
|
|
|
syntax match subxS1Comment /# \..*/ | highlight subxS1Comment ctermfg=27
|
|
|
|
syntax match subxS2Comment /# \. \..*/ | highlight subxS2Comment ctermfg=19
|
2018-11-30 17:43:49 +00:00
|
|
|
|
2018-07-01 06:05:10 +00:00
|
|
|
set comments-=:#
|
2018-07-01 04:40:14 +00:00
|
|
|
set comments+=n:#
|
|
|
|
syntax match subxCommentedCode "#? .*" | highlight link subxCommentedCode CommentedCode
|
|
|
|
let b:cmt_head = "#? "
|
2018-08-04 23:28:22 +00:00
|
|
|
|
2018-08-05 04:21:19 +00:00
|
|
|
" comment token
|
2018-11-30 17:43:49 +00:00
|
|
|
syntax match subxDelimiter / \. / | highlight link subxDelimiter CommentedCode
|
2018-08-11 18:09:22 +00:00
|
|
|
|
2018-11-21 03:37:00 +00:00
|
|
|
syntax match subxString %"[^"]*"% | highlight link subxString Constant
|
2018-11-25 04:54:56 +00:00
|
|
|
" match globals but not registers like 'EAX'
|
2018-12-01 00:40:35 +00:00
|
|
|
syntax match subxGlobal %[^/]\<[A-Z][a-z0-9_-]*\>\|^[A-Z][a-z0-9_-]*\>% | highlight link subxGlobal SpecialChar
|
|
|
|
"? syntax match subxGlobal %\/\@!\<[A-Z][a-z0-9_-]*\>% | highlight link subxGlobal SpecialChar
|
2018-11-30 22:20:37 +00:00
|
|
|
" tweak the red color from the colorscheme just a tad to improve contrast
|
|
|
|
highlight SpecialChar ctermfg=196
|
2018-11-21 03:37:00 +00:00
|
|
|
|
2018-08-13 03:26:53 +00:00
|
|
|
let &cpo = s:save_cpo
|