jwalton512 / vim-blade

Vim syntax highlighting for Blade templates.
225 stars 37 forks source link

Indent issue #28

Closed jrean closed 8 years ago

jrean commented 9 years ago

Hi,

I have a problem with indentation on *.blade.php files. I was using this trick based on the following issue https://github.com/xsbeats/vim-blade/issues/1

autocmd BufNewFile,BufRead *.blade.php set ft=html | set ft=phtml | set ft=blade " Fix blade auto-indent
@foreach ($articles as $article)
   <h1>{{ $article->title }}</h1>
   <p>{{ $article->content }}</p>#
|
@endforeach

When it should be

@foreach ($articles as $article)
   <h1>{{ $article->title }}</h1>
   <p>{{ $article->content }}</p>#
   |
@endforeach

The following command outputs:

:set ft?
filtetype=blade

How to solve it?

Regards,

clarkbarz commented 9 years ago

I'm having the same issue. The fix that was used for #1, #3, and #5 isn't working for me. However, I'm having some luck using the simple indent/blade.vim file that @abackstrom committed in #3. Maybe that should be used as the starting point for building out a more comprehensive indentation feature?

arthurvr commented 9 years ago

@xsbeats It would be freakin super unicorn awesome if you could fix this.

rendom commented 9 years ago

+1 on integrate indenting.

jwalton512 commented 9 years ago

@arthurvr @rendom unfortunately I don't really have the know how to implement any type of reliable indenting. I would encourage anyone that does have the knowledge to contribute.

rendom commented 9 years ago

A good start can be to include html indentation? https://github.com/rendom/vim-blade/blob/master/syntax/blade.vim#L15

jwalton512 commented 8 years ago

rebuilt from scratch. included indenting this time around. there will likely be some kinks to work out.

bx2 commented 8 years ago

@rendom, your quick-fix works just fine. Adding the basic HTML syntax solved all the issues for me (I've installed via rendom's fork).