annotate runtime/ftplugin.vim @ 11057:c90359f0e639

Added tag v8.0.0417 for changeset 679c12064dbc9990e693b8ff45be6c2a7749f4ae
author Christian Brabandt <cb@256bit.org>
date Sun, 05 Mar 2017 14:45:04 +0100
parents 8cd729851562
children f37561549ec2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim support file to switch on loading plugins for file types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
4 " Last change: 2006 Apr 30
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 if exists("did_load_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 let did_load_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 augroup filetypeplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 au FileType * call s:LoadFTPlugin()
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
13
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 func! s:LoadFTPlugin()
230
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
15 if exists("b:undo_ftplugin")
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
16 exe b:undo_ftplugin
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
17 unlet! b:undo_ftplugin b:did_ftplugin
9281a51ca7a2 updated for version 7.0064
vimboss
parents: 36
diff changeset
18 endif
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
19
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
20 let s = expand("<amatch>")
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
21 if s != ""
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if &cpo =~# "S" && exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " In compatible mode options are reset to the global values, need to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " set the local values also when a plugin was already used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 unlet b:did_ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
27
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
28 " When there is a dot it is used to separate filetype names. Thus for
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
29 " "aaa.bbb" load "aaa" and then "bbb".
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
30 for name in split(s, '\.')
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
31 exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
d20041a02ee5 updated for version 7.0228
vimboss
parents: 230
diff changeset
32 endfor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 endfunc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 augroup END