Closed lucasgrvarela closed 9 months ago
Do you have bat installed on your system? Because the previewer will use it if it's available and you can customize the colors of it by setting BAT_THEME
.
An example config:
colo gruvbox
set background=light
let $BAT_THEME = 'gruvbox-light'
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
And this is what it looks like:
@junegunn I don't have.
$ bat
bash: bat: command not found
minimal vimrc with only fzf and gruvbox and the same configurations as you:
let mapleader = " "
nnoremap <leader>e :E<CR>
nnoremap <leader>f :Files<CR>
nnoremap <leader>g :RG<CR>
nnoremap <leader>s :G<CR>
nnoremap <leader><space> :Buffers<CR>
set clipboard=unnamedplus
call plug#begin('~/.vim.plugged')
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'morhetz/gruvbox'
call plug#end()
colo gruvbox
set background=light
let $BAT_THEME = 'gruvbox-light'
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
Result:
In this case do you believe there is something wrong in my side/my terminal anything like that?
I installed BAT to test the configs, this is the result:
$ bat --version
bat 0.23.0 (871abd2)
Tried to use different terminals, like alacritty and kitty same result.. I saw this https://sw.kovidgoyal.net/kitty/faq/#using-a-color-theme-with-a-background-color-does-not-work-well-in-vim and gave it a try, then the colors changed a bit they are more readable but still not ok.
Using a different vim version also changed the colors.. (now with my original vimrc)
$ /usr/bin/vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 04 2023 10:24:44)
Included patches: 1-1378, 1499
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
The last screenshot clearly shows that the configs are picked up. Can you double-check if they are properly set?
:echo $BAT_THEME
:echo g:fzf_colors
:echo fzf#wrap()
(you should see some color codes if g:fzf_colors
is set)&termguicolors
set? :echo &termguicolors
$ vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 4 2023 09:48:24)
Included patches: 1-1976
Thank you for the help in the end updating the vim for the latest version, plus installing bat and setting it to let $BAT_THEME = 'gruvbox-light'
worked!
Tested with and without g:fzf_colors and in both cases it is working fine now.
man fzf
)I tried to define g:fzf_colors and FZF_DEFAULT_OPTS --color options, none of them worked. Looks like all the Light themes are broken with the Preview text always in White color no matter what I define. My end goal is to get Gruvbox Light Medium working but I tried all the defaults vim color schemes and the polar.vim, in all the cases the Light versions are broken while the Dark versions are Ok.
I could do a workaround defining the preview-bg to something like a dark color like #282828 so dark bg on white text works but then I have a very bad and ugly preview that doesn't match at all my theme. The desired behaviour is to have the original bg color #fbf1c7 from gruvbox light theme being used in the preview-bg and be able to read the text/code.
Not sure if one default color is being defined wrong in the code or anything like that. I disabled all my plugins and the behavior was the same.