Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Sep 132010
 

How to set the filetype in Vim

Answer:

When you created a new file by using the command vi, vim does not know the file type unless you save the file with a specific extension, e.g. test.c, or sometimes when the extension cannot be recognized by vim, you need to set the file type manually in command mode - pressing Esc + :

:set filetype=c

That is it.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>