Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently work on a cms with .tpl files. It's mainly HTML so I would lile vim to understand that I want to use an "HTML complient" mode for autoindent.

When I type text, it works, but when I try gg=G, vim remove all tabs and spaces befor each line instead of making a clen indentation for my file.

I suppose there is something to put in my .vimrc but I don't know what.

Do you have any idea ?

share|improve this question

The indent files are located in the indentfolder where you have your vimfiles. On my machine (Windows) this is c:\Program Files\Vim\Vim73\indent.

You can try to copy html.vim to tpl.vimor maybe find some online to put there.

Disclaimer: I have not tries this my self.

share|improve this answer
I downloaded and copy the vim file to ftplugin/tpl/tpl.vim but while I have no errors, gg=G still remove leading spaces and tabs. – MARTIN Damien Dec 13 '11 at 12:59
According to the install instructions you should copy to the indentfolder - Unix: copy script to ~/.vim/indent Win: copy script to ~\vimfiles\indent – tidbeck Dec 13 '11 at 14:07
I currently use pathogen ( So, I moved the script to `C:\Program Files\Vim\vimfiles\bundle\autoindents\indent`. I duplicated html.vim to tpl.vim But as it works in HTML files, there is nothing more in TPL files. – MARTIN Damien Dec 13 '11 at 14:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.