annotate runtime/syntax/synload.vim @ 3503:7e4428115d2c v7.3.514

updated for version 7.3.514 Problem: No completion for :history command. Solution: Add the completion and update the docs. Also fix ":behave" completion. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Mon, 30 Apr 2012 18:48:53 +0200
parents b37888de599c
children 1003f9b262d7
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>
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2518
diff changeset
3 " Last Change: 2012 Feb 11
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " This file sets up for syntax highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " It is loaded from "syntax.vim" and "manual.vim".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " 1. Set the default highlight groups.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " 2. Install Syntax autocommands for all the available syntax files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if !has("syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " let others know that syntax has been switched on
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 let syntax_on = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Set the default highlighting colors. Use a color scheme if specified.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if exists("colors_name")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 exe "colors " . colors_name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 runtime! syntax/syncolor.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Line continuation is used here, remove 'C' from 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 let s:cpo_save = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " First remove all old syntax autocommands.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 au! Syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 au Syntax * call s:SynSet()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 fun! s:SynSet()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " clear syntax for :set syntax=OFF and any syntax name that doesn't exist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 let s = expand("<amatch>")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 if s == "ON"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " :set syntax=ON
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 if &filetype == ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 echohl ErrorMsg
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 echo "filetype unknown"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 echohl None
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 let s = &filetype
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 if s != ""
782
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
52 " Load the syntax file(s). When there are several, separated by dots,
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
53 " load each in sequence.
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
54 for name in split(s, '\.')
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
55 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
d20041a02ee5 updated for version 7.0228
vimboss
parents: 164
diff changeset
56 endfor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
2518
87e49236d219 Also support Doxygen in C# files. (Andreas J. Beblik)
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
61 " Handle adding doxygen to other languages (C, C++, C#, IDL)
3356
b37888de599c Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2518
diff changeset
62 au Syntax c,cpp,cs,idl,php
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
63 \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
64 \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
856
8cd729851562 updated for version 7.0g
vimboss
parents: 782
diff changeset
65 \ | runtime! syntax/doxygen.vim
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
66 \ | endif
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
67
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
68
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " Source the user-specified syntax highlighting file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 if exists("mysyntaxfile") && filereadable(expand(mysyntaxfile))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 execute "source " . mysyntaxfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 " Restore 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 let &cpo = s:cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 unlet s:cpo_save