Skip to content
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

[Feature request]: Add unicode codepoint indicator to statusline #1042

Open
osamuaoki opened this issue Jun 15, 2024 · 0 comments
Open

[Feature request]: Add unicode codepoint indicator to statusline #1042

osamuaoki opened this issue Jun 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@osamuaoki
Copy link

Is your feature related to a problem?

Problem

These days, even English text data may contain hard to distinguish characters which may cause intriguing errors. For example:

  • - (hyphen) +U2D
  • (en-dash) +U2013
  • (em-dash) +U2014
  • (horizontal line) +U23AF

It is highly desirable to indicate the unicode code point of the cursor position character from editor.

Describe the new feature

Desirable feature

In addition to clock display recipe, add recipe for unicode code point display, e.g., [+2D]

Proposed solution

[N]vim's internal capability can be leveraged to create such a feature. For example, by adding equivalent of my user configuration.

  -- add unicode code point display to statusline
  {
    "rebelot/heirline.nvim",
    opts = function(_, opts)
      local status = require "astroui.status"
      -- add unicode codepoint indicator to last statusline indicator
      opts.statusline[#opts.statusline] = status.component.builder {
        provider = "[+U%02B]",
        hl = status.hl.get_attributes "mode", -- highlight based on mode attributes
        surround = { separator = "right", color = status.hl.mode_bg }, -- background highlight based on mode
      }
    end,
  },

Issue for me

I don't know how to add the above content to this package and make it discover-able from community.lua to create proper pull request to this package.

Additional context

FYI-1

I use to set statusline string in good old VIM as:

set statusline=%<%f%m%r%h%w%=%y%2l/%2L=%P,%2c%V\ [U+%02B]

FYI-2

The code above conflicts with the current clock recipe.

@osamuaoki osamuaoki added the enhancement New feature or request label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant