PDA

View Full Version : Vim not formatting code



mongoose_za
December 6th, 2010, 06:03 PM
Hi there,

I'm on Ubuntu Maverick and just installed vim(7.2.330) via the repos.
I've also installed cream via the repos.

Launching vim via terminal I opened an html file.
I put in ESCgg=G. I've also tried ESCggVG=. On my windows machine these commands format the html nicely but is not working here on my linux. Any suggestions?

Btw if I use cream then the formatting works fine. But obviously I'd prefer to have this work in vim itself.


Thanks

DaithiF
December 6th, 2010, 06:25 PM
you need to tell vim to load indent expressions based on the type of file being edited.
add:

filetype indent on

to your .vimrc, restart vim, and it should then work.

mongoose_za
December 6th, 2010, 07:03 PM
That was quick and easy. Thanks a lot DaithiF.