-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(highlights): add fzf-lua #79
base: main
Are you sure you want to change the base?
Conversation
We should probably mention in the README about this setting for generating highlights for fzf. require("fzf-lua").setup({ fzf_colors = true }) I've been using this plugin for a while now, but I just learned about this setting recently. 😀 |
Hey @ramojus, this PR has all the changes from the PR with blink. |
Hey, sorry for the delays, I'm quite busy lately. I'm just wondering if we really need to support this plugin? We have telescope, which is much more popular. Does this plugin have anything that telescope doesn't? |
Also just saw that this plugin has a |
Why Fzf-Lua
It looks like this. |
I was waiting for that one great! |
@ramojus I've removed variables |
local M = {} | ||
|
||
function M.set(hl, colors) | ||
hl.set("FzfLuaNormal", { bg = colors.dark_bg, fg = colors.fg3 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently there is no easy way to change normal bg
or preview bg
without changing a whole lot of highlight groups manually.
I think it's okay to use some variables for highlights as long as it offers readability and/or maintainability improvements. Here we could have a variable normal
for FzfLuaNormal
, this variable could then be reused in other highlight groups. Similarly we could have a variable preview_normal
.
A fine alternative would be to reuse FzfLuaNormal
and FzfLuaPreviewNormal
with linking and hl.get
function.
hl.set("FzfLuaPreviewNormal", { bg = hl.get("Normal").bg, fg = hl.get("Normal").fg }) | ||
hl.set("FzfLuaPreviewBorder", { bg = hl.get("Normal").bg, fg = hl.get("Normal").bg }) | ||
hl.set("FzfLuaPreviewTitle", { link = "FzfLuaTitle" }) | ||
hl.set("FzfLuaCursorLine", { bg = colors.bg2, fg = colors.fg2 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I would suggest: (normal
being FzfLuaNormal
)
local groups = require("mellifluous.highlights.custom_groups").get(colors)
hl.set("FzfLuaCursorLine", { bg = groups.MenuButtonSelected(normal.bg).bg, fg = normal.fg })
I don't think there's any reason to have lighter fg
for this group, keeping the same fg
as for other results will offer more consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, apparently, FzfLuaCursorLine
is intended for the preview window. I was confused about the naming convention and removed it.
hl.set("FzfLuaScrollFloatFull", { link = "FzfLuaScrollBorderFull" }) | ||
hl.set("FzfLuaScrollFloatEmpty", { link = "FzfLuaScrollBorderEmpty" }) | ||
hl.set("FzfLuaHeaderBind", { fg = colors.ui_purple }) | ||
hl.set("FzfLuaHeaderText", { fg = colors.fg4 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This group goes nicely here:
hl.set("FzfLuaFzfHeader", { fg = colors.fg4 })
https://github.com/ibhagwan/fzf-lua
Before
After
Before
After