refactor: improve multicursor config
This commit is contained in:
+17
-3
@@ -1202,15 +1202,19 @@ end
|
|||||||
function M.mc_statusline()
|
function M.mc_statusline()
|
||||||
local mc = require("multicursor-nvim")
|
local mc = require("multicursor-nvim")
|
||||||
local status = {}
|
local status = {}
|
||||||
if mc.hasCursors() then
|
if mc.numEnabledCursors() > 1 then
|
||||||
status.enabled = true
|
status.enabled = true
|
||||||
|
status.cursors = mc.numEnabledCursors()
|
||||||
|
status.disabled = mc.numDisabledCursors()
|
||||||
if vim.fn.mode() == "v" then
|
if vim.fn.mode() == "v" then
|
||||||
status.icon = " "
|
-- status.icon = " "
|
||||||
|
status.icon = ""
|
||||||
status.short_text = "V"
|
status.short_text = "V"
|
||||||
status.text = "VISUAL"
|
status.text = "VISUAL"
|
||||||
status.color = "lualine_a_visual"
|
status.color = "lualine_a_visual"
|
||||||
else
|
else
|
||||||
status.icon = " "
|
-- status.icon = " "
|
||||||
|
status.icon = ""
|
||||||
status.short_text = "N"
|
status.short_text = "N"
|
||||||
status.text = "NORMAL"
|
status.text = "NORMAL"
|
||||||
status.color = "lualine_a_normal"
|
status.color = "lualine_a_normal"
|
||||||
@@ -1221,9 +1225,19 @@ function M.mc_statusline()
|
|||||||
status.short_text = "NO"
|
status.short_text = "NO"
|
||||||
status.text = "SINGLE"
|
status.text = "SINGLE"
|
||||||
status.color = "lualine_a_normal"
|
status.color = "lualine_a_normal"
|
||||||
|
status.cursors = 1
|
||||||
|
status.disabled = 0
|
||||||
end
|
end
|
||||||
status.icon_short_text = status.icon .. status.short_text
|
status.icon_short_text = status.icon .. status.short_text
|
||||||
status.icon_text = status.icon .. status.text
|
status.icon_text = status.icon .. status.text
|
||||||
|
|
||||||
|
if status.cursors > 1 and status.disabled > 0 then
|
||||||
|
status.count = status.cursors .. "/" .. status.disabled
|
||||||
|
elseif status.cursors > 1 and status.disabled <= 0 then
|
||||||
|
status.count = status.cursors
|
||||||
|
else
|
||||||
|
status.count = ""
|
||||||
|
end
|
||||||
return status
|
return status
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -194,13 +194,14 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local mc = require("multicursor-nvim")
|
local mc = require("multicursor-nvim")
|
||||||
|
|
||||||
mc.setup()
|
mc.setup({
|
||||||
|
-- set to true if you want multicursor undo history
|
||||||
|
-- to clear when clearing cursors
|
||||||
|
shallowUndo = false,
|
||||||
|
|
||||||
-- Customize how cursors look.
|
-- set to empty table to disable signs
|
||||||
vim.api.nvim_set_hl(0, "MultiCursorCursor", { link = "Cursor" })
|
signs = { "⎸", "", "⎹" },
|
||||||
vim.api.nvim_set_hl(0, "MultiCursorVisual", { link = "Visual" })
|
})
|
||||||
vim.api.nvim_set_hl(0, "MultiCursorDisabledCursor", { link = "Visual" })
|
|
||||||
vim.api.nvim_set_hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user