aboutsummaryrefslogtreecommitdiff
path: root/support/vim
diff options
context:
space:
mode:
Diffstat (limited to 'support/vim')
-rw-r--r--support/vim/ftdetect/build.vim1
-rw-r--r--support/vim/ftplugin/build.vim24
-rw-r--r--support/vim/syntax/build.vim70
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
5if exists("b:did_ftplugin")
6 finish
7endif
8
9" Don't load another plugin for this buffer
10let b:did_ftplugin = 1
11
12" Set format options -- allow comment formatting with gq, but disable
13" other processing
14setlocal fo-=tcrowan2 fo+=q
15
16" Set 'comments' to be the same as C/C++
17setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
18
19" Win32 can filter files in the browse dialog
20if has("gui_win32") && !exists("b:browsefilter")
21 let b:browsefilter = "Build files (*.bld)\t*.bld\n" .
22 \ "All Files (*.*)\t*.*\n"
23endif
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
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14" Keywords
15syn keyword Conditional if then else
16syn keyword Loop for do in
17syn keyword Logic not and or
18syn 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
19syn keyword Todo TODO FIXME XXX
20syn keyword Type int string bool float version
21syn keyword Constant null true false file never always important normal hidden autogenerated filetime
22syn keyword Builtins files dirs matches replace regexp execute unlink exists getMakeDeps toString targets fileName dirName
23
24syn match TargetProcess /[a-zA-Z_][a-zA-Z0-9_]*:/he=e-1
25
26syn cluster CommentGroup contains=Todo
27
28syn match Special display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
29syn match Special display contained "\\\(u\x\{4}\|U\x\{8}\)"
30
31" TODO: do we want to end at end of line too?
32syn region doubleString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=Special,CmdEx
33
34syn region CmdEx start=+$(+ skip=+"\|\\)\|\\\\+ end=+)+
35
36syn case ignore
37syn match Numbers display transparent "\<\d\|\.\d" contains=Number,Float,OctalError,Octal
38syn match Number display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
39" Hex
40syn match Number display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
41syn match Octal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
42syn match OctalZero display contained "\<0"
43syn match Float display contained "\d\+f"
44syn match Float display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
45syn match Float display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
46syn match Float display contained "\d\+e[-+]\=\d\+[fl]\=\>"
47" Flag bad digits in octal
48syn match OctalError display contained "0\o*[89]\d*"
49syn case match
50
51
52syn region cppComment start="#" skip="\\$" end="$" contains=@CommentGroup keepend
53syn region cComment start="/\*" end="\*/" contains=@CommentGroup fold
54syn region cppComment start="//" skip="\\$" end="$" contains=@CommentGroup keepend
55
56
57syntax region Block start="{" end="}" transparent fold
58
59hi def link OctalError Error
60hi def link cComment Comment
61hi def link cppComment Comment
62hi def link singleString String
63hi def link doubleString String
64hi def link cmdEx String
65hi def link Constructor Operator
66hi def link Logic Statement
67hi def link Loop Conditional
68hi def link Builtins Function
69hi def link TargetProcess Type
70