feat: enhance statusline with icon and text concatenation
This commit is contained in:
@@ -1245,9 +1245,12 @@ function M.mc_statusline()
|
|||||||
status.color = "lualine_a_normal"
|
status.color = "lualine_a_normal"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Add the icon and text to the status object
|
||||||
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
|
||||||
|
|
||||||
|
-- Update the status object
|
||||||
if status.cursors > 1 and status.disabled > 0 then
|
if status.cursors > 1 and status.disabled > 0 then
|
||||||
status.count = status.cursors .. "/" .. status.disabled
|
status.count = status.cursors .. "/" .. status.disabled
|
||||||
elseif status.cursors > 1 and status.disabled <= 0 then
|
elseif status.cursors > 1 and status.disabled <= 0 then
|
||||||
@@ -1482,6 +1485,7 @@ function M.setup_replace_ellipsis(enable)
|
|||||||
vim.api.nvim_create_augroup("EllipsisReplace", { clear = true })
|
vim.api.nvim_create_augroup("EllipsisReplace", { clear = true })
|
||||||
|
|
||||||
if enable then
|
if enable then
|
||||||
|
-- Add an autocmd to handle the InsertLeave event
|
||||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||||
group = "EllipsisReplace",
|
group = "EllipsisReplace",
|
||||||
callback = M.replace_ellipsis,
|
callback = M.replace_ellipsis,
|
||||||
|
|||||||
+10
-3
@@ -13,7 +13,7 @@ local rootiest = require("config.rootiest")
|
|||||||
|
|
||||||
M.alternate = {
|
M.alternate = {
|
||||||
{ -- Toggle Alternate
|
{ -- Toggle Alternate
|
||||||
"<leader>a",
|
"<leader>A",
|
||||||
"<cmd>Alternate<cr>",
|
"<cmd>Alternate<cr>",
|
||||||
desc = "Toggle Alternate",
|
desc = "Toggle Alternate",
|
||||||
},
|
},
|
||||||
@@ -535,6 +535,13 @@ M.gp = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
M.group = {
|
M.group = {
|
||||||
|
avante = {
|
||||||
|
{ -- Avante
|
||||||
|
lhs = "<leader>a",
|
||||||
|
icon = { icon = "", color = "red" },
|
||||||
|
group = "Avante",
|
||||||
|
},
|
||||||
|
},
|
||||||
chatgpt = { -- ChatGPT
|
chatgpt = { -- ChatGPT
|
||||||
lhs = "<leader>cx",
|
lhs = "<leader>cx",
|
||||||
group = "ChatGPT",
|
group = "ChatGPT",
|
||||||
@@ -804,7 +811,7 @@ M.lazygit = {
|
|||||||
end,
|
end,
|
||||||
desc = "LazyGit",
|
desc = "LazyGit",
|
||||||
},
|
},
|
||||||
{ -- LazyGit
|
{ -- LazyGit
|
||||||
"<leader>gg",
|
"<leader>gg",
|
||||||
function()
|
function()
|
||||||
require("data.func").open_lazygit_popup()
|
require("data.func").open_lazygit_popup()
|
||||||
@@ -906,7 +913,7 @@ M.misc = {
|
|||||||
{ -- Telescope Find Files
|
{ -- Telescope Find Files
|
||||||
lhs = "<leader><leader>",
|
lhs = "<leader><leader>",
|
||||||
rhs = function()
|
rhs = function()
|
||||||
LazyVim.pick("find_files")()
|
LazyVim.pick("files")()
|
||||||
end,
|
end,
|
||||||
desc = "Find Files",
|
desc = "Find Files",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -54,5 +54,11 @@ return {
|
|||||||
opts = data.types.avante,
|
opts = data.types.avante,
|
||||||
build = "make",
|
build = "make",
|
||||||
dependencies = data.deps.avante,
|
dependencies = data.deps.avante,
|
||||||
|
keys = function()
|
||||||
|
-- Add keymaps for Avante group
|
||||||
|
for _, item in ipairs(data.keys.group.avante) do
|
||||||
|
data.func.add_keymap(item)
|
||||||
|
end
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ return {
|
|||||||
{ -- Navic
|
{ -- Navic
|
||||||
import = "lazyvim.plugins.extras.editor.navic",
|
import = "lazyvim.plugins.extras.editor.navic",
|
||||||
},
|
},
|
||||||
|
{ -- Refactoring
|
||||||
|
import = "lazyvim.plugins.extras.editor.refactoring",
|
||||||
|
},
|
||||||
{ -- Trouble
|
{ -- Trouble
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
cmd = data.cmd.trouble,
|
cmd = data.cmd.trouble,
|
||||||
@@ -37,7 +40,7 @@ return {
|
|||||||
opts = data.types.flash,
|
opts = data.types.flash,
|
||||||
keys = data.keys.flash,
|
keys = data.keys.flash,
|
||||||
},
|
},
|
||||||
{
|
{ -- NeoTree
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
opts = data.types.neotree.opts,
|
opts = data.types.neotree.opts,
|
||||||
},
|
},
|
||||||
@@ -145,9 +148,9 @@ return {
|
|||||||
end,
|
end,
|
||||||
keys = data.keys.undotree,
|
keys = data.keys.undotree,
|
||||||
},
|
},
|
||||||
{ -- NumberToggle
|
-- { -- NumberToggle
|
||||||
"sitiom/nvim-numbertoggle",
|
-- "sitiom/nvim-numbertoggle",
|
||||||
},
|
-- },
|
||||||
{ -- Noice
|
{ -- Noice
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|||||||
+13
-13
@@ -7,19 +7,6 @@
|
|||||||
local data = require("data")
|
local data = require("data")
|
||||||
|
|
||||||
local P = { -- Define Telescope Plugins Specs
|
local P = { -- Define Telescope Plugins Specs
|
||||||
{ -- Telescope Cmdline
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"jonarrien/telescope-cmdline.nvim",
|
|
||||||
},
|
|
||||||
keys = data.keys.telescope.cmdline,
|
|
||||||
opts = data.types.telescope.cmdline,
|
|
||||||
config = function(_, opts)
|
|
||||||
require("telescope").setup(opts)
|
|
||||||
require("telescope").load_extension("cmdline")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{ -- Telescope All Recent
|
{ -- Telescope All Recent
|
||||||
"prochri/telescope-all-recent.nvim",
|
"prochri/telescope-all-recent.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
@@ -178,6 +165,19 @@ local P = { -- Define Telescope Plugins Specs
|
|||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{ -- Fzf Lua
|
||||||
|
"ibhagwan/fzf-lua",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if require("data.func").check_global_var("use_telescope", false, true) then
|
||||||
|
P = { { import = "lazyvim.plugins.extras.editor.fzf" } }
|
||||||
|
end
|
||||||
|
|
||||||
|
if require("data.func").check_global_var("use_fzf_lua", true, false) then
|
||||||
|
table.insert(P, 1, { import = "lazyvim.plugins.extras.editor.fzf" })
|
||||||
|
table.insert(P, 2, { "ibhagwan/fzf-lua", lazy = false, opts = {} })
|
||||||
|
end
|
||||||
|
|
||||||
return P
|
return P
|
||||||
|
|||||||
Reference in New Issue
Block a user