From 0248f2e7ed07390abd271b4e11f3e1af53e6bb7c Mon Sep 17 00:00:00 2001 From: Ryan El Kochta Date: Sat, 19 Apr 2025 17:21:06 -0400 Subject: [PATCH] catppuccin: various fixes to make transparent background look better --- lua/core/theme.lua | 13 +++++++++++-- lua/plugins/bufferline.lua | 2 +- lua/plugins/theme.lua | 9 +++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lua/core/theme.lua b/lua/core/theme.lua index 34b415b..1494b62 100644 --- a/lua/core/theme.lua +++ b/lua/core/theme.lua @@ -1,9 +1,18 @@ -- Set colorscheme to dracula vim.cmd[[colorscheme catppuccin]] --- Enable for lualine as well +-- disable transparent background for lualine +local custom_catppuccin = function () + -- Use catppuccin's internal "utils" lualine theme; this isn't ideal, + -- but for whatever reason, returning require("lualine.themes.catppuccin") + -- leads to lualine light/dark theme not changing automatically + local catppuccin = require("catppuccin.utils.lualine")(require("catppuccin").flavour) + local palette = require("catppuccin.palettes").get_palette() + catppuccin.normal.c.bg = palette.mantle + return catppuccin +end require("lualine").setup { options = { - theme = "catppuccin", + theme = custom_catppuccin, } } diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 4014f98..b994bc1 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -32,6 +32,6 @@ return { }, { "nvim-tree/nvim-web-devicons", - lazy = true + lazy = true, }, } diff --git a/lua/plugins/theme.lua b/lua/plugins/theme.lua index a2ccf6a..881a291 100644 --- a/lua/plugins/theme.lua +++ b/lua/plugins/theme.lua @@ -12,6 +12,15 @@ return { lsp_trouble = true, which_key = true, }, + -- transparent_background needs some highlight fixups + custom_highlights = function(colors) + return { + -- fixup telescope selection color + TelescopeSelection = { fg = colors.text, bg = colors.surface0 }, + -- make bufferline more readable + BufferlineFill = { bg = colors.mantle }, + } + end, }, }, {