Skip to content

asterios-technologies/vim-asterios

Repository files navigation

vim-asterios

reviewdog

This repository contains ViM and NeoViM support for the following languages used when developing an ASTERIOS Application:

  • the PsyC (support of the .psy files, provided with SnipMate compatible snippets);
  • the KhiC (support of the .khic files);
  • the Bgt (support of the .bgt files);
  • the tak (support of the .tak files).

It also features an integration with ALE to provide linting of PsyC source files.

Installation

Use your favorite package manager to install this plug-in. vim-plug is recommended. Add the following to your vim configuration file:

Plug 'krono-safe/vim-asterios'

and then, after re-launching ViM, run:

:PlugInstall

PsyC Linting

Screenshot of a Gvim window showing a syntax error in a PsyC file

To enable linting of PsyC source files, you need the ALE plug-in. The linting is actually performed by running psyko module, thus you need to provide some configuration for the command to work. For example:

" local variable: root Krono-Safe installation directory
let s:ks_dir = 'C:\Program Files (x86)\Krono-Safe'

" full path to psyko.exe
let g:ast_psyko_path = s:ks_dir . '\psyko-8.10.2\bin\psyko.exe'

" default product is ksim, but you can override this if you want
" (let's not do that here, and leave this line commented out)
" let g:ast_product_name = 'power-mpc5777m-module'

" kernel-dir path (--kernel-dir argument)
let g:ast_kernel_dir = s:ks_dir . '\ksim-8.10.2'

For more information, see :help vim-asterios-psyc-lint.

JSON Configuration Files Linting and Autocompletion

Animated GIF of linting and autocompletion of an ASTERIOS JSON configuration file

Linting and autocompletion of JSON configuration files requires another plug-in: coc.nvim. Once you have installed it, install the JSON language server extension with:

:CocInstall coc-json

vim-asterios is then ready to take care of the rest of the configuration for you. Make sure that g:ast_product_name and g:ast_kernel_dir are correctly set, then run :AsteriosConfig in a buffer with your JSON configuration file to enable linting and autocompletion.

See :help vim-asterios-json-comp for more information.

Contributing

Please refer to the file CONTRIBUTING.md.

License

This repository is under the Apache-V2 license.