Я открыл vim
без загрузки ничего:Почему `filetype on` не определяет тип файла в vim?
vim -V -u NONE
И набрали одну строку:
<?xml?>
После запуска:
:unlet did_load_filetypes
:filetype on
проверить тип файла текущего буфера:
:set ft?
Он печати filetype=
Если я печатаю
:unlet did_load_filetypes
:filetype detect
затем :set ft?
напечатает filetype=xml
.
В VIM документ:
Detail: The ":filetype on" command will load one of these files:
Amiga $VIMRUNTIME/filetype.vim
Mac $VIMRUNTIME:filetype.vim
MS-DOS $VIMRUNTIME\filetype.vim
RiscOS Vim:Filetype
Unix $VIMRUNTIME/filetype.vim
VMS $VIMRUNTIME/filetype.vim
This file is a Vim script that defines autocommands for the
BufNewFile and BufRead events. If the file type is not found by the
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
contents of the file.
различия То, что между :filetype on
и :filetype detect
?
Спасибо за помощь.