Mercurial > ec-dotfiles
annotate vendor/vim-syntax/blade.vim @ 619:7045cd713864
Simpler variable
author | nanaya <me@nanaya.pro> |
---|---|
date | Mon, 09 Jul 2018 16:08:46 +0900 |
parents | b305f2ce5f88 |
children | 11e00204fb18 |
rev | line source |
---|---|
589 | 1 " Vim syntax file |
2 " Language: Blade (Laravel) | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
3 " Maintainer: Jason Walton <jwalton512@gmail.com> |
589 | 4 " Filenames: *.blade.php |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
5 |
589 | 6 if exists('b:current_syntax') |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
7 finish |
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
8 endif |
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
9 |
589 | 10 if !exists("main_syntax") |
11 let main_syntax = 'blade' | |
12 endif | |
13 | |
14 runtime! syntax/html.vim | |
15 unlet! b:current_syntax | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
16 runtime! syntax/php.vim |
589 | 17 unlet! b:current_syntax |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
18 |
589 | 19 syn case match |
20 syn clear htmlError | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
21 |
589 | 22 if has('patch-7.4.1142') |
595 | 23 syn iskeyword @,48-57,_,192-255,@-@,: |
589 | 24 else |
25 setlocal iskeyword+=@-@ | |
26 endif | |
27 | |
28 syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend | |
29 syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend | |
30 syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
31 |
595 | 32 syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include |
33 \ @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue | |
612 | 34 \ @unset @lang @choice @component @slot @prepend @json @isset @auth @guest @switch @case @includeFirst @empty |
595 | 35 \ nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt |
36 | |
612 | 37 syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @endforelse @endwhile @endcan |
595 | 38 \ @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim @endcomponent |
612 | 39 \ @endslot @endprepend @endisset @endempty @endauth @endguest @endswitch |
595 | 40 \ containedin=ALLBUT,@bladeExempt |
41 | |
42 if exists('g:blade_custom_directives') | |
43 exe "syn keyword bladeKeyword @" . join(g:blade_custom_directives, ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt" | |
44 endif | |
45 if exists('g:blade_custom_directives_pairs') | |
46 exe "syn keyword bladeKeyword @" . join(keys(g:blade_custom_directives_pairs), ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt" | |
47 exe "syn keyword bladeKeyword @" . join(values(g:blade_custom_directives_pairs), ' @') . " containedin=ALLBUT,@bladeExempt" | |
48 endif | |
49 | |
50 syn region bladePhpRegion matchgroup=bladeKeyword start="\<@php\>\s*(\@!" end="\<@endphp\>" contains=@bladePhp containedin=ALLBUT,@bladeExempt keepend | |
51 syn match bladeKeyword "@php\ze\s*(" nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt | |
589 | 52 |
53 syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
54 |
589 | 55 syn cluster bladePhp contains=@phpClTop |
595 | 56 syn cluster bladeExempt contains=bladeComment,bladePhpRegion,bladePhpParenBlock,@htmlTop |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
57 |
595 | 58 syn cluster htmlPreproc add=bladeEcho,bladeComment,bladePhpRegion |
589 | 59 |
595 | 60 syn case ignore |
61 syn keyword bladeTodo todo fixme xxx note contained | |
589 | 62 |
63 hi def link bladeDelimiter PreProc | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
64 hi def link bladeComment Comment |
589 | 65 hi def link bladeTodo Todo |
66 hi def link bladeKeyword Statement | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
67 |
589 | 68 let b:current_syntax = 'blade' |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
69 |
589 | 70 if exists('main_syntax') && main_syntax == 'blade' |
71 unlet main_syntax | |
538
f5b6dba3308b
Add syntax highlight for blade (laravel).
edogawaconan <me@myconan.net>
parents:
diff
changeset
|
72 endif |