add vim syntax

This commit is contained in:
Daniella 2023-02-25 11:42:45 +01:00
parent 8c30e2fd2f
commit 5300cf7c16
Signed by: TudbuT
GPG key ID: 7D63D5634B7C417F
2 changed files with 18 additions and 0 deletions

View file

@ -9,6 +9,9 @@ func main { mega |
"make sure its executable";
[ "sudo" "chmod" "a+rx" "/bin/spl" ] command-wait;
"add vim syntax";
[ "sudo" "cp" "spl.vim" "/usr/share/*vim*/runtime/syntax/spl.vim"] command-wait;
"SPL is now installed!" println
0

15
spl.vim Normal file
View file

@ -0,0 +1,15 @@
if exists("b:current_syntax")
finish
endif
syn match Comment /".*?";/
syn match Number /\<[0-9._]*\>/
syn match Function /\<func[ \n]\+[^ ]\+[ \n]\+{ .*[ ]*|\|{ .*[ ]*|\|{\|}/
syn keyword Keyword while if exit eq lt gt neg or and not + - * ++ -- % / with
syn match Keyword /;/
syn keyword Type pop dup swap
syn match Type /=[a-zA-Z0-9_\-]\+\|\<_[a-zA-Z0-9_\-]\+\>/
syn match Identifier /[a-zA-Z0-9_\-]\+:\|\<this\>/
syn match String /"[^"]*"/
syn match Typedef /\<def[ \n]\+[^ ]*\|construct/