Skip to content
vala-langPublic

About

Vala syntax highlighting, indentation, snippets and more for Vim

Topics

Resources

Stars

57 stars

Watchers

1 watching

Forks

Latest commit

 

History

85 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vala.vim

Description

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.

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

  • Methods: any word followed by (
  • Lambda expressions: (...) =>
  • Arrays, lists and hash tables as in Array<int>, List<string> and HashTable<string, int>
  • Operators and Delimiters: +, -, *, /, =, ( ), [ ], { }...
  • String formatting in printf-like methods: %d, %f, %s, %c, %u, %%...
  • String templates: @"$var1 = $(var2 * var3)"

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:

  • Method arguments spanning multiple lines.
  • Code Attributes such as CCode, DBus, etc.
  • Lambda expressions, like those used inside a foreach method.

Linting

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.

Snippets

Useful snippets with UltiSnips:

  • try catch statements.
  • for, foreach, while loops.
  • if else statements.
  • switch case statements.
  • class, property, signal definitions.
  • Documentation using Valadoc taglets.
  • Many more!

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

License

This 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.

About

Vala syntax highlighting, indentation, snippets and more for Vim

Topics

Resources

Stars

57 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages