3

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?

blueyed
  • 27,102
  • 4
  • 75
  • 71
teddy
  • 31
  • 3

3 Answers3

1

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
GhostCode
  • 578
  • 1
  • 8
  • 18
1

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

blueyed
  • 27,102
  • 4
  • 75
  • 71
0

You weren't clear on what editor you were looking for a plugin for (vim?).

There are a number of IDE's that support Smarty formatting. I personally use Netbeans (see Smarty plugin for NetBeans), but there are also PHP Storm, CodeLobster, and Aptana to name a few more.

Community
  • 1
  • 1
Paul DelRe
  • 4,003
  • 1
  • 24
  • 26
  • thank for the answer.Sorry for not describing it clear, the editor I use is VIM though. – teddy Sep 07 '11 at 06:25