7
|
1 " Vim support file to switch on loading plugins for file types
|
|
2 "
|
|
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
|
230
|
4 " Last change: 2005 Mar 25
|
7
|
5
|
|
6 if exists("did_load_ftplugin")
|
|
7 finish
|
|
8 endif
|
|
9 let did_load_ftplugin = 1
|
|
10
|
|
11 augroup filetypeplugin
|
|
12 au FileType * call s:LoadFTPlugin()
|
|
13 func! s:LoadFTPlugin()
|
230
|
14 if exists("b:undo_ftplugin")
|
|
15 exe b:undo_ftplugin
|
|
16 unlet! b:undo_ftplugin b:did_ftplugin
|
|
17 endif
|
7
|
18 if expand("<amatch>") != ""
|
|
19 if &cpo =~# "S" && exists("b:did_ftplugin")
|
|
20 " In compatible mode options are reset to the global values, need to
|
|
21 " set the local values also when a plugin was already used.
|
|
22 unlet b:did_ftplugin
|
|
23 endif
|
|
24 runtime! ftplugin/<amatch>.vim ftplugin/<amatch>_*.vim ftplugin/<amatch>/*.vim
|
|
25 endif
|
|
26 endfunc
|
|
27 augroup END
|