1Description="vimscript" 2 3-- Syntax file created by Max Christian Pohle 4 5 6Categories = {"script", "config"} 7 8Digits = [[ (?:[0-9])(?:0x|0X|0b)[0-9a-fA-F']+|#?\d*[\.]?\d+(?:[eE][\-\+]\d+)?[lLuU]* ]] 9 10Keywords={ 11 { Id=1, 12 List={ "call", "set", "let", "au", "if", "endif", "else", "has", 13 "autocmd", "augroup", "end", "function", "while", "endwhile", "endfunction"}, 14 }, 15 { Id=2, 16 List= { "filetype", "ft", "syntax", "colorscheme" } 17 }, 18 { Id=3, 19 Regex=[[[nvxsoilc]n?o?remap|\&\w+]] 20 }, 21 { Id=4, 22 Regex=[[(\w+)\s*\(]] 23 } 24} 25 26Strings = { 27 Delimiter=[[']], 28 29 DelimiterPairs= { 30 { Open=[["(?=.*")]], Close=[["]] } 31 } 32} 33 34Comments = { 35 { 36 Block=false, 37 Nested=false, 38 Delimiter = { [[ ^"|"(?!.*")]] } 39 } 40} 41 42IgnoreCase=true 43 44Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\.|\:|\&|<|>|\!|=|\/|\*|\%|\+|\-|\~|\||\^]] 45 46function OnStateChange(oldState, newState, token) 47 48 if newState==HL_STRING then 49 openDelim=token 50 end 51 52 if oldState==HL_STRING and token==openDelim then 53 openDelim = nil 54 return HL_STRING_END 55 end 56 57 return newState 58end 59