local function lualine_spell() if vim.wo.spell then return "spell" else return end end local conditions = { spell_on = function() return vim.wo.spell end, filetype_is_tex = function() return vim.bo.filetype == "tex" end } -- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/ -- override 'encoding': don't display if encoding is utf-8. local encoding = function() local ret, _ = vim.bo.fenc:gsub("^utf%-8$", "") return ret end -- fileformat: don't display if &ff is unix. local fileformat = function() local ret, _ = vim.bo.fileformat:gsub("^unix$", "") return ret end return { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() require("lualine").setup({ options = { icons_enabled = true, theme = "catppuccin", section_separators = { left = '', right = '' }, component_separators = { left = '', right = '' }, disabled_filetypes = { "NvimTree", }, }, sections = { lualine_a = { { 'mode', fmt = string.lower } }, lualine_b = { 'branch', { 'diff', diff_color = { added = { fg = 'LightGreen' }, modified = { fg = 'LightBlue' }, removed = { fg = 'LightRed' }, } }, { lualine_spell, cond = conditions.spell_on, } }, lualine_c = { 'filename' }, lualine_x = { encoding, fileformat, 'filetype' }, lualine_y = { 'progress' }, lualine_z = { 'location', { 'diagnostics', sources = { 'nvim_diagnostic' }, sections = { 'error', 'warn', 'info', 'hint' }, symbols = { error = 'e', warn = 'w', info = 'i', hint = 'h' } } } }, inactive_sections = { lualine_a = {}, lualine_b = {}, lualine_c = { 'filename' }, lualine_x = {}, lualine_y = {}, lualine_z = {} }, tabline = {}, extensions = {} }) end, }