Giter VIP home page Giter VIP logo

Comments (7)

junegunn avatar junegunn commented on June 2, 2024

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:

image

from fzf.vim.

lucasgrvarela avatar lucasgrvarela commented on June 2, 2024

@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:

image

In this case do you believe there is something wrong in my side/my terminal anything like that?

from fzf.vim.

lucasgrvarela avatar lucasgrvarela commented on June 2, 2024

I installed BAT to test the configs, this is the result:

$ bat --version
bat 0.23.0 (871abd2)

image

from fzf.vim.

lucasgrvarela avatar lucasgrvarela commented on June 2, 2024

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.

image

from fzf.vim.

lucasgrvarela avatar lucasgrvarela commented on June 2, 2024

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 [email protected]
Compiled by [email protected]

image

from fzf.vim.

junegunn avatar junegunn commented on June 2, 2024

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
  • Also, what is the output of :echo fzf#wrap() (you should see some color codes if g:fzf_colors is set)
  • Is &termguicolors set? :echo &termguicolors

from fzf.vim.

lucasgrvarela avatar lucasgrvarela commented on June 2, 2024

image

$ 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.

from fzf.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.