1 " Vim support file to switch on loading plugins for file types
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last change: 2006 Apr 30
6 if exists("did_load_ftplugin")
9 let did_load_ftplugin = 1
11 augroup filetypeplugin
12 au FileType * call s:LoadFTPlugin()
14 func! s:LoadFTPlugin()
15 if exists("b:undo_ftplugin")
17 unlet! b:undo_ftplugin b:did_ftplugin
20 let s = expand("<amatch>")
22 if &cpo =~# "S" && exists("b:did_ftplugin")
23 " In compatible mode options are reset to the global values, need to
24 " set the local values also when a plugin was already used.
28 " When there is a dot it is used to separate filetype names. Thus for
29 " "aaa.bbb" load "aaa" and then "bbb".
30 for name in split(s, '\.')
31 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'