Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProjectGrep unreadable with light themes #24

Closed
NicolaiRuckel opened this issue Feb 7, 2020 · 6 comments
Closed

ProjectGrep unreadable with light themes #24

NicolaiRuckel opened this issue Feb 7, 2020 · 6 comments

Comments

@NicolaiRuckel
Copy link

When using :FzfPreviewProjectGrep with a light theme the text is barely readable (see screenshot).
Manually editing bin/preview_fzf_grep to use another colorscheme fixes that issue. Maybe a global theme option for using bat would be nice.
Screenshot from 2020-02-07 15-48-49

@metalelf0
Copy link

@NicolaiRuckel you can also do :let g:fzf_preview_command = 'bat --color=always --style=grid --theme=GitHub {-1}', as stated in the readme. Sub GitHub with any light theme of your choice.

@NicolaiRuckel
Copy link
Author

NicolaiRuckel commented Feb 7, 2020

Thank you for your suggestion. I did this but for FzfPreviewProjectGrep the corresponding option is let g:fzf_preview_grep_preview_cmd and its default value is expand('<sfile>:h:h') . '/bin/preview_fzf_grep'. I tried to replace it with bat but this gives some errors.

@metalelf0
Copy link

Hmm, right. Guess we'll need to wait for a fix then ;)

@NicolaiRuckel
Copy link
Author

NicolaiRuckel commented Feb 7, 2020

Maybe the base16 theme would be a more sensible default?
See sharkdp/bat#490

Actually, it doesn’t work even if you set your terminal colors in nvim.

@yuki-yano
Copy link
Owner

One workaround is to copy and rewrite the preview script to an executable location.
Set the path to g:fzf_preview_grep_preview_cmd and preview with the modified script.

I may remove the theme specification from the preview script.
In that case, you can use any theme by setting the BAT_THEME environment variable.
let $BAT_THEME = 'GitHub'

@NicolaiRuckel
Copy link
Author

That is actually a very good suggestion. I’ll do that. Thank you very much. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants