Closed mvolkmann closed 7 years ago
Hi, I also have written a colorscheme to avoid this situation :).
I have added this to the FAQ now: https://github.com/w0rp/ale#faq-change-signs
@liuchengxu do you mind sharing how you got those red and yellow dots using your colorscheme? I like the colorscheme I am currently using, but would love to add those dots to it.
@joaqo Very simple. As mentioned in https://github.com/w0rp/ale#faq-change-signs , what you need to do is to change the default signs in your .vimrc:
let g:ale_sign_error = '•'
let g:ale_sign_warning = '•'
Concerning the colors, you can customize them to your personal taste.
hi link ALEErrorSign Error
hi link ALEWarningSign Warning
Hey @liuchengxu thanks for the answer! Sorry to bother you again, but when I run:
hi link ALEErrorSign Error
hi link ALEWarningSign Warning
For some reason the background of the icon turns red and the icon turns black, which is kind of the inverse of what I was hoping for, very weird. Do you have any idea of how could I be messing this up?
@joaqo Check the current highlight setting via :verbose hi ALEErrorSign
. In my case, it says:
:verbose hi ALEErrorSign
ALEErrorSign xxx links to Error
Last set from ~/.vim/plugged/space-vim-dark/colors/space-vim-dark.vim
next step, :verbose hi Error
:
:verbose hi Error
Error xxx cterm=bold ctermfg=160 ctermbg=235 gui=bold guifg=#e0211d
Last set from ~/.vim/plugged/space-vim-dark/colors/space-vim-dark.vim
Based on 256-xterm-24bit-rgb-color-chart, I can see the colors are all expected. In terms of your problem, I think you should take a look at cterm option of Error. Does it have been set as cterm=inverse
?
:verbose hi ALEErrorSign
looks the same as yours, but :verbose hi Error
looked like this:
:verbose hi Error
Error xxx term=reverse cterm=bold,reverse ctermfg=167 ctermbg=235 gui=bold,reverse guifg=#fb4934 guibg=bg
Last set from ~/.vim/plugged/gruvbox/colors/gruvbox.vim
So it seems there is some wierd configs going on in my color theme gruvbox. Tweaked things a bit and ended up using,
hi link ALEErrorSign GruvboxRed
hi link ALEWarningSign GruvboxYellow
cause I couldn't get bothered deciphering where the reverse came from. This might help anyone else using gruvbox and works great. @liuchengxu thanks for the help!
@joaqo Glad you have figured it out.
The reverse comes from cterm=bold,reverse gui=bold,reverse
in the highlight setting of Error. If someone still wants to fix the reverse issue, just override cterm
and gui
option with reverse
removed:
hi link ALEErrorSign Error
hi link ALEWarningSign Warning
hi Error cterm=bold gui=bold
hi Warning cterm=bold gui=bold
For the case of gruvbox, it's simpler to use joaqo's solution: GruvboxRed
and GruvboxYellow
.
Just to add, if you want to avoid linking colors defined by your colorscheme
(like Error or Warning) and don't want to redefine Error or Warning, you can define ALEErrorSign and ALEWarningSign colors yourself like so:
let g:ale_sign_error = "â—‰"
let g:ale_sign_warning = "â—‰"
highlight ALEErrorSign ctermfg=9 ctermbg=15 guifg=#C30500 guibg=#F5F5F5
highlight ALEWarningSign ctermfg=11 ctermbg=15 guifg=#ED6237 guibg=#F5F5F5
gui
sets gvim
and cterm
sets vim
fg
, bg
set the 'foreground' and 'background' colors respectively
Nice settings. I'm going to use those myself. It's a pity I can't make the signs prettier by default. You can't really make any assumptions about what characters someone's font might support, etc.
hi @w0rp! glad you like it 🙂
💟 thanks for the amazing plugin!! It's really great.
Just to add, if you want to avoid linking colors defined by your
colorscheme
(like Error or Warning) and don't want to redefine Error or Warning, you can define ALEErrorSign and ALEWarningSign colors yourself like so:let g:ale_sign_error = "â—‰" let g:ale_sign_warning = "â—‰" highlight ALEErrorSign ctermfg=9 ctermbg=15 guifg=#C30500 guibg=#F5F5F5 highlight ALEWarningSign ctermfg=11 ctermbg=15 guifg=#ED6237 guibg=#F5F5F5
gui
setsgvim
andcterm
setsvim
fg
,bg
set the 'foreground' and 'background' colors respectively
@her When I override ctermfg/ctermbg, it just removes the colors, but it doesn't use the colors of the provided number. I end up with a default fg/bg of what my terminal is using. What am I missing? I'm using base16 Solarized Dark terminal wide. Does that change the behaviour of how I reference colors with numbers?
Hi, there. I followed @her 's setting, but I got a half circle,
If I using gVim
I got a small circle,
How could I get the effect like @her ?
Worked with konsole 19.04.
@her When I override ctermfg/ctermbg, it just removes the colors, but it doesn't use the colors of the provided number. I end up with a default fg/bg of what my terminal is using. What am I missing? I'm using base16 Solarized Dark terminal wide. Does that change the behaviour of how I reference colors with numbers?
Me too. The only 2 ways to made it works were :
The output of :verbose hi ALEWarningSign
varry...
ALEWarningSign xxx cleared
ALEWarningSign xxx links to Todo Modifié la dernière fois dans ~/.vim/bundle/ale/autoload/ale/sign.vim ligne 36
ALEWarningSign xxx ctermfg=11 ctermbg=8 guifg=#ED6237 guibg=#F5F5F5 Modifié la dernière fois dans ~/.vimrc ligne 144
Maybe we should open another issues for it ? (sorry if it is not the right place)
EDIT : It will be useful to add this settings in the FAQ with the other highlights
let g:ale_change_sign_column_color = 1 highlight ALESignColumnWithErrors ctermfg=0 ctermbg=8 guifg=#A5A5A5 guibg=#F5F5F5 highlight ALESignColumnWithoutErrors ctermfg=0 ctermbg=0 guifg=#A5A5A5 guibg=#F5F5F5
@realestninja @Kingmk13
if there are already highlights for the group you need to use !
let g:ale_change_sign_column_color = 1
highlight! ALESignColumnWithErrors ctermfg=0 ctermbg=8 guifg=#A5A5A5 guibg=#F5F5F5
highlight! ALESignColumnWithoutErrors ctermfg=0 ctermbg=0 guifg=#A5A5A5 guibg=#F5F5F5
hope this helps! 🙃
Sorry for the late respond I was busy with other install/configs...
Thanks you @her, but it doesn't work. However I didn't know the trick with the !
. :smiley:
It only works if you put the settings in a fyletype (like c.vim or python.vim in .vim/after/ftplugins/) or if you enter the command. So apparently it needs ALE to be fully loaded to take effect.
To have my ALE's highlight group automatically customized for all fyletype, I used autocmd
in my .vimrc :
autocmd VimEnter * :let g:ale_change_sign_column_color = 1
autocmd VimEnter * :highlight! ALESignColumnWithErrors ctermfg=0 ctermbg=8 guifg=#A5A5A5 guibg=#F5F5F5
autocmd VimEnter * :highlight! ALESignColumnWithoutErrors ctermfg=0 ctermbg=0 guifg=#A5A5A5 guibg=#F5F5F5
autocmd VimEnter * :highlight! ALEErrorSign ctermfg=9 ctermbg=8 guifg=#C30500 guibg=#F5F5F5
autocmd VimEnter * :highlight! ALEWarningSign ctermfg=11 ctermbg=8 guifg=#ED6237 guibg=#F5F5F5
autocmd VimEnter * :highlight! ALEInfoSign ctermfg=14 ctermbg=8 guifg=#ED6237 guibg=#F5F5F5
autocmd VimEnter * :highlight! ALEError ctermfg=9 ctermbg=8 guifg=#C30500 guibg=#F5F5F5
autocmd VimEnter * :highlight! ALEWarning ctermfg=11 ctermbg=8 guifg=#ED6237 guibg=#F5F5F5
autocmd VimEnter * :highlight! ALEInfo ctermfg=14 ctermbg=8 guifg=#ED6237 guibg=#F5F5F5
I have the same problem with not being to set color when using a colorscheme, checking :verbose hi ALEWarningSign
gives me the output ALEWarningSign xxx cleared
.
I found out that this is a problem with the colorscheme config and its location in vimrc
. I use haishanh/night-owl.vim; one of the settings is hi clear
, and because I load the colorscheme after I set the settings for ALE, the highlights I set earlier get cleared out. Setting the colorscheme options before setting the highlight colors for ALE fix this problem for me.
Checking several other popular colorschemes like Monokai, Dracula or Gruvbox, they all first set hi clear
, so I assume most colorschemes have this setting and I'm commenting here for anyone who has the same problem.
To remove the gutter background color, add this to .vimrc:
This is especially useful when using emojis for error and warning signs that are configured like this: