How to manually set Vim's filetype?

Vim can detects the file types from quite well. But under certain situations, such as creating a new file, Vim does not automatically set the file type. How to manually set it?

asked Jan 22, 2016 by anonymous

1 Answer

In side Vim, to set a filetype, set value to the filetype variable. For example, to set the filetype to php:

:set filetype=php
answered Jan 23, 2016 by Eric Z Ma (44,280 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost