vim-airline / vim-airline-themes

A collection of themes for vim-airline
MIT License
2.04k stars 349 forks source link

Bold text in cterm breaks the color in base16-vim #260

Closed henry-hsieh closed 2 years ago

henry-hsieh commented 2 years ago

environment

" base16 let base16colorspace=256 source ~/.vimrc_background

" Vim-airline let g:airline_theme='base16_shell'

- What is your airline configuration:
```vim
let g:airline_theme='base16_shell'

if you are using terminal:

actual behavior

The vim-airline uses bold texts on A and Z sections by default. Because I didn't turn on the termguicolors, the cterm=bold actually uses Brighter Black as foreground color in Normal mode even if the color code is Darker Black (ctermfg=0). The Brighter Black foreground makes the texts hard to read. My terminal color is set by base16-shell. The screenshots of airline and its highlight are shown in second figure and third figure. As you can see, airline_a_bold and airline_z_bold are set to bold and the foreground color is set to color 0 (Darker Black).

expected behavior

When I change to other mode, the issue is gone. The screenshots of airline and its highlight are shown in fourth figure and fifth figure. The airline_a_bold and airline_z_bold are set to bold and the foreground color is set to color 18 (the second most Darker Black in the scheme). This is because the color is set to base01 in visual mode's setting. In contrast, the color is set to base00 in normal mode's setting. As shown in sixth figure, the color code of base01 is 18, and the color code of base00 is 0. The first eight colors of palette have their bold colors (map to following eight colors). The bold color of base00 is base03, and the bold color of base01 is still base01. If I turn on the termguicolors, vim-airline directly uses the RGB color, the foreground color is set to base00.

screen shot (if possible)

1. Terminal color 2. Normal mode airline color 3. Normal mode airline highlight 4. Visual mode airline color 5. Visual mode airline highlight 6. Base 16 Tomorrow Night Scheme of base16-shell

chrisbra commented 2 years ago

you can try to remove the bold mode by using the accent=none (see the help)

henry-hsieh commented 2 years ago

you can try to remove the bold mode by using the accent=none (see the help)

Sorry, I don't see accent option in neovim or vim. Or we can remove cterm=bold in this line in vim-airline to achieve that. Another option is change the color of normal mode from base00 to base01 in base16-vim airline scheme.

chrisbra commented 2 years ago

Did you check the help for vim-airline? :h airline-accents (https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L1815)

henry-hsieh commented 2 years ago

Did you check the help for vim-airline? :h airline-accents (https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L1815)

Sorry, I didn't check that. After I add following setting in .vimrc, the problem is fixed. Thanks for your help!

call airline#parts#define_accent('mode', 'none')
call airline#parts#define_accent('linenr', 'none')
call airline#parts#define_accent('maxlinenr', 'none')
call airline#parts#define_accent('colnr', 'none')