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