This page describes how to add Vala syntax highlighting and valac error parsing/navigation support to vim


  • Download the Vala syntax highlight definition for Vim: vala.vim

  • Create the Vim local directory under your home with:

mkdir -p $HOME/.vim/syntax
mkdir -p $HOME/.vim/ftdetect
  • Copy the vala.vim file there:

cp vala.vim $HOME/.vim/syntax/vala.vim
  • Create a new file $HOME/.vim/ftdetect/vala.vim with these 2 lines:

autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala


  • The syntax file additionally supports following options in ~/.vimrc

" Disable valadoc syntax highlight
"let vala_ignore_valadoc = 1

" Enable comment strings
let vala_comment_strings = 1

" Highlight space errors
let vala_space_errors = 1
" Disable trailing space errors
"let vala_no_trail_space_error = 1
" Disable space-tab-space errors
let vala_no_tab_space_error = 1

" Minimum lines used for comment syncing (default 50)
"let vala_minlines = 120

Projects/Vala/Vim (last edited 2013-12-08 05:46:48 by KoalaYeung)