0

I am kind of new to VIM, i am still learning it. I would like to achive something like in most IDEs, to make VIM underline my mistakes with some color (red for example).

I found syntastic, because everyone recommends it. I installed it, it works "properly" i guess, but i dont see any error highlight, neither underline. I have the "default setting" stuff in my .vimrc:

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0

And i also added

let g:syntastic_enable_signs=1

Still no highlight, no underline on mistakes. I am usually coding in python, so that is what i would like to see:

class some_calass(self)
    self.somevar = 0

And to higligh/underline the "class" line, because i forget the ":" at the end.

If i use

:SyntasticCheck

I get the normal Syntastic window with the corresponding errors in a new split tab, and a "ruler" pops up in the left side with red ">>" markings at the error, however i would like to avoid them both, thats why i switched off the

let g:syntastic_check_on_open = 0

option. I would only like a highlight/underline function on the errors at all the time.

Thanks for the help!

Gábor Erdős
  • 3,599
  • 4
  • 24
  • 56

1 Answers1

3

The error is at the end of the class line, and syntastic does highlight a single character after the closing parenthesis. If you want the entire line highlighted you can do something like this:

highlight link SyntasticErrorLine error
highlight link SyntasticWarningLine todo

Syntastic doesn't care about the contents of your files, only the external checkers do. Not all of these checkers return enough information for syntastic to highlight errors in a meaningful way, and even when they do, syntastic doesn't know how to parse all information that might be relevant. Most of the time syntastic will highlight only a single character as above, or nothing at all. You can make the signs (that is, the things in the gutter margin) highlight the lines they're placed on if you like, that's a Vim feature, but that doesn't make the information about the errors any more precise than syntastic has it.

See :h syntastic-error-signs and :h syntastic-highlighting for details about what you can tweak.

lcd047
  • 5,731
  • 2
  • 28
  • 38
  • Thanks a lot! As far as i see then the problem might be with the external checker. I have flake8 installed. Can you suggest any external python checker that might work? I dont see any highlighting btw, even if i write something lie "asdasdasdkj" which should not be accepted in a python file i guess :) – Gábor Erdős Nov 26 '15 at 11:33
  • @GáborErdős You don't seem to understand what I wrote above. All checkers work, it's your expectation that is unrealistic. The `highlight link` trick above is the best you can do. – lcd047 Nov 26 '15 at 11:43