NixOS/home/config/nvim/lua/plugins/incline.lua

29 lines
1 KiB
Lua
Raw Normal View History

2024-06-12 09:54:11 +07:00
return {
-- Show filenames in the right top most of buffer
"b0o/incline.nvim",
config = function()
local helpers = require "incline.helpers"
local devicons = require "nvim-web-devicons"
require("incline").setup {
window = {
padding = 0,
margin = { horizontal = 0 },
},
render = function(props)
local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t")
local ft_icon, ft_color = devicons.get_icon_color(filename)
local modified = vim.bo[props.buf].modified
return {
ft_icon and { " ", ft_icon, " ", guibg = ft_color, guifg = helpers.contrast_color(ft_color) } or "",
" ",
{ filename, gui = modified and "bold,italic" or "bold" },
" ",
guibg = "#44406e",
}
end,
}
end,
-- Optional: Lazy load Incline
event = "VeryLazy",
}