Vim errorformat and ncvhdl

147 views Asked by At

I am trying to set up my Vim environment, to be able to compile VHDL code by using the Cadence VHDL Compiler (ncvhdl). However, my errorformat string is not working properly. A typical ncvhdl error line is:

ncvhdl_p: *E,EXPBEG (tc_lg_and2-rtl-a.vhd,3|34): expecting the
reserved word 'BEGIN' [1.2].

I am setting the errorformat to:

set errorformat=ncvhdl_p:\ *E\\,%m\ (%f\\,%l\|%c)

Any hints out there? Thanks!

1

There are 1 answers

1
Vitor On BEST ANSWER

This is what you want to do:

set errorformat=ncvhdl_p:\ \*%t\\,%.%#\ (%f\\,%l\\|%c):\ %m
  • The * character needs to be escaped.
  • Use %t to identify a single character indicating the error type (Error/Warning/Lint).
  • Use %.%# to skip a string, like .* in regular expressions.

For more information:

:help errorformat

The setting set makeprg=cat\ example.txt can be used as a quick way of testing the errorformat expression if example.txt contains a list of error lines copied from the command output.