diff --git a/nvim/lua/plugs/incline.lua b/nvim/lua/plugs/incline.lua new file mode 100644 index 0000000..5405084 --- /dev/null +++ b/nvim/lua/plugs/incline.lua @@ -0,0 +1,69 @@ +return { + "b0o/incline.nvim", + dependencies = { + "lewis6991/gitsigns.nvim" + }, + config = function() + require("gitsigns").setup({}) + local devicons = require("nvim-web-devicons") + require("incline").setup({ + window = { + padding = 0, + }, + render = function(props) + local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t") + if filename == "" then + filename = "[No Name]" + end + local ft_icon, ft_color = devicons.get_icon_color(filename) + + local function get_git_diff() + local icons = { removed = "", changed = "", added = "" } + local signs = vim.b[props.buf].gitsigns_status_dict + local labels = {} + if signs == nil then + return labels + end + for name, icon in pairs(icons) do + if tonumber(signs[name]) and signs[name] > 0 then + table.insert(labels, { icon .. signs[name] .. " ", group = "Diff" .. name }) + end + end + if #labels > 0 then + table.insert(labels, { "┊ " }) + end + return labels + end + + local function get_diagnostic_label() + local icons = { error = "", warn = "", info = "", hint = "" } + local label = {} + + for severity, icon in pairs(icons) do + local n = #vim.diagnostic.get(props.buf, { severity = vim.diagnostic.severity[string.upper(severity)] }) + if n > 0 then + table.insert(label, { icon .. n .. " ", group = "DiagnosticSign" .. severity }) + end + end + if #label > 0 then + table.insert(label, { "┊ " }) + end + return label + end + + return { + guibg = "#1e2030", + guifg = "#cad3f5", + { " " }, + { get_diagnostic_label() }, + { get_git_diff() }, + { (ft_icon or "") .. " ", guifg = ft_color, guibg = "none" }, + { filename .. " ", gui = vim.bo[props.buf].modified and "bold,italic" or "bold" }, + { "┊  " .. vim.api.nvim_win_get_number(props.win), group = "DevIconWindows" }, + { " " } + } + end, + }) + end, + event = "VeryLazy", +} diff --git a/nvim/lua/plugs/lualine.lua b/nvim/lua/plugs/lualine.lua index d1d256d..9576b8c 100644 --- a/nvim/lua/plugs/lualine.lua +++ b/nvim/lua/plugs/lualine.lua @@ -14,7 +14,7 @@ return { sections = { lualine_a = {"mode"}, lualine_b = {"branch"}, - lualine_c = { "require(\"lualine_extension_lspsaga\").get_breadcrumbs()" }, + lualine_c = {}, lualine_x = {"encoding", "fileformat", "filetype"}, lualine_y = {"progress"}, lualine_z = {"location"} @@ -22,8 +22,8 @@ return { inactive_sections = { lualine_a = {}, lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = {"location"}, + lualine_c = {}, + lualine_x = {}, lualine_y = {}, lualine_z = {} },