📅 2015-Mar-19 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ filetype, vim ⬩ 📚 Archive
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 .vimrc
:
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 on
is already done before this line in the .vimrc
file.
For more info, try :help new-filetype
in your Vim 😊
Tried with: Vim 7.4 and Ubuntu 14.04