Closed RayZ0rr closed 1 year ago
@RayZ0rrm, the highlights you posted are the neovim part of the customization, while I'm not sure if you can get to the exact look and feel as the one you linked you can probably get close, read man fzf
to understand the border and spacing options and set fzf's highlights via fzf_colors
.
The only thing I think you cannot do rn is the zero spacing between the main fzf window and the preview window when using the default ("builtin") previwer, however, if you use bat
previewer you can remove the preview border and set the bat
colorscheme to something that would be close to what you wanted.
@ibhagwan thank you for the quick response as always. I'll look into fzf_colors. I see that you have set it up in your nvim config. But it seems to be dependent on your colorscheme. Let me look into it more.
@ibhagwan thank you for the quick response as always. I'll look into fzf_colors. I see that you have set it up in your nvim config. But it seems to be dependent on your colorscheme. Let me look into it more.
You can always use fzf_cli_args
to send flags directly to fzf without fzf-lua transforming any of them.
@RayZ0rr, when you're done if you don't mind please share your customization, I'd love to see what you made of it :-)
@ibhagwan I don't think I was capable of reproducing telescope's design. I am currently using the one from my dots, specifically here
It looks like this in the terminal (wezterm)
And like this in nvim
The only problem is the help window with green background which seems not that clear
Except for that I really like the current look and it feels more refreshing to use fzf :heart:
Looks great, ty @RayZ0rr :)
Here's the settings I use to achieve something similar to what's shown in the first comment. Hope this helps!
fzf-lua
configurationThis achieves the following results (I'm still iterating on the theme, so colors are not final, but that should be irrelevant to configuration of fzf-lua
):
Looks amazing @0xcharly!
@0xcharly, I’m thinking it might be worthwhile to add a new border style with the same “fat” characters so this would be made possible without having to use a custom colorscheme, something akin to the thicc
style:
https://github.com/ibhagwan/fzf-lua/blob/7aff4a3a089c65c6e60646945d8a5c8116078061/lua/fzf-lua/defaults.lua#L76-L82
Would love to create a profile that demonstrates this style that can work with or without a custom colorscheme.
https://github.com/ibhagwan/fzf-lua/commit/ca3757661d6575bd7a4e28177081351a36732dff
Update and try :FzfLua profiles
and select borderless
.
Thanks for this new profile! It's looking good out of the box. I only have 2 comments:
I think PmenuThumb
might be more appropriate for the scrollbar thumb. How about the following for default highlights (untested)?:
vim.api.nvim_set_hl(0, 'ReverseDirectory', {
link = 'Directory',
reverse = true,
})
local hls = {
scrollbar_e = 'PmenuSbar',
scrollbar_f = 'PmenuThumb',
title = 'ReverseDirectory',
borders = 'FloatBorder',
}
There is an extra blank character at the beginning of the title box (see your screenshots and my attachment below)
This is, of course, only my personal opinion. Feel free to choose whatever works best for you.
ty @0xcharly for the comments!
ReverseDirectory
Unlike the PmenuXXX
highlights, IMHO Directory
is not consistent between colorschemes and can vary greatly in color, while it looks great in your screenshot it will vary greatly for users.
I think
PmenuThumb
might be more appropriate for the scrollbar thumb
I tried it and it seems PmenuThumb
is consitently brighter on all of my colorschemes which made it harder to determine which part is full vs empty, I somewhat like the cleaner look with equal background but not opposed to testing with a darker color or no color (see below) for empty.
Thankfully, it's very easy to set customization overrides, like this:
:lua require"fzf-lua".setup({"borderless",winopts={hl={scrollfloat_e="PmenuThumb"}}})
Try this for an empty background, also interesting:
:lua require"fzf-lua".setup({"borderless",winopts={hl={scrollfloat_e=""}}})
There is an extra blank character at the beginning of the title box (see your screenshots and my attachment below)
Fixed in https://github.com/ibhagwan/fzf-lua/commit/3115ed3d1be551e463f1639d6225d2fc2669ab70.
One more thing, this part in your config:
-- Disable icons, improve performances drastically.
local noicon = {
git_icons = false,
file_icons = false,
color_icons = false,
}
opts['btags'] = noicon
opts['buffers'] = noicon
...
Can be reduced to:
global_git_icons = false,
global_file_icons = false,
@0xcharly, I forgot to mention one more thing, the current profile defines the border as an array of empty strings which adds padding around the main terminal window, it's worth noting that if you set winopts.border = "none"
you can drop the main window border completely, try it out and see which one you like more:
:lua require"fzf-lua".setup({"borderless",winopts={border="none"}})
Notice the zero-padding of the fzf terminal:
@RayZ0rr, I was able to achieve something very similar to what you're after with the addition of the title to the main window, modified borderless
theme below:
use the
title
function to add titles to other providers (git, etc)local function title(str) return { winopts = { -- passthrough options to main window's `nvim_open_win` title = { { " " .. str .. " ", "IncSearch" } }, title_pos = "center", } } local hls = { bg = "PmenuSbar", sel = "PmenuSel", } end require("fzf-lua").setup { global_git_icons = false, global_file_icons = false, winopts = { border = { " ", " ", " ", " ", " ", " ", " ", " " }, preview = { scrollbar = "float", scrolloff = "-2", title_align = "center", }, hl = { title = "IncSearch", border = hls.bg, preview_border = hls.bg, scrollfloat_e = "", scrollfloat_f = hls.sel, }, }, fzf_colors = { ["gutter"] = { "bg", hls.bg }, ["bg"] = { "bg", hls.bg }, ["bg+"] = { "bg", hls.sel }, ["fg+"] = { "fg", hls.sel }, }, files = title("Find Files"), grep = title("Search"), }
ty @0xcharly for the comments!
ReverseDirectory
Unlike the
PmenuXXX
highlights, IMHODirectory
is not consistent between colorschemes and can vary greatly in color, while it looks great in your screenshot it will vary greatly for users.
Fair enough, I haven't tested with other themes, but was just looking for something that would make sense from a highlight naming convention point of view. I guess File
would be even closer, but it also makes sense to take something that works with most themes out of the box.
I think
PmenuThumb
might be more appropriate for the scrollbar thumbI tried it and it seems
PmenuThumb
is consitently brighter on all of my colorschemes which made it harder to determine which part is full vs empty, I somewhat like the cleaner look with equal background but not opposed to testing with a darker color or no color (see below) for empty.
Yeah, same comment as above, it makes sense to use something that looks good out of the box over something that is more semantically correct. Even though it's a bit of a shame, presets do need to work out of the box to be relevant.
Thankfully, it's very easy to set customization overrides, like this:
:lua require"fzf-lua".setup({"borderless",winopts={hl={scrollfloat_e="PmenuThumb"}}})
Try this for an empty background, also interesting:
:lua require"fzf-lua".setup({"borderless",winopts={hl={scrollfloat_e=""}}})
Yeah, thanks for the flexibility here. I'm going to keep my config as-is anyway, since I like where I landed. The only thing that I'll change is to use blanks for border characters.
Working great now:
There is an extra blank character at the beginning of the title box (see your screenshots and my attachment below)
Fixed in 3115ed3.
Thanks for the quick fix!
One more thing, this part in your config:
-- Disable icons, improve performances drastically. local noicon = { git_icons = false, file_icons = false, color_icons = false, } opts['btags'] = noicon opts['buffers'] = noicon ...
Can be reduced to:
global_git_icons = false, global_file_icons = false,
I had noticed that from the profile's configs and promptly updated mine to take advantage of that! Much cleaner.
@0xcharly, I forgot to mention one more thing, the current profile defines the border as an array of empty strings which adds padding around the main terminal window, it's worth noting that if you set
winopts.border = "none"
you can drop the main window border completely, try it out and see which one you like more:
I did try that to begin with, but I personally prefer the look of the window with the extra padding. Thanks for the pointer though, might be useful for someone else that lands on this issue.
https://github.com/ibhagwan/fzf-lua/commit/577f2a74c6914515d45a4c1f390978c18d9cd3cb
Ok final update to this (hopefully :smile:), new "quickstart" profile borderless_full
that hopefully answers the design question in the OP.
Left most of terminal fzf's colors as default, probably room for improvement via fzf_colors
but I'll leave that for incoming PRs.
Tysm @0xcharly for opening my eyes to the new design, your final setup looks amazing!
My pleasure! And thank you for all the work on this issue, for all the commits you've sent since yesterday, and in general for bringing fzf-lua
into the world: I'm a big fan of Telescope, but fzf-lua
answers my need for performances.
I've noticed that in the leftside results window, if a result is too long, it eats the file icon. How can I make it always show up to get a more uniform look.
And can the preview title only shows filename not a long path?
I've noticed that in the leftside results window, if a result is too long, it eats the file icon. How can I make it always show up to get a more uniform look.
That’s controlled by fzf (the binary, not Fzf-lua), I’m not aware of any option to keep the left side pinned, you can use :FzfLua files path_shorten=true
will most likely help in this case.
And can the preview title only shows filename not a long path?
Currently no but it’s probably not a bad idea to shorten the path or use only the filename, I’ll add it to the feature list.
https://github.com/ibhagwan/fzf-lua/commit/30bb3a64da164135097c9cac7c0fbeabc6aa0426
@GreenSleeper, def made more sense to have just the filename, this commit makes it the default (customizable).
@GreenSleeper, def made more sense to have just the filename, this commit makes it the default (customizable).
I try to update, but why I'm I getting this error?
I try to update, but why I'm I getting this error?
This error isn’t from Fzf-lua, looks like the lazy.nvim
updater, I would try to uninstall and reinstall the plug-in, perhaps also open an issue with lazy if you’d like this solved for the future?
I can reproduce the issue on my end. It seems to be due to the vimdoc
plugin generating another fzf-lua-table-of-contents
vimdoc tag because of the recent addition of "Table of Contents" in the readme.
Oh, I see that our messages crossed: https://github.com/ibhagwan/fzf-lua/commit/6171eee035ce47319e81a784453017d7eab18ea4
Oh, I see that our messages crossed: 6171eee
Yap, should be ok now, I forgot the README to vimdoc plugin already generates a fzf-lua-table-of-contents
tag.
@GreenSleeper update to https://github.com/ibhagwan/fzf-lua/commit/b1ee200e50f11506be7dcb9c529ce091b375dc6a and the message should disappear.
I can confirm that https://github.com/ibhagwan/fzf-lua/commit/6171eee035ce47319e81a784453017d7eab18ea4 fixed the issue. Thanks for the quick fix!
I can confirm that 6171eee fixed the issue. Thanks for the quick fix!
Techincally you need https://github.com/ibhagwan/fzf-lua/commit/b1ee200e50f11506be7dcb9c529ce091b375dc6a, post the vimdoc generator step :-)
Fair, I guess the CI was fast enough!
Sorry if this is a stupid question but I am trying to customize the way that fzf looks.
My goal is something similar to https://github.com/olimorris/onedarkpro.nvim/issues/31 (which is for telescope but I want to see if I can achieve something similar to fzf.
My current one looks like this:
I have created a config file based on Conscious