diff options
author | Christian Chiarulli <[email protected]> | 2022-09-21 17:58:52 -0400 |
---|---|---|
committer | Christian Chiarulli <[email protected]> | 2022-09-21 17:58:52 -0400 |
commit | 2cfb55ddb628e135a95f669d9f393ed3a2b1d950 (patch) | |
tree | f636c8e3e2a99884088c511e28beabe805c748f6 | |
parent | 4b0a60e23c0554b1dfa14e80f1e19feffd0204a5 (diff) |
feat(lualine): improvements
-rw-r--r-- | lua/lvim/core/lualine/components.lua | 26 | ||||
-rw-r--r-- | lua/lvim/core/lualine/conditions.lua | 2 | ||||
-rw-r--r-- | lua/lvim/core/lualine/styles.lua | 1 |
3 files changed, 17 insertions, 12 deletions
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 }, |