From 4935f02217e81d1ee674645517d30947fc750e3f Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 13 Aug 2014 00:10:32 +0200 Subject: [PATCH] Add blade support, closes #34 --- build | 1 + ftdetect/polyglot.vim | 1 + indent/blade.vim | 12 ++++++++++++ syntax/blade.vim | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 indent/blade.vim create mode 100644 syntax/blade.vim diff --git a/build b/build index a4c29b3..d53a94a 100755 --- a/build +++ b/build @@ -67,6 +67,7 @@ concat_ftdetect() { PACKS=" arduino:sudar/vim-arduino-syntax + blade:xsbeats/vim-blade c++11:octol/vim-cpp-enhanced-highlight c/c++:vim-jp/cpp-vim c-extensions:kergoth/aftersyntaxc.vim diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 0cdbebc..26103a5 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1,4 +1,5 @@ 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 *.coffee set filetype=coffee autocmd BufNewFile,BufRead *Cakefile set filetype=coffee diff --git a/indent/blade.vim b/indent/blade.vim new file mode 100644 index 0000000..73550fb --- /dev/null +++ b/indent/blade.vim @@ -0,0 +1,12 @@ +" Language: Blade (Laravel) +" Maintainer: xsbeats +" 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 diff --git a/syntax/blade.vim b/syntax/blade.vim new file mode 100644 index 0000000..a02b88a --- /dev/null +++ b/syntax/blade.vim @@ -0,0 +1,35 @@ +" Language: Blade (Laravel) +" Maintainer: xsbeats +" 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="\([@|{]\)\@