How to jump/display the column of an error

409 views Asked by At

To check the syntax of my python scripts I am using the syntastic vim plugin with pylint as checker.

Is there a way to not only display or highlight the line where an error occurs but the column/exact position of this error too?

I used a vim syntax checker plugin in the past which shows me an error while typing. So I knew exactly where an error occurs. Now I'm an old man and can't remember of this plugin... ;-(

1

There are 1 answers

6
Ingo Karkat On BEST ANSWER

Syntastic stores the errors in the location list window. You can use :lopen to show it, and then use commands like :ll (or <Enter>) to jump to the error under the cursor. Alternatively, you can also navigate through errors via :lnext and related commands.

If the corresponding error message did come with a column (i.e. the error looks like filename|42 col 7| error message), the cursor will be positioned there.

pylint and error columns

Syntastic gets the information from external checkers, pylint in your case. Based on this question, pylint currently did not support reporting of columns, only lines (but you could try out the patch mentioned in the answer).

But with recent versions of both pylint and Syntastic, this should work out-of-the-box!