rcarriga / nvim-dap-ui

A UI for nvim-dap
MIT License
2.42k stars 88 forks source link

Non-private Unicode code points for default icons? #173

Closed HiPhish closed 1 year ago

HiPhish commented 1 year ago

The default icons are within the private use area of Unicode, which means they can look like anything depending on the font. Most likely they will just show up as tofu. This makes for a really unpleasant first experience. Instead I propose the following Unicode characters:

Name Symbol
pause ⏸️
play
step_into
step_over
step_out
step_back
run_last 🔁
terminate

My goal was to use symbols from the Emoji set, so it depends on your browser how well it will display on GitHub. And of course it depends on the terminal font how nice the icons will actually look. You might get an ugly mess of monochrome and coloured emoji, but at least the symbols will be recognizable. Here is an example of what I mean:

Screenshot_20221117_234408

rcarriga commented 1 year ago

I've had people request the pretty much the opposite of this as well and to use a private area font :sweat_smile: The difference here is as you said you're targeting emoji so they'll at least be roughly consistent. However, I think I'm on the side of being opinionated and saying that nvim-dap-ui recommends a specific font to use and once you have that font then you'll get the exact same experience.

codicons is a font specifically designed for use in a text editor so there's no need to figure out the best ones to use, you just use the one built for purpose. I can't tell you how much I hate picking icons from fonts which will look good for different configurations :sweat_smile: I also use it in nvim-neotest which I believe has a lot of overlap with this in users.

HiPhish commented 1 year ago

OK, fair enough. I was afraid I would have to compile the icon font myself and then set it up as a fallback in fontconfig, but it turns out that I can just drop the compiled release into /usr/local/share/fonts and it will work. I have separate machines for work and private use, so I want as little "ricing" outside the editor as possible, but one extra font file won't hurt.

I can't tell you how much I hate picking icons from fonts which will look good for different configurations

I don't think that can ever be done. At best you can pick a choice which will at least be legible in most terminals, even if it looks ugly (like my screenshot above).

shmerl commented 6 months ago

Is there a way to a least make this flexible? I.e. by default it can use these codicons symbols as now, but configuration could allow for the user to override them with any arbitrary Unicode symbol.

I.e. those who don't want to use the font will be able to set something that they prefer and avoid the hassle.

shmerl commented 6 months ago

Oh, I figured it's already possible! I tried something like this and it worked!

local ui_config = {
  icons = { expanded = "🞃", collapsed = "🞂", current_frame = "→" },
  controls = {
    icons = {
      pause = "⏸",
      play = "⯈",
      step_into = "↴",
      step_over = "↷",
      step_out = "↑",
      step_back = "↶",
      run_last = "🗘",
      terminate = "🕱",
      disconnect = "⏻"
    }
  }
}

require("dapui").setup(ui_config)

May be you can post something like this for users in the readme, it would make it easier for those who don't use the font.