简体   繁体   中英

How do i fix this minor indent issue with vim?

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

这有帮助吗?

:setfiletype html.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM