Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

smarty autoindent html [closed]

Is there any plugin that I can use to auto indent html in "smarty" template. the way i do this in vim is like: while editing a smarty template: :set filetype=html

press "=G" after moving cursor to the head of file Is there a plugin for vim that can do this for me?

like image 592
teddy Avatar asked Mar 19 '26 05:03

teddy


2 Answers

For anyone who's still looking for an answer to this, simply add the following line to your vimrc:

au BufRead,BufNewFile *.tpl set filetype=html

The above will treat .tpl files as HTML. You can swap the values (tpl/html) for whatever other combination as well.

Once your file is open, just use this keystroke to indent:

gg=G
like image 116
GhostCode Avatar answered Mar 22 '26 05:03

GhostCode


This plugin handles indenting of HTML and PHP in Smarty templates: https://github.com/blueyed/smarty.vim

like image 42
blueyed Avatar answered Mar 22 '26 05:03

blueyed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!