#when you do find it, send pls
1 messages · Page 1 of 1 (latest)
-- Highlights for digits using Catppuccin colors
local digit_highlights = {
["0"] = { fg = colors.surface2 },
["1"] = { fg = colors.red },
["2"] = { fg = colors.peach },
["3"] = { fg = colors.yellow },
["4"] = { fg = colors.green },
["5"] = { fg = colors.teal },
["6"] = { fg = colors.blue },
["7"] = { fg = colors.lavender },
["8"] = { fg = colors.pink },
["9"] = { fg = colors.flamingo },
}
-- Apply highlights
for digit, hl in pairs(digit_highlights) do
vim.api.nvim_set_hl(0, "Digit" .. digit, hl)
end
-- Function to colorize each digit of a number
local function colorize_number(number)
local result = ""
for digit in tostring(number):gmatch(".") do
local hl_group = "Digit" .. digit
result = result .. "%#" .. hl_group .. "#" .. digit
end
return result
end
-- Function to handle the StatusColumn
function StatusColumn()
local current_line = vim.api.nvim_win_get_cursor(0)[1]
local distance = math.abs(vim.v.lnum - current_line)
return colorize_number(distance == 0 and current_line or distance) .. " "
end
-- Enable the custom StatusColumn
vim.opt.statuscolumn = "%{%v:lua.StatusColumn()%}"
vim.o.relativenumber = true
vim.o.number = true```