René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
Filetype [VIM] | ||
:filetype on
The command
:filetype on basically sources $VIMRUNTIME/filetype.vim . Since syntax.vim has a line with :filetype on , $VIMRUNTIME/filetype.vim is also (implicetely) sourced
by doing a :syntax on .
filetype.vim checks if the global variable did_load_filetypes is set. If it is set, it won't source the file again, otherwise, it will set the variable.
It then sets up a lot of
au BufNewFile,BufRead *.some-extension setf some_filetype
Finally, it does a
runtime! ftdetect/*.vim
which allos to put filetype detection scripts under (for example) $RUNTIME\ftdetect
|