Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i fix this minor indent issue with vim?

Tags:

vim

macvim

If I have :setf html everything works as expected in the below example (the indentation matches up).

say however, i have the following code (note the indent before the code), except i have it on :setf php.

the | is the cursor

       <div class="sig">|</div> 

If I hit enter, it does this

       <div class="sig">
|</div> 

Because 99% of the time im editing php there is html in the template file, i find it kind of annoying to switch.

I feel like there must be a way for vim to read markers and perhaps have multiple filetypes in one document (just like if setf=html it could maybe read the style tags or an inline style tag and 'know' that that little snippet in the "" is a css filetype

like image 205
Tallboy Avatar asked May 10 '12 23:05

Tallboy


1 Answers

Does this help?

:setfiletype html.php
like image 129
Greg Sexton Avatar answered Oct 02 '22 05:10

Greg Sexton