-
-
Notifications
You must be signed in to change notification settings - Fork 577
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
Suggestion: complete fzf_colors #581
Comments
cool !!! |
I also maintain a Vim theme, moonfly, which I have just FZF'ified in the last couple of days with the existing I also echo @trevordmiller statement, thanks to @junegunn for fzf and fzf.vim! :) |
@junegunn What do you think about this? I'm happy to submit a pull request if you could give me some guidance on how to contribute and add to |
Although I don't want to add more configuration options, I'll see if I can improve the consistency of the colors. Please note that most of those colors are extracted from the current color scheme, so you shouldn't be seeing completely random colors. Try switching color schemes and see if the colors adapt accordingly, if they don't, let me know. |
A few color hard-coded items I notice with fzf.vim:
Fixing those 2 items would solve all my issues with fzf.vim and my moonfly Vim theme. Lastly, thanks for fzf, it is wonderful. |
The numbers in the dictionary are not from 256-color code table. They are base color codes prefixed by echo -e "\x1b[31mRED"
echo -e "\x1b[41mON_RED"
# To use 256-color scheme, you need to prefix 38;5; and fzf.vim doesn't do it
echo -e "\x1b[38;5;31mNOT RED" And those colors are only used when fzf fails to extract colors from the current color scheme: " Try to extract LineNr color. If failed, use yellow (33)
s:yellow(" %4d ", "LineNr") As for blue colors in Ag, you can currently override the options by redefining the command like I suggested here: #454 (comment) But using blue and bright blue seems to make sense, and it works okay for my color scheme. |
Interesting with regards to the At least the 2nd suggestion was more useful 😃 I think this one fix should solve some of Trevor's issues, the |
Yeah, realized I also like the red pair, |
But an unintended pop? After reading your previous response more clearly I now understand why misinterpreted fix for The poping red did not look good in my theme, and likely Nova as well. Why not use P.S. I use Rg instead of Ag with fzf.vim, but that's not a discussion for here. |
I think you're confused. They are not different. echo -e "\x1b[38;5;1mred / \x1b[31msame red" |
Ok, I have done a quick play, the incorrect/non-theme blue color seen here in When I change the definition of I think this experience was why I said 30 should become 3, 31 becomes 1, etc. Now I am not sure about where the I know this is so pedantic, but having fzf integrate perfectly with Vim themes really does make a difference for the better. |
Oh, it seems like a bug. let s:ansi = {'black': 0, 'red': 1, 'green': 2, 'yellow': 3, 'blue': 4, 'magenta': 5, 'cyan': 6} Right? |
Actually, this is how it should be: diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim
index dfb5e54..d81f219 100644
--- a/autoload/fzf/vim.vim
+++ b/autoload/fzf/vim.vim
@@ -182,7 +182,7 @@ endfunction
function! s:ansi(str, group, default, ...)
let fg = s:get_color('fg', a:group)
let bg = s:get_color('bg', a:group)
- let color = s:csi(empty(fg) ? s:ansi[a:default] : fg, 1) .
+ let color = (empty(fg) ? s:ansi[a:default] : s:csi(fg, 1)) .
\ (empty(bg) ? '' : ';'.s:csi(bg, 0))
return printf("\x1b[%s%sm%s\x1b[m", color, a:0 ? ';1' : '', a:str)
endfunction
@@ -692,7 +692,7 @@ function! fzf#vim#grep(grep_command, with_column, ...)
\ 'column': a:with_column,
\ 'options': ['--ansi', '--prompt', capname.'> ',
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
- \ '--color', 'hl:68,hl+:110']
+ \ '--color', 'hl:4,hl+:12']
\}
function! opts.sink(lines)
return s:ag_handler(a:lines, self.column)
@@ -941,7 +941,7 @@ endfunction
" Marks
" ------------------------------------------------------------------
function! s:format_mark(line)
- return substitute(a:line, '\S', '\=s:yellow(submatch(0))', '')
+ return substitute(a:line, '\S', '\=s:yellow(submatch(0), "Number")', '')
endfunction
function! s:mark_sink(lines) |
Please update. |
Hello @junegunn, Sorry for my delayed response. Yes, I am very pleased with all the changes you have done in the last day or so. I no longer see any color issues with my Vim moonfly theme. From my perspective this is now a resolved issue. Hopefully @trevordmiller will confirm the same with his Nova theme. Many thanks, I genuinely appreciate the improvements you have implemented 👏 |
@junegunn @bluz71 I just upgraded to latest and tested and all of the situations from my screenshots have been fixed! Thank you so much. This marks 100% consistent colors for my theme 🎉. Y'all are awesome ❤️ Closing. |
I've added custom FZF colors to a Vim theme I maintain using the fzf color variables described in the docs like this:
This looks great with
:FZF
:But a few of the other commands have other colors that can't be customized and are out of place:
:Buffers
The green and yellows here:
:Ag
The blue here:
:Snippets
The blue here:
:Lines
The blue and purple here:
:BLines
The purple here:
:Marks
The blue here:
:Windows
The green and yellow here:
:History:
The yellow and green here:
:History/
The yellow and green here:
It would be great if
g:fzf_colors
keys could be provided for all of these colors consistently so I could replace all the colors that don't match the theme.I have latest fzf and fzf.vim and have reproduced with a minimal config.
Thank you so much for fzf and fzf.vim! They are fantastic :)
The text was updated successfully, but these errors were encountered: