From 85fe093efb8353552171575809c02a5e9124fa68 Mon Sep 17 00:00:00 2001 From: chaeing Date: Fri, 20 Aug 2021 02:16:29 -0700 Subject: [Feature] switch galaxyline to lualine (#1329) --- lua/core/lualine/colors.lua | 16 ++++ lua/core/lualine/components.lua | 130 ++++++++++++++++++++++++++++++ lua/core/lualine/conditions.lua | 17 ++++ lua/core/lualine/init.lua | 47 +++++++++++ lua/core/lualine/styles.lua | 170 ++++++++++++++++++++++++++++++++++++++++ lua/core/lualine/utils.lua | 24 ++++++ 6 files changed, 404 insertions(+) create mode 100644 lua/core/lualine/colors.lua create mode 100644 lua/core/lualine/components.lua create mode 100644 lua/core/lualine/conditions.lua create mode 100644 lua/core/lualine/init.lua create mode 100644 lua/core/lualine/styles.lua create mode 100644 lua/core/lualine/utils.lua (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/colors.lua b/lua/core/lualine/colors.lua new file mode 100644 index 00000000..4984cd1f --- /dev/null +++ b/lua/core/lualine/colors.lua @@ -0,0 +1,16 @@ +local colors = { + bg = "#202328", + fg = "#bbc2cf", + yellow = "#ECBE7B", + cyan = "#008080", + darkblue = "#081633", + green = "#98be65", + orange = "#FF8800", + violet = "#a9a1e1", + magenta = "#c678dd", + purple = "#c678dd", + blue = "#51afef", + red = "#ec5f67", +} + +return colors diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua new file mode 100644 index 00000000..b9211a79 --- /dev/null +++ b/lua/core/lualine/components.lua @@ -0,0 +1,130 @@ +local conditions = require "core.lualine.conditions" +local colors = require "core.lualine.colors" + +return { + vi_mode = { + function() + return " " + end, + left_padding = 0, + right_padding = 0, + condition = conditions.hide_in_width, + }, + branch = { + "branch", + icon = " ", + condition = function() + return conditions.hide_in_width() and conditions.check_git_workspace() + end, + }, + diff = { + "diff", + symbols = { added = "  ", modified = "柳", removed = " " }, + color_added = { fg = colors.green }, + color_modified = { fg = colors.yellow }, + color_removed = { fg = colors.red }, + condition = conditions.hide_in_width, + }, + python_env = { + function() + local utils = require "core.lualine.utils" + if vim.bo.filetype == "python" then + local venv = os.getenv "CONDA_DEFAULT_ENV" + if venv then + return string.format("  (%s)", utils.env_cleanup(venv)) + end + venv = os.getenv "VIRTUAL_ENV" + if venv then + return string.format("  (%s)", utils.env_cleanup(venv)) + end + return "" + end + return "" + end, + color = { fg = colors.green }, + condition = conditions.hide_in_width, + }, + diagnostics = { + "diagnostics", + sources = { "nvim_lsp" }, + symbols = { error = " ", warn = " ", info = " ", hint = " " }, + condition = conditions.hide_in_width, + }, + treesitter = { + function() + if next(vim.treesitter.highlighter.active) then + return "  " + end + return "" + end, + color = { fg = colors.green }, + condition = conditions.hide_in_width, + }, + lsp = { + function(msg) + msg = msg or "LSP Inactive" + local buf_clients = vim.lsp.buf_get_clients() + if next(buf_clients) == nil then + return msg + end + local buf_ft = vim.bo.filetype + local buf_client_names = {} + + -- add client + local utils = require "lsp.utils" + local active_client = utils.get_active_client_by_ft(buf_ft) + for _, client in pairs(buf_clients) do + if client.name ~= "null-ls" then + table.insert(buf_client_names, client.name) + end + end + vim.list_extend(buf_client_names, active_client or {}) + + -- add formatter + local formatters = require "lsp.null-ls.formatters" + local supported_formatters = formatters.list_supported_names(buf_ft) + vim.list_extend(buf_client_names, supported_formatters) + + -- add linter + local linters = require "lsp.null-ls.linters" + local supported_linters = linters.list_supported_names(buf_ft) + vim.list_extend(buf_client_names, supported_linters) + + return table.concat(buf_client_names, ", ") + end, + condition = conditions.hide_in_width, + icon = " ", + color = { gui = "bold" }, + }, + location = { "location", condition = conditions.hide_in_width }, + progress = { "progress", condition = conditions.hide_in_width }, + spaces = { + function() + local label = "Spaces: " + if not vim.api.nvim_buf_get_option(0, "expandtab") then + label = "Tab size: " + end + return label .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " + end, + condition = conditions.hide_in_width, + }, + encoding = { + "o:encoding", + upper = true, + condition = conditions.hide_in_width, + }, + filetype = { "filetype", condition = conditions.hide_in_width }, + scrollbar = { + function() + local current_line = vim.fn.line "." + local total_lines = vim.fn.line "$" + local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" } + local line_ratio = current_line / total_lines + local index = math.ceil(line_ratio * #chars) + return chars[index] + end, + color = { fg = colors.yellow, bg = colors.bg }, + left_padding = 0, + right_padding = 0, + }, +} diff --git a/lua/core/lualine/conditions.lua b/lua/core/lualine/conditions.lua new file mode 100644 index 00000000..2d2d81ef --- /dev/null +++ b/lua/core/lualine/conditions.lua @@ -0,0 +1,17 @@ +local window_width_limit = 80 + +local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand "%:t") ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > window_width_limit + end, + check_git_workspace = function() + local filepath = vim.fn.expand "%:p:h" + local gitdir = vim.fn.finddir(".git", filepath .. ";") + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, +} + +return conditions diff --git a/lua/core/lualine/init.lua b/lua/core/lualine/init.lua new file mode 100644 index 00000000..5b3ce2a1 --- /dev/null +++ b/lua/core/lualine/init.lua @@ -0,0 +1,47 @@ +local M = {} +M.config = function() + lvim.builtin.lualine = { + active = true, + style = "lvim", + options = { + icons_enabled = nil, + component_separators = nil, + section_separators = nil, + theme = nil, + disabled_filetypes = nil, + }, + sections = { + lualine_a = nil, + lualine_b = nil, + lualine_c = nil, + lualine_x = nil, + lualine_y = nil, + lualine_z = nil, + }, + inactive_sections = { + lualine_a = nil, + lualine_b = nil, + lualine_c = nil, + lualine_x = nil, + lualine_y = nil, + lualine_z = nil, + }, + tabline = nil, + extensions = nil, + on_config_done = nil, + } +end + +M.setup = function() + require("core.lualine.styles").update() + require("core.lualine.utils").validate_theme() + + local lualine = require "lualine" + lualine.setup(lvim.builtin.lualine) + + if lvim.builtin.lualine.on_config_done then + lvim.builtin.lualine.on_config_done(lualine, lvim.builtin.lualine) + end +end + +return M diff --git a/lua/core/lualine/styles.lua b/lua/core/lualine/styles.lua new file mode 100644 index 00000000..e35f66fe --- /dev/null +++ b/lua/core/lualine/styles.lua @@ -0,0 +1,170 @@ +local M = {} +local components = require "core.lualine.components" + +local styles = { + lvim = nil, + default = nil, + none = nil, +} + +styles.none = { + style = "none", + options = { + icons_enabled = true, + component_separators = "", + section_separators = "", + disabled_filetypes = {}, + }, + sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, +} + +styles.default = { + style = "default", + options = { + icons_enabled = true, + component_separators = { "", "" }, + section_separators = { "", "" }, + disabled_filetypes = {}, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { "filename" }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, +} + +styles.lvim = { + style = "lvim", + options = { + icons_enabled = true, + component_separators = "", + section_separators = "", + disabled_filetypes = { "dashboard", "" }, + }, + sections = { + lualine_a = { + components.vi_mode, + }, + lualine_b = { + components.branch, + }, + lualine_c = { + components.diff, + components.python_env, + }, + lualine_x = { + components.diagnostics, + components.treesitter, + components.lsp, + -- components.location, + -- components.progress, + -- components.spaces, + -- components.encoding, + components.filetype, + }, + lualine_y = { + -- components.filetype, + }, + lualine_z = { + components.scrollbar, + }, + }, + inactive_sections = { + lualine_a = { + "filename", + }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = { "nvim-tree" }, +} + +function M.get_style(style) + local style_keys = vim.tbl_keys(styles) + if not vim.tbl_contains(style_keys, style) then + local Log = require "core.log" + local logger = Log:get_default() + logger.error( + "Invalid lualine style", + string.format('"%s"', style), + "options are: ", + string.format('"%s"', table.concat(style_keys, '", "')) + ) + logger.info '"lvim" style is applied.' + style = "lvim" + end + + return vim.deepcopy(styles[style]) +end + +function M.update() + local config = lvim.builtin.lualine + local style = M.get_style(config.style) + + lvim.builtin.lualine = { + active = true, + style = style.style, + options = { + icons_enabled = config.options.icons_enabled or style.options.icons_enabled, + component_separators = config.options.component_separators or style.options.component_separators, + section_separators = config.options.section_separators or style.options.section_separators, + theme = config.options.theme or lvim.colorscheme or "auto", + disabled_filetypes = config.options.disabled_filetypes or style.options.disabled_filetypes, + }, + sections = { + lualine_a = config.sections.lualine_a or style.sections.lualine_a, + lualine_b = config.sections.lualine_b or style.sections.lualine_b, + lualine_c = config.sections.lualine_c or style.sections.lualine_c, + lualine_x = config.sections.lualine_x or style.sections.lualine_x, + lualine_y = config.sections.lualine_y or style.sections.lualine_y, + lualine_z = config.sections.lualine_z or style.sections.lualine_z, + }, + inactive_sections = { + lualine_a = config.inactive_sections.lualine_a or style.inactive_sections.lualine_a, + lualine_b = config.inactive_sections.lualine_b or style.inactive_sections.lualine_b, + lualine_c = config.inactive_sections.lualine_c or style.inactive_sections.lualine_c, + lualine_x = config.inactive_sections.lualine_x or style.inactive_sections.lualine_x, + lualine_y = config.inactive_sections.lualine_y or style.inactive_sections.lualine_y, + lualine_z = config.inactive_sections.lualine_z or style.inactive_sections.lualine_z, + }, + tabline = config.tabline or style.tabline, + extensions = config.extensions or style.extensions, + on_config_done = config.on_config_done, + } +end + +return M diff --git a/lua/core/lualine/utils.lua b/lua/core/lualine/utils.lua new file mode 100644 index 00000000..f2f29592 --- /dev/null +++ b/lua/core/lualine/utils.lua @@ -0,0 +1,24 @@ +local M = {} + +function M.validate_theme() + local theme = lvim.builtin.lualine.options.theme + + local lualine_loader = require "lualine.utils.loader" + local ok = pcall(lualine_loader.load_theme, theme) + if not ok then + lvim.builtin.lualine.options.theme = "auto" + end +end + +function M.env_cleanup(venv) + if string.find(venv, "/") then + local final_venv = venv + for w in venv:gmatch "([^/]+)" do + final_venv = w + end + venv = final_venv + end + return venv +end + +return M -- cgit v1.2.3 From 378c1c3eb5f32da7057371fedda405250ccb67c8 Mon Sep 17 00:00:00 2001 From: chaeing Date: Mon, 23 Aug 2021 23:49:18 -0700 Subject: [Feature] enhance lualine config (#1372) --- lua/core/lualine/components.lua | 36 +++++++++++++++++++++-------- lua/core/lualine/init.lua | 2 +- lua/core/lualine/styles.lua | 50 ++++++++--------------------------------- lua/core/lualine/utils.lua | 3 +++ 4 files changed, 40 insertions(+), 51 deletions(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua index b9211a79..042f6b6d 100644 --- a/lua/core/lualine/components.lua +++ b/lua/core/lualine/components.lua @@ -2,13 +2,16 @@ local conditions = require "core.lualine.conditions" local colors = require "core.lualine.colors" return { - vi_mode = { + mode = { function() return " " end, left_padding = 0, right_padding = 0, - condition = conditions.hide_in_width, + condition = function() + return true + end, + color = {}, }, branch = { "branch", @@ -16,6 +19,14 @@ return { condition = function() return conditions.hide_in_width() and conditions.check_git_workspace() end, + color = { gui = "bold" }, + }, + filename = { + "filename", + condition = function() + return true + end, + color = {}, }, diff = { "diff", @@ -24,6 +35,7 @@ return { color_modified = { fg = colors.yellow }, color_removed = { fg = colors.red }, condition = conditions.hide_in_width, + color = {}, }, python_env = { function() @@ -41,14 +53,15 @@ return { end return "" end, - color = { fg = colors.green }, condition = conditions.hide_in_width, + color = { fg = colors.green }, }, diagnostics = { "diagnostics", sources = { "nvim_lsp" }, symbols = { error = " ", warn = " ", info = " ", hint = " " }, condition = conditions.hide_in_width, + color = {}, }, treesitter = { function() @@ -57,8 +70,8 @@ return { end return "" end, - color = { fg = colors.green }, condition = conditions.hide_in_width, + color = { fg = colors.green }, }, lsp = { function(msg) @@ -92,12 +105,12 @@ return { return table.concat(buf_client_names, ", ") end, - condition = conditions.hide_in_width, icon = " ", + condition = conditions.hide_in_width, color = { gui = "bold" }, }, - location = { "location", condition = conditions.hide_in_width }, - progress = { "progress", condition = conditions.hide_in_width }, + location = { "location", condition = conditions.hide_in_width, color = {} }, + progress = { "progress", condition = conditions.hide_in_width, color = {} }, spaces = { function() local label = "Spaces: " @@ -107,13 +120,15 @@ return { return label .. vim.api.nvim_buf_get_option(0, "shiftwidth") .. " " end, condition = conditions.hide_in_width, + color = {}, }, encoding = { "o:encoding", upper = true, condition = conditions.hide_in_width, + color = {}, }, - filetype = { "filetype", condition = conditions.hide_in_width }, + filetype = { "filetype", condition = conditions.hide_in_width, color = {} }, scrollbar = { function() local current_line = vim.fn.line "." @@ -123,8 +138,11 @@ return { local index = math.ceil(line_ratio * #chars) return chars[index] end, - color = { fg = colors.yellow, bg = colors.bg }, left_padding = 0, right_padding = 0, + condition = function() + return true + end, + color = { fg = colors.yellow, bg = colors.bg }, }, } diff --git a/lua/core/lualine/init.lua b/lua/core/lualine/init.lua index 5b3ce2a1..aa6fe098 100644 --- a/lua/core/lualine/init.lua +++ b/lua/core/lualine/init.lua @@ -40,7 +40,7 @@ M.setup = function() lualine.setup(lvim.builtin.lualine) if lvim.builtin.lualine.on_config_done then - lvim.builtin.lualine.on_config_done(lualine, lvim.builtin.lualine) + lvim.builtin.lualine.on_config_done(lualine) end end diff --git a/lua/core/lualine/styles.lua b/lua/core/lualine/styles.lua index e35f66fe..876d7fa3 100644 --- a/lua/core/lualine/styles.lua +++ b/lua/core/lualine/styles.lua @@ -69,14 +69,15 @@ styles.lvim = { icons_enabled = true, component_separators = "", section_separators = "", - disabled_filetypes = { "dashboard", "" }, + disabled_filetypes = { "dashboard" }, }, sections = { lualine_a = { - components.vi_mode, + components.mode, }, lualine_b = { components.branch, + components.filename, }, lualine_c = { components.diff, @@ -86,15 +87,9 @@ styles.lvim = { components.diagnostics, components.treesitter, components.lsp, - -- components.location, - -- components.progress, - -- components.spaces, - -- components.encoding, components.filetype, }, - lualine_y = { - -- components.filetype, - }, + lualine_y = {}, lualine_z = { components.scrollbar, }, @@ -132,39 +127,12 @@ function M.get_style(style) end function M.update() - local config = lvim.builtin.lualine - local style = M.get_style(config.style) + local style = M.get_style(lvim.builtin.lualine.style) + if lvim.builtin.lualine.options.theme == nil then + lvim.builtin.lualine.options.theme = lvim.colorscheme + end - lvim.builtin.lualine = { - active = true, - style = style.style, - options = { - icons_enabled = config.options.icons_enabled or style.options.icons_enabled, - component_separators = config.options.component_separators or style.options.component_separators, - section_separators = config.options.section_separators or style.options.section_separators, - theme = config.options.theme or lvim.colorscheme or "auto", - disabled_filetypes = config.options.disabled_filetypes or style.options.disabled_filetypes, - }, - sections = { - lualine_a = config.sections.lualine_a or style.sections.lualine_a, - lualine_b = config.sections.lualine_b or style.sections.lualine_b, - lualine_c = config.sections.lualine_c or style.sections.lualine_c, - lualine_x = config.sections.lualine_x or style.sections.lualine_x, - lualine_y = config.sections.lualine_y or style.sections.lualine_y, - lualine_z = config.sections.lualine_z or style.sections.lualine_z, - }, - inactive_sections = { - lualine_a = config.inactive_sections.lualine_a or style.inactive_sections.lualine_a, - lualine_b = config.inactive_sections.lualine_b or style.inactive_sections.lualine_b, - lualine_c = config.inactive_sections.lualine_c or style.inactive_sections.lualine_c, - lualine_x = config.inactive_sections.lualine_x or style.inactive_sections.lualine_x, - lualine_y = config.inactive_sections.lualine_y or style.inactive_sections.lualine_y, - lualine_z = config.inactive_sections.lualine_z or style.inactive_sections.lualine_z, - }, - tabline = config.tabline or style.tabline, - extensions = config.extensions or style.extensions, - on_config_done = config.on_config_done, - } + lvim.builtin.lualine = vim.tbl_deep_extend("keep", lvim.builtin.lualine, style) end return M diff --git a/lua/core/lualine/utils.lua b/lua/core/lualine/utils.lua index f2f29592..cf80a99e 100644 --- a/lua/core/lualine/utils.lua +++ b/lua/core/lualine/utils.lua @@ -2,6 +2,9 @@ local M = {} function M.validate_theme() local theme = lvim.builtin.lualine.options.theme + if type(theme) == "table" then + return + end local lualine_loader = require "lualine.utils.loader" local ok = pcall(lualine_loader.load_theme, theme) -- cgit v1.2.3 From 291c8bb5bd894b4da7c9e684915348a094a13aae Mon Sep 17 00:00:00 2001 From: chaeing Date: Thu, 26 Aug 2021 00:20:04 -0700 Subject: [Refactor] Lualine component conditions (#1394) --- lua/core/lualine/components.lua | 42 ++++++++++++++++++++++------------------- lua/core/lualine/conditions.lua | 10 +++++----- 2 files changed, 28 insertions(+), 24 deletions(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/components.lua b/lua/core/lualine/components.lua index 042f6b6d..894d9e9b 100644 --- a/lua/core/lualine/components.lua +++ b/lua/core/lualine/components.lua @@ -1,6 +1,17 @@ local conditions = require "core.lualine.conditions" local colors = require "core.lualine.colors" +local function diff_source() + local gitsigns = vim.b.gitsigns_status_dict + if gitsigns then + return { + added = gitsigns.added, + modified = gitsigns.changed, + removed = gitsigns.removed, + } + end +end + return { mode = { function() @@ -8,34 +19,29 @@ return { end, left_padding = 0, right_padding = 0, - condition = function() - return true - end, color = {}, + condition = nil, }, branch = { - "branch", + "b:gitsigns_head", icon = " ", - condition = function() - return conditions.hide_in_width() and conditions.check_git_workspace() - end, color = { gui = "bold" }, + condition = conditions.hide_in_width, }, filename = { "filename", - condition = function() - return true - end, color = {}, + condition = nil, }, diff = { "diff", + source = diff_source, symbols = { added = "  ", modified = "柳", removed = " " }, color_added = { fg = colors.green }, color_modified = { fg = colors.yellow }, color_removed = { fg = colors.red }, - condition = conditions.hide_in_width, color = {}, + condition = nil, }, python_env = { function() @@ -53,15 +59,15 @@ return { end return "" end, - condition = conditions.hide_in_width, color = { fg = colors.green }, + condition = conditions.hide_in_width, }, diagnostics = { "diagnostics", sources = { "nvim_lsp" }, symbols = { error = " ", warn = " ", info = " ", hint = " " }, - condition = conditions.hide_in_width, color = {}, + condition = conditions.hide_in_width, }, treesitter = { function() @@ -70,8 +76,8 @@ return { end return "" end, - condition = conditions.hide_in_width, color = { fg = colors.green }, + condition = conditions.hide_in_width, }, lsp = { function(msg) @@ -106,8 +112,8 @@ return { return table.concat(buf_client_names, ", ") end, icon = " ", - condition = conditions.hide_in_width, color = { gui = "bold" }, + condition = conditions.hide_in_width, }, location = { "location", condition = conditions.hide_in_width, color = {} }, progress = { "progress", condition = conditions.hide_in_width, color = {} }, @@ -125,8 +131,8 @@ return { encoding = { "o:encoding", upper = true, - condition = conditions.hide_in_width, color = {}, + condition = conditions.hide_in_width, }, filetype = { "filetype", condition = conditions.hide_in_width, color = {} }, scrollbar = { @@ -140,9 +146,7 @@ return { end, left_padding = 0, right_padding = 0, - condition = function() - return true - end, color = { fg = colors.yellow, bg = colors.bg }, + condition = nil, }, } diff --git a/lua/core/lualine/conditions.lua b/lua/core/lualine/conditions.lua index 2d2d81ef..3ee4fbb8 100644 --- a/lua/core/lualine/conditions.lua +++ b/lua/core/lualine/conditions.lua @@ -7,11 +7,11 @@ local conditions = { hide_in_width = function() return vim.fn.winwidth(0) > window_width_limit end, - check_git_workspace = function() - local filepath = vim.fn.expand "%:p:h" - local gitdir = vim.fn.finddir(".git", filepath .. ";") - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, + -- check_git_workspace = function() + -- local filepath = vim.fn.expand "%:p:h" + -- local gitdir = vim.fn.finddir(".git", filepath .. ";") + -- return gitdir and #gitdir > 0 and #gitdir < #filepath + -- end, } return conditions -- cgit v1.2.3 From 5b94e3cee2c4405e98c9c0e8769670723a1f4bae Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Thu, 26 Aug 2021 12:49:29 +0200 Subject: fix logging when plenary is not available (#1390) --- lua/core/lualine/styles.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/styles.lua b/lua/core/lualine/styles.lua index 876d7fa3..53b0691e 100644 --- a/lua/core/lualine/styles.lua +++ b/lua/core/lualine/styles.lua @@ -112,14 +112,13 @@ function M.get_style(style) local style_keys = vim.tbl_keys(styles) if not vim.tbl_contains(style_keys, style) then local Log = require "core.log" - local logger = Log:get_default() - logger.error( + Log:error( "Invalid lualine style", string.format('"%s"', style), "options are: ", string.format('"%s"', table.concat(style_keys, '", "')) ) - logger.info '"lvim" style is applied.' + Log:info '"lvim" style is applied.' style = "lvim" end -- cgit v1.2.3 From 27679f988fe187f9831ba7895c9c3a7ce2dd14f4 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Thu, 26 Aug 2021 20:32:16 +0200 Subject: [Refactor]: only allow a single logger (#1405) --- lua/core/lualine/styles.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/styles.lua b/lua/core/lualine/styles.lua index 53b0691e..84e8123d 100644 --- a/lua/core/lualine/styles.lua +++ b/lua/core/lualine/styles.lua @@ -118,7 +118,7 @@ function M.get_style(style) "options are: ", string.format('"%s"', table.concat(style_keys, '", "')) ) - Log:info '"lvim" style is applied.' + Log:debug '"lvim" style is applied.' style = "lvim" end -- cgit v1.2.3 From 7aa079d74a11f53f90e3b30371f530e85eb63b93 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Thu, 26 Aug 2021 22:40:24 -0400 Subject: disable nvimtree and outline for lualine --- lua/core/lualine/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/init.lua b/lua/core/lualine/init.lua index aa6fe098..9bf4f831 100644 --- a/lua/core/lualine/init.lua +++ b/lua/core/lualine/init.lua @@ -8,7 +8,7 @@ M.config = function() component_separators = nil, section_separators = nil, theme = nil, - disabled_filetypes = nil, + disabled_filetypes = {'NvimTree', 'Outline'} }, sections = { lualine_a = nil, -- cgit v1.2.3 From a0fd11ea0875e663b396dcdbce446072bcc1005e Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Thu, 26 Aug 2021 22:54:15 -0400 Subject: use styles.lua rather instead of editing options directly --- lua/core/lualine/init.lua | 2 +- lua/core/lualine/styles.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/init.lua b/lua/core/lualine/init.lua index 9bf4f831..30b6a6a6 100644 --- a/lua/core/lualine/init.lua +++ b/lua/core/lualine/init.lua @@ -8,7 +8,7 @@ M.config = function() component_separators = nil, section_separators = nil, theme = nil, - disabled_filetypes = {'NvimTree', 'Outline'} + disabled_filetypes = nil }, sections = { lualine_a = nil, diff --git a/lua/core/lualine/styles.lua b/lua/core/lualine/styles.lua index 84e8123d..3595e5e3 100644 --- a/lua/core/lualine/styles.lua +++ b/lua/core/lualine/styles.lua @@ -69,7 +69,7 @@ styles.lvim = { icons_enabled = true, component_separators = "", section_separators = "", - disabled_filetypes = { "dashboard" }, + disabled_filetypes = { "dashboard", "NvimTree", "Outline" }, }, sections = { lualine_a = { -- cgit v1.2.3 From 33af0668baf2df2a27782e2db8c6dd72cdf914b4 Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Fri, 27 Aug 2021 00:10:45 -0400 Subject: format --- lua/core/lualine/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/core/lualine') diff --git a/lua/core/lualine/init.lua b/lua/core/lualine/init.lua index 30b6a6a6..aa6fe098 100644 --- a/lua/core/lualine/init.lua +++ b/lua/core/lualine/init.lua @@ -8,7 +8,7 @@ M.config = function() component_separators = nil, section_separators = nil, theme = nil, - disabled_filetypes = nil + disabled_filetypes = nil, }, sections = { lualine_a = nil, -- cgit v1.2.3