PatrickF1 / fzf.fish

🔍🐟 Fzf plugin for Fish
MIT License
1.96k stars 78 forks source link

[Search Git Status] use box drawing chars for staged/unstaged header #291

Closed yogan closed 1 year ago

yogan commented 1 year ago

This makes the little header box for Git staged/unstaged/merged/etc. look a bit nicer.

Old:

+--------+
| Staged |
+--------+

New:

╭────────╮
│ Staged │
╰────────╯

It does not look perfect on GitHub web, but works in a terminal with a proper font: image

We could make this optional (add some $_fzf_fish_use_unicode_box variable), but fzf itself is also using those box drawing characters by default, so I guess pretty much everyone using fzf.fish should be fine with it.

PatrickF1 commented 1 year ago

Hi Frank, thanks for the PR. This is a great idea!

  1. How do you know fzf also uses these box chars already? Are they the ones used in the fzf window border?
  2. How do you type the box characters on the keyboard?
PatrickF1 commented 1 year ago

Hmm I forgot that it seems we are already using these chars here https://github.com/PatrickF1/fzf.fish/blob/main/functions/_fzf_search_history.fish#L11

yogan commented 1 year ago

Hi Patrick! Yes, I have used the same characters that fzf does, and that's also how I "typed" them: by copy/paste from a fzf output. :-) There are ways to type extended Unicode characters by some key combinations, but that depends on the OS, so I can't really give a clear answer for that. I usually just look them up when I need them. Wikipedia has a nice overview for example: https://en.wikipedia.org/wiki/Box-drawing_character

Those are the ones that I have used:

$ echo '╭─╮│╰─╯' | unicode-inspect.pl
╭       U256d # BOX DRAWINGS LIGHT ARC DOWN AND RIGHT
─       U2500 # BOX DRAWINGS LIGHT HORIZONTAL
╮       U256e # BOX DRAWINGS LIGHT ARC DOWN AND LEFT
│       U2502 # BOX DRAWINGS LIGHT VERTICAL
╰       U2570 # BOX DRAWINGS LIGHT ARC UP AND RIGHT
─       U2500 # BOX DRAWINGS LIGHT HORIZONTAL
╯       U256f # BOX DRAWINGS LIGHT ARC UP AND LEFT