From 340cf5ed5e75673d34055f7f91727ce79965b703 Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 5 Feb 2025 19:35:55 -0600 Subject: [PATCH 01/16] feat(perf): cache colors for up to 3x speed improvements --- lua/rose-pine/utilities.lua | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lua/rose-pine/utilities.lua b/lua/rose-pine/utilities.lua index 26e019e..32a8575 100644 --- a/lua/rose-pine/utilities.lua +++ b/lua/rose-pine/utilities.lua @@ -14,10 +14,17 @@ local function color_to_rgb(color) return { byte(new_color, 16), byte(new_color, 8), byte(new_color, 0) } end +local color_cache = {} + ---@param color string Palette key or hex value function utilities.parse_color(color) + if color_cache[color] then + return color_cache[color] + end + if color == nil then - return print("Invalid color: " .. color) + print("Invalid color: " .. color) + return nil end color = color:lower() @@ -26,13 +33,21 @@ function utilities.parse_color(color) color = require("rose-pine.palette")[color] or vim.api.nvim_get_color_by_name(color) end + color_cache[color] = color return color end +local blend_cache = {} + ---@param fg string Foreground color ---@param bg string Background color ---@param alpha number Between 0 (background) and 1 (foreground) function utilities.blend(fg, bg, alpha) + local cache_key = fg .. bg .. alpha + if blend_cache[cache_key] then + return blend_cache[cache_key] + end + local fg_rgb = color_to_rgb(fg) local bg_rgb = color_to_rgb(bg) @@ -41,7 +56,10 @@ function utilities.blend(fg, bg, alpha) return math.floor(math.min(math.max(0, ret), 255) + 0.5) end - return string.format("#%02X%02X%02X", blend_channel(1), blend_channel(2), blend_channel(3)) + local result = string.format("#%02X%02X%02X", blend_channel(1), blend_channel(2), blend_channel(3)) + + blend_cache[cache_key] = result + return result end return utilities From 946de320f411e71530d7e8c9249fc344d8ad66aa Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 5 Feb 2025 19:36:10 -0600 Subject: [PATCH 02/16] fix: strip non-standard blend properties --- lua/rose-pine.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 4f4dfdc..8ffa5c0 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -1122,9 +1122,14 @@ local function set_highlights() if config.options.before_highlight ~= nil then config.options.before_highlight(group, highlight, palette) end + if highlight.blend ~= nil and (highlight.blend >= 0 and highlight.blend <= 100) and highlight.bg ~= nil then highlight.bg = utilities.blend(highlight.bg, highlight.blend_on or palette.base, highlight.blend / 100) end + + highlight.blend = nil + highlight.blend_on = nil + vim.api.nvim_set_hl(0, group, highlight) end From 0511701746d6f03846b7848c59b98b2d9387090f Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 5 Feb 2025 19:49:14 -0600 Subject: [PATCH 03/16] feat: use experimental darker text for dawn --- lua/rose-pine/palette.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua index 59c300c..cfefd65 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -47,7 +47,7 @@ local variants = { overlay = "#f2e9e1", muted = "#9893a5", subtle = "#797593", - text = "#575279", + text = "#464261", love = "#b4637a", gold = "#ea9d34", rose = "#d7827e", From 8b216f72526a9c220bb79de0a01382cd3c8c64d0 Mon Sep 17 00:00:00 2001 From: Tiago Date: Sun, 23 Feb 2025 21:19:21 +0000 Subject: [PATCH 04/16] feat: add support for vim-sneak (#342) --- lua/rose-pine.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 8ffa5c0..85f9aac 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -1022,6 +1022,11 @@ local function set_highlights() SnacksIndentScope = { fg = palette.foam }, SnacksPickerMatch = { fg = palette.rose, bold = styles.bold }, + + -- justinmk/vim-sneak + Sneak = { fg = palette.base, bg = palette.love }, + SneakCurrent = { link = "StatusLineTerm" }, + SneakScope = { link = "IncSearch" }, } local transparency_highlights = { DiagnosticVirtualTextError = { fg = groups.error }, From 44739383b9ba01512a9d81db1f542632502d510f Mon Sep 17 00:00:00 2001 From: mvllow Date: Tue, 25 Feb 2025 19:58:52 -0600 Subject: [PATCH 05/16] docs: add highlight group examples with blend and inherit options --- readme.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 8a2740c..6ef48bc 100644 --- a/readme.md +++ b/readme.md @@ -27,8 +27,8 @@ Install `rose-pine/neovim` using your favourite package manager: ```lua -- lua/plugins/rose-pine.lua -return { - "rose-pine/neovim", +return { + "rose-pine/neovim", name = "rose-pine", config = function() vim.cmd("colorscheme rose-pine") @@ -123,9 +123,13 @@ require("rose-pine").setup({ -- }, }, + -- NOTE: Highlight groups are extended (merged) by default. Disable this + -- per group via `inherit = false` highlight_groups = { -- Comment = { fg = "foam" }, + -- StatusLine = { fg = "love", bg = "love", blend = 15 }, -- VertSplit = { fg = "muted", bg = "muted" }, + -- Visual = { fg = "base", bg = "text", inherit = false }, }, before_highlight = function(group, highlight, palette) From d7dc9cd3f2664511e55bd7262557593e759b6225 Mon Sep 17 00:00:00 2001 From: stelo <42366677+jfkisafk@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:25:25 -0700 Subject: [PATCH 06/16] feat: extends DapUIType fg to iris (#348) --- lua/rose-pine.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 85f9aac..24fa5da 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -722,6 +722,7 @@ local function set_highlights() DapUIThread = { fg = palette.gold }, DapUIValue = { fg = palette.text }, DapUIVariable = { fg = palette.text }, + DapUIType = { fg = palette.iris }, DapUIWatchesEmpty = { fg = palette.love }, DapUIWatchesError = { link = "DapUIWatchesEmpty" }, DapUIWatchesValue = { link = "DapUIThread" }, From 5ccc37982260d0b468c82aa965e2a8afc50e9d66 Mon Sep 17 00:00:00 2001 From: aileot <46470475+aileot@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:27:19 +0000 Subject: [PATCH 07/16] fix: set `background=light` if variant is "dawn" (#349) * fix: set `background=light` if variant is "dawn" This change might fix https://github.com/rose-pine/neovim/issues/321 * Update lua/rose-pine.lua * fix: restrict variants that override `&background` The other variant params are considered as if "auto" --- lua/rose-pine.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 24fa5da..73c9534 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -1182,6 +1182,12 @@ function M.colorscheme(variant) end vim.g.colors_name = "rose-pine" + if variant == "dawn" then + vim.o.background = "light" + elseif variant == "main" or variant == "moon" then + vim.o.background = "dark" + end + set_highlights() end From 39ec539f8392dfa3e4a7736461fce7c223721aca Mon Sep 17 00:00:00 2001 From: Andrei Heidelbacher Date: Thu, 1 May 2025 03:02:53 +0200 Subject: [PATCH 08/16] feat(lualine): change background from base to surface (#354) This change improves the contrast of the statusline while aligning with the theme's spec. --- lua/lualine/themes/rose-pine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lualine/themes/rose-pine.lua b/lua/lualine/themes/rose-pine.lua index 4c2c9a6..e409130 100644 --- a/lua/lualine/themes/rose-pine.lua +++ b/lua/lualine/themes/rose-pine.lua @@ -1,7 +1,7 @@ local p = require("rose-pine.palette") local config = require("rose-pine.config") -local bg_base = p.base +local bg_base = p.surface if config.options.styles.transparency then bg_base = "NONE" end From a67f5ef34bb269692ede83fd7f7397e0b5c3736d Mon Sep 17 00:00:00 2001 From: Andrei Heidelbacher Date: Thu, 1 May 2025 03:53:00 +0200 Subject: [PATCH 09/16] fix(blink.cmp): remove dedicated BlinkCmpDoc highlight (#355) The default `BlinkCmpDoc` highlight is linked to `NormalFloat`, which is a sensible default. However, due to overriding the default link with only `fg` provided, the `bg` is cleared and the documentation popup is indistinguishable from regular text. This change is technically a no-op in terms of intended palette, because `NormalFloat` should already use `palette.text`, and only fixes the cleared `bg` bug. --- lua/rose-pine.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 73c9534..600ac4e 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -977,7 +977,6 @@ local function set_highlights() AvanteReversedThirdTitle = { fg = palette.iris }, -- Saghen/blink.cmp - BlinkCmpDoc = { fg = palette.text }, BlinkCmpDocBorder = { fg = palette.highlight_high }, BlinkCmpGhostText = { fg = palette.muted }, From d195ed8673ab887460b6a08b9845172c69ca34f7 Mon Sep 17 00:00:00 2001 From: Andrei Heidelbacher Date: Thu, 1 May 2025 23:55:24 +0200 Subject: [PATCH 10/16] feat(blink.cmp): improve BlinkCmpDoc contrast between current line (#356) --- lua/rose-pine.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 600ac4e..4e9c665 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -977,6 +977,8 @@ local function set_highlights() AvanteReversedThirdTitle = { fg = palette.iris }, -- Saghen/blink.cmp + BlinkCmpDoc = { bg = palette.highlight_low }, + BlinkCmpDocSeparator = { bg = palette.highlight_low }, BlinkCmpDocBorder = { fg = palette.highlight_high }, BlinkCmpGhostText = { fg = palette.muted }, From 6b9840790cc7acdfadde07f308d34b62dd9cc675 Mon Sep 17 00:00:00 2001 From: fdcote <48247604+fdcote@users.noreply.github.com> Date: Mon, 5 May 2025 13:13:20 -0400 Subject: [PATCH 11/16] feat: add `QuickFixLine` (#357) --- lua/rose-pine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 4e9c665..fc21a2c 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -121,7 +121,7 @@ local function set_highlights() PmenuSel = { fg = palette.text, bg = palette.overlay }, PmenuThumb = { bg = palette.muted }, Question = { fg = palette.gold }, - -- QuickFixLink = {}, + QuickFixLine = { fg = palette.foam }, -- RedrawDebugNormal = {}, RedrawDebugClear = { fg = palette.base, bg = palette.gold }, RedrawDebugComposed = { fg = palette.base, bg = palette.pine }, From 83c66bcadbcaf344cf0af1a41d8bd92255116b66 Mon Sep 17 00:00:00 2001 From: Adrian Schneider <166428581+adrior11@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:31:24 +0200 Subject: [PATCH 12/16] feat(grug-far): add highlight groups for add/remove results (#366) --- lua/rose-pine.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index fc21a2c..801f28d 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -961,6 +961,8 @@ local function set_highlights() GrugFarInputPlaceholder = { link = "Comment" }, GrugFarResultsActionMessage = { fg = palette.foam }, GrugFarResultsChangeIndicator = { fg = groups.git_change }, + GrugFarResultsRemoveIndicator = { fg = groups.git_delete }, + GrugFarResultsAddIndicator = { fg = groups.git_add }, GrugFarResultsHeader = { fg = palette.pine }, GrugFarResultsLineNo = { fg = palette.iris }, GrugFarResultsLineColumn = { link = "GrugFarResultsLineNo" }, From f93360149e9ed4df8677fbb07c7231ea0fd03b97 Mon Sep 17 00:00:00 2001 From: fdcote <48247604+fdcote@users.noreply.github.com> Date: Thu, 26 Jun 2025 17:32:32 -0400 Subject: [PATCH 13/16] feat: add `ModesFormat` (#367) --- lua/rose-pine.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 801f28d..571d336 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -462,6 +462,7 @@ local function set_highlights() -- mvllow/modes.nvim ModesCopy = { bg = palette.gold }, ModesDelete = { bg = palette.love }, + ModesFormat = { bg = palette.rose }, ModesInsert = { bg = palette.foam }, ModesReplace = { bg = palette.pine }, ModesVisual = { bg = palette.iris }, From 72befaffeac38db7bdd49e0549eaa2c4806dd878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Karpi=C5=84ski?= <40724893+davkk@users.noreply.github.com> Date: Fri, 18 Jul 2025 22:25:55 +0200 Subject: [PATCH 14/16] fix: do not clear `blend` prop from highlight (#351) * add private built-in blend override --------- Co-authored-by: mvllow --- lua/rose-pine.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 571d336..196f03a 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -1140,6 +1140,10 @@ local function set_highlights() highlight.blend = nil highlight.blend_on = nil + if highlight._nvim_blend ~= nil then + highlight.blend = highlight._nvim_blend + end + vim.api.nvim_set_hl(0, group, highlight) end From 0e70556c8ceb3604c87b2e2589a9c0e9873eba73 Mon Sep 17 00:00:00 2001 From: HieuDao-code <106801182+HieuDao-code@users.noreply.github.com> Date: Sun, 24 Aug 2025 16:47:05 +0200 Subject: [PATCH 15/16] feat(diffview.nvim): add support for `sindrets/diffview.nvim` (#369) --- lua/rose-pine.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 196f03a..aa3abc0 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -1032,6 +1032,39 @@ local function set_highlights() Sneak = { fg = palette.base, bg = palette.love }, SneakCurrent = { link = "StatusLineTerm" }, SneakScope = { link = "IncSearch" }, + + -- sindrets/diffview.nvim + DiffviewPrimary = { fg = palette.pine }, + DiffviewSecondary = { fg = palette.foam }, + DiffviewNormal = { fg = palette.text, bg = palette.surface }, + DiffviewWinSeparator = { fg = palette.text, bg = palette.surface }, + + DiffviewFilePanelTitle = { fg = palette.foam, bold = styles.bold }, + DiffviewFilePanelCounter = { fg = palette.rose }, + DiffviewFilePanelRootPath = { fg = palette.foam, bold = styles.bold }, + DiffviewFilePanelFileName = { fg = palette.text }, + DiffviewFilePanelSelected = { fg = palette.gold }, + DiffviewFilePanelPath = { link = "Comment" }, + + DiffviewFilePanelInsertions = { fg = groups.git_add }, + DiffviewFilePanelDeletions = { fg = groups.git_delete }, + DiffviewFilePanelConflicts = { fg = groups.git_merge }, + DiffviewFolderName = { fg = palette.foam, bold = styles.bold }, + DiffviewFolderSign = { fg = palette.subtle }, + DiffviewHash = { fg = palette.rose }, + DiffviewReference = { fg = palette.foam, bold = styles.bold }, + DiffviewReflogSelector = { fg = palette.rose }, + DiffviewStatusAdded = { fg = groups.git_add }, + DiffviewStatusUntracked = { fg = groups.untracked }, + DiffviewStatusModified = { fg = groups.git_change }, + DiffviewStatusRenamed = { fg = groups.git_rename }, + DiffviewStatusCopied = { fg = groups.untracked }, + DiffviewStatusTypeChange = { fg = groups.git_change }, + DiffviewStatusUnmerged = { fg = groups.git_change }, + DiffviewStatusUnknown = { fg = groups.git_delete }, + DiffviewStatusDeleted = { fg = groups.git_delete }, + DiffviewStatusBroken = { fg = groups.git_delete }, + DiffviewStatusIgnored = { fg = groups.git_ignore }, } local transparency_highlights = { DiagnosticVirtualTextError = { fg = groups.error }, From 72a04c4065345b51b56aed4859ea1d884f734097 Mon Sep 17 00:00:00 2001 From: Antoine Bertin Date: Sun, 24 Aug 2025 16:50:23 +0200 Subject: [PATCH 16/16] feat: add AvantePromptInput highlight support (#368) * feat: add AvantePromptInput highlight support --- lua/rose-pine.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index aa3abc0..f10ffcd 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -978,6 +978,8 @@ local function set_highlights() AvanteReversedSubtitle = { fg = palette.foam }, AvanteThirdTitle = { fg = palette.highlight_med, bg = palette.iris }, AvanteReversedThirdTitle = { fg = palette.iris }, + AvantePromptInput = { fg = palette.text, bg = groups.panel }, + AvantePromptInputBorder = { fg = groups.border }, -- Saghen/blink.cmp BlinkCmpDoc = { bg = palette.highlight_low },