AstroNvim / AstroNvim/astrocommunity
[Feature request]: Add unicode codepoint indicator to statusline
- Dominant language
- Lua
- Stars
- 1.7k
- Forks
- 313
- PR merge metrics
- No merged PRs in 30d
Description
### 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.
Contributor guide
Research direction
Locate the existing clock display recipe and the community.lua entry point mentioned in the issue. Review how recipes are exposed there and how the current clock recipe is assembled. Done means a discoverable unicode codepoint statusline recipe that does not conflict with the clock recipe.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100