Mercurial > vim
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 |
rev | line source |
---|---|
7 | 1 " Vim syntax support file |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
3356 | 3 " Last Change: 2012 Feb 11 |
7 | 4 |
5 " This file sets up for syntax highlighting. | |
6 " It is loaded from "syntax.vim" and "manual.vim". | |
7 " 1. Set the default highlight groups. | |
8 " 2. Install Syntax autocommands for all the available syntax files. | |
9 | |
10 if !has("syntax") | |
11 finish | |
12 endif | |
13 | |
14 " let others know that syntax has been switched on | |
15 let syntax_on = 1 | |
16 | |
17 " Set the default highlighting colors. Use a color scheme if specified. | |
18 if exists("colors_name") | |
19 exe "colors " . colors_name | |
20 else | |
21 runtime! syntax/syncolor.vim | |
22 endif | |
23 | |
24 " Line continuation is used here, remove 'C' from 'cpoptions' | |
25 let s:cpo_save = &cpo | |
26 set cpo&vim | |
27 | |
28 " First remove all old syntax autocommands. | |
29 au! Syntax | |
30 | |
31 au Syntax * call s:SynSet() | |
32 | |
33 fun! s:SynSet() | |
34 " clear syntax for :set syntax=OFF and any syntax name that doesn't exist | |
35 syn clear | |
36 if exists("b:current_syntax") | |
37 unlet b:current_syntax | |
38 endif | |
39 | |
40 let s = expand("<amatch>") | |
41 if s == "ON" | |
42 " :set syntax=ON | |
43 if &filetype == "" | |
44 echohl ErrorMsg | |
45 echo "filetype unknown" | |
46 echohl None | |
47 endif | |
48 let s = &filetype | |
49 endif | |
50 | |
51 if s != "" | |
782 | 52 " Load the syntax file(s). When there are several, separated by dots, |
53 " load each in sequence. | |
54 for name in split(s, '\.') | |
55 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim" | |
56 endfor | |
7 | 57 endif |
58 endfun | |
59 | |
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 | 62 au Syntax c,cpp,cs,idl,php |
22 | 63 \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax) |
64 \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax) | |
856 | 65 \ | runtime! syntax/doxygen.vim |
22 | 66 \ | endif |
67 | |
68 | |
7 | 69 " Source the user-specified syntax highlighting file |
70 if exists("mysyntaxfile") && filereadable(expand(mysyntaxfile)) | |
71 execute "source " . mysyntaxfile | |
72 endif | |
73 | |
74 " Restore 'cpoptions' | |
75 let &cpo = s:cpo_save | |
76 unlet s:cpo_save |