diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/vim/ftdetect/build.vim | 1 | ||||
-rw-r--r-- | support/vim/ftplugin/build.vim | 24 | ||||
-rw-r--r-- | support/vim/syntax/build.vim | 70 |
3 files changed, 95 insertions, 0 deletions
diff --git a/support/vim/ftdetect/build.vim b/support/vim/ftdetect/build.vim new file mode 100644 index 0000000..8419934 --- /dev/null +++ b/support/vim/ftdetect/build.vim | |||
@@ -0,0 +1 @@ | |||
au BufRead,BufNewFile *.bld set filetype=build | |||
diff --git a/support/vim/ftplugin/build.vim b/support/vim/ftplugin/build.vim new file mode 100644 index 0000000..6b24838 --- /dev/null +++ b/support/vim/ftplugin/build.vim | |||
@@ -0,0 +1,24 @@ | |||
1 | " Vim filetype plugin file | ||
2 | " Language: Build | ||
3 | |||
4 | " Only do this when not done yet for this buffer | ||
5 | if exists("b:did_ftplugin") | ||
6 | finish | ||
7 | endif | ||
8 | |||
9 | " Don't load another plugin for this buffer | ||
10 | let b:did_ftplugin = 1 | ||
11 | |||
12 | " Set format options -- allow comment formatting with gq, but disable | ||
13 | " other processing | ||
14 | setlocal fo-=tcrowan2 fo+=q | ||
15 | |||
16 | " Set 'comments' to be the same as C/C++ | ||
17 | setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// | ||
18 | |||
19 | " Win32 can filter files in the browse dialog | ||
20 | if has("gui_win32") && !exists("b:browsefilter") | ||
21 | let b:browsefilter = "Build files (*.bld)\t*.bld\n" . | ||
22 | \ "All Files (*.*)\t*.*\n" | ||
23 | endif | ||
24 | |||
diff --git a/support/vim/syntax/build.vim b/support/vim/syntax/build.vim new file mode 100644 index 0000000..ae83d94 --- /dev/null +++ b/support/vim/syntax/build.vim | |||
@@ -0,0 +1,70 @@ | |||
1 | " Vim syntax file | ||
2 | " Language: Buildscript | ||
3 | " Maintainer: Mike Buland :) | ||
4 | " Last Change: 2009 Dec 4 | ||
5 | |||
6 | " For version 5.x: Clear all syntax items | ||
7 | " For version 6.x: Quit when a syntax file was already loaded | ||
8 | if version < 600 | ||
9 | syntax clear | ||
10 | elseif exists("b:current_syntax") | ||
11 | finish | ||
12 | endif | ||
13 | |||
14 | " Keywords | ||
15 | syn keyword Conditional if then else | ||
16 | syn keyword Loop for do in | ||
17 | syn keyword Logic not and or | ||
18 | syn keyword Statement include set unset function target input condition requires rule profile auto config display type default cache global value return output allow action warning error notice local continue break all export tag | ||
19 | syn keyword Todo TODO FIXME XXX | ||
20 | syn keyword Type int string bool float version | ||
21 | syn keyword Constant null true false file never always important normal hidden autogenerated filetime | ||
22 | syn keyword Builtins files dirs matches replace regexp execute unlink exists getMakeDeps toString targets fileName dirName | ||
23 | |||
24 | syn match TargetProcess /[a-zA-Z_][a-zA-Z0-9_]*:/he=e-1 | ||
25 | |||
26 | syn cluster CommentGroup contains=Todo | ||
27 | |||
28 | syn match Special display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" | ||
29 | syn match Special display contained "\\\(u\x\{4}\|U\x\{8}\)" | ||
30 | |||
31 | " TODO: do we want to end at end of line too? | ||
32 | syn region doubleString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=Special,CmdEx | ||
33 | |||
34 | syn region CmdEx start=+$(+ skip=+"\|\\)\|\\\\+ end=+)+ | ||
35 | |||
36 | syn case ignore | ||
37 | syn match Numbers display transparent "\<\d\|\.\d" contains=Number,Float,OctalError,Octal | ||
38 | syn match Number display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" | ||
39 | " Hex | ||
40 | syn match Number display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" | ||
41 | syn match Octal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero | ||
42 | syn match OctalZero display contained "\<0" | ||
43 | syn match Float display contained "\d\+f" | ||
44 | syn match Float display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" | ||
45 | syn match Float display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" | ||
46 | syn match Float display contained "\d\+e[-+]\=\d\+[fl]\=\>" | ||
47 | " Flag bad digits in octal | ||
48 | syn match OctalError display contained "0\o*[89]\d*" | ||
49 | syn case match | ||
50 | |||
51 | |||
52 | syn region cppComment start="#" skip="\\$" end="$" contains=@CommentGroup keepend | ||
53 | syn region cComment start="/\*" end="\*/" contains=@CommentGroup fold | ||
54 | syn region cppComment start="//" skip="\\$" end="$" contains=@CommentGroup keepend | ||
55 | |||
56 | |||
57 | syntax region Block start="{" end="}" transparent fold | ||
58 | |||
59 | hi def link OctalError Error | ||
60 | hi def link cComment Comment | ||
61 | hi def link cppComment Comment | ||
62 | hi def link singleString String | ||
63 | hi def link doubleString String | ||
64 | hi def link cmdEx String | ||
65 | hi def link Constructor Operator | ||
66 | hi def link Logic Statement | ||
67 | hi def link Loop Conditional | ||
68 | hi def link Builtins Function | ||
69 | hi def link TargetProcess Type | ||
70 | |||