Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
siduck committed Oct 7, 2024
1 parent b18a012 commit 177af7c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 236 deletions.
103 changes: 18 additions & 85 deletions lua/base46/integrations/statusline/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,96 +3,29 @@ local get_theme_tb = require("base46").get_theme_tb
local colors = get_theme_tb "base_30"
local generate_color = require("base46.colors").change_hex_lightness

local statusline_bg = (config.ui.transparency or config.base46.transparency) and "NONE" or colors.statusline_bg
local statusline_bg = config.base46.transparency and "NONE" or colors.statusline_bg
local light_grey = generate_color(colors.light_grey, 8)

local M = {

StatusLine = {
bg = statusline_bg,
},

St_gitIcons = {
fg = light_grey,
bg = statusline_bg,
bold = true,
},

St_Lsp = {
fg = colors.nord_blue,
bg = statusline_bg,
},

St_LspMsg = {
fg = colors.green,
bg = statusline_bg,
},

St_EmptySpace = {
fg = colors.grey,
bg = colors.lightbg,
},

St_file = {
bg = colors.lightbg,
fg = colors.white,
},

St_file_sep = {
bg = statusline_bg,
fg = colors.lightbg,
},

St_cwd_icon = {
fg = colors.one_bg,
bg = colors.red,
},

St_cwd_text = {
fg = colors.white,
bg = colors.lightbg,
},

St_cwd_sep = {
fg = colors.red,
bg = statusline_bg,
},

St_pos_sep = {
fg = colors.green,
bg = colors.lightbg,
},

St_pos_icon = {
fg = colors.black,
bg = colors.green,
},

St_pos_text = {
fg = colors.green,
bg = colors.lightbg,
},
StatusLine = { bg = statusline_bg },
St_gitIcons = { fg = light_grey, bg = statusline_bg, bold = true },
St_Lsp = { fg = colors.nord_blue, bg = statusline_bg },
St_LspMsg = { fg = colors.green, bg = statusline_bg },
St_EmptySpace = { fg = colors.grey, bg = colors.lightbg },
St_file = { bg = colors.lightbg, fg = colors.white },
St_file_sep = { bg = statusline_bg, fg = colors.lightbg },
St_cwd_icon = { fg = colors.one_bg, bg = colors.red },
St_cwd_text = { fg = colors.white, bg = colors.lightbg },
St_cwd_sep = { fg = colors.red, bg = statusline_bg },
St_pos_sep = { fg = colors.green, bg = colors.lightbg },
St_pos_icon = { fg = colors.black, bg = colors.green },
St_pos_text = { fg = colors.green, bg = colors.lightbg },

-- lsp highlights
St_lspError = {
fg = colors.red,
bg = statusline_bg,
},

St_lspWarning = {
fg = colors.yellow,
bg = statusline_bg,
},

St_LspHints = {
fg = colors.purple,
bg = statusline_bg,
},

St_LspInfo = {
fg = colors.green,
bg = statusline_bg,
},
St_lspError = { fg = colors.red, bg = statusline_bg },
St_lspWarning = { fg = colors.yellow, bg = statusline_bg },
St_LspHints = { fg = colors.purple, bg = statusline_bg },
St_LspInfo = { fg = colors.green, bg = statusline_bg },
}

local function genModes_hl(modename, col)
Expand Down
6 changes: 3 additions & 3 deletions lua/base46/integrations/statusline/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
local theme = require("nvconfig").ui.statusline.theme
local stl = require("nvconfig").ui.statusline

if theme == "custom" then
if not stl.enabled then
return {}
end

local theme_module = "base46.integrations.statusline." .. theme
local theme_module = "base46.integrations.statusline." .. stl.theme
return require(theme_module)
92 changes: 16 additions & 76 deletions lua/base46/integrations/statusline/minimal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,19 @@ local generate_color = require("base46.colors").change_hex_lightness
local light_grey = generate_color(colors.light_grey, 8)

local M = {
StatusLine = {
bg = "none",
},

St_gitIcons = {
fg = light_grey,
bg = "none",
bold = true,
},

-- LSP
St_lspError = {
fg = colors.red,
bg = "none",
},

St_lspWarning = {
fg = colors.yellow,
bg = "none",
},

St_LspHints = {
fg = colors.purple,
bg = "none",
},

St_LspInfo = {
fg = colors.green,
bg = "none",
},

St_LspMsg = {
fg = colors.green,
},

St_Lsp = {
fg = colors.green,
},

St_EmptySpace = {
fg = colors.black,
bg = "none",
},

St_EmptySpace2 = {
fg = colors.black,
},

St_file = {
fg = colors.white,
bg = "none",
},

St_file_sep = {
fg = colors.black,
bg = "none",
},

St_sep_r = {
fg = colors.one_bg,
bg = "none",
},
StatusLine = { bg = "none" },
St_gitIcons = { fg = light_grey, bg = "none", bold = true },
St_lspError = { fg = colors.red, bg = "none" },
St_lspWarning = { fg = colors.yellow, bg = "none" },
St_LspHints = { fg = colors.purple, bg = "none" },
St_LspInfo = { fg = colors.green, bg = "none" },
St_LspMsg = { fg = colors.green },
St_Lsp = { fg = colors.green },
St_EmptySpace = { fg = colors.black, bg = "none" },
St_EmptySpace2 = { fg = colors.black },
St_file = { fg = colors.white, bg = "none" },
St_file_sep = { fg = colors.black, bg = "none" },
St_sep_r = { fg = colors.one_bg, bg = "none" },
}

local function genModes_hl(modename, col)
Expand All @@ -86,20 +37,9 @@ genModes_hl("Command", "green")
genModes_hl("Select", "blue")

local function gen_hl(name, col)
M["St_" .. name .. "_bg"] = {
fg = colors.black,
bg = colors[col],
}

M["St_" .. name .. "_txt"] = {
fg = colors[col],
bg = colors.one_bg,
}

M["St_" .. name .. "_sep"] = {
fg = colors[col],
bg = colors.black,
}
M["St_" .. name .. "_bg"] = { fg = colors.black, bg = colors[col] }
M["St_" .. name .. "_txt"] = { fg = colors[col], bg = colors.one_bg }
M["St_" .. name .. "_sep"] = { fg = colors[col], bg = colors.black }
end

gen_hl("file", "red")
Expand Down
31 changes: 9 additions & 22 deletions lua/base46/integrations/statusline/vscode.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
local config = require("nvconfig")
local config = require "nvconfig"
local get_theme_tb = require("base46").get_theme_tb
local theme_type = get_theme_tb "type"
local colors = get_theme_tb "base_30"
local generate_color = require("base46.colors").change_hex_lightness
local lighten = require("base46.colors").change_hex_lightness

local statusline_bg = (config.ui.transparency or config.base46.transparency) and "NONE" or colors.statusline_bg
local light_grey = generate_color(colors.light_grey, 8)
local statusline_bg = config.base46.transparency and "NONE" or lighten(colors.statusline_bg, 1)
local light_grey = lighten(colors.light_grey, 8)

if theme_type == "light" then
light_grey = generate_color(colors.light_grey, -15)
light_grey = lighten(colors.light_grey, -15)
end

local M = {
StatusLine = {
fg = light_grey,
bg = statusline_bg,
},

St_Mode = {
fg = light_grey,
bg = colors.one_bg2,
},

StText = {
fg = light_grey,
bg = statusline_bg,
},
return {
StatusLine = { fg = light_grey, bg = statusline_bg },
St_Mode = { fg = light_grey, bg = colors.one_bg2 },
StText = { fg = light_grey, bg = statusline_bg },
}

return M
63 changes: 14 additions & 49 deletions lua/base46/integrations/statusline/vscode_colored.lua
Original file line number Diff line number Diff line change
@@ -1,62 +1,27 @@
local config = require("nvconfig")
local config = require "nvconfig"
local get_theme_tb = require("base46").get_theme_tb
local theme_type = get_theme_tb "type"
local colors = get_theme_tb "base_30"
local generate_color = require("base46.colors").change_hex_lightness
local lighten = require("base46.colors").change_hex_lightness

local statusline_bg = (config.ui.transparency or config.base46.transparency) and "NONE" or colors.statusline_bg
local light_grey = generate_color(colors.light_grey, 8)
local statusline_bg = config.base46.transparency and "NONE" or lighten(colors.statusline_bg, 1)
local light_grey = lighten(colors.light_grey, 8)

if theme_type == "light" then
light_grey = generate_color(colors.light_grey, -15)
light_grey = lighten(colors.light_grey, -15)
end

local M = {
StatusLine = {
fg = light_grey,
bg = statusline_bg,
},

StText = {
fg = light_grey,
bg = statusline_bg,
},

StatusLine = { fg = light_grey, bg = statusline_bg },
StText = { fg = light_grey, bg = statusline_bg },
-- LSP
St_lspError = {
fg = colors.red,
bg = statusline_bg,
},

St_lspWarning = {
fg = colors.yellow,
bg = statusline_bg,
},

St_LspHints = {
fg = colors.purple,
bg = statusline_bg,
},

St_Lsp = {
fg = colors.green,
bg = statusline_bg,
},

St_LspMsg = {
fg = colors.red,
bg = statusline_bg,
},

St_cwd = {
fg = colors.red,
bg = colors.one_bg3,
},

St_ft = {
fg = colors.blue,
bg = statusline_bg,
},
St_lspError = { fg = colors.red, bg = statusline_bg },
St_lspWarning = { fg = colors.yellow, bg = statusline_bg },
St_LspHints = { fg = colors.purple, bg = statusline_bg },
St_Lsp = { fg = colors.green, bg = statusline_bg },
St_LspMsg = { fg = colors.red, bg = statusline_bg },
St_cwd = { fg = colors.red, bg = colors.one_bg3 },
St_ft = { fg = colors.blue, bg = statusline_bg },
}

local function genModes_hl(modename, col)
Expand Down
2 changes: 1 addition & 1 deletion lua/base46/integrations/tbline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ local hlgroups_glassy = {
"TbBufOffModified",
}

if config.ui.transparency or config.base46.transparency then
if config.base46.transparency then
for _, val in ipairs(hlgroups_glassy) do
highlights[val].bg = "NONE"
end
Expand Down

0 comments on commit 177af7c

Please sign in to comment.