summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-05-15 14:51:42 -0400
committernodist <kevin.comas.git@gmail.com>2026-05-15 14:51:42 -0400
commit3d837715c698312120ed20600274b8bd3a8f5666 (patch)
tree4618672d937674b76d22bde7c7358dcc4aab37b9
parent523cbafd9dfbe75cee418e696827c8a35c84f232 (diff)
basic syntax highlight
-rw-r--r--ftdetect/kpl.vim2
-rw-r--r--ftplugin/kpl.vim2
-rw-r--r--syntax/kpl.vim61
3 files changed, 65 insertions, 0 deletions
diff --git a/ftdetect/kpl.vim b/ftdetect/kpl.vim
new file mode 100644
index 0000000..a151565
--- /dev/null
+++ b/ftdetect/kpl.vim
@@ -0,0 +1,2 @@
+
+autocmd BufNewFile,BufRead *.kpl setfiletype kpl
diff --git a/ftplugin/kpl.vim b/ftplugin/kpl.vim
new file mode 100644
index 0000000..c80720d
--- /dev/null
+++ b/ftplugin/kpl.vim
@@ -0,0 +1,2 @@
+
+setlocal commentstring=//\ %s
diff --git a/syntax/kpl.vim b/syntax/kpl.vim
new file mode 100644
index 0000000..70a422c
--- /dev/null
+++ b/syntax/kpl.vim
@@ -0,0 +1,61 @@
+
+" Operators
+syn match kplOperator "[~!$%&*\-+=|:'<,>\./]"
+hi def link kplOperator Operator
+
+" Comments
+syn match kplTodo contained "\<TODO\>" contains=@NoSpell
+syn match kplCommentLine "\/\/.*$" contains=kplTodo
+syn region kplCommentRange start="/\*" end="\*/" contains=kplTodo
+hi def link kplTodo TODO
+hi def link kplCommentLine Comment
+hi def link kplCommentRange Comment
+
+" Semicolon
+syn match kplSemicolon ";"
+hi def link kplSemicolon Comment
+
+" Number
+syn match kplNumber "\d\+\%(\.\d\+\)\?"
+hi def link kplNumber Number
+
+" String
+syn region kplString start=/"/ skip=/\\\\"/ end=/"/
+hi def link kplString String
+
+" Var
+syn match kplVar "[a-z]\w*" contains=@NoSpell
+hi def link kplVar Ignore
+
+" Ignore
+syn match kplIgnore "_\w*" contains=@NoSpell
+hi def link kplIgnore Comment
+
+" Symbol
+syn match kplSymbol "\.\w\+" contains=@NoSpell
+hi def link kplSymbol Identifier
+
+" Keyword
+syn match kplKeyword "`[a-z]\+" contains=@NoSpell
+hi def link kplKeyword Conditional
+
+" Type
+syn match kplType "[A-Z]\w*" contains=@NoSpell
+hi def link kplType Type
+
+" Qualifiers
+syn match kplQualifiers "Const\|Empty\|Lock\|Ref" contains=@NoSpell
+hi def link kplQualifiers Repeat
+
+" Define
+syn match kplDefine "\[\|\]"
+hi def link kplDefine Define
+
+" List
+syn match kplList "[()]"
+hi def link kplList Special
+
+" Action
+syn match kplAction "[?@#^{}]"
+hi def link kplAction Function
+