🪴 my neovim config:)
1
fork

Configure Feed

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

refactor(guicursor): move to `plugin/guicursor.lua`

robin dade2792 c2fb2ea8

+59 -58
+1 -58
config/lua/ivy/config/options.lua
··· 246 246 vim.g.markdown_recommended_style = 0 247 247 248 248 -- cursor 249 - local guicursor_opts = { 249 + vim.g.guicursor_config = { 250 250 normal = { 251 251 type = "block", 252 252 }, ··· 271 271 type = "block", 272 272 }, 273 273 } 274 - 275 - local mode_lookup = { 276 - normal = "n-v", 277 - insert = "i-c-ci-ve", 278 - replace = "r-cr", 279 - operator = "o", 280 - showmatch = "sm", 281 - } 282 - local type_lookup = { 283 - block = "block", 284 - vertical = "ver", 285 - horizontal = "hor", 286 - } 287 - local guicusor = vim.iter(pairs(guicursor_opts)):fold("", function(str, mode, opts) 288 - vim.validate("mode", mode, function(v) 289 - return vim.tbl_contains({ "normal", "insert", "replace", "operator", "showmatch" }, v) 290 - end, "valid mode") 291 - vim.validate("opts", opts, function(v) 292 - vim.validate("type", v.type, function(t) 293 - return vim.tbl_contains({ "block", "vertical", "horizontal" }, t) 294 - end, "valid type") 295 - if v.type ~= "block" then 296 - vim.validate("size", v.size, function(s) 297 - return type(s) == "number" 298 - end, "valid size with type ~= block") 299 - end 300 - 301 - if v.animate then 302 - vim.validate("animate", v.animate, function(anim) 303 - vim.validate("wait", anim.wait, "number") 304 - vim.validate("on", anim.on, "number") 305 - vim.validate("off", anim.off, "number") 306 - return true 307 - end, "valid animation") 308 - end 309 - 310 - return true 311 - end, "valid opts") 312 - if #str > 0 then 313 - str = str .. "," 314 - end 315 - local s = string.format( 316 - "%s:%s", 317 - mode_lookup[mode], 318 - opts.type ~= "block" and string.format("%s%d", type_lookup[opts.type], opts.size) or type_lookup[opts.type] 319 - ) 320 - 321 - if opts.animate then 322 - local anim = opts.animate 323 - local anim_str = string.format("blinkwait%d-blinkon%d-blinkoff%d", anim.wait, anim.on, anim.off) 324 - s = s .. "-" .. anim_str 325 - end 326 - 327 - return str .. s 328 - end) 329 - 330 - vim.opt.guicursor = guicusor 331 274 332 275 -- lsp 333 276 vim.diagnostic.config({
+58
config/plugin/guicursor.lua
··· 1 + local mode_lookup = { 2 + normal = "n-v", 3 + insert = "i-c-ci-ve", 4 + replace = "r-cr", 5 + operator = "o", 6 + showmatch = "sm", 7 + } 8 + 9 + local type_lookup = { 10 + block = "block", 11 + vertical = "ver", 12 + horizontal = "hor", 13 + } 14 + 15 + local guicursor = vim.iter(pairs(vim.g.guicursor_config or {})):fold("", function(str, mode, opts) 16 + vim.validate("mode", mode, function(v) 17 + return vim.tbl_contains({ "normal", "insert", "replace", "operator", "showmatch" }, v) 18 + end, "valid mode") 19 + vim.validate("opts", opts, function(v) 20 + vim.validate("type", v.type, function(t) 21 + return vim.tbl_contains({ "block", "vertical", "horizontal" }, t) 22 + end, "valid type") 23 + if v.type ~= "block" then 24 + vim.validate("size", v.size, function(s) 25 + return type(s) == "number" 26 + end, "valid size with type ~= block") 27 + end 28 + 29 + if v.animate then 30 + vim.validate("animate", v.animate, function(anim) 31 + vim.validate("wait", anim.wait, "number") 32 + vim.validate("on", anim.on, "number") 33 + vim.validate("off", anim.off, "number") 34 + return true 35 + end, "valid animation") 36 + end 37 + 38 + return true 39 + end, "valid opts") 40 + if #str > 0 then 41 + str = str .. "," 42 + end 43 + local s = string.format( 44 + "%s:%s", 45 + mode_lookup[mode], 46 + opts.type ~= "block" and string.format("%s%d", type_lookup[opts.type], opts.size) or type_lookup[opts.type] 47 + ) 48 + 49 + if opts.animate then 50 + local anim = opts.animate 51 + local anim_str = string.format("blinkwait%d-blinkon%d-blinkoff%d", anim.wait, anim.on, anim.off) 52 + s = s .. "-" .. anim_str 53 + end 54 + 55 + return str .. s 56 + end) 57 + 58 + vim.opt.guicursor = guicursor