Home

Awesome

vala.vim

Description

This is a Vim plugin that provides file detection, syntax highlighting, proper indentation, better Syntastic integration, code snippets and more for the Vala programming language.

The base version has been imported directly from the official site.

vala.vim - solarized dark vala.vim - solarized light

Some of the features displayed in the above images are listed below.

File detection

Automatic detection of .vala, .vapi and .valadoc files.

Syntax highlighting

Indentation

The indentation file is largely based on the rust.vim plugin, which is mainly a fix on top of cindent. It improves the indentation of:

Syntastic

The amazing Syntastic plugin already comes with support for Vala. One can make use of the following magic comments to specify particular packages and vapi directories, for example:

// modules: gio-2.0 gtk+-3.0
// vapidirs: vapi

However, I thought it would be useful to be able to specify which files should be compiled with the current one, as well as additional compiler flags, which will be passed to the valac compiler:

// sources: neededfile.vala
// flags: --enable-deprecated

Note that passing files like this, while convenient, is suboptimal, since their location is relative to the current working path.

Snippets

Useful snippets with UltiSnips:

Additional functionality

This plugin also comes with helper functions to:

You can bind them by adding these lines to your .vimrc:

if has("autocmd")
	autocmd FileType vala ValaCodingStyle
	autocmd FileType vala noremap <F8> :CCode<CR>
end