robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
1be2fdb910
master
1" Vim syntax file 2" Language: Gleam 3" Maintainer: Kirill Morozov <kirill@robotix.pro> 4" Based On: https://github.com/gleam-lang/gleam.vim 5" Last Change: 2025 Apr 20 6" 2025 May 15 Add @Spell clusters #17324 7 8if exists ( "b:current_syntax" ) 9finish 10endif 11let b: current_syntax = "gleam" 12 13syntax case match 14 15" Keywords 16syntax keyword gleamConditional case if 17syntax keyword gleamConstant const 18syntax keyword gleamDebug echo 19syntax keyword gleamException panic assert todo 20syntax keyword gleamInclude import 21syntax keyword gleamKeyword as let use 22syntax keyword gleamStorageClass pub opaque 23syntax keyword gleamType type 24 25" Number 26"" Int 27syntax match gleamNumber "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\> " 28 29"" Binary 30syntax match gleamNumber "\<-\=0 [ bB ] _\?\%( [ 01 ] \| [ 01 ] _ [ 01 ] \)\+\> " 31 32"" Octet 33syntax match gleamNumber "\<-\=0 [ oO ] \?_\?\%(\o\|\o_\o\)\+\> " 34 35"" Hexadecimal 36syntax match gleamNumber "\<-\=0 [ xX ] _\?\%(\x\|\x_\x\)\+\> " 37 38"" Float 39syntax match gleamFloat "\(0 * [ 1-9 ][ 0-9_ ] * \|0\)\.\(0 * [ 1-9 ][ 0-9_ ] * \|0\)\(e-\=0 * [ 1-9 ][ 0-9_ ] * \)\= " 40 41" String 42syntax region gleamString start = /" /end = /" /contains = gleamSpecial , @Spell 43syntax match gleamSpecial '\\. 'contained 44 45" Operators 46"" Basic 47syntax match gleamOperator "[ -+/* ] \.\=\| [ %= ] " 48 49"" Arrows + Pipeline 50syntax match gleamOperator "<-\| [ -| ] > " 51 52"" Bool 53syntax match gleamOperator "&&\||| " 54 55"" Comparison 56syntax match gleamOperator "[ <> ] =\=\.\=\| [ =! ] = " 57 58"" Misc 59syntax match gleamOperator "\.\.\|<>\|| " 60 61" Type 62syntax match gleamIdentifier "\< [ A-Z ][ a-zA-Z0-9 ] * \> "contains = @NoSpell 63 64" Attribute 65syntax match gleamPreProc "@ [ a-z ][ a-z_ ] * "contains = @NoSpell 66 67" Function definition 68syntax keyword gleamKeyword fn nextgroup = gleamFunction skipwhite skipempty 69syntax match gleamFunction "[ a-z ][ a-z0-9_ ] * \ze\s * ( "skipwhite skipnl contains = @NoSpell 70 71" Comments 72syntax region gleamComment start = "// "end = "$ "contains = gleamTodo , @Spell 73syntax region gleamSpecialComment start = "/// "end = "$ "contains = @Spell 74syntax region gleamSpecialComment start = "//// "end = "$ "contains = @Spell 75syntax keyword gleamTodo contained TODO FIXME XXX NB NOTE 76 77" Highlight groups 78highlight link gleamComment Comment 79highlight link gleamConditional Conditional 80highlight link gleamConstant Constant 81highlight link gleamDebug Debug 82highlight link gleamException Exception 83highlight link gleamFloat Float 84highlight link gleamFunction Function 85highlight link gleamIdentifier Identifier 86highlight link gleamInclude Include 87highlight link gleamKeyword Keyword 88highlight link gleamNumber Number 89highlight link gleamOperator Operator 90highlight link gleamPreProc PreProc 91highlight link gleamSpecial Special 92highlight link gleamSpecialComment SpecialComment 93highlight link gleamStorageClass StorageClass 94highlight link gleamString String 95highlight link gleamTodo Todo 96highlight link gleamType Type 97 98" vim: sw=2 sts=2 et