mirror of
https://github.com/rose-pine/neovim.git
synced 2025-10-15 12:38:53 +02:00
Compare commits
16 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72a04c4065 |
||
|
|
0e70556c8c |
||
|
|
72befaffea |
||
|
|
f93360149e |
||
|
|
83c66bcadb |
||
|
|
6b9840790c | ||
|
|
d195ed8673 | ||
|
|
a67f5ef34b | ||
|
|
39ec539f83 | ||
|
|
5ccc379822 | ||
|
|
d7dc9cd3f2 | ||
|
|
44739383b9 | ||
|
|
8b216f7252 | ||
|
|
0511701746 | ||
|
|
946de320f4 | ||
|
|
340cf5ed5e |
5 changed files with 90 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
local p = require("rose-pine.palette")
|
local p = require("rose-pine.palette")
|
||||||
local config = require("rose-pine.config")
|
local config = require("rose-pine.config")
|
||||||
|
|
||||||
local bg_base = p.base
|
local bg_base = p.surface
|
||||||
if config.options.styles.transparency then
|
if config.options.styles.transparency then
|
||||||
bg_base = "NONE"
|
bg_base = "NONE"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ local function set_highlights()
|
||||||
PmenuSel = { fg = palette.text, bg = palette.overlay },
|
PmenuSel = { fg = palette.text, bg = palette.overlay },
|
||||||
PmenuThumb = { bg = palette.muted },
|
PmenuThumb = { bg = palette.muted },
|
||||||
Question = { fg = palette.gold },
|
Question = { fg = palette.gold },
|
||||||
-- QuickFixLink = {},
|
QuickFixLine = { fg = palette.foam },
|
||||||
-- RedrawDebugNormal = {},
|
-- RedrawDebugNormal = {},
|
||||||
RedrawDebugClear = { fg = palette.base, bg = palette.gold },
|
RedrawDebugClear = { fg = palette.base, bg = palette.gold },
|
||||||
RedrawDebugComposed = { fg = palette.base, bg = palette.pine },
|
RedrawDebugComposed = { fg = palette.base, bg = palette.pine },
|
||||||
|
|
@ -462,6 +462,7 @@ local function set_highlights()
|
||||||
-- mvllow/modes.nvim
|
-- mvllow/modes.nvim
|
||||||
ModesCopy = { bg = palette.gold },
|
ModesCopy = { bg = palette.gold },
|
||||||
ModesDelete = { bg = palette.love },
|
ModesDelete = { bg = palette.love },
|
||||||
|
ModesFormat = { bg = palette.rose },
|
||||||
ModesInsert = { bg = palette.foam },
|
ModesInsert = { bg = palette.foam },
|
||||||
ModesReplace = { bg = palette.pine },
|
ModesReplace = { bg = palette.pine },
|
||||||
ModesVisual = { bg = palette.iris },
|
ModesVisual = { bg = palette.iris },
|
||||||
|
|
@ -722,6 +723,7 @@ local function set_highlights()
|
||||||
DapUIThread = { fg = palette.gold },
|
DapUIThread = { fg = palette.gold },
|
||||||
DapUIValue = { fg = palette.text },
|
DapUIValue = { fg = palette.text },
|
||||||
DapUIVariable = { fg = palette.text },
|
DapUIVariable = { fg = palette.text },
|
||||||
|
DapUIType = { fg = palette.iris },
|
||||||
DapUIWatchesEmpty = { fg = palette.love },
|
DapUIWatchesEmpty = { fg = palette.love },
|
||||||
DapUIWatchesError = { link = "DapUIWatchesEmpty" },
|
DapUIWatchesError = { link = "DapUIWatchesEmpty" },
|
||||||
DapUIWatchesValue = { link = "DapUIThread" },
|
DapUIWatchesValue = { link = "DapUIThread" },
|
||||||
|
|
@ -960,6 +962,8 @@ local function set_highlights()
|
||||||
GrugFarInputPlaceholder = { link = "Comment" },
|
GrugFarInputPlaceholder = { link = "Comment" },
|
||||||
GrugFarResultsActionMessage = { fg = palette.foam },
|
GrugFarResultsActionMessage = { fg = palette.foam },
|
||||||
GrugFarResultsChangeIndicator = { fg = groups.git_change },
|
GrugFarResultsChangeIndicator = { fg = groups.git_change },
|
||||||
|
GrugFarResultsRemoveIndicator = { fg = groups.git_delete },
|
||||||
|
GrugFarResultsAddIndicator = { fg = groups.git_add },
|
||||||
GrugFarResultsHeader = { fg = palette.pine },
|
GrugFarResultsHeader = { fg = palette.pine },
|
||||||
GrugFarResultsLineNo = { fg = palette.iris },
|
GrugFarResultsLineNo = { fg = palette.iris },
|
||||||
GrugFarResultsLineColumn = { link = "GrugFarResultsLineNo" },
|
GrugFarResultsLineColumn = { link = "GrugFarResultsLineNo" },
|
||||||
|
|
@ -974,9 +978,12 @@ local function set_highlights()
|
||||||
AvanteReversedSubtitle = { fg = palette.foam },
|
AvanteReversedSubtitle = { fg = palette.foam },
|
||||||
AvanteThirdTitle = { fg = palette.highlight_med, bg = palette.iris },
|
AvanteThirdTitle = { fg = palette.highlight_med, bg = palette.iris },
|
||||||
AvanteReversedThirdTitle = { fg = palette.iris },
|
AvanteReversedThirdTitle = { fg = palette.iris },
|
||||||
|
AvantePromptInput = { fg = palette.text, bg = groups.panel },
|
||||||
|
AvantePromptInputBorder = { fg = groups.border },
|
||||||
|
|
||||||
-- Saghen/blink.cmp
|
-- Saghen/blink.cmp
|
||||||
BlinkCmpDoc = { fg = palette.text },
|
BlinkCmpDoc = { bg = palette.highlight_low },
|
||||||
|
BlinkCmpDocSeparator = { bg = palette.highlight_low },
|
||||||
BlinkCmpDocBorder = { fg = palette.highlight_high },
|
BlinkCmpDocBorder = { fg = palette.highlight_high },
|
||||||
BlinkCmpGhostText = { fg = palette.muted },
|
BlinkCmpGhostText = { fg = palette.muted },
|
||||||
|
|
||||||
|
|
@ -1022,6 +1029,44 @@ local function set_highlights()
|
||||||
SnacksIndentScope = { fg = palette.foam },
|
SnacksIndentScope = { fg = palette.foam },
|
||||||
|
|
||||||
SnacksPickerMatch = { fg = palette.rose, bold = styles.bold },
|
SnacksPickerMatch = { fg = palette.rose, bold = styles.bold },
|
||||||
|
|
||||||
|
-- justinmk/vim-sneak
|
||||||
|
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 = {
|
local transparency_highlights = {
|
||||||
DiagnosticVirtualTextError = { fg = groups.error },
|
DiagnosticVirtualTextError = { fg = groups.error },
|
||||||
|
|
@ -1122,9 +1167,18 @@ local function set_highlights()
|
||||||
if config.options.before_highlight ~= nil then
|
if config.options.before_highlight ~= nil then
|
||||||
config.options.before_highlight(group, highlight, palette)
|
config.options.before_highlight(group, highlight, palette)
|
||||||
end
|
end
|
||||||
|
|
||||||
if highlight.blend ~= nil and (highlight.blend >= 0 and highlight.blend <= 100) and highlight.bg ~= nil then
|
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)
|
highlight.bg = utilities.blend(highlight.bg, highlight.blend_on or palette.base, highlight.blend / 100)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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)
|
vim.api.nvim_set_hl(0, group, highlight)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -1171,6 +1225,12 @@ function M.colorscheme(variant)
|
||||||
end
|
end
|
||||||
vim.g.colors_name = "rose-pine"
|
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()
|
set_highlights()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ local variants = {
|
||||||
overlay = "#f2e9e1",
|
overlay = "#f2e9e1",
|
||||||
muted = "#9893a5",
|
muted = "#9893a5",
|
||||||
subtle = "#797593",
|
subtle = "#797593",
|
||||||
text = "#575279",
|
text = "#464261",
|
||||||
love = "#b4637a",
|
love = "#b4637a",
|
||||||
gold = "#ea9d34",
|
gold = "#ea9d34",
|
||||||
rose = "#d7827e",
|
rose = "#d7827e",
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,17 @@ local function color_to_rgb(color)
|
||||||
return { byte(new_color, 16), byte(new_color, 8), byte(new_color, 0) }
|
return { byte(new_color, 16), byte(new_color, 8), byte(new_color, 0) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local color_cache = {}
|
||||||
|
|
||||||
---@param color string Palette key or hex value
|
---@param color string Palette key or hex value
|
||||||
function utilities.parse_color(color)
|
function utilities.parse_color(color)
|
||||||
|
if color_cache[color] then
|
||||||
|
return color_cache[color]
|
||||||
|
end
|
||||||
|
|
||||||
if color == nil then
|
if color == nil then
|
||||||
return print("Invalid color: " .. color)
|
print("Invalid color: " .. color)
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
color = color:lower()
|
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)
|
color = require("rose-pine.palette")[color] or vim.api.nvim_get_color_by_name(color)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
color_cache[color] = color
|
||||||
return color
|
return color
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local blend_cache = {}
|
||||||
|
|
||||||
---@param fg string Foreground color
|
---@param fg string Foreground color
|
||||||
---@param bg string Background color
|
---@param bg string Background color
|
||||||
---@param alpha number Between 0 (background) and 1 (foreground)
|
---@param alpha number Between 0 (background) and 1 (foreground)
|
||||||
function utilities.blend(fg, bg, alpha)
|
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 fg_rgb = color_to_rgb(fg)
|
||||||
local bg_rgb = color_to_rgb(bg)
|
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)
|
return math.floor(math.min(math.max(0, ret), 255) + 0.5)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
return utilities
|
return utilities
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ Install `rose-pine/neovim` using your favourite package manager:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
-- lua/plugins/rose-pine.lua
|
-- lua/plugins/rose-pine.lua
|
||||||
return {
|
return {
|
||||||
"rose-pine/neovim",
|
"rose-pine/neovim",
|
||||||
name = "rose-pine",
|
name = "rose-pine",
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd("colorscheme rose-pine")
|
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 = {
|
highlight_groups = {
|
||||||
-- Comment = { fg = "foam" },
|
-- Comment = { fg = "foam" },
|
||||||
|
-- StatusLine = { fg = "love", bg = "love", blend = 15 },
|
||||||
-- VertSplit = { fg = "muted", bg = "muted" },
|
-- VertSplit = { fg = "muted", bg = "muted" },
|
||||||
|
-- Visual = { fg = "base", bg = "text", inherit = false },
|
||||||
},
|
},
|
||||||
|
|
||||||
before_highlight = function(group, highlight, palette)
|
before_highlight = function(group, highlight, palette)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue