blob: d4bccfc1474920122e671330d45b80bfd2f383d1 [file] [log] [blame]
Bram Moolenaar822ff862014-06-12 21:46:14 +02001" Vim syntax file
2" Language: Kivy
Corey Prophitt56e8ed62024-07-31 21:53:45 +02003" Maintainer: Corey Prophitt <corey@prophitt.me>
4" Last Change: Jul 31st, 2024
Bram Moolenaar822ff862014-06-12 21:46:14 +02005" Version: 1
Corey Prophitt56e8ed62024-07-31 21:53:45 +02006" URL: https://kivy.org/
Bram Moolenaar822ff862014-06-12 21:46:14 +02007
8if exists("b:current_syntax")
9 finish
10endif
11
12" Load Python syntax first (Python can be used within Kivy)
13syn include @pyth $VIMRUNTIME/syntax/python.vim
14
15" Kivy language rules can be found here
Corey Prophitt56e8ed62024-07-31 21:53:45 +020016" https://kivy.org/doc/stable/guide/lang.html
Bram Moolenaar822ff862014-06-12 21:46:14 +020017
18" Define Kivy syntax
19syn match kivyPreProc /#:.*/
Riley Bruins8906e222024-07-07 20:53:04 +020020syn match kivyComment /#[^:].*/
Bram Moolenaar822ff862014-06-12 21:46:14 +020021syn match kivyRule /<\I\i*\(,\s*\I\i*\)*>:/
22syn match kivyAttribute /\<\I\i*\>/ nextgroup=kivyValue
23
24syn region kivyValue start=":" end=/$/ contains=@pyth skipwhite
25
26syn region kivyAttribute matchgroup=kivyIdent start=/[\a_][\a\d_]*:/ end=/$/ contains=@pyth skipwhite
27
28hi def link kivyPreproc PreProc
29hi def link kivyComment Comment
30hi def link kivyRule Function
31hi def link kivyIdent Statement
32hi def link kivyAttribute Label
33
34let b:current_syntax = "kivy"
35
36" vim: ts=8