From 845c6a4fe72df8d3b599ca52a5f8b0b084386ba6 Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Tue, 20 Sep 2022 16:03:27 -0400 Subject: feat(lualine): update statusline --- lua/lvim/core/lualine/components.lua | 35 ++++++++++++++++++++++++++++------- lua/lvim/core/lualine/styles.lua | 6 ++---- 2 files changed, 30 insertions(+), 11 deletions(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index c88bf82b..d7e6cd59 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -12,10 +12,26 @@ local function diff_source() end end +local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true) +local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true) +local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true) + +vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background }) +vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background }) +vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.background }) + +local location_color = nil +local branch = "" + +if lvim.colorscheme == "tokyonight-night" then + location_color = "SLBranchName" + branch = "%#SLGitIcon#" .. "" .. "%*" .. "%#SLBranchName#" +end + return { mode = { function() - return " " + return "  " end, padding = { left = 0, right = 0 }, color = {}, @@ -23,9 +39,8 @@ return { }, branch = { "b:gitsigns_head", - icon = " ", + icon = branch, color = { gui = "bold" }, - cond = conditions.hide_in_width, }, filename = { "filename", @@ -61,7 +76,7 @@ return { "diagnostics", sources = { "nvim_diagnostic" }, symbols = { error = " ", warn = " ", info = " ", hint = " " }, - cond = conditions.hide_in_width, + -- cond = conditions.hide_in_width, }, treesitter = { function() @@ -111,8 +126,14 @@ return { color = { gui = "bold" }, cond = conditions.hide_in_width, }, - location = { "location", cond = conditions.hide_in_width, color = {} }, - progress = { "progress", cond = conditions.hide_in_width, color = {} }, + location = { "location", color = location_color }, + progress = { + "progress", + fmt = function() + return "%P/%L" + end, + color = {}, + }, spaces = { function() if not vim.api.nvim_buf_get_option(0, "expandtab") then @@ -144,7 +165,7 @@ return { return chars[index] end, padding = { left = 0, right = 0 }, - color = { fg = colors.yellow, bg = colors.bg }, + color = "SLProgress", cond = nil, }, } diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua index 8991d9d9..49ad6312 100644 --- a/lua/lvim/core/lualine/styles.lua +++ b/lua/lvim/core/lualine/styles.lua @@ -80,7 +80,6 @@ styles.lvim = { }, lualine_b = { components.branch, - components.filename, }, lualine_c = { components.diff, @@ -88,13 +87,12 @@ styles.lvim = { }, lualine_x = { components.diagnostics, - components.treesitter, components.lsp, components.filetype, }, - lualine_y = {}, + lualine_y = { components.location }, lualine_z = { - components.scrollbar, + components.progress, }, }, inactive_sections = { -- cgit v1.2.3 From 5948c30362ea947d1e66aa8ebb8c85845907b5b7 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Tue, 20 Sep 2022 23:03:34 -0400 Subject: fix: make sure to use global in lualine --- lua/lvim/core/lualine/styles.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua index 49ad6312..5e6f3864 100644 --- a/lua/lvim/core/lualine/styles.lua +++ b/lua/lvim/core/lualine/styles.lua @@ -11,6 +11,7 @@ styles.none = { style = "none", options = { theme = "auto", + globalstatus = true, icons_enabled = lvim.use_icons, component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, @@ -40,6 +41,7 @@ styles.default = { style = "default", options = { theme = "auto", + globalstatus = true, icons_enabled = lvim.use_icons, component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, -- cgit v1.2.3 From 21311b54a52c13dfe687f22c1d7bee0a163525f2 Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Wed, 21 Sep 2022 14:00:44 -0400 Subject: fix: plain tokyonight --- lua/lvim/core/lualine/components.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index d7e6cd59..f52502dc 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -23,7 +23,7 @@ vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.backgr local location_color = nil local branch = "" -if lvim.colorscheme == "tokyonight-night" then +if lvim.colorscheme == "tokyonight" then location_color = "SLBranchName" branch = "%#SLGitIcon#" .. "" .. "%*" .. "%#SLBranchName#" end -- cgit v1.2.3 From efa466a99add5fad498e4868ca4b37294e4d8307 Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Wed, 21 Sep 2022 14:05:19 -0400 Subject: fix: lualine filetype padding --- lua/lvim/core/lualine/components.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index f52502dc..75de300a 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -154,7 +154,7 @@ return { color = {}, cond = conditions.hide_in_width, }, - filetype = { "filetype", cond = conditions.hide_in_width }, + filetype = { "filetype", cond = conditions.hide_in_width, padding = { left = 0, right = 1 } }, scrollbar = { function() local current_line = vim.fn.line "." -- cgit v1.2.3 From 4a48232ee064fd1340a78fdbc2582de6503f9489 Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Wed, 21 Sep 2022 14:07:31 -0400 Subject: fix(lualine): little more padding --- lua/lvim/core/lualine/components.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index 75de300a..690462cc 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -154,7 +154,7 @@ return { color = {}, cond = conditions.hide_in_width, }, - filetype = { "filetype", cond = conditions.hide_in_width, padding = { left = 0, right = 1 } }, + filetype = { "filetype", cond = conditions.hide_in_width, padding = { left = 1, right = 2 } }, scrollbar = { function() local current_line = vim.fn.line "." -- cgit v1.2.3 From 526c010c80de00815f3fb53e1461fcbeabc55f12 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Wed, 21 Sep 2022 14:41:48 -0400 Subject: fix: lualine git signs padding --- lua/lvim/core/lualine/components.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index 690462cc..0a58e415 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -50,7 +50,8 @@ return { diff = { "diff", source = diff_source, - symbols = { added = "  ", modified = " ", removed = " " }, + symbols = { added = " ", modified = " ", removed = " " }, + padding = { left = 2, right = 1 }, diff_color = { added = { fg = colors.green }, modified = { fg = colors.yellow }, -- cgit v1.2.3 From 2cfb55ddb628e135a95f669d9f393ed3a2b1d950 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Wed, 21 Sep 2022 17:58:52 -0400 Subject: feat(lualine): improvements --- lua/lvim/core/lualine/components.lua | 26 +++++++++++++++----------- lua/lvim/core/lualine/conditions.lua | 2 +- lua/lvim/core/lualine/styles.lua | 1 + 3 files changed, 17 insertions(+), 12 deletions(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index 0a58e415..5f29d4ef 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -22,10 +22,18 @@ vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.backgr local location_color = nil local branch = "" +local separator = "│" if lvim.colorscheme == "tokyonight" then location_color = "SLBranchName" branch = "%#SLGitIcon#" .. "" .. "%*" .. "%#SLBranchName#" + + local status_ok, tnc = pcall(require, "tokyonight.colors") + if status_ok then + local tncolors = tnc.setup { transform = true } + vim.api.nvim_set_hl(0, "SLSeparator", { fg = cursorline_hl.background, bg = tncolors.black }) + separator = "%#SLSeparator#" .. "│" .. "%*" + end end return { @@ -124,6 +132,7 @@ return { local unique_client_names = vim.fn.uniq(buf_client_names) return "[" .. table.concat(unique_client_names, ", ") .. "]" end, + separator = separator, color = { gui = "bold" }, cond = conditions.hide_in_width, }, @@ -135,19 +144,14 @@ return { end, color = {}, }, + spaces = { function() - if not vim.api.nvim_buf_get_option(0, "expandtab") then - return "Tab size: " .. vim.api.nvim_buf_get_option(0, "tabstop") .. " " - end - local size = vim.api.nvim_buf_get_option(0, "shiftwidth") - if size == 0 then - size = vim.api.nvim_buf_get_option(0, "tabstop") - end - return "Spaces: " .. size .. " " + local shiftwidth = vim.api.nvim_buf_get_option(0, "shiftwidth") + return " " .. shiftwidth end, - cond = conditions.hide_in_width, - color = {}, + separator = separator, + padding = 1, }, encoding = { "o:encoding", @@ -155,7 +159,7 @@ return { color = {}, cond = conditions.hide_in_width, }, - filetype = { "filetype", cond = conditions.hide_in_width, padding = { left = 1, right = 2 } }, + filetype = { "filetype", cond = nil, padding = { left = 1, right = 1 } }, scrollbar = { function() local current_line = vim.fn.line "." diff --git a/lua/lvim/core/lualine/conditions.lua b/lua/lvim/core/lualine/conditions.lua index 6e120b26..8a89c0bd 100644 --- a/lua/lvim/core/lualine/conditions.lua +++ b/lua/lvim/core/lualine/conditions.lua @@ -1,4 +1,4 @@ -local window_width_limit = 70 +local window_width_limit = 100 local conditions = { buffer_not_empty = function() diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua index 5e6f3864..7e576855 100644 --- a/lua/lvim/core/lualine/styles.lua +++ b/lua/lvim/core/lualine/styles.lua @@ -90,6 +90,7 @@ styles.lvim = { lualine_x = { components.diagnostics, components.lsp, + components.spaces, components.filetype, }, lualine_y = { components.location }, -- cgit v1.2.3 From 2ecdc8ecbff0f8b15eca46d7f51ba1eab873a8a8 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Wed, 21 Sep 2022 21:12:15 -0400 Subject: fix: improve lualine inactive --- lua/lvim/core/lualine/styles.lua | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua index 7e576855..57bd7260 100644 --- a/lua/lvim/core/lualine/styles.lua +++ b/lua/lvim/core/lualine/styles.lua @@ -71,6 +71,7 @@ styles.lvim = { style = "lvim", options = { theme = "auto", + globalstatus = true, icons_enabled = lvim.use_icons, component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, @@ -100,13 +101,25 @@ styles.lvim = { }, inactive_sections = { lualine_a = { - "filename", + components.mode, + }, + lualine_b = { + components.branch, + }, + lualine_c = { + components.diff, + components.python_env, + }, + lualine_x = { + components.diagnostics, + components.lsp, + components.spaces, + components.filetype, + }, + lualine_y = { components.location }, + lualine_z = { + components.progress, }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, }, tabline = {}, extensions = { "nvim-tree" }, -- cgit v1.2.3 From 3803fff75846089f5c4aac70bbed7b58c77561e3 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Wed, 21 Sep 2022 21:18:44 -0400 Subject: fix: lualine slightly better --- lua/lvim/core/lualine/styles.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua index 57bd7260..0d759c95 100644 --- a/lua/lvim/core/lualine/styles.lua +++ b/lua/lvim/core/lualine/styles.lua @@ -75,7 +75,7 @@ styles.lvim = { icons_enabled = lvim.use_icons, component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, - disabled_filetypes = { "alpha", "NvimTree", "Outline" }, + disabled_filetypes = { "alpha" }, }, sections = { lualine_a = { @@ -122,7 +122,7 @@ styles.lvim = { }, }, tabline = {}, - extensions = { "nvim-tree" }, + extensions = {}, } function M.get_style(style) -- cgit v1.2.3 From bea690fc16e3e23e8644c61b1d2e140fb8851d1b Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Wed, 21 Sep 2022 21:21:00 -0400 Subject: fix: use columns instead of winwidth --- lua/lvim/core/lualine/conditions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/conditions.lua b/lua/lvim/core/lualine/conditions.lua index 8a89c0bd..42d52a83 100644 --- a/lua/lvim/core/lualine/conditions.lua +++ b/lua/lvim/core/lualine/conditions.lua @@ -5,7 +5,7 @@ local conditions = { return vim.fn.empty(vim.fn.expand "%:t") ~= 1 end, hide_in_width = function() - return vim.fn.winwidth(0) > window_width_limit + return vim.o.columns > window_width_limit end, -- check_git_workspace = function() -- local filepath = vim.fn.expand "%:p:h" -- cgit v1.2.3 From 8767a17b5e6087153494a5cd30e5ae0c5165c9af Mon Sep 17 00:00:00 2001 From: Philippe Richard Date: Sun, 2 Oct 2022 23:48:23 -0400 Subject: feat: move icons to a single icons file (#3115) --- lua/lvim/core/lualine/components.lua | 31 +++++++++++++++++++++---------- lua/lvim/core/lualine/styles.lua | 10 ++++++++-- 2 files changed, 29 insertions(+), 12 deletions(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index 5f29d4ef..badece1e 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -21,25 +21,25 @@ vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorl vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.background }) local location_color = nil -local branch = "" -local separator = "│" +local branch = lvim.icons.git.Branch +local separator = lvim.icons.ui.LineMiddle if lvim.colorscheme == "tokyonight" then location_color = "SLBranchName" - branch = "%#SLGitIcon#" .. "" .. "%*" .. "%#SLBranchName#" + branch = "%#SLGitIcon#" .. lvim.icons.git.Branch .. "%*" .. "%#SLBranchName#" local status_ok, tnc = pcall(require, "tokyonight.colors") if status_ok then local tncolors = tnc.setup { transform = true } vim.api.nvim_set_hl(0, "SLSeparator", { fg = cursorline_hl.background, bg = tncolors.black }) - separator = "%#SLSeparator#" .. "│" .. "%*" + separator = "%#SLSeparator#" .. lvim.icons.ui.LineMiddle .. "%*" end end return { mode = { function() - return "  " + return " " .. lvim.icons.ui.Target .. " " end, padding = { left = 0, right = 0 }, color = {}, @@ -58,7 +58,11 @@ return { diff = { "diff", source = diff_source, - symbols = { added = " ", modified = " ", removed = " " }, + symbols = { + added = lvim.icons.git.LineAdded .. " ", + modified = lvim.icons.git.LineModified .. " ", + removed = lvim.icons.git.LineRemoved .. " ", + }, padding = { left = 2, right = 1 }, diff_color = { added = { fg = colors.green }, @@ -73,7 +77,9 @@ return { if vim.bo.filetype == "python" then local venv = os.getenv "CONDA_DEFAULT_ENV" or os.getenv "VIRTUAL_ENV" if venv then - return string.format("  (%s)", utils.env_cleanup(venv)) + local icons = require "nvim-web-devicons" + local py_icon, _ = icons.get_icon ".py" + return string.format(" " .. py_icon .. " (%s)", utils.env_cleanup(venv)) end end return "" @@ -84,12 +90,17 @@ return { diagnostics = { "diagnostics", sources = { "nvim_diagnostic" }, - symbols = { error = " ", warn = " ", info = " ", hint = " " }, + symbols = { + error = lvim.icons.diagnostics.BoldError .. " ", + warn = lvim.icons.diagnostics.BoldWarning .. " ", + info = lvim.icons.diagnostics.BoldInformation .. " ", + hint = lvim.icons.diagnostics.BoldHint .. " ", + }, -- cond = conditions.hide_in_width, }, treesitter = { function() - return "" + return lvim.icons.ui.Tree end, color = function() local buf = vim.api.nvim_get_current_buf() @@ -148,7 +159,7 @@ return { spaces = { function() local shiftwidth = vim.api.nvim_buf_get_option(0, "shiftwidth") - return " " .. shiftwidth + return lvim.icons.ui.Tab .. " " .. shiftwidth end, separator = separator, padding = 1, diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua index 0d759c95..8cde37c4 100644 --- a/lua/lvim/core/lualine/styles.lua +++ b/lua/lvim/core/lualine/styles.lua @@ -43,8 +43,14 @@ styles.default = { theme = "auto", globalstatus = true, icons_enabled = lvim.use_icons, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, + component_separators = { + left = lvim.icons.ui.DividerRight, + right = lvim.icons.ui.DividerLeft, + }, + section_separators = { + left = lvim.icons.ui.BoldDividerRight, + right = lvim.icons.ui.BoldDividerLeft, + }, disabled_filetypes = {}, }, sections = { -- cgit v1.2.3 From e5bcf01c759e7c833d8a5f1fcf665b6ea32a7c16 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Tue, 4 Oct 2022 19:23:52 +0200 Subject: refactor: more deliberate reload (#3133) --- lua/lvim/core/lualine/init.lua | 7 ++----- lua/lvim/core/lualine/styles.lua | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/init.lua b/lua/lvim/core/lualine/init.lua index e041e8a8..cd6237bf 100644 --- a/lua/lvim/core/lualine/init.lua +++ b/lua/lvim/core/lualine/init.lua @@ -34,16 +34,13 @@ M.config = function() end M.setup = function() - -- avoid running in headless mode since it's harder to detect failures - if #vim.api.nvim_list_uis() == 0 then - local Log = require "lvim.core.log" - Log:debug "headless mode detected, skipping running setup for lualine" + local status_ok, lualine = pcall(require, "lualine") + if not status_ok then return end require("lvim.core.lualine.styles").update() - local lualine = require "lualine" lualine.setup(lvim.builtin.lualine) if lvim.builtin.lualine.on_config_done then diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua index 8cde37c4..81dbbabb 100644 --- a/lua/lvim/core/lualine/styles.lua +++ b/lua/lvim/core/lualine/styles.lua @@ -152,6 +152,14 @@ function M.update() local style = M.get_style(lvim.builtin.lualine.style) lvim.builtin.lualine = vim.tbl_deep_extend("keep", lvim.builtin.lualine, style) + + local color_template = vim.g.colors_name or lvim.colorscheme + local theme_supported, template = pcall(function() + require("lualine.utils.loader").load_theme(color_template) + end) + if theme_supported and template then + lvim.builtin.lualine.options.theme = color_template + end end return M -- cgit v1.2.3 From dcdfbf1727731c6779396ce450a6b9d33849f835 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Fri, 7 Oct 2022 04:52:37 +0000 Subject: feat: use icon for copilot in statusline (#3173) --- lua/lvim/core/lualine/components.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index badece1e..91411d64 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -16,6 +16,7 @@ local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true) local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true) local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true) +vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = "NONE" }) vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background }) vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background }) vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.background }) @@ -122,12 +123,17 @@ return { end local buf_ft = vim.bo.filetype local buf_client_names = {} + local copilot_active = false -- add client for _, client in pairs(buf_clients) do - if client.name ~= "null-ls" then + if client.name ~= "null-ls" and client.name ~= "copilot" then table.insert(buf_client_names, client.name) end + + if client.name == "copilot" then + copilot_active = true + end end -- add formatter @@ -141,7 +147,14 @@ return { vim.list_extend(buf_client_names, supported_linters) local unique_client_names = vim.fn.uniq(buf_client_names) - return "[" .. table.concat(unique_client_names, ", ") .. "]" + + local language_servers = "[" .. table.concat(unique_client_names, ", ") .. "]" + + if copilot_active then + language_servers = language_servers .. "%#SLCopilot#" .. " " .. lvim.icons.git.Octoface .. "%*" + end + + return language_servers end, separator = separator, color = { gui = "bold" }, -- cgit v1.2.3 From 9925edf79e1aa00a0b00eb20146edef6c3920496 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Sat, 8 Oct 2022 22:14:21 +0000 Subject: fix(lualine): guard setup on install (#3185) --- lua/lvim/core/lualine/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/init.lua b/lua/lvim/core/lualine/init.lua index cd6237bf..f7cacb35 100644 --- a/lua/lvim/core/lualine/init.lua +++ b/lua/lvim/core/lualine/init.lua @@ -34,6 +34,12 @@ M.config = function() end M.setup = function() + if #vim.api.nvim_list_uis() == 0 then + local Log = require "lvim.core.log" + Log:debug "headless mode detected, skipping running setup for lualine" + return + end + local status_ok, lualine = pcall(require, "lualine") if not status_ok then return -- cgit v1.2.3 From c8ef47622d4b9d24e72f4a997de10d642f8de17c Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Sun, 9 Oct 2022 03:49:45 -0400 Subject: fix(lualine): globalstatus=true by default --- lua/lvim/core/lualine/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/init.lua b/lua/lvim/core/lualine/init.lua index f7cacb35..0ee35c04 100644 --- a/lua/lvim/core/lualine/init.lua +++ b/lua/lvim/core/lualine/init.lua @@ -9,7 +9,7 @@ M.config = function() section_separators = nil, theme = nil, disabled_filetypes = nil, - globalstatus = false, + globalstatus = true, }, sections = { lualine_a = nil, -- cgit v1.2.3 From 2a3b9510bc8569f47176d8e4b5f84421161cc420 Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Sat, 15 Oct 2022 22:29:10 -0400 Subject: fix: copilot background should matcha statusline --- lua/lvim/core/lualine/components.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lvim/core/lualine') diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index 91411d64..e4148e20 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -16,7 +16,7 @@ local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true) local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true) local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true) -vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = "NONE" }) +vim.api.nvim_set_hl(0, "SLCopilot", { fg = "#6CC644", bg = statusline_hl.background }) vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background }) vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background }) vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.background }) -- cgit v1.2.3