Add blade support, closes #34

This commit is contained in:
Adam Stankiewicz 2014-08-13 00:10:32 +02:00
parent 438d222b95
commit 4935f02217
4 changed files with 49 additions and 0 deletions

1
build
View File

@ -67,6 +67,7 @@ concat_ftdetect() {
PACKS=" PACKS="
arduino:sudar/vim-arduino-syntax arduino:sudar/vim-arduino-syntax
blade:xsbeats/vim-blade
c++11:octol/vim-cpp-enhanced-highlight c++11:octol/vim-cpp-enhanced-highlight
c/c++:vim-jp/cpp-vim c/c++:vim-jp/cpp-vim
c-extensions:kergoth/aftersyntaxc.vim c-extensions:kergoth/aftersyntaxc.vim

View File

@ -1,4 +1,5 @@
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
autocmd BufRead,BufNewFile *.blade.php set filetype=blade
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn setlocal filetype=clojure autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn setlocal filetype=clojure
autocmd BufNewFile,BufRead *.coffee set filetype=coffee autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee autocmd BufNewFile,BufRead *Cakefile set filetype=coffee

12
indent/blade.vim Normal file
View File

@ -0,0 +1,12 @@
" Language: Blade (Laravel)
" Maintainer: xsbeats <jwalton512@gmail.com>
" URL: http://github.com/xsbeats/vim-blade
" License: WTFPL
if exists("b:did_indent")
finish
endif
runtime! indent/html.vim
let b:did_indent = 1

35
syntax/blade.vim Normal file
View File

@ -0,0 +1,35 @@
" Language: Blade (Laravel)
" Maintainer: xsbeats <jwalton512@gmail.com>
" URL: http://github.com/xsbeats/vim-blade
" License: WTFPL
if exists("b:current_syntax")
finish
endif
runtime! syntax/html.vim
unlet b:current_syntax
runtime! syntax/php.vim
unlet b:current_syntax
syn match bladeConditional /@\(choice\|each\|elseif\|extends\|for\|foreach\|if\|include\|lang\|section\|unless\|while\|yield\)\>\s*/ nextgroup=bladeParenBlock containedin=ALLBUT,bladeComment
syn match bladeKeyword /@\(else\|endfor\|endforeach\|endif\|endsection\|endunless\|endwhile\|overwrite\|parent\|show\|stop\)\>/ containedin=ALL,bladeComment
syn region bladeCommentBlock start="{{--" end="--}}" contains=bladeComment keepend containedin=TOP
syn match bladeComment /.*/ contained containedin=bladeCommentBlock
syn region bladeEchoUnescaped matchgroup=bladeEchoDelim start="\([@|{]\)\@<!{{\(--\)\@!" end="}}" contains=@phpClInside containedin=ALLBUT,bladeComment
syn region bladeEchoEscaped matchgroup=bladeEchoDelim start="\(@\)\@<!{{{" end="}}}" contains=@phpClInside containedin=ALLBUT,bladeComment
syn cluster bladeStatement contains=bladeConditional,bladeKeyword
syn region bladeParenBlock start="(" end=")" contained oneline contains=bladeParenBlock,@phpClInside,@bladeStatement extend keepend
hi def link bladeComment Comment
hi def link bladeConditional Conditional
hi def link bladeKeyword Keyword
hi def link bladeEchoDelim Delimiter
let b:current_syntax = 'blade'