Search code examples
editorsyntax-highlightingvalacode-editor

Editor with syntax highlighting for Vala


I am trying to get an editor with syntax highlighting for Vala code. So far I have tried:

  • Vim
  • Sublime Text
  • Visual Studio Code
  • Notepad++

None of these highlight my text. I have found this list which says that three of the above support highlighting for Vala. So how do do I get them to highlight? Or if I can't what can I use instead (I don't really want to download each one in turn to find out).


Solution

  • The list you point to, https://wiki.gnome.org/Projects/Vala/Tools#Editors, is meant to be an up to date list for the Vala community. The table on that page has Yes indicated for each editor that has syntax highlighting. Some of the Yes entries have links through to pages with more information. For example the Yes link for Vim has detailed instructions for setting up syntax highlighting.

    Vim

    Vim has very good support provided by https://github.com/arrufat/vala.vim There are even some nice screenshots in the README.md for that repository.

    For Vim it depends on the plugin manager you are using. For example if you are using vim-plug add the following line to ~/.vimrc:

    Plug 'arrufat/vala.vim'
    

    There are more details on the Coding in Vala with the Vim Text Editor on the Wiki. A page linked to from the Vala Tools page.

    Visual Studio Code

    Syntax highlighting is provided by https://github.com/thiagoabreu/vala-code

    In VS Code you open the extension tab by clicking on the square within a square like symbol and type 'Vala'. The extension will come up in the list and you can install it.

    There is a page on the Vala wiki dedicated to Coding in Vala with Visual Studio Code.

    Sublime Text

    Syntax highlighting is provided by https://packagecontrol.io/packages/Vala

    Again this is linked to from the Tools page on the Wiki.

    Notepad++

    I don't know anything about that.

    In General

    In general a lot of editors have generated their syntax highlighting from TextMate language bundles, including Visual Studio Code and Sublime Text. If you wish to work on syntax highlighting then more details, with more links, are given on the Vala Tools wiki page.