Mercurial > ec-dotfiles
comparison vendor/vim-syntax/blade.vim @ 538:f5b6dba3308b
Add syntax highlight for blade (laravel).
author | edogawaconan <me@myconan.net> |
---|---|
date | Mon, 05 Jan 2015 21:49:47 +0900 |
parents | |
children | a056f6920d8e |
comparison
equal
deleted
inserted
replaced
537:351bd965bc1f | 538:f5b6dba3308b |
---|---|
1 " Language: Blade | |
2 " Maintainer: Jason Walton <jwalton512@gmail.com> | |
3 " URL: https://github.com/xsbeats/vim-blade | |
4 " License: DBAD | |
5 | |
6 " Check if our syntax is already loaded | |
7 if exists('b:current_syntax') && b:current_syntax == 'blade' | |
8 finish | |
9 endif | |
10 | |
11 " Include PHP | |
12 runtime! syntax/php.vim | |
13 silent! unlet b:current_syntax | |
14 | |
15 " Echos | |
16 syn region bladeUnescapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{!!/ end=/!!}\s*/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment | |
17 syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{\@!/ end=/}}\s*/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment | |
18 syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{{\@!/ end=/}}}/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment | |
19 | |
20 " Structures | |
21 syn match bladeStructure /\s*@\(else\|empty\|endfor\|endforeach\|endforelse\|endif\|endpush\|endsection\|endunless\|endwhile\|overwrite\|show\|stop\)\>/ | |
22 syn match bladeStructure /\s*@\(append\|choice\|each\|elseif\|extends\|for\|foreach\|forelse\|if\|include\|lang\|push\|section\|stack\|unless\|while\|yield\|\)\>\s*/ nextgroup=bladeParens | |
23 syn region bladeParens matchgroup=bladeParen start=/(/ end=/)/ contained contains=@bladeAll,@phpClTop | |
24 | |
25 " Comments | |
26 syn region bladeComments start=/\s*{{--/ end=/--}}/ contains=bladeComment keepend | |
27 syn match bladeComment /.*/ contained containedin=bladeComments | |
28 | |
29 " Clusters | |
30 syn cluster bladeAll contains=bladeStructure,bladeParens | |
31 | |
32 " Highlighting | |
33 hi def link bladeComment Comment | |
34 hi def link bladeEchoDelim Delimiter | |
35 hi def link bladeParen Delimiter | |
36 hi def link bladeStructure Keyword | |
37 | |
38 | |
39 if !exists('b:current_syntax') | |
40 let b:current_syntax = 'blade' | |
41 endif |