Closed j4g0 closed 1 year ago
I've also had this issue! I installed the package separately from polygot
and my file had only php syntax highlighting - @j4g0 's solution fixed it for me however!
Same problem. Simply added this line to my local .vimrc:
autocmd BufRead,BufNewFile *.blade.php set filetype=blade
Same problem. Simply added this line to my local .vimrc:
autocmd BufRead,BufNewFile *.blade.php set filetype=blade
Thank you. It works well!
thanks, but not why I need to add syntax=blade
for me to make it work
augroup file_blade_php
autocmd BufRead,BufNewFile *.blade.php setlocal ts=2 sts=2 sw=2 filetype=blade syntax=blade expandtab
augroup END
It shouldn't be necessary to add this configuration yourself. If the plugin was installed correctly, the ftdetect/blade.vim file will handle setting the filetype to 'blade'.
If this isn't working for you, you can debug where the filetype was last set using :verbose set ft?
.
I got vim-blade as part of sheerun/vim-polyglot which I installed via vundle on Linux Mint 18 Sarah 64 bit. The syntax works fine but I have to manually set it since vim does not seem to recognize viewname.blade.php as a blade file but as php. My airline as well as the set filetype? command say so. My workaround so far (thx to romainl) is an autocommand in my vimrc:
augroup blade autocmd! autocmd BufNewFile,BufRead *.blade.php set filetype=blade augroup END
but since no one else mentioned it as an issue so far, is was wondering where I could have screwed up during installation :)