From a6b0efd5301406adb44dfb12bfc73cf40f28b55b Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 10 Oct 2015 17:15:29 +0200 Subject: Add glsl and kotlin languages, fixes #72, #71 --- syntax/kotlin.vim | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 syntax/kotlin.vim (limited to 'syntax/kotlin.vim') diff --git a/syntax/kotlin.vim b/syntax/kotlin.vim new file mode 100644 index 00000000..e3d3f079 --- /dev/null +++ b/syntax/kotlin.vim @@ -0,0 +1,103 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1 + +" Vim syntax file +" Language: Kotlin +" Maintainer: Alexander Udalov +" Latest Revision: 1 October 2015 + +if exists("b:current_syntax") + finish +endif + +let b:current_syntax = "kotlin" + +syn keyword ktStatement break continue return +syn keyword ktConditional if else when +syn keyword ktRepeat do for while +syn keyword ktOperator as in is by +syn keyword ktKeyword get set out super this This where +syn keyword ktException try catch finally throw + +syn keyword ktInclude import package + +syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit +syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic +syn keyword ktStructure class object interface fun val var constructor init +syn keyword ktTypedef typealias + +syn keyword ktBoolean true false +syn keyword ktConstant null + +syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix + +syn keyword ktTodo TODO FIXME XXX contained +syn match ktLineComment "//.*$" contains=ktTodo,@Spell +syn region ktComment matchgroup=ktCommentMatchGroup start="/\*" end="\*/" contains=ktComment,ktTodo,@Spell + +syn match ktSpecialCharError "\v\\." contained +syn match ktSpecialChar "\v\\([tbnr'"$\\]|u\x{4})" contained +syn region ktString start='"' skip='\\"' end='"' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError +syn region ktString start='"""' end='"""' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError +syn match ktCharacter "\v'[^']*'" contains=ktSpecialChar,ktSpecialCharError +syn match ktCharacter "\v'\\''" contains=ktSpecialChar +syn match ktCharacter "\v'[^\\]'" + +" TODO: highlight label in 'this@Foo' +syn match ktAnnotation "\v(\w)@" + + + +hi link ktStatement Statement +hi link ktConditional Conditional +hi link ktRepeat Repeat +hi link ktOperator Operator +hi link ktKeyword Keyword +hi link ktException Exception + +hi link ktInclude Include + +hi link ktType Type +hi link ktModifier StorageClass +hi link ktStructure Structure +hi link ktTypedef Typedef + +hi link ktBoolean Boolean +hi link ktConstant Constant + +hi link ktTodo Todo +hi link ktLineComment Comment +hi link ktComment Comment +hi link ktCommentMatchGroup Comment + +hi link ktSpecialChar SpecialChar +hi link ktSpecialCharError Error +hi link ktString String +hi link ktCharacter Character + +hi link ktAnnotation Identifier +hi link ktLabel Identifier + +hi link ktSimpleInterpolation Identifier +hi link ktComplexInterpolationBrace Identifier + +hi link ktNumber Number +hi link ktFloat Float + +hi link ktExclExcl Special +hi link ktArrow Structure + +endif -- cgit v1.2.3