diff --git a/doc/github-nvim-theme.txt b/doc/github-nvim-theme.txt index 4c0394b..2bd5248 100644 --- a/doc/github-nvim-theme.txt +++ b/doc/github-nvim-theme.txt @@ -520,6 +520,7 @@ Current list of modules are: - neotree - notify - nvimtree +- snacks - telescope - treesitter - treesitter_context diff --git a/lua/github-theme/config.lua b/lua/github-theme/config.lua index a48bebb..b4198fd 100644 --- a/lua/github-theme/config.lua +++ b/lua/github-theme/config.lua @@ -113,6 +113,7 @@ local defaults = { ---@field neogit? boolean|GhTheme.Config.Module ---@field neotree? boolean|GhTheme.Config.Module ---@field notify? boolean|GhTheme.Config.Module + ---@field snacks? boolean|GhTheme.Config.Module ---@field nvimtree? boolean|GhTheme.Config.Module ---@field telescope? boolean|GhTheme.Config.Module ---@field treesitter? boolean|GhTheme.Config.Module @@ -147,6 +148,9 @@ local defaults = { treesitter = util.is_nvim, lsp_semantic_tokens = util.is_nvim, + snacks = { + enable = true, + }, }, } @@ -155,9 +159,9 @@ M.module_names = { 'coc', 'coc_explorer', 'dapui', - 'diffchar', 'dashboard', 'diagnostic', + 'diffchar', 'fidget', 'fzf', 'gitgutter', @@ -171,6 +175,7 @@ M.module_names = { 'neotree', 'notify', 'nvimtree', + 'snacks', 'telescope', 'treesitter', 'treesitter_context', diff --git a/lua/github-theme/group/editor.lua b/lua/github-theme/group/editor.lua index 89044f0..f57dedd 100644 --- a/lua/github-theme/group/editor.lua +++ b/lua/github-theme/group/editor.lua @@ -52,7 +52,7 @@ function M.get(spec, config) NormalNC = { fg = spec.fg1, bg = inactive and spec.bg0 or trans and 'NONE' or spec.bg1 }, -- normal text in non-current windows NormalFloat = { fg = spec.fg1, bg = trans and 'NONE' or config.darken.floats and spec.bg0 or spec.bg1 }, -- Normal text in floating windows. - FloatBorder = { fg = c.border.default }, -- TODO + FloatBorder = { fg = spec.fg2, bg = trans and 'NONE' or spec.bg0 }, Pmenu = { fg = spec.fg1, bg = spec.bg0 }, -- Popup menu: normal item. PmenuSel = { bg = spec.sel1 }, -- Popup menu: selected item. PmenuSbar = { link = 'Pmenu' }, -- Popup menu: scrollbar. diff --git a/lua/github-theme/group/modules/snacks.lua b/lua/github-theme/group/modules/snacks.lua new file mode 100644 index 0000000..38ca599 --- /dev/null +++ b/lua/github-theme/group/modules/snacks.lua @@ -0,0 +1,108 @@ +-- https://github.com/folke/snacks.nvim/ + +local M = {} + +---@param spec GhTheme.Spec +---@param config GhTheme.Config.Options +---@param opts GhTheme.Config.Module +function M.get(spec, config, opts) + local c = spec.palette + + -- Handle configuration options + local indent_scope_color = (opts and opts.indent_scope_color) or 'text' + local float_transparent = config and config.options and config.options.transparent + local float_solid = config and config.options and not config.options.transparent + + local hlgroups = { + SnacksNormal = { link = 'NormalFloat' }, + SnacksWinBar = { link = 'Title' }, + SnacksBackdrop = { link = 'FloatShadow' }, + SnacksNormalNC = { link = 'NormalFloat' }, + SnacksWinBarNC = { link = 'SnacksWinBar' }, + + SnacksNotifierInfo = { fg = c.blue.base }, + SnacksNotifierIconInfo = { fg = c.blue.base }, + SnacksNotifierTitleInfo = { fg = c.blue.base, style = 'italic' }, + SnacksNotifierFooterInfo = { link = 'DiagnosticInfo' }, + SnacksNotifierBorderInfo = { fg = c.blue.base }, + + SnacksNotifierWarn = { fg = c.yellow.base }, + SnacksNotifierIconWarn = { fg = c.yellow.base }, + SnacksNotifierTitleWarn = { fg = c.yellow.base, style = 'italic' }, + SnacksNotifierBorderWarn = { fg = c.yellow.base }, + SnacksNotifierFooterWarn = { link = 'DiagnosticWarn' }, + + SnacksNotifierDebug = { fg = c.orange }, + SnacksNotifierIconDebug = { fg = c.orange }, + SnacksNotifierTitleDebug = { fg = c.orange, style = 'italic' }, + SnacksNotifierBorderDebug = { fg = c.orange }, + SnacksNotifierFooterDebug = { link = 'DiagnosticHint' }, + + SnacksNotifierError = { fg = c.red.base }, + SnacksNotifierIconError = { fg = c.red.base }, + SnacksNotifierTitleError = { fg = c.red.base, style = 'italic' }, + SnacksNotifierBorderError = { fg = c.red.base }, + SnacksNotifierFooterError = { link = 'DiagnosticError' }, + + SnacksNotifierTrace = { fg = c.magenta.base }, + SnacksNotifierIconTrace = { fg = c.magenta.base }, + SnacksNotifierTitleTrace = { fg = c.magenta.base, style = 'italic' }, + SnacksNotifierBorderTrace = { fg = c.magenta.base }, + SnacksNotifierFooterTrace = { link = 'DiagnosticHint' }, + + SnacksDashboardNormal = { link = 'Normal' }, + SnacksDashboardDesc = { fg = c.fg.default }, + SnacksDashboardFile = { fg = c.blue.bright }, + SnacksDashboardDir = { link = 'NonText' }, + SnacksDashboardFooter = { fg = c.yellow.base, style = 'italic' }, + SnacksDashboardHeader = { fg = c.magenta.bright }, + SnacksDashboardIcon = { fg = c.orange, style = 'bold' }, + SnacksDashboardKey = { fg = c.yellow.bright }, + SnacksDashboardTerminal = { link = 'SnacksDashboardNormal' }, + SnacksDashboardSpecial = { fg = c.fg.default }, + SnacksDashboardTitle = { link = 'Title' }, + + SnacksIndent = { fg = spec.bg3 }, + SnacksIndentScope = { + fg = indent_scope_color == 'text' and spec.fg1 + or c[indent_scope_color] and c[indent_scope_color].base + or spec.fg1, + }, + + SnacksPickerSelected = { + fg = float_transparent and c.accent.fg or spec.fg1, + bg = float_transparent and 'NONE' or spec.bg3, + style = 'bold', + }, + SnacksPickerMatch = { fg = c.yellow.bright }, + + SnacksPicker = { link = 'NormalFloat' }, + SnacksPickerBorder = { link = 'FloatBorder' }, + SnacksPickerInputBorder = { link = 'SnacksPickerBorder' }, + SnacksPickerInput = { link = 'NormalFloat' }, + SnacksPickerPrompt = { fg = c.accent.fg }, + } + + if float_solid then + hlgroups['SnacksPickerTitle'] = { + fg = spec.bg0, + bg = c.magenta.base, + } + hlgroups['SnacksPickerPreviewTitle'] = { + fg = spec.bg0, + bg = c.green.base, + } + hlgroups['SnacksPickerInputTitle'] = { + fg = spec.bg0, + bg = c.red.base, + } + hlgroups['SnacksPickerListTitle'] = { + fg = spec.bg0, + bg = c.blue.bright, + } + end + + return hlgroups +end + +return M diff --git a/lua/github-theme/palette/github_dark.lua b/lua/github-theme/palette/github_dark.lua index 7c5d883..dd0f3c0 100755 --- a/lua/github-theme/palette/github_dark.lua +++ b/lua/github-theme/palette/github_dark.lua @@ -169,9 +169,9 @@ local function generate_spec(pal) spec.diag = { error = pal.danger.fg, - warn = pal.attention.fg, + warn = pal.severe.fg, info = pal.accent.fg, - hint = pal.fg.muted, + hint = pal.attention.fg, } spec.diag_bg = { diff --git a/lua/github-theme/util/lualine.lua b/lua/github-theme/util/lualine.lua index 23c4853..678bedc 100644 --- a/lua/github-theme/util/lualine.lua +++ b/lua/github-theme/util/lualine.lua @@ -15,8 +15,11 @@ return function(style) local tint = function(color) return { a = { bg = color, fg = s.bg1 }, - b = { bg = blend(color, 0.2), fg = blend(color, 0.8) }, - c = { bg = blend(color, 0.01), fg = blend(color, 0.60) }, + b = { bg = blend(color, 0.1), fg = blend(color, 0.9) }, + c = { + bg = config.transparent and 'NONE' or blend(color, 0.01), + fg = blend(color, 0.8), + }, } end