Vim has support for many filetypes. If it detects that a file is of a certain filetype, then syntax highlighting and indenting rules of that filetype are applied to the file.
If you have a new file extension that you want to associate with an existing filetype, that is easy to do in Vim. For example, to associate files of type
.foo with the filetype
.html, add this line to your
autocmd BufRead,BufNewFile *.foo set filetype=html
- The list of filetypes known to your Vim can be found as described here.
- Make sure that
filetype onis already done before this line in the
For more info, try
:help new-filetype in your Vim 🙂
Tried with: Vim 7.4 and Ubuntu 14.04