Moved filename from lualine to incline

This commit is contained in:
2024-09-24 22:35:12 +02:00
parent 540e7f811d
commit d61284f62f
2 changed files with 12 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ return {
event = "VeryLazy",
config = function()
local incline = require("incline")
local devicons = require("nvim-web-devicons")
incline.setup({
highlight = {
@@ -19,11 +18,14 @@ return {
},
},
render = function(props)
local devicons = require("nvim-web-devicons")
local helpers = require("incline.helpers")
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 modified = vim.bo[props.buf].modified
local function get_git_diff()
local icons = { removed = "", changed = "", added = "" }
@@ -66,6 +68,9 @@ return {
return {
{ get_diagnostic_label() },
{ get_git_diff() },
ft_icon and { " ", ft_icon, " ", guibg = ft_color, guifg = helpers.contrast_color(ft_color) } or "",
" ",
{ filename, gui = modified and "bold,italic" or "bold" },
}
end,
})

View File

@@ -86,10 +86,10 @@ return {
return { bg = mode_color[vim.fn.mode()], fg = colors.bg }
end,
}
local filename = {
"filename",
color = { fg = colors.magenta, bg = "None", gui = "bold" },
}
-- local filename = {
-- "filename",
-- color = { fg = colors.magenta, bg = "None", gui = "bold" },
-- }
local branch = {
"branch",
icon = "",
@@ -283,7 +283,8 @@ return {
},
sections = {
lualine_a = { mode },
lualine_b = { filename, branch },
-- lualine_b = { filename, branch },
lualine_b = { branch },
-- lualine_c = { diagnostics, sep, harpoon },
lualine_c = { sep, harpoon },
-- lualine_x = { copilot, diff, fileformat, lazy, mason },