🪴 a tiny, customizable statusline for neovim
3
fork

Configure Feed

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

feat: add replace and operator hl modes (#1)

Reviewed-on: https://codeberg.org/comfysage/lylla.nvim/pulls/1
Co-authored-by: koi <me@koi.rip>
Co-committed-by: koi <me@koi.rip>

authored by koi.rip koi.rip and committed by robinwobin.dev 5daeae02 3bf72593

+12 -4
+2
README.md
··· 117 117 visual = { link = "MiniIconsPurple" }, 118 118 command = { link = "MiniIconsOrange" }, 119 119 insert = { link = "MiniIconsGrey" }, 120 + replace = { link = "MiniIconsGrey" }, 121 + operator = { link = "NonText" }, 120 122 }, 121 123 ``` 122 124
+1 -1
lua/lylla/config.lua
··· 8 8 9 9 ---@class lylla.config 10 10 ---@field refresh_rate integer 11 - ---@field hls table<'normal'|'visual'|'command'|'insert', vim.api.keyset.highlight> 11 + ---@field hls table<'normal'|'visual'|'command'|'insert'|'replace'|'operator', vim.api.keyset.highlight> 12 12 ---@field modules (lylla.item|lylla.item.tuple|string)[] 13 13 ---@field winbar any[] 14 14 ---@field tabline (fun(): (lylla.item|lylla.item.tuple|string)[])|vim.NIL
+3 -1
lua/lylla/init.lua
··· 14 14 local config = lzrq("lylla.config") 15 15 local utils = lzrq("lylla.utils") 16 16 17 - ---@type table<'normal'|'visual'|'command'|'insert', vim.api.keyset.highlight> 17 + ---@type table<'normal'|'visual'|'command'|'insert'|'replace'|'operator', vim.api.keyset.highlight> 18 18 local default_hls = { 19 19 normal = { link = "@property" }, 20 20 visual = { link = "@constant" }, 21 21 command = { link = "@function" }, 22 22 insert = { link = "@variable" }, 23 + replace = { link = "@type" }, 24 + operator = { link = "NonText" }, 23 25 } 24 26 25 27 ---@param cfg? lylla.config
+6 -2
lua/lylla/utils.lua
··· 216 216 local mode = vim.api.nvim_get_mode().mode 217 217 local hl_name = utils.get_modehl_name("normal") 218 218 219 - if string.match(mode, "^[vVs]") then 219 + if string.match(mode, "^[vVs]") then 220 220 hl_name = utils.get_modehl_name("visual") 221 221 elseif string.match(mode, "^c") then 222 222 hl_name = utils.get_modehl_name("command") 223 - elseif string.match(mode, "^[irRt]") then 223 + elseif string.match(mode, "^[it]") then 224 224 hl_name = utils.get_modehl_name("insert") 225 + elseif string.match(mode, "^[rR]") then 226 + hl_name = utils.get_modehl_name("replace") 227 + elseif string.match(mode, "^%ao") then 228 + hl_name = utils.get_modehl_name("operator") 225 229 end 226 230 227 231 return hl_name, utils.create_hl(utils.reverse_hl(hl_name))