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,
})