- Description
- File detection
- Syntax highlighting
- Indentation
- Linting
- Snippets
- Additional functionality
- License
This is a Vim plugin that provides file detection, syntax highlighting, proper indentation, code snippets and more for the Vala programming language.
The base version has been imported directly from the official site.
Some of the features displayed in the above images are listed below.
Automatic detection of .vala, .vapi and .valadoc files.
- Methods: any word followed by
( - Lambda expressions:
(...) => - Arrays, lists and hash tables as in
Array<int>,List<string>andHashTable<string, int> - Operators and Delimiters:
+,-,*,/,=,( ),[ ],{ }... - String formatting in
printf-like methods:%d,%f,%s,%c,%u,%%... - String templates:
@"$var1 = $(var2 * var3)"
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:
- Method arguments spanning multiple lines.
- Code Attributes such as
CCode,DBus, etc. - Lambda expressions, like those used inside a
foreachmethod.
Linting is left to dedicated plugins. For example, ALE supports vala-lint out of the box. For compiler errors and completion, use vala-language-server with an LSP client.
Useful snippets with UltiSnips:
try catchstatements.for,foreach,whileloops.if elsestatements.switch casestatements.class,property,signaldefinitions.- Documentation using Valadoc taglets.
- Many more!
This plugin also comes with helper functions to:
- Adhere to the Vala Coding Style.
- Insert
CCodeattributes for the symbol below the cursor, useful when creating Vala Legacy Bindings.
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>
endThis plugin is distributed under the terms of the GNU General Public License version 3 or later (GPL-3.0-or-later). See the LICENSE file for the full license text.

