vim-fuzzbox/fuzzbox.vim

[Features request] Add an option for centered the title

Closed this issue · 5 comments

I was going to code it for myself, so I'm writing it here, especially if you'd like me to push it here too. The idea is just to be able to center the titles (it's prettier for my taste).

Which titles? The prompt title is already centered, but I didn’t center the menu and preview titles as I found they worked quite well when both were left aligned (the prompt on the other hand benefits from centering to avoid distraction from the input).

I think it would be nice to add options around this, but I didn’t rush into it. I think we’d want to extract a function for Fuzzy window titles, which could look at config settings (not limited to position) and do the desired rendering. I did actually do this initially but decided it was premature so backed out. Interesting to see you’re already thinking it would be useful to customise, probably means it’s a good idea in general. I’m not yet sure how this could be applied consistently as selectors can do as the please with the preview callback, but it certainly seems worth another look. 👍

Image

I already center the title of my windows, as you can see on this screenshot.
I think it looks much nicer.
Telescope (nvim plug-in) does the same thing :)

At the moment Fuzzyy does not always set a title the menu/results and preview screens, unlike Telescope AFAIK. Where relevant it shows a count of the number of matches in the menu/results title and the file name / buffer name in the preview title.

Right now the prompt title is centered, and the menu/results and preview titles are not (defaults to left-aligned, no padding). It might be nice to be able to customise that, but I'm not yet sure how that customisation should be applied, so I'm cautious about introducing a feature for this in a hurry. I know how it could be applied, in a number of ways, but whether it should and how is not clear.

Here's how it looks now, with the count of matches in the menu/results title:

Image

Centering the count in the menu/results title looks weird, and centering the preview while not centering the menu/results title also looks weird (I tried both).

I suspect the right answer to this is to move the count into the prompt and apply it consistently, remove the title from the menu/results, and center the preview title to match the centering of the prompt.

it's good like this !, maybe with two space ? - title - instead of -title-

it's good like this !, maybe with two space ? - title - instead of -title-

I did try that initially, but wasn't convinced. I'll try it again. I would like to make this more configurable, but am wary of rushing it.

At the moment it looks a bit rubbish when using dropdown theme, so I need to revisit to improve that too.