vim-polyglot/syntax/blade.vim

50 lines
1.8 KiB
VimL
Raw Normal View History

if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
2016-01-22 03:08:00 -05:00
" Vim syntax file
" Language: Blade (Laravel)
2014-11-10 20:37:21 -05:00
" Maintainer: Jason Walton <jwalton512@gmail.com>
2016-01-22 03:08:00 -05:00
" Filenames: *.blade.php
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
if exists('b:current_syntax')
2014-08-12 18:10:32 -04:00
finish
endif
2016-01-22 03:08:00 -05:00
if !exists("main_syntax")
let main_syntax = 'blade'
endif
runtime! syntax/html.vim
unlet! b:current_syntax
2014-08-12 18:10:32 -04:00
runtime! syntax/php.vim
2016-01-22 03:08:00 -05:00
unlet! b:current_syntax
syn case match
syn clear htmlError
syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @include @each @inject @extends @section @unless nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @stop @append @endsection containedin=ALLBUT,@bladeExempt
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
syn cluster bladePhp contains=@phpClTop
syn cluster bladeExempt contains=bladeComment,@htmlTop
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
syn keyword bladeTodo todo fixme xxx contained
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
hi def link bladeDelimiter PreProc
2014-11-10 20:37:21 -05:00
hi def link bladeComment Comment
2016-01-22 03:08:00 -05:00
hi def link bladeTodo Todo
hi def link bladeKeyword Statement
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
let b:current_syntax = 'blade'
2014-08-12 18:10:32 -04:00
2016-01-22 03:08:00 -05:00
if exists('main_syntax') && main_syntax == 'blade'
unlet main_syntax
2014-11-10 20:37:21 -05:00
endif
endif