A lualine.nvim component that shows the hexadecimal value of the character under the cursor.
- Displays the hex bytes of the current character (e.g.
0x41forA). - Handles multibyte characters (e.g.
0xe38182forあ). - Shows a placeholder (
∅by default) when the cursor is past the end of the line. - Customisable icon, prefix, and empty-state symbol.
- Neovim
- nvim-lualine/lualine.nvim
- A Nerd Font to render the default
icon(). Overrideiconif you are not using a Nerd Font.
Add this plugin as a dependency of lualine.nvim so it is loaded before
lualine's setup() resolves component names.
{
"nvim-lualine/lualine.nvim",
dependencies = { "yuuan/lualine-charvaluehex" },
config = function()
require("lualine").setup({
sections = {
lualine_z = { "charvaluehex" },
},
})
end,
}use {
"nvim-lualine/lualine.nvim",
requires = { "yuuan/lualine-charvaluehex" },
config = function()
require("lualine").setup({
sections = {
lualine_z = { "charvaluehex" },
},
})
end,
}Reference the component by its name ("charvaluehex") in any lualine section:
sections = {
lualine_z = { "charvaluehex" },
}| Option | Type | Default | Description |
|---|---|---|---|
icon |
string | '' |
Icon rendered before the hex value (standard lualine option). The default glyph requires a Nerd Font. |
prefix |
string | '0x' |
Prefix prepended to the hex digits. |
placeholder |
string | '∅' |
Text shown when no character is under the cursor (e.g. '-', 'N/A'). |
require("lualine").setup({
sections = {
lualine_z = {
{
"charvaluehex",
icon = "",
prefix = "\\x",
placeholder = "N/A",
},
},
},
})MIT. See LICENSE.