diff --git a/lua/plugins/UI.lua b/lua/plugins/UI.lua index c8b0fa4..57bbfeb 100644 --- a/lua/plugins/UI.lua +++ b/lua/plugins/UI.lua @@ -39,13 +39,15 @@ return { "nvim-lualine/lualine.nvim", opts = function(_, opts) local icons = require("lazyvim.config").icons + local warning_col = { fg = "#bf7b00" } opts.options.theme = "horizon" opts.sections = { lualine_a = { "mode" }, lualine_b = { - Util.lualine.root_dir({ color = { fg = "#bf7b00" } }), + -- Show "root dir" of current file when different from CWD + Util.lualine.root_dir({ color = warning_col }), { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, { Util.lualine.pretty_path() }, }, @@ -63,8 +65,22 @@ return { lualine_x = opts.sections.lualine_x, lualine_z = opts.sections.lualine_y, lualine_y = { - { "fileformat", separator = "", padding = { left = 1, right = 0 } }, - "encoding", + { + "fileformat", + color = function() + return (vim.bo.fileformat ~= "unix") and warning_col or nil + end, + separator = "", + padding = { left = 1, right = 0 }, + }, + { + function() + return vim.o.fileencoding + end, + color = function() + return (vim.o.fileencoding ~= "utf-8") and warning_col or nil + end, + }, }, } end,