Overview
VHDL-Tool's features are accessible from within Vim and NeoVim through an array of plugins.
NeoVim is a fork of Vim aimed at modernizing the codebase, improving performance and providing a better plugin API.
We strongly recomend using NeoVim instead of Vim so that you can take advantage of NeoVim's superior Language Server Protocol integration.
Whichever method you choose, first download the vhdl-tool binary and put it somewhere in your $PATH and create a configuration file at the root of your source directory.
Language server (NeoVim)
You can access VHDL-Tool's built in language server from within NeoVim with the LanguageClient-neovim plugin. This exposes all of the features of VHDL-Tool from within NeoVim.
Running
A NeoVim configuration file to get you started can be found here. This configuration file uses vim-plug. First, install it by following the instructions on the website.
You will also need to:
$ pip2 install neovim
$ pip3 install neovim
to get Python support in NeoVim. Then you will need to install the plugins. Run the command:
$ nvim +PlugInstall +UpdateRemotePlugins +qa
Then start NeoVim in a directory containing the YAML configuration file. Open a VHDL file and everything should work.
Use the :copen command to open the quickfix window containing the list of errors.
Language server (Vim)
You can also access VHDL-Tool's built in language server from within Vim, however, Vim's language server protocol support is not as robust or complete as NeoVim's.
Running
A NeoVim configuration file to get you started can be found here. This configuration file uses vim-plug. First, install it by following the instructions on the website.
You will need to install the plugins as above. Then start Vim in a directory containing the YAML configuration file.
Other Syntax, type checking and linting plugins
If you do not want to use NeoVim or the Language Server Protocol, there are other plugins to display error messages and warnings inline, like so:
Syntastic is one such plugin. Neomake also works well. Configuration for both plugins is described below. It is assumed that vim-plug is installed.
Syntastic
To install Syntastic, add the following lines to your vimrc/init.vim in the plugin section:
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/syntastic'
Plug 'http://git.vhdltool.com/vhdl-tool/syntastic-vhdl-tool'
call plug#end()
And, add the following to the end of your vimrc/init.vim:
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_vhdl_checkers = ['vhdltool']
Neomake
To install Neomake, add the following lines to your vimrc/init.vim in the plugin section:
call plug#begin('~/.vim/plugged')
Plug 'neomake/neomake'
call plug#end()
And, add the following to the end of your vimrc/init.vim:
let g:neomake_open_list = 2
autocmd! BufWritePost,BufRead * Neomake
let g:neomake_vhdl_vhdltool_maker = {
\ 'exe': 'vhdl-tool',
\ 'args': ['client', 'lint', '--compact'],
\ 'errorformat': '%f:%l:%c:%t:%m',
\ }
let g:neomake_vhdl_enabled_makers = ['vhdltool']
Running
Before you start Vim/NeoVim with your new configuration, make sure you start the VHDL-Tool server (note that this step is not necessary when using the language server):
$ vhdl-tool server &
$ nvim
If you would rather use a pre-existing configuration you can find a complete NeoVim configuration optimised for VHDL editing here and a minimal one that only includes VHDL-Tool specific functionality here.
Troubleshooting
Make sure vhdl-tool is configured properly by running vhdl-tool check-config in the directory containing the configuration file.
To troubleshoot your NwoVim configuration:
:CheckHealth