🪴 my neovim config:)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lylla: refactor hls

robin dd3dc7c4 776648d1

+18 -15
+18 -15
config/config/lylla.lua
··· 33 33 sl_right_sep = "" 34 34 end 35 35 36 - local hls = {} 36 + local function to_camel(s) 37 + return string.gsub(string.gsub(s, "^(%a)", string.upper), "_(%a)", string.upper) 38 + end 39 + 40 + local _hls = {} 41 + local hls = vim.defaulttable(function(k) 42 + return _hls[k] or vim.api.nvim_get_hl(0, { name = to_camel(k) }) 43 + end) 37 44 vim.once.ColorScheme(function() 38 - hls.normal = vim.api.nvim_get_hl(0, { name = "Normal" }).fg 39 - hls.statusline = vim.api.nvim_get_hl(0, { name = "StatusLine" }).fg 40 - 41 - hls.tab = "TabLine" 45 + _hls.tab = hls.tab_line 42 46 ---@type table 43 - hls.tab_rev = utils.reverse_hl(hls.tab) 44 - hls.tab_rev.bg = "NONE" 45 - hls.cur = "TabLineSel" 47 + _hls.tab_rev = utils.reverse_hl(hls.tab) 48 + _hls.tab_rev.bg = "NONE" 49 + _hls.cur = hls.tab_line_sel 46 50 ---@type table 47 - hls.cur_rev = utils.reverse_hl(hls.cur) 48 - hls.cur_rev.bg = "NONE" 49 - hls.fil = "TabLineFill" 51 + _hls.cur_rev = utils.reverse_hl(hls.cur) 52 + _hls.cur_rev.bg = "NONE" 50 53 end) 51 54 52 55 local sections = {} ··· 160 163 end, { events = { "FileType", "LspAttach" } }), 161 164 lylla.component(function() 162 165 return { 163 - { "l: ", { fg = hls.statusline, italic = true } }, 164 - { "%l", { fg = hls.normal } }, 165 - { "/%L", { fg = hls.statusline, italic = true } }, 166 + { "l: ", { fg = hls.status_line.fg, italic = true } }, 167 + { "%l", { fg = hls.normal.fg } }, 168 + { "/%L", { fg = hls.status_line.fg, italic = true } }, 166 169 { " " }, 167 170 { "c: ", { bg = "NONE", italic = true } }, 168 171 { "%c" }, ··· 237 240 end) 238 241 ) 239 242 240 - table.insert(t, { "%T", hls.fil }) 243 + table.insert(t, { "%T", hls.tab_line_fill }) 241 244 242 245 if vim.fn.tabpagenr("$") > 1 then 243 246 table.insert(t, "%=")