scripts.vim (866B)
1 " Vim support file to detect file types in scripts 2 " 3 " Maintainer: The Vim Project <https://github.com/vim/vim> 4 " Last Change: 2023 Aug 27 5 " Former Maintainer: Bram Moolenaar <Bram@vim.org> 6 7 " This file is called by an autocommand for every file that has just been 8 " loaded into a buffer. It checks if the type of file can be recognized by 9 " the file contents. The autocommand is in $VIMRUNTIME/filetype.vim. 10 11 12 " Bail out when a FileType autocommand has already set the filetype. 13 if did_filetype() 14 finish 15 endif 16 17 " Load the user defined scripts file first 18 " Only do this when the FileType autocommand has not been triggered yet 19 if exists("myscriptsfile") && filereadable(expand(myscriptsfile)) 20 execute "source " . myscriptsfile 21 if did_filetype() 22 finish 23 endif 24 endif 25 26 " The main code is in a compiled function for speed. 27 call dist#script#DetectFiletype()