diff --git a/README.md b/README.md index d1d003e..941248e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ This port of Catppuccin is special because it was the first one and the one that - [Feline](https://github.com/feline-nvim/feline.nvim) - [Lualine](https://github.com/hoob3rt/lualine.nvim) - [Nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - - [LSP Saga](https://github.com/glepnir/lspsaga.nvim) + - [LSP Saga](https://github.com/tami5/lspsaga.nvim) - [Git signs](https://github.com/lewis6991/gitsigns.nvim) - [Indent Blankline](https://github.com/lukas-reineke/indent-blankline.nvim) - [Trouble](https://github.com/folke/trouble.nvim) @@ -116,6 +116,7 @@ integrations = { information = "underline", }, }, + coc_nvim = false, lsp_trouble = false, cmp = true, lsp_saga = false, @@ -190,7 +191,7 @@ After setting things up, you can load catppuccin like so: ```vim " Vim Script -let g:catppuccin_flavour = "dusk" " latte, frappe, macchiato, mocha +let g:catppuccin_flavour = "frappe" " latte, frappe, macchiato, mocha colorscheme catppuccin ``` diff --git a/lua/catppuccin/config.lua b/lua/catppuccin/config.lua index db44af1..3ae05e9 100644 --- a/lua/catppuccin/config.lua +++ b/lua/catppuccin/config.lua @@ -35,6 +35,7 @@ config.options = { information = "underline", }, }, + coc_nvim = false, lsp_trouble = false, cmp = true, lsp_saga = false, diff --git a/lua/catppuccin/core/integrations/bufferline.lua b/lua/catppuccin/core/integrations/bufferline.lua index 5819ca1..a2c4a0a 100644 --- a/lua/catppuccin/core/integrations/bufferline.lua +++ b/lua/catppuccin/core/integrations/bufferline.lua @@ -1,27 +1,29 @@ local M = {} function M.get(cp) + local transparent_background = require("catppuccin.config").options.transparent_background + local bg_highlight = transparent_background and "NONE" or cp.base - local inactive_bg = cp.mantle + local inactive_bg = transparent_background and "NONE" or cp.mantle - return { - BufferLineFill = { bg = cp.crust }, - BufferLineBackcrust = { fg = cp.text, bg = inactive_bg }, -- others - BufferLineBufferVisible = { fg = cp.surface1, bg = inactive_bg }, - BufferLineBufferSelected = { fg = cp.text, bg = cp.base, style = "bold,italic" }, -- current - BufferLineTab = { fg = cp.surface1, bg = cp.base }, - BufferLineTabSelected = { fg = cp.red, bg = cp.blue }, - BufferLineTabClose = { fg = cp.red, bg = inactive_bg }, - BufferLineIndicatorSelected = { fg = cp.peach, bg = cp.base }, - -- separators - BufferLineSeparator = { fg = inactive_bg, bg = inactive_bg }, - BufferLineSeparatorVisible = { fg = inactive_bg, bg = inactive_bg }, - BufferLineSeparatorSelected = { fg = inactive_bg, bg = inactive_bg }, - -- close buttons - BufferLineCloseButton = { fg = cp.surface1, bg = inactive_bg }, - BufferLineCloseButtonVisible = { fg = cp.surface1, bg = inactive_bg }, - BufferLineCloseButtonSelected = { fg = cp.red, bg = cp.base }, - } + return { + BufferLineFill = { bg = bg_highlight }, + BufferLineBackcrust = { fg = cp.text, bg = inactive_bg }, -- others + BufferLineBufferVisible = { fg = cp.surface1, bg = inactive_bg }, + BufferLineBufferSelected = { fg = cp.text, bg = cp.base, style = "bold,italic" }, -- current + BufferLineTab = { fg = cp.surface1, bg = cp.base }, + BufferLineTabSelected = { fg = cp.red, bg = cp.blue }, + BufferLineTabClose = { fg = cp.red, bg = inactive_bg }, + BufferLineIndicatorSelected = { fg = cp.peach, bg = cp.base }, + -- separators + BufferLineSeparator = { fg = inactive_bg, bg = inactive_bg }, + BufferLineSeparatorVisible = { fg = inactive_bg, bg = inactive_bg }, + BufferLineSeparatorSelected = { fg = inactive_bg, bg = inactive_bg }, + -- close buttons + BufferLineCloseButton = { fg = cp.surface1, bg = inactive_bg }, + BufferLineCloseButtonVisible = { fg = cp.surface1, bg = inactive_bg }, + BufferLineCloseButtonSelected = { fg = cp.red, bg = cp.base }, + } end return M diff --git a/lua/catppuccin/core/integrations/coc_nvim.lua b/lua/catppuccin/core/integrations/coc_nvim.lua new file mode 100644 index 0000000..b04563f --- /dev/null +++ b/lua/catppuccin/core/integrations/coc_nvim.lua @@ -0,0 +1,27 @@ +local M = {} + +local util = require("catppuccin.utils.util") + +function M.get(cp) + local error = cp.red + local warning = cp.yellow + local info = cp.sky + local hint = cp.teal + + return { + -- These groups are for the coc.nvim, the documentation is here (https://github.com/neoclide/coc.nvim/blob/master/doc/coc.txt#L2365). + CocErrorHighlight = { fg = error }, + CocErrorSign = { fg = error }, + CocErrorVirtualText = { fg = error }, + CocHintHighlight = { fg = hint }, + CocHintSign = { fg = hint }, + CocHintVirtualText = { fg = hint }, + CocInfoHighlight = { fg = info }, + CocInfoSign = { fg = info }, + CocInfoVirtualText = { fg = info }, + CocWarningHighlight = { fg = warning }, + CocWarningSign = { fg = warning }, + } +end + +return M diff --git a/lua/catppuccin/core/integrations/feline.lua b/lua/catppuccin/core/integrations/feline.lua index 034406d..b2a347c 100644 --- a/lua/catppuccin/core/integrations/feline.lua +++ b/lua/catppuccin/core/integrations/feline.lua @@ -23,7 +23,7 @@ local assets = { slant_right_2 = "", slant_right_2_thin = "", chubby_dot = "●", - slim_dot = '•', + slim_dot = "•", } local clrs = require("catppuccin.core.palettes.init").get_palette() @@ -62,6 +62,15 @@ local mode_colors = { local shortline = false +local function is_enabled(is_shortline, winid, min_width) + if is_shortline then + return true + end + + winid = winid or 0 + return vim.api.nvim_win_get_width(winid) > min_width +end + -- Initialize the components table local components = { active = {}, @@ -77,7 +86,7 @@ local invi_sep = { str = " ", hl = { fg = sett.bkg, - bg = sett.bkg + bg = sett.bkg, }, } @@ -85,17 +94,19 @@ local invi_sep = { local function any_git_changes() local gst = b.gitsigns_status_dict -- git stats if gst then - if gst["added"] and gst["added"] > 0 or gst["removed"] and gst["removed"] > 0 or gst["changed"] and gst["changed"] > 0 then + if + gst["added"] and gst["added"] > 0 + or gst["removed"] and gst["removed"] > 0 + or gst["changed"] and gst["changed"] > 0 + then return true end end return false end - -- #################### STATUSLINE -> - -- ######## Left -- Current vi mode ------> @@ -103,7 +114,7 @@ local vi_mode_hl = function() return { fg = sett.bkg, bg = mode_colors[vim.fn.mode()][2], - style = "bold" + style = "bold", } end @@ -134,7 +145,7 @@ components.active[1][3] = { hl = vi_mode_hl, } --- there is a dilema: we need to hide Diffs if ther is no git info. We can do that, but this will +-- there is a dilema: we need to hide Diffs if there is no git info. We can do that, but this will -- leave the right_semicircle colored with purple, and since we can't change the color conditonally -- then the solution is to create two right_semicircles: one with a mauve sett.bkg and the other one normal -- sett.bkg; both have the same fg (vi mode). The mauve one appears if there is git info, else the one with @@ -146,12 +157,12 @@ components.active[1][4] = { hl = function() return { fg = mode_colors[vim.fn.mode()][2], - bg = sett.bkg + bg = sett.bkg, } end, enabled = function() return not any_git_changes() - end + end, } -- enable if git diffs are available @@ -160,12 +171,12 @@ components.active[1][5] = { hl = function() return { fg = mode_colors[vim.fn.mode()][2], - bg = sett.diffs + bg = sett.diffs, } end, enabled = function() return any_git_changes() - end + end, } -- Current vi mode ------> @@ -205,7 +216,7 @@ components.active[1][9] = { }, enabled = function() return any_git_changes() - end + end, } -- Diffs ------> @@ -230,7 +241,7 @@ components.active[1][10] = { -- end, hl = { fg = sett.extras, - bg = sett.bkg + bg = sett.bkg, }, left_sep = invi_sep, } @@ -243,7 +254,7 @@ components.active[1][11] = { -- end, hl = { fg = sett.extras, - bg = sett.bkg + bg = sett.bkg, }, left_sep = invi_sep, } @@ -285,12 +296,10 @@ components.active[2][1] = { return "" end, - enabled = shortline or function(winid) - return vim.api.nvim_win_get_width(winid) > 80 - end, + enabled = is_enabled(shortline, winid, 80), hl = { fg = clrs.rosewater, - bg = sett.bkg + bg = sett.bkg, }, } @@ -351,12 +360,10 @@ components.active[2][5] = { components.active[3][1] = { provider = "git_branch", - enabled = shortline or function(winid) - return vim.api.nvim_win_get_width(winid) > 70 - end, + enabled = is_enabled(shortline, winid, 70), hl = { fg = sett.extras, - bg = sett.bkg + bg = sett.bkg, }, icon = "  ", left_sep = invi_sep, @@ -373,7 +380,7 @@ components.active[3][2] = { end, hl = { fg = sett.extras, - bg = sett.bkg + bg = sett.bkg, }, right_sep = invi_sep, } @@ -387,11 +394,9 @@ components.active[3][3] = { icon = "  " return icon end - return " " .. icon .. " " .. filename .. " " - end, - enabled = shortline or function(winid) - return vim.api.nvim_win_get_width(winid) > 70 + return "%m" .. " " .. icon .. " " .. filename .. " " end, + enabled = is_enabled(shortline, winid, 70), hl = { fg = sett.bkg, bg = sett.curr_file, @@ -411,9 +416,7 @@ components.active[3][4] = { return "  " .. dir_name .. " " end, - enabled = shortline or function(winid) - return vim.api.nvim_win_get_width(winid) > 80 - end, + enabled = is_enabled(shortline, winid, 80), hl = { fg = sett.bkg, diff --git a/lua/catppuccin/core/integrations/lightspeed.lua b/lua/catppuccin/core/integrations/lightspeed.lua index 757482c..5baf2ed 100644 --- a/lua/catppuccin/core/integrations/lightspeed.lua +++ b/lua/catppuccin/core/integrations/lightspeed.lua @@ -15,8 +15,9 @@ function M.get(cp) if not get_prepared() then local catppuccin = require("catppuccin") if catppuccin.after_loading ~= nil then + local callback = catppuccin.after_loading catppuccin.after_loading = function () - catppuccin.after_loading() + callback() require'lightspeed'.init_highlight() end else diff --git a/lua/catppuccin/core/integrations/treesitter.lua b/lua/catppuccin/core/integrations/treesitter.lua index 011ac2b..2ed684c 100644 --- a/lua/catppuccin/core/integrations/treesitter.lua +++ b/lua/catppuccin/core/integrations/treesitter.lua @@ -106,7 +106,7 @@ function M.get(cp) tsxTSTagAttribute = { fg = cp.mauve }, -- cpp - cppTSProperty = { fg = cp.text }, + cppTSProperty = { fg = cp.rosewater }, -- yaml yamlTSField = { fg = cp.blue }, -- For fields. diff --git a/lua/catppuccin/core/mapper.lua b/lua/catppuccin/core/mapper.lua index 5b9ce73..11cd11b 100644 --- a/lua/catppuccin/core/mapper.lua +++ b/lua/catppuccin/core/mapper.lua @@ -79,6 +79,7 @@ local function get_base() WarningMsg = { fg = cp.yellow }, -- warning messages Whitespace = { fg = cp.surface1 }, -- "nbsp", "space", "tab" and "trail" in 'listchars' WildMenu = { bg = cp.overlay0 }, -- current match in 'wildmenu' completion + WinBar = { fg = cp.rosewater }, -- These groups are not listed as default vim groups, -- but they are defacto standard group names for syntax highlighting. -- overlay0ed out groups should chain up to their "preferred" group by