Vim normally sets the current filetype automatically and very accurately at that. In some cases though, such as when you're starting a file from scratch, it doesn't know the filetype. In these cases, you can set the filetype manually.
:set filetype=perl
:set filetype=php
:set filetype=python
etc...
Friday, December 12, 2008
Subscribe to:
Post Comments (Atom)
4 comments:
Even shorter!
:set ft=perl
...or...
:setf perl
Be warned that :setf won't change 'ft' if it has already been set to something else.
Also, if you start a new file with the name and extension you intent to call it, vim will set the filetype for you.
And how can I get the value of filetype? (If it's possible, of course.)
To see the current filetype:
:set filetype
Post a Comment