Vim config files for Kyn highlighting
This commit is contained in:
1
.vim/ftdetect/kyn.vim
Normal file
1
.vim/ftdetect/kyn.vim
Normal file
@@ -0,0 +1 @@
|
|||||||
|
autocmd BufNewFile,BufRead *.kyn setfiletype kyn
|
||||||
47
.vim/syntax/kyn.vim
Normal file
47
.vim/syntax/kyn.vim
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Kyn
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
syn keyword kynKeyword fun struct let if while return assert is
|
||||||
|
|
||||||
|
" Instructions/Modules
|
||||||
|
syn keyword kynInstruction println print math exit compare input concat split file
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn match kynComment /#.*/
|
||||||
|
|
||||||
|
" Strings
|
||||||
|
syn region kynString start=/"/ end=/"/
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
syn match kynNumber /\d\+\(\.\d\+\)\?/
|
||||||
|
|
||||||
|
" Variables
|
||||||
|
syn match kynVariable /\$[a-zA-Z_][a-zA-Z0-9_]*/
|
||||||
|
|
||||||
|
" Type Placeholders
|
||||||
|
syn match kynType /<[a-zA-Z_][a-zA-Z0-9_]*>/
|
||||||
|
|
||||||
|
" Operators
|
||||||
|
syn match kynOperator /[=+\-*\/^%]/
|
||||||
|
syn match kynOperator /==\|!=\|>=\|<=/
|
||||||
|
|
||||||
|
" Special variables
|
||||||
|
syn keyword kynSpecial self
|
||||||
|
|
||||||
|
" Highlighting links
|
||||||
|
hi def link kynKeyword Keyword
|
||||||
|
hi def link kynInstruction Statement
|
||||||
|
hi def link kynComment Comment
|
||||||
|
hi def link kynString String
|
||||||
|
hi def link kynNumber Number
|
||||||
|
hi def link kynVariable Identifier
|
||||||
|
hi def link kynType Type
|
||||||
|
hi def link kynOperator Operator
|
||||||
|
hi def link kynSpecial Special
|
||||||
|
|
||||||
|
let b:current_syntax = "kyn"
|
||||||
Reference in New Issue
Block a user