junegunn / fzf.vim

fzf :heart: vim
MIT License
9.66k stars 584 forks source link

How to change the Rg preview window color scheme? #1317

Closed gor-bit closed 3 years ago

gor-bit commented 3 years ago

On my terminal (iTerm2), the current color scheme of the default Rg preview window currently makes the line numbers very difficult to read. The screenshot below shows what this looks like using the Vim minimal configuration.

I'd like to update the Rg preview window (I believe it uses bat) to use the base64 color scheme.

i.e. Set bat --theme=base16 instead of the current bat.

How can I update the vim plugin to do this? I can't find where bat is called anywhere within the code.

Thanks!

Screen Shot 2021-08-22 at 11 31 48 pm
savchenko commented 3 years ago

Add '--preview', 'bat --some_bat_parameter' to the fzf#vim#grep options. fzf_opt_rg in the example below:

command! -bang -nargs=* Rg call fzf#vim#grep(fzf_cmd_rg .shellescape(<q-args>), 1, fzf#vim#with_preview({'options': fzf_opt_rg}), <bang>0)
junegunn commented 3 years ago

Put export BAT_THEME=base16 in your shell configuration file or let $BAT_THEME = 'base16' in your Vim configuration file.