From 75c2ed6f3f44226c08681f54ddd98ae0fe032682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 30 Nov 2023 20:43:23 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20config(nvim):=20multicurso?= =?UTF-8?q?r=20added=20tu=20lualine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lua/plugins/extras/coding/multicursor.lua | 49 ++++++++++++++++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/.config/nvim/lua/plugins/extras/coding/multicursor.lua b/.config/nvim/lua/plugins/extras/coding/multicursor.lua index b2339d21..e9456888 100644 --- a/.config/nvim/lua/plugins/extras/coding/multicursor.lua +++ b/.config/nvim/lua/plugins/extras/coding/multicursor.lua @@ -1,13 +1,48 @@ return { - "smoka7/multicursors.nvim", - dependencies = { - "nvim-treesitter/nvim-treesitter", - "smoka7/hydra.nvim", - }, - cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" }, + { + "smoka7/multicursors.nvim", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "smoka7/hydra.nvim", + }, + cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" }, -- stylua: ignore keys = { { mode = { "v", "n" }, "m", "MCstart", desc = "Create a selection for selected text or word under the cursor" }, }, - config = true, + opts = { + hint_config = { + border = "rounded", + position = "bottom-right", + }, + generate_hints = { + normal = true, + insert = true, + extend = true, + config = { + column_count = 1, + }, + }, + }, + }, + { + "nvim-lualine/lualine.nvim", + optional = true, + opts = function(_, opts) + local function is_active() + local ok, hydra = pcall(require, "hydra.statusline") + return ok and hydra.is_active() + end + + local function get_name() + local ok, hydra = pcall(require, "hydra.statusline") + if ok then + return hydra.get_name() + end + return "" + end + + table.insert(opts.sections.lualine_b, { get_name, cond = is_active }) + end, + }, }