From d790bcaa8277c7531461066be487a007aa2562f5 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Fri, 11 Mar 2022 23:04:59 +0300 Subject: [PATCH] update status line --- config/nvim/lua/user/lualine.lua | 60 ++++++++------------------------ 1 file changed, 15 insertions(+), 45 deletions(-) diff --git a/config/nvim/lua/user/lualine.lua b/config/nvim/lua/user/lualine.lua index 7e91cc9..f34c2b2 100644 --- a/config/nvim/lua/user/lualine.lua +++ b/config/nvim/lua/user/lualine.lua @@ -12,23 +12,26 @@ local branch = { local diagnostics = { "diagnostics", - sections = { "error", "warn" }, + sections = { "error", "warn", "info", "hint" }, + always_visible = true, } local filename = { - "filename", + function() + local filename = vim.fn.expand("%:t") + local fileext = vim.fn.expand("%:e") + local icon = require("nvim-web-devicons").get_icon(filename, fileext) + + return icon .. " " .. filename + end, } local fileformat = { - "fileformat", - symbols = { - unix = "", - dos = "", - mac = "", - }, + function() + return "[" .. vim.bo.fileformat .. "]" + end, } --- don't know if it's working or not. seems working right local tabstop = { function() local tabstop = vim.bo.tabstop @@ -41,39 +44,6 @@ local tabstop = { end, } -local location = { - "location", -} - -local encoding = { - "encoding", -} - -local filetype = { - "filetype", -} - --- local timer = vim.loop.new_timer() --- timer:start( --- 0, --- 1000, --- vim.schedule_wrap(function() --- vim.g.lualine_time_module = os.date("%H:%M", os.time()) --- end) --- ) --- local time = { --- function() --- return vim.g.lualine_time_module --- end, --- cond = function() --- if vim.g.lualine_time_module then --- return true --- end - --- return false --- end, --- } - lualine.setup({ options = { disabled_filetypes = { "NvimTree" }, @@ -83,9 +53,9 @@ lualine.setup({ sections = { lualine_a = { mode }, lualine_b = { branch }, - lualine_c = { diagnostics, filename, fileformat }, - lualine_x = { tabstop, location, encoding, filetype }, - lualine_y = {}, + lualine_c = { diagnostics }, + lualine_x = { tabstop, fileformat }, + lualine_y = { filename }, lualine_z = {}, }, })