From e3b24b585b65466271aae178ea2bbd91b550d167 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Mon, 6 Oct 2025 11:51:45 +1100 Subject: [PATCH] Vim config files for Kyn highlighting --- .vim/ftdetect/kyn.vim | 1 + .vim/syntax/kyn.vim | 47 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .vim/ftdetect/kyn.vim create mode 100644 .vim/syntax/kyn.vim diff --git a/.vim/ftdetect/kyn.vim b/.vim/ftdetect/kyn.vim new file mode 100644 index 0000000..c2e93dc --- /dev/null +++ b/.vim/ftdetect/kyn.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.kyn setfiletype kyn diff --git a/.vim/syntax/kyn.vim b/.vim/syntax/kyn.vim new file mode 100644 index 0000000..8c448ca --- /dev/null +++ b/.vim/syntax/kyn.vim @@ -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"