Vala syntax files updated.

This commit is contained in:
Kolan Sh 2012-12-28 16:44:18 +04:00
parent 12186b573b
commit 19c3492a6f
3 changed files with 10 additions and 35 deletions

View File

@ -3,8 +3,7 @@
" Maintainers: Emmanuele Bassi <ebassi@gnome.org> " Maintainers: Emmanuele Bassi <ebassi@gnome.org>
" Hans Vercammen <hveso3@gmail.com> " Hans Vercammen <hveso3@gmail.com>
" pancake <pancake@nopcode.org> " pancake <pancake@nopcode.org>
" Sebastian Reichel <sre@ring0.de> " Last Change: 2009-10-28
" Last Change: 2012-02-19
" Filenames: *.vala *.vapi " Filenames: *.vala *.vapi
" "
" REFERENCES: " REFERENCES:
@ -14,9 +13,6 @@
" - validate code attributes " - validate code attributes
" - better error checking for known errors " - better error checking for known errors
" - full support for valadoc " - full support for valadoc
"
" add vala in /usr/share/vim/vim73/scripts.vim below ruby
" to have shebang support
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@ -72,7 +68,7 @@ if exists("vala_comment_strings")
syn cluster valaCommentStringGroup contains=valaCommentString,valaCharacter,valaNumber syn cluster valaCommentStringGroup contains=valaCommentString,valaCharacter,valaNumber
syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaComment2String,valaCharacter,valaNumber,valaSpaceError,@Spell syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaComment2String,valaCharacter,valaNumber,valaSpaceError,@Spell
syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell extend fold syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell extend
if !exists("vala_ignore_valadoc") if !exists("vala_ignore_valadoc")
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell
endif endif
@ -83,17 +79,6 @@ else
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,valaCommentStartError,valaSpaceError,@Spell syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,valaCommentStartError,valaSpaceError,@Spell
endif endif
endif endif
syn region valaPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1
syn match valaPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
" Comment if 0 blocks (ported from c.vim)
if !exists("vala_no_if0")
syn region valaCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=valaCppOut2 fold
syn region valaCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=valaSpaceError,valaCppSkip
syn region valaCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=valaSpaceError,valaCppSkip
endif
" match comment errors " match comment errors
syntax match valaCommentError display "\*/" syntax match valaCommentError display "\*/"
syntax match valaCommentStartError display "/\*"me=e-1 contained syntax match valaCommentStartError display "/\*"me=e-1 contained
@ -141,9 +126,6 @@ else
endif endif
exec "syn sync ccomment valaComment minlines=" . b:vala_minlines exec "syn sync ccomment valaComment minlines=" . b:vala_minlines
" code folding
syn region valaBlock start="{" end="}" transparent fold
" The default highlighting. " The default highlighting.
hi def link valaType Type hi def link valaType Type
hi def link valaStorage StorageClass hi def link valaStorage StorageClass
@ -184,14 +166,6 @@ hi def link valaNumber Number
hi def link valaUnicodeNumber SpecialChar hi def link valaUnicodeNumber SpecialChar
hi def link valaUnicodeSpecifier SpecialChar hi def link valaUnicodeSpecifier SpecialChar
hi def link valaPreCondit PreCondit
if !exists("vala_no_if0")
hi def link valaCppSkip valaCppOut
hi def link valaCppOut2 valaCppOut
hi def link valaCppOut Comment
endif
let b:current_syntax = "vala" let b:current_syntax = "vala"
let &cpo = s:vala_cpo_save let &cpo = s:vala_cpo_save

4
.vim/ftdetect/vala.vim Normal file
View File

@ -0,0 +1,4 @@
au BufRead *.vala set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead *.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead,BufNewFile *.vala setf vala
au BufRead,BufNewFile *.vapi setf vala

3
.vimrc
View File

@ -170,9 +170,6 @@ let g:clang_complete_auto = 1
let g:clang_complete_copen = 1 let g:clang_complete_copen = 1
" ------- Vala -------- " ------- Vala --------
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
" Disable valadoc syntax highlight " Disable valadoc syntax highlight
"let vala_ignore_valadoc = 1 "let vala_ignore_valadoc = 1