require("lz.n").load({ { "lualine.nvim", event = "VimEnter", after = function() local navic = require("nvim-navic") local breadcrumb = function() if not navic.is_available() then return "" end local location = navic.get_location() if vim.fn.strdisplaywidth(location) <= 60 then return location end while vim.fn.strdisplaywidth(location) > 59 do location = vim.fn.strcharpart(location, 0, vim.fn.strchars(location) - 1) end return location .. "…" end require("lualine").setup({ options = { theme = "auto", component_separators = "", section_separators = "", globalstatus = true, }, sections = { lualine_a = { "mode" }, lualine_b = { "branch" }, lualine_c = { { "filename", path = 1 }, breadcrumb }, lualine_x = { { "kulala", icon = "HTTP" }, { "db_ui#statusline", type = "vim_fun", cond = function() return vim.fn.exists("*db_ui#statusline") == 1 end, }, "diagnostics", }, lualine_y = { "filetype" }, lualine_z = { "location" }, }, }) end, }, { "gitsigns.nvim", event = { "BufReadPre", "BufNewFile" }, after = function() require("gitsigns").setup({ signs = { add = { text = "│" }, change = { text = "│" }, delete = { text = "_" }, topdelete = { text = "‾" }, }, on_attach = function(bufnr) local gs = require("gitsigns") local map_hunk = function(lhs, direction, desc) vim.keymap.set("n", lhs, function() if vim.wo.diff then return lhs end vim.schedule(function() gs.nav_hunk(direction) end) return "" end, { buffer = bufnr, desc = desc, expr = true }) end map_hunk("]h", "next", "Next git hunk") map_hunk("[h", "prev", "Previous git hunk") vim.keymap.set("n", "gp", gs.preview_hunk, { buffer = bufnr, desc = "Preview git hunk" }) vim.keymap.set("n", "gs", gs.stage_hunk, { buffer = bufnr, desc = "Stage git hunk" }) end, }) end, }, { "diffview.nvim", cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewRefresh", "DiffviewFileHistory" }, keys = { { "gd", function() vim.cmd("DiffviewOpen -C" .. vim.fn.fnameescape(require("project").root())) end, desc = "Review project changes", }, { "gq", "DiffviewClose", desc = "Close git review" }, { "gr", "DiffviewRefresh", desc = "Refresh git review" }, }, after = function() require("diffview").setup({}) end, }, { "zen-mode.nvim", cmd = "ZenMode", keys = { { "uz", "ZenMode", desc = "Toggle zen mode" }, }, after = function() require("zen-mode").setup({}) end, }, { "render-markdown.nvim", ft = "markdown", keys = { { "um", "RenderMarkdown buf_toggle", desc = "Toggle Markdown rendering" }, }, after = function() require("render-markdown").setup({}) end, }, { "which-key.nvim", event = "VimEnter", after = function() require("which-key").setup({ preset = "helix", spec = { { "b", group = "Buffers" }, { "c", group = "Code" }, { "d", group = "Diagnostics" }, { "g", group = "Git" }, { "n", group = "Notes" }, { "q", group = "Database" }, { "r", group = "HTTP" }, { "s", group = "Search" }, { "u", group = "UI" }, }, }) end, }, })