annotate runtime/indent.vim @ 25600:096a366a921f

Added tag v8.2.3336 for changeset b85e44974a08e3bee9c6c10992c40bc95ed14354
author Bram Moolenaar <Bram@vim.org>
date Thu, 12 Aug 2021 21:15:04 +0200
parents 19ef2bbf569c
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 indent files 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>
1549
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
4 " Last Change: 2008 Feb 22
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_indent_on")
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_indent_on = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 augroup filetypeindent
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
12 au FileType * call s:LoadIndent()
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
13 func! s:LoadIndent()
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
14 if exists("b:undo_indent")
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
15 exe b:undo_indent
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
16 unlet! b:undo_indent b:did_indent
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
17 endif
1549
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
18 let s = expand("<amatch>")
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
19 if s != ""
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
20 if exists("b:did_indent")
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
21 unlet b:did_indent
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
22 endif
1549
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
23
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
24 " When there is a dot it is used to separate filetype names. Thus for
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
25 " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
26 for name in split(s, '\.')
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
27 exe 'runtime! indent/' . name . '.vim'
19ef2bbf569c updated for version 7.1-263
vimboss
parents: 233
diff changeset
28 endfor
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
29 endif
fca8a9b65afa updated for version 7.0065
vimboss
parents: 7
diff changeset
30 endfunc
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 augroup END