Neomake: Coloring of errors at the end of lines

Created on 28 Mar 2019  路  4Comments  路  Source: neomake/neomake

I recently updated Neomake and found it now places errors at the end of your current line. Pretty awesome. I'm a little lost with the configuration of this feature. It would be great to be able to set the coloring of the text as it can be pretty distracting. Also, I didn't find a config setting for toggling it. Is it g:neomake_place_signs?

question

Most helpful comment

Ahh, so that's what it is. I'm using a theme called Mustang and these are my Error and Warning colors:

:hi Error
Error          xxx ctermfg=15 ctermbg=9 guifg=White guibg=Red
:hi WarningMsg
WarningMsg     xxx ctermfg=224 guifg=Red

I've configured my virtual text as such:

let g:neomake_virtualtext_prefix = ''
hi NeomakeVirtualtextError ctermbg=234 ctermfg=238
hi NeomakeVirtualtextWarning ctermbg=234 ctermfg=238

Makes it look like this:
Screenshot from 2019-03-29 10-48-17

This is what a warning looked like before I made any config changes:
Screenshot from 2019-03-29 09-51-10

Overall I really like the feature. Just took me by surprise and couldn't find any info about it.

Thanks much for the help. I'd suggest adding virtual text to the usage section of the Readme.

All 4 comments

This is virtualtext. The highlights are linked to existing ones, but you can set them yourself: https://github.com/neomake/neomake/blob/36c91c3b8f0f731b3ab6a3a01a9eb2e1be15ab86/autoload/neomake/virtualtext.vim#L109-L112

You can configure g:neomake_virtualtext_prefix and g:neomake_virtualtext_current_error to enable/disable it for now.

It is considered an experimental feature (only works with Neovim development version for now).

Related issue: https://github.com/neomake/neomake/issues/2336

I think it should also be possible to configure this per buffer/tab at least, and I've experimented a bit with hiding it when going to / coming from insert mode.

Feedback about enhancements is appreciated, of course.

Closing this for now, but please follow up.

I'd be interested in how it looks for you, what colorscheme you are using, and what :hi Error, :hi WarningMsg gives you.

Ahh, so that's what it is. I'm using a theme called Mustang and these are my Error and Warning colors:

:hi Error
Error          xxx ctermfg=15 ctermbg=9 guifg=White guibg=Red
:hi WarningMsg
WarningMsg     xxx ctermfg=224 guifg=Red

I've configured my virtual text as such:

let g:neomake_virtualtext_prefix = ''
hi NeomakeVirtualtextError ctermbg=234 ctermfg=238
hi NeomakeVirtualtextWarning ctermbg=234 ctermfg=238

Makes it look like this:
Screenshot from 2019-03-29 10-48-17

This is what a warning looked like before I made any config changes:
Screenshot from 2019-03-29 09-51-10

Overall I really like the feature. Just took me by surprise and couldn't find any info about it.

Thanks much for the help. I'd suggest adding virtual text to the usage section of the Readme.

FWIW, I love the idea of this feature, but the default colors in (at least solarized8) were way too prominent out of the box. I wasn't able to get changes to them to stick, so I reluctantly disabled this.

That said, I realize that virtualtext is still a new thing and everyone is figuring out the best way to use / configure them. As a suggestion, the approach that https://github.com/tveskag/nvim-blame-line took for colouring 'just worked' out of the box and seems to do so (to this vim script novice, at least) by sidestepping the issue of configurability entirely.

Thanks for a superb plugin!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

towry picture towry  路  5Comments

pengowen123 picture pengowen123  路  6Comments

treyhunner picture treyhunner  路  3Comments

cycomanic picture cycomanic  路  3Comments

sirex picture sirex  路  6Comments