annotate runtime/syntax/syntax.vim @ 5723:bcb24ef20b88

Added tag v7-4-206 for changeset 7e826028d399
author Bram Moolenaar <bram@vim.org>
date Wed, 19 Mar 2014 12:37:22 +0100
parents 3fc0f57ecb91
children 367439b95aba
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 syntax support file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Last Change: 2001 Sep 04
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " This file is used for ":syntax on".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " It installs the autocommands and starts highlighting for all buffers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if !has("syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " If Syntax highlighting appears to be on already, turn it off first, so that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " any leftovers are cleared.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 if exists("syntax_on") || exists("syntax_manual")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 so <sfile>:p:h/nosyntax.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Load the Syntax autocommands and set the default methods for highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 runtime syntax/synload.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Load the FileType autocommands if not done yet.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if exists("did_load_filetypes")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 let s:did_ft = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 filetype on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 let s:did_ft = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Set up the connection between FileType and Syntax autocommands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " This makes the syntax automatically set when the file type is detected.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 augroup syntaxset
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 au! FileType * exe "set syntax=" . expand("<amatch>")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 augroup END
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Execute the syntax autocommands for the each buffer.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " If the filetype wasn't detected yet, do that now.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Always do the syntaxset autocommands, for buffers where the 'filetype'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " already was set manually (e.g., help buffers).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 doautoall syntaxset FileType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 if !s:did_ft
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 doautoall filetypedetect BufRead
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 endif