From b77bd8e7ceebc9732ed0e3f3be53bcc4e369463a Mon Sep 17 00:00:00 2001
From: mvllow
Date: Fri, 4 Feb 2022 19:22:13 -0600
Subject: [PATCH 01/18] BREAKING!: rewrite config api and update styles
- move config to lua
- use rose for search match
- fix background flicker when automatically switching to dawn
- remove unneeded highlights (please report regressions)
- remove deprecated `LspDiagnostics*`
- remove `LspReference*`
- improve overall consistency between elements
- non-treesitter updates to match treesitter styles
- update popup menu scrollbar and selection
- update telescope selection
- match cursorcolumn to cursorline
---
colors/rose-pine.vim | 5 -
lua/lualine/themes/rose-pine.lua | 39 +-
lua/rose-pine/bufferline/init.lua | 11 +-
lua/rose-pine/config.lua | 74 ---
lua/rose-pine/galaxyline/theme.lua | 21 +-
lua/rose-pine/init.lua | 144 ++++-
lua/rose-pine/palette.lua | 12 +-
lua/rose-pine/theme.lua | 882 ++++++++++++++---------------
readme.md | 2 +
9 files changed, 593 insertions(+), 597 deletions(-)
delete mode 100644 lua/rose-pine/config.lua
diff --git a/colors/rose-pine.vim b/colors/rose-pine.vim
index af1ddba..6b86afa 100644
--- a/colors/rose-pine.vim
+++ b/colors/rose-pine.vim
@@ -1,6 +1 @@
-lua package.loaded['rose-pine'] = nil
-lua package.loaded['rose-pine.config'] = nil
-lua package.loaded['rose-pine.palette'] = nil
-lua package.loaded['rose-pine.theme'] = nil
-
lua require('rose-pine').colorscheme()
diff --git a/lua/lualine/themes/rose-pine.lua b/lua/lualine/themes/rose-pine.lua
index dde3075..bb2b604 100644
--- a/lua/lualine/themes/rose-pine.lua
+++ b/lua/lualine/themes/rose-pine.lua
@@ -1,34 +1,35 @@
-local p = require('rose-pine.palette')
+local palette = require('rose-pine.palette')
+local colors = palette[vim.g.rose_pine_variant or 'main']
return {
normal = {
- a = { bg = p.rose, fg = p.base, gui = 'bold' },
- b = { bg = p.overlay, fg = p.rose },
- c = { bg = p.base, fg = p.text },
+ a = { bg = colors.rose, fg = colors.base, gui = 'bold' },
+ b = { bg = colors.overlay, fg = colors.rose },
+ c = { bg = colors.base, fg = colors.text },
},
insert = {
- a = { bg = p.foam, fg = p.base, gui = 'bold' },
- b = { bg = p.overlay, fg = p.foam },
- c = { bg = p.base, fg = p.text },
+ a = { bg = colors.foam, fg = colors.base, gui = 'bold' },
+ b = { bg = colors.overlay, fg = colors.foam },
+ c = { bg = colors.base, fg = colors.text },
},
visual = {
- a = { bg = p.iris, fg = p.base, gui = 'bold' },
- b = { bg = p.overlay, fg = p.iris },
- c = { bg = p.base, fg = p.text },
+ a = { bg = colors.iris, fg = colors.base, gui = 'bold' },
+ b = { bg = colors.overlay, fg = colors.iris },
+ c = { bg = colors.base, fg = colors.text },
},
replace = {
- a = { bg = p.pine, fg = p.base, gui = 'bold' },
- b = { bg = p.overlay, fg = p.pine },
- c = { bg = p.base, fg = p.text },
+ a = { bg = colors.pine, fg = colors.base, gui = 'bold' },
+ b = { bg = colors.overlay, fg = colors.pine },
+ c = { bg = colors.base, fg = colors.text },
},
command = {
- a = { bg = p.love, fg = p.base, gui = 'bold' },
- b = { bg = p.overlay, fg = p.love },
- c = { bg = p.base, fg = p.text },
+ a = { bg = colors.love, fg = colors.base, gui = 'bold' },
+ b = { bg = colors.overlay, fg = colors.love },
+ c = { bg = colors.base, fg = colors.text },
},
inactive = {
- a = { bg = p.base, fg = p.muted, gui = 'bold' },
- b = { bg = p.base, fg = p.muted },
- c = { bg = p.base, fg = p.muted },
+ a = { bg = colors.base, fg = colors.muted, gui = 'bold' },
+ b = { bg = colors.base, fg = colors.muted },
+ c = { bg = colors.base, fg = colors.muted },
},
}
diff --git a/lua/rose-pine/bufferline/init.lua b/lua/rose-pine/bufferline/init.lua
index 3ae77b4..4eb8a9a 100644
--- a/lua/rose-pine/bufferline/init.lua
+++ b/lua/rose-pine/bufferline/init.lua
@@ -1,4 +1,5 @@
-local p = require('rose-pine.palette')
+local palette = require('rose-pine.palette')
+local colors = palette[vim.g.rose_pine_variant or 'main']
-- TODO: Someone who uses bufferline.nvim is free to PR with this addition
-- `:h bufferline-highlights`
@@ -13,11 +14,11 @@ local p = require('rose-pine.palette')
-- ```
return {
fill = {
- guifg = p.text,
- guibg = p.base,
+ guifg = colors.text,
+ guibg = colors.base,
},
background = {
- guifg = p.text,
- guibg = p.base,
+ guifg = colors.text,
+ guibg = colors.base,
},
}
diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua
deleted file mode 100644
index 6b3ac12..0000000
--- a/lua/rose-pine/config.lua
+++ /dev/null
@@ -1,74 +0,0 @@
-local palette = require('rose-pine.palette')
-
-local function opt(key, default)
- key = 'rose_pine_' .. key
-
- if vim.g[key] == nil then
- return default
- end
-
- if vim.g[key] == 0 or vim.g[key] == false then
- return false
- end
-
- return vim.g[key]
-end
-
-local config = {
- variant = opt('variant', 'main'),
-
- bold_vertical_split_line = opt('bold_vertical_split_line', false),
- disable_italics = opt('disable_italics', false),
- disable_background = opt('disable_background', false),
- disable_float_background = opt('disable_float_background', false),
- inactive_background = opt('inactive_background', false),
-
- colors = {
- border = palette.highlight_med,
- comment = palette.muted,
- link = palette.iris,
- punctuation = palette.subtle,
-
- error = palette.love,
- hint = palette.iris,
- info = palette.foam,
- warn = palette.gold,
-
- git_add = palette.foam,
- git_change = palette.rose,
- git_delete = palette.love,
- git_dirty = palette.rose,
- git_ignore = palette.muted,
- git_merge = palette.iris,
- git_rename = palette.pine,
- git_stage = palette.iris,
- git_text = palette.rose,
-
- ---@type string|table
- headings = {
- h1 = palette.iris,
- h2 = palette.foam,
- h3 = palette.rose,
- h4 = palette.gold,
- h5 = palette.pine,
- h6 = palette.foam,
- },
- },
-}
-
-local colors = vim.g.rose_pine_colors or {}
-
-if type(colors.headings) == 'string' then
- colors.headings = {
- h1 = colors.headings,
- h2 = colors.headings,
- h3 = colors.headings,
- h4 = colors.headings,
- h5 = colors.headings,
- h6 = colors.headings,
- }
-end
-
-config.colors = vim.tbl_deep_extend('force', config.colors, colors)
-
-return config
diff --git a/lua/rose-pine/galaxyline/theme.lua b/lua/rose-pine/galaxyline/theme.lua
index 5142949..b964186 100644
--- a/lua/rose-pine/galaxyline/theme.lua
+++ b/lua/rose-pine/galaxyline/theme.lua
@@ -4,16 +4,17 @@ if not present then
end
local palette = require('rose-pine.palette')
+local colors = palette[vim.g.rose_pine_variant or 'main']
galaxyline_colors['rose-pine'] = {
- bg = palette.overlay,
- fg = palette.text,
- fg_alt = palette.subtle,
- blue = palette.foam,
- cyan = palette.foam,
- green = palette.muted,
- magenta = palette.iris,
- orange = palette.rose,
- red = palette.love,
- yellow = palette.gold,
+ bg = colors.overlay,
+ fg = colors.text,
+ fg_alt = colors.subtle,
+ blue = colors.foam,
+ cyan = colors.foam,
+ green = colors.muted,
+ magenta = colors.iris,
+ orange = colors.rose,
+ red = colors.love,
+ yellow = colors.gold,
}
diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua
index f872457..748edce 100644
--- a/lua/rose-pine/init.lua
+++ b/lua/rose-pine/init.lua
@@ -1,5 +1,112 @@
+local palette = require('rose-pine.palette')
+
local M = {}
+---@class RosePineConfig
+---@field variant 'main'|'moon'|'dawn'
+---@field bold_vert_split boolean
+---@field dim_nc_background boolean
+---@field disable_background boolean
+---@field disable_float_background boolean
+---@field disable_italics boolean
+---@field groups RosePineGroups
+
+---@class RosePineGroups
+---@field border string
+---@field comment string
+---@field link string
+---@field punctuation string
+---@field error string
+---@field hint string
+---@field info string
+---@field warn string
+---@field git RosePineGit
+---@field headings string|RosePineHeadings
+
+---@class RosePineGit
+---@field add string
+---@field change string
+---@field delete string
+---@field dirty string
+---@field ignore string
+---@field merge string
+---@field rename string
+---@field stage string
+---@field text string
+
+---@class RosePineHeadings
+---@field h1 string
+---@field h2 string
+---@field h3 string
+---@field h4 string
+---@field h5 string
+---@field h6 string
+
+---@type RosePineConfig
+local config = {}
+
+---@param opts RosePineConfig
+function M.setup(opts)
+ vim.g.rose_pine_variant = opts.variant or 'main'
+
+ local default_config = {
+ variant = 'main',
+ bold_vert_split = false,
+ dim_nc_background = false,
+ disable_background = false,
+ disable_float_background = false,
+ disable_italics = false,
+
+ groups = {
+ border = 'highlight_med',
+ comment = 'muted',
+ link = 'iris',
+ punctuation = 'subtle',
+
+ error = 'love',
+ hint = 'iris',
+ info = 'foam',
+ warn = 'gold',
+
+ git = {
+ add = 'foam',
+ change = 'rose',
+ delete = 'love',
+ dirty = 'rose',
+ ignore = 'muted',
+ merge = 'iris',
+ rename = 'pine',
+ stage = 'iris',
+ text = 'rose',
+ },
+
+ headings = {
+ h1 = 'iris',
+ h2 = 'foam',
+ h3 = 'rose',
+ h4 = 'gold',
+ h5 = 'pine',
+ h6 = 'foam',
+ },
+ },
+ }
+
+ local groups = opts.groups or {}
+ if type(groups.headings) == 'string' then
+ groups.headings = {
+ h1 = groups.headings,
+ h2 = groups.headings,
+ h3 = groups.headings,
+ h4 = groups.headings,
+ h5 = groups.headings,
+ h6 = groups.headings,
+ }
+ end
+
+ config.user_variant = opts.variant or nil
+ config = vim.tbl_deep_extend('force', default_config, opts)
+end
+
function M.colorscheme()
if vim.g.colors_name then
vim.cmd('hi clear')
@@ -8,20 +115,34 @@ function M.colorscheme()
vim.opt.termguicolors = true
vim.g.colors_name = 'rose-pine'
- -- Match terminal theme if no variant is set
- if vim.g.rose_pine_variant == nil and vim.o.background == 'light' then
- vim.g.rose_pine_variant = 'dawn'
- elseif vim.g.rose_pine_variant == 'dawn' then
+ -- match variant to vim background
+ if config.user_variant == nil and vim.o.background == 'light' then
+ config.variant = 'dawn'
+ end
+
+ -- match vim background to variant
+ if config.user_variant == 'main' or config.user_variant == 'moon' then
+ vim.o.background = 'dark'
+ elseif config.user_variant == 'dawn' then
vim.o.background = 'light'
end
+ ---@param color string
+ local function get_palette_color(color)
+ if color and not color:find('#') then
+ return palette[config.variant][color:lower()]
+ end
+
+ return color:lower()
+ end
+
---@param group string
---@param color table
local function highlight(group, color)
local style = color.style and 'gui=' .. color.style or 'gui=NONE'
- local fg = color.fg and 'guifg=' .. color.fg or 'guifg=NONE'
- local bg = color.bg and 'guibg=' .. color.bg or 'guibg=NONE'
- local sp = color.sp and 'guisp=' .. color.sp or ''
+ local fg = color.fg and 'guifg=' .. get_palette_color(color.fg) or 'guifg=NONE'
+ local bg = color.bg and 'guibg=' .. get_palette_color(color.bg) or 'guibg=NONE'
+ local sp = color.sp and 'guisp=' .. get_palette_color(color.sp) or ''
local hl = 'highlight ' .. group .. ' ' .. style .. ' ' .. fg .. ' ' .. bg .. ' ' .. sp
@@ -31,15 +152,16 @@ function M.colorscheme()
end
end
- for group, colors in pairs(require('rose-pine.theme')) do
- highlight(group, colors)
+ local theme = require('rose-pine.theme').get(config)
+ for group, color in pairs(theme) do
+ highlight(group, color)
end
require('rose-pine.galaxyline.theme')
end
function M.set(variant)
- vim.g.rose_pine_variant = variant
+ config.variant = variant
vim.cmd('colorscheme rose-pine')
end
@@ -52,7 +174,7 @@ function M.toggle(variants)
end
if vim.g.rose_pine_current_variant == nil then
- vim.g.rose_pine_current_variant = index[vim.g.rose_pine_variant] or 0
+ vim.g.rose_pine_current_variant = index[config.variant] or 0
end
vim.g.rose_pine_current_variant = (vim.g.rose_pine_current_variant % #variants) + 1
diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua
index 0b24973..13c0bcf 100644
--- a/lua/rose-pine/palette.lua
+++ b/lua/rose-pine/palette.lua
@@ -1,4 +1,6 @@
-local variants = {
+local palette = {}
+
+palette = {
main = {
base = '#191724',
surface = '#1f1d2e',
@@ -55,14 +57,6 @@ local variants = {
},
}
-local palette = variants.main
-
-if string.match(vim.g.rose_pine_variant or '', 'moon') then
- palette = variants.moon
-elseif string.match(vim.g.rose_pine_variant or '', 'dawn') then
- palette = variants.dawn
-end
-
vim.tbl_deep_extend('force', palette, { none = 'NONE' })
return palette
diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua
index 6eb9344..1bd38a4 100644
--- a/lua/rose-pine/theme.lua
+++ b/lua/rose-pine/theme.lua
@@ -1,469 +1,423 @@
local palette = require('rose-pine.palette')
-local config = require('rose-pine.config')
-local util = require('rose-pine.util')
+local blend = require('rose-pine.util').blend
-local group = config.colors
+local M = {}
-local maybe_italic = 'italic'
-if config.disable_italics == true then
- maybe_italic = nil
+function M.get(config)
+ local theme = {}
+ local groups = config.groups
+ local colors = palette[config.variant or 'main']
+ local styles = {
+ italic = (config.disable_italics and 'italic') or 'NONE',
+ vert_split = (config.bold_vert_split and colors.surface) or colors.none,
+ background = (config.disable_background and colors.none) or colors.base,
+ float_background = (config.disable_float_background and colors.none) or colors.surface,
+ inactive_background = (config.dim_nc_background and colors.surface) or colors.base,
+ }
+
+ theme = {
+ ColorColumn = { bg = colors.highlight_high },
+ Conceal = { bg = colors.none },
+ -- Cursor = {},
+ CursorColumn = { bg = colors.overlay },
+ -- CursorIM = {},
+ CursorLine = { bg = colors.overlay },
+ CursorLineNr = { fg = colors.text },
+ DarkenedPanel = { bg = colors.surface },
+ DarkenedStatusline = { bg = colors.surface },
+ DiffAdd = { bg = blend(groups.git.add, colors.base, 0.5) },
+ DiffChange = { bg = colors.overlay },
+ DiffDelete = { bg = blend(groups.git.delete, colors.base, 0.5) },
+ DiffText = { bg = blend(groups.git.text, colors.base, 0.5) },
+ diffAdded = { link = 'DiffAdd' },
+ diffChanged = { link = 'DiffChange' },
+ diffRemoved = { link = 'DiffDelete' },
+ Directory = { fg = colors.foam, bg = colors.none },
+ -- EndOfBuffer = {},
+ ErrorMsg = { fg = colors.love, style = 'bold' },
+ FloatBorder = { fg = groups.border },
+ FoldColumn = { fg = colors.muted },
+ Folded = { fg = colors.text, bg = colors.surface },
+ IncSearch = { fg = colors.base, bg = colors.rose },
+ LineNr = { fg = colors.muted },
+ MatchParen = { fg = colors.text, bg = colors.highlight_med },
+ ModeMsg = { fg = colors.subtle },
+ MoreMsg = { fg = colors.iris },
+ NonText = { fg = colors.muted },
+ Normal = { fg = colors.text, bg = styles.background },
+ NormalFloat = { fg = colors.text, bg = styles.float_background },
+ NormalNC = { fg = colors.text, bg = styles.inactive_background },
+ NvimInternalError = { fg = '#ffffff', bg = colors.love },
+ Pmenu = { fg = colors.subtle, bg = styles.float_background },
+ PmenuSbar = { bg = colors.highlight_low },
+ PmenuSel = { fg = colors.text, bg = colors.overlay },
+ PmenuThumb = { bg = colors.highlight_med },
+ Question = { fg = colors.gold },
+ -- QuickFixLine = {},
+ -- RedrawDebugNormal = {}
+ RedrawDebugClear = { fg = '#ffffff', bg = colors.gold },
+ RedrawDebugComposed = { fg = '#ffffff', bg = colors.pine },
+ RedrawDebugRecompose = { fg = '#ffffff', bg = colors.love },
+ Search = { bg = colors.highlight_med },
+ SpecialKey = { fg = colors.foam },
+ SpellBad = { sp = colors.love, style = 'undercurl' },
+ SpellCap = { sp = colors.subtle, style = 'undercurl' },
+ SpellLocal = { sp = colors.subtle, style = 'undercurl' },
+ SpellRare = { sp = colors.subtle, style = 'undercurl' },
+ SignColumn = { fg = colors.text, bg = styles.background },
+ StatusLine = { fg = colors.subtle, bg = colors.surface },
+ StatusLineNC = { fg = colors.muted, bg = colors.base },
+ StatusLineTerm = { link = 'StatusLine' },
+ StatusLineTermNC = { link = 'StatusLineNC' },
+ TabLine = { fg = colors.subtle, bg = colors.surface },
+ TabLineFill = { bg = colors.surface },
+ TabLineSel = { fg = colors.text, bg = colors.overlay },
+ Title = { fg = colors.text },
+ VertSplit = { fg = colors.overlay, bg = styles.vert_split },
+ Visual = { bg = colors.highlight_med },
+ -- VisualNOS = {},
+ WarningMsg = { fg = colors.gold },
+ -- Whitespace = {},
+ -- WildMenu = {},
+
+ Boolean = { fg = colors.rose },
+ Character = { fg = colors.gold },
+ Comment = { fg = groups.comment, style = styles.italic },
+ Conditional = { fg = colors.pine },
+ Constant = { fg = colors.gold },
+ Debug = { fg = colors.rose },
+ Define = { fg = colors.iris },
+ Delimiter = { fg = colors.subtle },
+ Error = { fg = colors.love },
+ Exception = { fg = colors.pine },
+ Float = { fg = colors.gold },
+ Function = { fg = colors.rose },
+ Identifier = { fg = colors.rose },
+ -- Ignore = {},
+ Include = { fg = colors.iris },
+ Keyword = { fg = colors.pine },
+ Label = { fg = colors.foam },
+ Macro = { fg = colors.iris },
+ Number = { fg = colors.gold },
+ Operator = { fg = colors.subtle },
+ PreCondit = { fg = colors.iris },
+ PreProc = { fg = colors.iris },
+ Repeat = { fg = colors.pine },
+ Special = { fg = colors.rose },
+ SpecialChar = { fg = colors.rose },
+ SpecialComment = { fg = colors.iris },
+ Statement = { fg = colors.pine },
+ StorageClass = { fg = colors.foam },
+ String = { fg = colors.gold },
+ Structure = { fg = colors.foam },
+ Tag = { fg = colors.rose },
+ Todo = { fg = colors.iris },
+ Type = { fg = colors.foam },
+ Typedef = { fg = colors.foam },
+ Underlined = { style = 'underline' },
+
+ htmlArg = { fg = colors.iris },
+ htmlBold = { style = 'bold' },
+ htmlEndTag = { fg = colors.subtle },
+ htmlH1 = { fg = groups.headings.h1, style = 'bold' },
+ htmlH2 = { fg = groups.headings.h2, style = 'bold' },
+ htmlH3 = { fg = groups.headings.h3, style = 'bold' },
+ htmlH4 = { fg = groups.headings.h4, style = 'bold' },
+ htmlH5 = { fg = groups.headings.h5, style = 'bold' },
+ htmlItalic = { style = styles.italic },
+ htmlLink = { fg = groups.link },
+ htmlTag = { fg = colors.subtle },
+ htmlTagN = { fg = colors.text },
+ htmlTagName = { fg = colors.foam },
+
+ markdownDelimiter = { fg = colors.subtle },
+ markdownH1 = { fg = groups.headings.h1, style = 'bold' },
+ markdownH1Delimiter = { link = 'markdownH1' },
+ markdownH2 = { fg = groups.headings.h2, style = 'bold' },
+ markdownH2Delimiter = { link = 'markdownH2' },
+ markdownH3 = { fg = groups.headings.h3, style = 'bold' },
+ markdownH3Delimiter = { link = 'markdownH3' },
+ markdownH4 = { fg = groups.headings.h4, style = 'bold' },
+ markdownH4Delimiter = { link = 'markdownH4' },
+ markdownH5 = { fg = groups.headings.h5, style = 'bold' },
+ markdownH5Delimiter = { link = 'markdownH5' },
+ markdownH6 = { fg = groups.headings.h6, style = 'bold' },
+ markdownH6Delimiter = { link = 'markdownH6' },
+ markdownLinkText = { fg = groups.link, style = 'underline' },
+ markdownUrl = { link = 'markdownLinkText' },
+
+ mkdCode = { fg = colors.foam, style = styles.italic },
+ mkdCodeDelimiter = { fg = colors.rose },
+ mkdCodeEnd = { fg = colors.foam },
+ mkdCodeStart = { fg = colors.foam },
+ mkdFootnotes = { fg = colors.foam },
+ mkdID = { fg = colors.foam, style = 'underline' },
+ mkdInlineURL = { fg = groups.link, style = 'underline' },
+ mkdLink = { link = 'mkdInlineURL' },
+ mkdLinkDef = { link = 'mkdInlineURL' },
+ mkdListItemLine = { fg = colors.text },
+ mkdRule = { fg = colors.subtle },
+ mkdURL = { link = 'mkdInlineURL' },
+
+ DiagnosticError = { fg = groups.error },
+ DiagnosticHint = { fg = groups.hint },
+ DiagnosticInfo = { fg = groups.info },
+ DiagnosticWarn = { fg = groups.warn },
+ DiagnosticDefaultError = { fg = groups.error },
+ DiagnosticDefaultHint = { fg = groups.hint },
+ DiagnosticDefaultInfo = { fg = groups.info },
+ DiagnosticDefaultWarn = { fg = groups.warn },
+ DiagnosticFloatingError = { fg = groups.error },
+ DiagnosticFloatingHint = { fg = groups.hint },
+ DiagnosticFloatingInfo = { fg = groups.info },
+ DiagnosticFloatingWarn = { fg = groups.warn },
+ DiagnosticSignError = { fg = groups.error },
+ DiagnosticSignHint = { fg = groups.hint },
+ DiagnosticSignInfo = { fg = groups.info },
+ DiagnosticSignWarn = { fg = groups.warn },
+ DiagnosticUnderlineError = { sp = groups.error, style = 'undercurl' },
+ DiagnosticUnderlineHint = { sp = groups.hint, style = 'undercurl' },
+ DiagnosticUnderlineInfo = { sp = groups.info, style = 'undercurl' },
+ DiagnosticUnderlineWarn = { sp = groups.warn, style = 'undercurl' },
+ DiagnosticVirtualTextError = { fg = groups.error },
+ DiagnosticVirtualTextHint = { fg = groups.hint },
+ DiagnosticVirtualTextInfo = { fg = groups.info },
+ DiagnosticVirtualTextWarn = { fg = groups.warn },
+
+ -- TSAttribute = {},
+ TSBoolean = { link = 'Boolean' },
+ TSCharacter = { link = 'Character' },
+ TSComment = { link = 'Comment' },
+ TSConditional = { link = 'Conditional' },
+ TSConstBuiltin = { fg = colors.love },
+ -- TSConstMacro = {},
+ TSConstant = { fg = colors.foam },
+ TSConstructor = { fg = colors.foam },
+ -- TSEmphasis = {},
+ -- TSError = {},
+ -- TSException = {},
+ TSField = { fg = colors.foam },
+ -- TSFloat = {},
+ TSFuncBuiltin = { fg = colors.love },
+ -- TSFuncMacro = {},
+ TSFunction = { fg = colors.rose },
+ TSInclude = { fg = colors.pine },
+ TSKeyword = { fg = colors.pine },
+ -- TSKeywordFunction = {},
+ TSKeywordOperator = { fg = colors.subtle },
+ TSLabel = { fg = colors.foam },
+ -- TSLiteral = {},
+ -- TSMethod = {},
+ -- TSNamespace = {},
+ -- TSNone = {},
+ TSNumber = { link = 'Number' },
+ TSOperator = { fg = colors.subtle },
+ TSParameter = { fg = colors.iris, style = styles.italic },
+ -- TSParameterReference = {},
+ TSProperty = { fg = colors.iris, style = styles.italic },
+ TSPunctBracket = { fg = groups.punctuation },
+ TSPunctDelimiter = { fg = groups.punctuation },
+ TSPunctSpecial = { fg = groups.punctuation },
+ -- TSRepeat = {},
+ -- TSStrike = {},
+ TSString = { link = 'String' },
+ TSStringEscape = { fg = colors.pine },
+ -- TSStringRegex = {},
+ TSStringSpecial = { link = 'TSString' },
+ -- TSSymbol = {},
+ TSTag = { fg = colors.foam },
+ TSTagDelimiter = { fg = colors.subtle },
+ TSText = { fg = colors.text },
+ TSTitle = { fg = groups.headings.h1, style = 'bold' },
+ TSType = { link = 'Type' },
+ -- TSTypeBuiltin = {},
+ TSURI = { fg = groups.link },
+ -- TSUnderline = {},
+ TSVariable = { fg = colors.text, style = styles.italic },
+ TSVariableBuiltin = { fg = colors.love },
+
+ -- romgrk/barbar.nvim
+ BufferCurrent = { fg = colors.text, bg = colors.overlay },
+ BufferCurrentIndex = { fg = colors.text, bg = colors.overlay },
+ BufferCurrentMod = { fg = colors.foam, bg = colors.overlay },
+ BufferCurrentSign = { fg = colors.subtle, bg = colors.overlay },
+ BufferCurrentTarget = { fg = colors.gold, bg = colors.overlay },
+ BufferInactive = { fg = colors.subtle },
+ BufferInactiveIndex = { fg = colors.subtle },
+ BufferInactiveMod = { fg = colors.foam },
+ BufferInactiveSign = { fg = colors.muted },
+ BufferInactiveTarget = { fg = colors.gold },
+ BufferTabpageFill = { fg = colors.base, bg = colors.base },
+ BufferVisible = { fg = colors.subtle },
+ BufferVisibleIndex = { fg = colors.subtle },
+ BufferVisibleMod = { fg = colors.foam },
+ BufferVisibleSign = { fg = colors.muted },
+ BufferVisibleTarget = { fg = colors.gold },
+
+ -- lewis6991/gitsigns.nvim
+ GitSignsAdd = { fg = groups.git.add },
+ GitSignsChange = { fg = groups.git.change },
+ GitSignsDelete = { fg = groups.git.delete },
+ SignAdd = { link = 'GitSignsAdd' },
+ SignChange = { link = 'GitSignsChange' },
+ SignDelete = { link = 'GitSignsDelete' },
+
+ -- mvllow/modes.nvim
+ ModesCopy = { bg = colors.gold },
+ ModesDelete = { bg = colors.love },
+ ModesInsert = { bg = colors.foam },
+ ModesVisual = { bg = colors.iris },
+
+ -- kyazdani42/nvim-tree.lua
+ NvimTreeEmptyFolderName = { fg = colors.muted },
+ NvimTreeFileDeleted = { fg = colors.love },
+ NvimTreeFileDirty = { fg = colors.rose },
+ NvimTreeFileMerge = { fg = colors.iris },
+ NvimTreeFileNew = { fg = colors.foam },
+ NvimTreeFileRenamed = { fg = colors.pine },
+ NvimTreeFileStaged = { fg = colors.iris },
+ NvimTreeFolderIcon = { fg = colors.subtle },
+ NvimTreeFolderName = { fg = colors.foam },
+ NvimTreeGitDeleted = { fg = groups.git.delete },
+ NvimTreeGitDirty = { fg = groups.git.dirty },
+ NvimTreeGitIgnored = { fg = groups.git.ignore },
+ NvimTreeGitMerge = { fg = groups.git.merge },
+ NvimTreeGitNew = { fg = groups.git.add },
+ NvimTreeGitRenamed = { fg = groups.git.rename },
+ NvimTreeGitStaged = { fg = groups.git.stage },
+ NvimTreeImageFile = { fg = colors.text },
+ NvimTreeNormal = { fg = colors.text },
+ NvimTreeOpenedFile = { fg = colors.text, bg = colors.highlight_med },
+ NvimTreeOpenedFolderName = { fg = colors.foam },
+ NvimTreeRootFolder = { fg = colors.iris },
+ NvimTreeSpecialFile = { link = 'NvimTreeNormal' },
+ NvimTreeWindowPicker = { fg = colors.base, bg = colors.iris },
+
+ -- folke/which-key.nvim
+ WhichKey = { fg = colors.iris },
+ WhichKeyGroup = { fg = colors.foam },
+ WhichKeySeparator = { fg = colors.subtle },
+ WhichKeyDesc = { fg = colors.gold },
+ WhichKeyFloat = { bg = colors.surface },
+ WhichKeyValue = { fg = colors.rose },
+
+ -- luka-reineke/indent-blankline.nvim
+ IndentBlanklineChar = { fg = colors.muted },
+
+ -- hrsh7th/nvim-cmp
+ CmpItemAbbr = { fg = colors.subtle },
+ CmpItemAbbrDeprecated = { fg = colors.subtle, style = 'strikethrough' },
+ CmpItemAbbrMatch = { fg = colors.text, style = 'bold' },
+ CmpItemAbbrMatchFuzzy = { fg = colors.text, style = 'bold' },
+ CmpItemKind = { fg = colors.iris },
+ CmpItemKindClass = { fg = colors.gold },
+ CmpItemKindFunction = { fg = colors.iris },
+ CmpItemKindInterface = { fg = colors.gold },
+ CmpItemKindMethod = { fg = colors.iris },
+ CmpItemKindSnippet = { fg = colors.iris },
+ CmpItemKindVariable = { fg = colors.foam },
+
+ -- TimUntersberger/neogit
+ NeogitDiffAddHighlight = { fg = colors.foam, bg = colors.highlight_med },
+ NeogitDiffContextHighlight = { bg = colors.highlight_low },
+ NeogitDiffDeleteHighlight = { fg = colors.love, bg = colors.highlight_med },
+ NeogitHunkHeader = { bg = colors.highlight_low },
+ NeogitHunkHeaderHighlight = { bg = colors.highlight_low },
+
+ -- vimwiki/vimwiki
+ VimwikiHR = { fg = colors.subtle },
+ VimwikiHeader1 = { fg = groups.headings.h1, style = 'bold' },
+ VimwikiHeader2 = { fg = groups.headings.h2, style = 'bold' },
+ VimwikiHeader3 = { fg = groups.headings.h3, style = 'bold' },
+ VimwikiHeader4 = { fg = groups.headings.h4, style = 'bold' },
+ VimwikiHeader5 = { fg = groups.headings.h5, style = 'bold' },
+ VimwikiHeader6 = { fg = groups.headings.h6, style = 'bold' },
+ VimwikiHeaderChar = { fg = colors.pine },
+ VimwikiLink = { fg = groups.link, style = 'underline' },
+ VimwikiList = { fg = colors.iris },
+ VimwikiNoExistsLink = { fg = colors.love },
+
+ -- nvim-neorg/neorg
+ NeorgHeading1Prefix = { fg = groups.headings.h1, style = 'bold' },
+ NeorgHeading1Title = { link = 'NeorgHeading1Prefix' },
+ NeorgHeading2Prefix = { fg = groups.headings.h2, style = 'bold' },
+ NeorgHeading2Title = { link = 'NeorgHeading2Prefix' },
+ NeorgHeading3Prefix = { fg = groups.headings.h3, style = 'bold' },
+ NeorgHeading3Title = { link = 'NeorgHeading3Prefix' },
+ NeorgHeading4Prefix = { fg = groups.headings.h4, style = 'bold' },
+ NeorgHeading4Title = { link = 'NeorgHeading4Prefix' },
+ NeorgHeading5Prefix = { fg = groups.headings.h5, style = 'bold' },
+ NeorgHeading5Title = { link = 'NeorgHeading5Prefix' },
+ NeorgHeading6Prefix = { fg = groups.headings.h6, style = 'bold' },
+ NeorgHeading6Title = { link = 'NeorgHeading6Prefix' },
+ NeorgMarkerTitle = { fg = colors.text, style = 'bold' },
+
+ -- tami5/lspsaga.nvim (fork of glepnir/lspsaga.nvim)
+ DefinitionCount = { fg = colors.rose },
+ DefinitionIcon = { fg = colors.rose },
+ DefintionPreviewTitle = { fg = colors.rose, style = 'bold' },
+ LspFloatWinBorder = { fg = groups.border },
+ LspFloatWinNormal = { bg = colors.base },
+ LspSagaAutoPreview = { fg = colors.subtle },
+ LspSagaCodeActionBorder = { fg = groups.border },
+ LspSagaCodeActionContent = { fg = colors.foam },
+ LspSagaCodeActionTitle = { fg = colors.gold, style = 'bold' },
+ LspSagaCodeActionTruncateLine = { link = 'LspSagaCodeActionBorder' },
+ LspSagaDefPreviewBorder = { fg = groups.border },
+ LspSagaDiagnosticBorder = { fg = groups.border },
+ LspSagaDiagnosticHeader = { fg = colors.gold, style = 'bold' },
+ LspSagaDiagnosticTruncateLine = { link = 'LspSagaDiagnosticBorder' },
+ LspSagaDocTruncateLine = { link = 'LspSagaHoverBorder' },
+ LspSagaFinderSelection = { fg = colors.gold },
+ LspSagaHoverBorder = { fg = groups.border },
+ LspSagaLspFinderBorder = { fg = groups.border },
+ LspSagaRenameBorder = { fg = colors.pine },
+ LspSagaRenamePromptPrefix = { fg = colors.love },
+ LspSagaShTruncateLine = { link = 'LspSagaSignatureHelpBorder' },
+ LspSagaSignatureHelpBorder = { fg = colors.pine },
+ ReferencesCount = { fg = colors.rose },
+ ReferencesIcon = { fg = colors.rose },
+ SagaShadow = { bg = colors.overlay },
+ TargetWord = { fg = colors.iris },
+
+ -- ray-x/lsp_signature.nvim
+ LspSignatureActiveParameter = { bg = colors.overlay },
+
+ -- rlane/pounce.nvim
+ PounceAccept = { fg = colors.love, bg = colors.highlight_high },
+ PounceAcceptBest = { fg = colors.base, bg = colors.gold },
+ PounceGap = { link = 'Search' },
+ PounceMatch = { link = 'Search' },
+
+ -- nvim-telescope/telescope.nvim
+ TelescopeBorder = { fg = groups.border },
+ TelescopeMatching = { fg = colors.rose },
+ TelescopeNormal = { fg = colors.subtle },
+ TelescopePromptNormal = { fg = colors.text },
+ TelescopePromptPrefix = { fg = colors.subtle },
+ TelescopeSelection = { fg = colors.text, bg = colors.overlay },
+ TelescopeSelectionCaret = { fg = colors.rose, bg = colors.overlay },
+ TelescopeTitle = { fg = colors.subtle },
+ }
+
+ vim.g.terminal_color_0 = colors.overlay -- black
+ vim.g.terminal_color_8 = colors.subtle -- bright black
+ vim.g.terminal_color_1 = colors.love -- red
+ vim.g.terminal_color_9 = colors.love -- bright red
+ vim.g.terminal_color_2 = colors.pine -- green
+ vim.g.terminal_color_10 = colors.pine -- bright green
+ vim.g.terminal_color_3 = colors.gold -- yellow
+ vim.g.terminal_color_11 = colors.gold -- bright yellow
+ vim.g.terminal_color_4 = colors.foam -- blue
+ vim.g.terminal_color_12 = colors.foam -- bright blue
+ vim.g.terminal_color_5 = colors.iris -- magenta
+ vim.g.terminal_color_13 = colors.iris -- bright magenta
+ vim.g.terminal_color_6 = colors.rose -- cyan
+ vim.g.terminal_color_14 = colors.rose -- bright cyan
+ vim.g.terminal_color_7 = colors.text -- white
+ vim.g.terminal_color_15 = colors.text -- bright white
+
+ return theme
end
-local background = palette.base
-if config.disable_background then
- background = palette.none
-end
-
-local float_background = palette.surface
-if config.disable_float_background then
- float_background = palette.none
-end
-
-local inactive_background = palette.none
-if config.inactive_background then
- inactive_background = util.blend('#000000', palette.base, palette.opacity)
-end
-
-local vert_split_background = palette.none
-if config.bold_vertical_split_line then
- vert_split_background = palette.overlay
-end
-
-local theme = {
- ColorColumn = { bg = palette.highlight_high },
- Conceal = { bg = palette.none },
- -- Cursor = {},
- CursorColumn = { bg = group.border },
- -- CursorIM = {},
- CursorLine = { bg = palette.highlight_low },
- CursorLineNr = { fg = palette.text },
- DarkenedPanel = { bg = palette.surface },
- DarkenedStatusline = { bg = palette.surface },
- DiffAdd = { bg = util.blend(group.git_add, palette.base, 0.5) },
- DiffChange = { bg = palette.overlay },
- DiffDelete = { bg = util.blend(group.git_delete, palette.base, 0.5) },
- DiffText = { bg = util.blend(group.git_text, palette.base, 0.5) },
- diffAdded = { link = 'DiffAdd' },
- diffChanged = { link = 'DiffChange' },
- diffRemoved = { link = 'DiffDelete' },
- Directory = { fg = palette.foam, bg = palette.none },
- -- EndOfBuffer = {},
- ErrorMsg = { fg = palette.love, style = 'bold' },
- FloatBorder = { fg = group.border },
- FoldColumn = { fg = palette.muted },
- Folded = { fg = palette.text, bg = palette.surface },
- IncSearch = { bg = palette.highlight_high },
- LineNr = { fg = palette.muted },
- MatchParen = { fg = palette.text, bg = palette.highlight_med },
- ModeMsg = { fg = palette.subtle },
- MoreMsg = { fg = palette.iris },
- NonText = { fg = palette.muted },
- Normal = { fg = palette.text, bg = background },
- NormalNC = { fg = palette.text, bg = inactive_background },
- NormalFloat = { fg = palette.text, bg = float_background },
- Pmenu = { fg = palette.subtle, bg = float_background },
- PmenuSbar = { bg = palette.overlay },
- PmenuSel = { fg = palette.text, bg = palette.overlay },
- PmenuThumb = { bg = palette.muted },
- Question = { fg = palette.gold },
- -- QuickFixLine = {},
- Search = { bg = palette.highlight_med },
- SpecialKey = { fg = palette.foam },
- SpellBad = { sp = palette.love, style = 'undercurl' },
- SpellCap = { sp = palette.subtle, style = 'undercurl' },
- SpellLocal = { sp = palette.subtle, style = 'undercurl' },
- SpellRare = { sp = palette.subtle, style = 'undercurl' },
- SignColumn = { fg = palette.text, bg = background },
- StatusLine = { fg = palette.subtle, bg = palette.surface },
- StatusLineNC = { fg = palette.muted, bg = palette.base },
- -- StatusLineTerm = {},
- -- StatusLineTermNC = {},
- TabLine = { fg = palette.subtle, bg = palette.overlay },
- TabLineFill = { bg = palette.surface },
- TabLineSel = { fg = palette.text, bg = palette.muted },
- Title = { fg = palette.text },
- VertSplit = { fg = palette.overlay, bg = vert_split_background },
- Visual = { bg = palette.highlight_med },
- -- VisualNOS = {},
- WarningMsg = { fg = palette.gold },
- -- Whitespace = {},
- -- WildMenu = {},
-
- Boolean = { fg = palette.gold },
- Character = { fg = palette.gold },
- Comment = { fg = group.comment, style = maybe_italic },
- Conditional = { fg = palette.pine },
- Constant = { fg = palette.gold },
- Debug = { fg = palette.rose },
- Define = { fg = palette.iris },
- Delimiter = { fg = palette.subtle },
- Error = { fg = palette.love },
- Exception = { fg = palette.pine },
- Float = { fg = palette.gold },
- Function = { fg = palette.rose },
- Identifier = { fg = palette.rose },
- -- Ignore = {},
- Include = { fg = palette.iris },
- Keyword = { fg = palette.pine },
- Label = { fg = palette.foam },
- Macro = { fg = palette.iris },
- Number = { fg = palette.gold },
- Operator = { fg = palette.subtle },
- PreCondit = { fg = palette.iris },
- PreProc = { fg = palette.iris },
- Repeat = { fg = palette.pine },
- Special = { fg = palette.rose },
- SpecialChar = { fg = palette.rose },
- SpecialComment = { fg = palette.iris },
- Statement = { fg = palette.pine },
- StorageClass = { fg = palette.foam },
- String = { fg = palette.gold },
- Structure = { fg = palette.foam },
- Tag = { fg = palette.rose },
- Todo = { fg = palette.iris },
- Type = { fg = palette.foam },
- Typedef = { fg = palette.foam },
- Underlined = { fg = palette.foam, style = 'underline' },
-
- htmlArg = { fg = palette.iris },
- htmlBold = { fg = palette.text, style = 'bold' },
- htmlEndTag = { fg = palette.subtle },
- htmlH1 = { fg = group.headings.h1, style = 'bold' },
- htmlH2 = { fg = group.headings.h2, style = 'bold' },
- htmlH3 = { fg = group.headings.h3, style = 'bold' },
- htmlH4 = { fg = group.headings.h4, style = 'bold' },
- htmlH5 = { fg = group.headings.h5, style = 'bold' },
- htmlItalic = { fg = palette.text, style = maybe_italic },
- htmlLink = { fg = group.link },
- htmlTag = { fg = palette.subtle },
- htmlTagN = { fg = palette.text },
- htmlTagName = { fg = palette.foam },
-
- markdownH1 = { fg = group.headings.h1, style = 'bold' },
- markdownH1Delimiter = { fg = group.headings.h1 },
- markdownH2 = { fg = group.headings.h2, style = 'bold' },
- markdownH2Delimiter = { fg = group.headings.h2 },
- markdownH3 = { fg = group.headings.h3, style = 'bold' },
- markdownH3Delimiter = { fg = group.headings.h3 },
- markdownH4 = { fg = group.headings.h4, style = 'bold' },
- markdownH4Delimiter = { fg = group.headings.h4 },
- markdownH5 = { fg = group.headings.h5, style = 'bold' },
- markdownH5Delimiter = { fg = group.headings.h5 },
- markdownH6 = { fg = group.headings.h6, style = 'bold' },
- markdownH6Delimiter = { fg = group.headings.h6 },
- markdownDelimiter = { fg = palette.subtle },
- markdownLinkText = { fg = group.link, style = 'underline' },
- markdownUrl = { fg = palette.iris, style = 'underline' },
- mkdCode = { fg = palette.foam, style = maybe_italic },
- mkdCodeDelimiter = { fg = palette.rose },
- mkdCodeEnd = { fg = palette.foam },
- mkdCodeStart = { fg = palette.foam },
- mkdFootnotes = { fg = palette.foam },
- mkdID = { fg = palette.foam, style = 'underline' },
- mkdInlineURL = { fg = group.link, style = 'underline' },
- mkdLink = { fg = group.link, style = 'underline' },
- mkdLinkDef = { fg = group.link, style = 'underline' },
- mkdListItemLine = { fg = palette.text },
- mkdRule = { fg = palette.subtle },
- mkdURL = { fg = palette.foam, style = 'underline' },
-
- -- Fix background mismatch if user sets custom float background
- -- In LSP hover float: (paramater)
- -- ^ ^
- typescriptParens = { bg = palette.none },
-
- DiagnosticHint = { fg = group.hint },
- DiagnosticInfo = { fg = group.info },
- DiagnosticInformation = { link = 'DiagnosticInfo' },
- DiagnosticWarn = { fg = group.warn },
- DiagnosticWarning = { link = 'DiagnosticWarn' },
- DiagnosticError = { fg = group.error },
- DiagnosticDefaultHint = { fg = group.hint },
- DiagnosticDefaultInfo = { fg = group.info },
- DiagnosticDefaultWarn = { fg = group.warn },
- DiagnosticDefaultError = { fg = group.error },
- DiagnosticFloatingHint = { fg = group.hint },
- DiagnosticFloatingInfo = { fg = group.info },
- DiagnosticFloatingWarn = { fg = group.warn },
- DiagnosticFloatingError = { fg = group.error },
- DiagnosticSignHint = { fg = group.hint },
- DiagnosticSignInfo = { fg = group.info },
- DiagnosticSignWarn = { fg = group.warn },
- DiagnosticSignError = { fg = group.error },
- DiagnosticUnderlineHint = { sp = group.hint, style = 'undercurl' },
- DiagnosticUnderlineInfo = { sp = group.info, style = 'undercurl' },
- DiagnosticUnderlineWarn = { sp = group.warn, style = 'undercurl' },
- DiagnosticUnderlineError = { sp = group.error, style = 'undercurl' },
- DiagnosticVirtualTextHint = { fg = group.hint },
- DiagnosticVirtualTextInfo = { fg = group.info },
- DiagnosticVirtualTextWarn = { fg = group.warn },
- DiagnosticVirtualTextError = { fg = group.error },
-
- LspReferenceText = { fg = palette.rose, bg = palette.highlight_med },
- LspReferenceRead = { fg = palette.rose, bg = palette.highlight_med },
- LspReferenceWrite = { fg = palette.rose, bg = palette.highlight_med },
-
- -- TODO: Deprecate in favour of 0.6.0 groups
- LspDiagnosticsSignWarning = { link = 'DiagnosticSignWarn' },
- LspDiagnosticsDefaultWarning = { link = 'DiagnosticDefaultWarn' },
- LspDiagnosticsFloatingWarning = { link = 'DiagnosticFloatingWarn' },
- LspDiagnosticsVirtualTextWarning = { link = 'DiagnosticVirtualTextWarn' },
- LspDiagnosticsUnderlineWarning = { link = 'DiagnosticUnderlineWarn' },
- LspDiagnosticsSignHint = { link = 'DiagnosticSignHint' },
- LspDiagnosticsDefaultHint = { link = 'DiagnosticDefaultHint' },
- LspDiagnosticsVirtualTextHint = { link = 'DiagnosticFloatingHint' },
- LspDiagnosticsFloatingHint = { link = 'DiagnosticVirtualTextHint' },
- LspDiagnosticsUnderlineHint = { link = 'DiagnosticUnderlineHint' },
- LspDiagnosticsSignError = { link = 'DiagnosticSignError' },
- LspDiagnosticsDefaultError = { link = 'DiagnosticDefaultError' },
- LspDiagnosticsFloatingError = { link = 'DiagnosticFloatingError' },
- LspDiagnosticsVirtualTextError = { link = 'DiagnosticVirtualTextError' },
- LspDiagnosticsUnderlineError = { link = 'DiagnosticUnderlineError' },
- LspDiagnosticsSignInformation = { link = 'DiagnosticSignInfo' },
- LspDiagnosticsDefaultInformation = { link = 'DiagnosticDefaultInfo' },
- LspDiagnosticsFloatingInformation = { link = 'DiagnosticFloatingInfo' },
- LspDiagnosticsVirtualTextInformation = { link = 'DiagnosticVirtualTextInfo' },
- LspDiagnosticsUnderlineInformation = { link = 'DiagnosticUnderlineInfo' },
-
- -- RedrawDebugNormal
- RedrawDebugClear = { fg = '#ffffff', bg = palette.gold },
- RedrawDebugComposed = { fg = '#ffffff', bg = palette.pine },
- RedrawDebugRecompose = { fg = '#ffffff', bg = palette.love },
-
- NvimInternalError = { fg = '#ffffff', bg = palette.love },
-
- -- TSAnnotation = {},
- -- TSAttribute = {},
- TSBoolean = { fg = palette.rose },
- -- TSCharacter = {},
- TSComment = { fg = group.comment, style = maybe_italic },
- -- TSConditional = {},
- TSConstBuiltin = { fg = palette.love },
- -- TSConstMacro = {},
- TSConstant = { fg = palette.foam },
- TSConstructor = { fg = palette.foam },
- -- TSEmphasis = {},
- -- TSError = {},
- -- TSException = {},
- TSField = { fg = palette.foam },
- -- TSFloat = {},
- TSFuncBuiltin = { fg = palette.love },
- -- TSFuncMacro = {},
- TSFunction = { fg = palette.rose },
- TSInclude = { fg = palette.pine },
- TSKeyword = { fg = palette.pine },
- -- TSKeywordFunction = {},
- TSKeywordOperator = { fg = palette.subtle },
- TSLabel = { fg = palette.foam },
- -- TSLiteral = {},
- -- TSMethod = {},
- -- TSNamespace = {},
- -- TSNone = {},
- -- TSNumber = {},
- TSOperator = { fg = palette.subtle },
- TSParameter = { fg = palette.iris, style = maybe_italic },
- -- TSParameterReference = {},
- TSProperty = { fg = palette.iris, style = maybe_italic },
- TSPunctBracket = { fg = group.punctuation },
- TSPunctDelimiter = { fg = group.punctuation },
- TSPunctSpecial = { fg = group.punctuation },
- -- TSRepeat = {},
- -- TSStrike = {},
- TSString = { fg = palette.gold },
- TSStringEscape = { fg = palette.pine },
- -- TSStringRegex = {},
- TSStringSpecial = { link = 'TSString' },
- -- TSSymbol = {},
- TSTag = { fg = palette.foam },
- TSTagDelimiter = { fg = palette.subtle },
- TSText = { fg = palette.text },
- TSTitle = { fg = group.headings.h1, style = 'bold' },
- -- TSType = {},
- -- TSTypeBuiltin = {},
- TSURI = { fg = palette.gold },
- -- TSUnderline = {},
- TSVariable = { fg = palette.text, style = maybe_italic },
- TSVariableBuiltin = { fg = palette.love },
-
- -- romgrk/barbar.nvim
- BufferTabpageFill = { fg = palette.base, bg = palette.base },
- BufferCurrent = { fg = palette.text, bg = palette.overlay },
- BufferCurrentIndex = { fg = palette.text, bg = palette.overlay },
- BufferCurrentMod = { fg = palette.foam, bg = palette.overlay },
- BufferCurrentSign = { fg = palette.subtle, bg = palette.overlay },
- BufferCurrentTarget = { fg = palette.gold, bg = palette.overlay },
- BufferInactive = { fg = palette.subtle },
- BufferInactiveIndex = { fg = palette.subtle },
- BufferInactiveMod = { fg = palette.foam },
- BufferInactiveSign = { fg = palette.muted },
- BufferInactiveTarget = { fg = palette.gold },
- BufferVisible = { fg = palette.subtle },
- BufferVisibleIndex = { fg = palette.subtle },
- BufferVisibleMod = { fg = palette.foam },
- BufferVisibleSign = { fg = palette.muted },
- BufferVisibleTarget = { fg = palette.gold },
-
- -- lewis6991/gitsigns.nvim
- SignAdd = { fg = group.git_add },
- SignChange = { fg = group.git_change },
- SignDelete = { fg = group.git_delete },
- GitSignsAdd = { fg = group.git_add },
- GitSignsChange = { fg = group.git_change },
- GitSignsDelete = { fg = group.git_delete },
-
- -- mvllow/modes.nvim
- ModesCopy = { bg = palette.gold },
- ModesDelete = { bg = palette.love },
- ModesInsert = { bg = palette.foam },
- ModesVisual = { bg = palette.iris },
-
- -- kyazdani42/nvim-tree.lua
- NvimTreeNormal = { fg = palette.text },
- NvimTreeFileDeleted = { fg = palette.love },
- NvimTreeFileDirty = { fg = palette.rose },
- NvimTreeFileMerge = { fg = palette.iris },
- NvimTreeFileNew = { fg = palette.foam },
- NvimTreeFileRenamed = { fg = palette.pine },
- NvimTreeFileStaged = { fg = palette.iris },
- NvimTreeEmptyFolderName = { fg = palette.muted },
- NvimTreeFolderIcon = { fg = palette.subtle },
- NvimTreeFolderName = { fg = palette.foam },
- NvimTreeImageFile = { fg = palette.text },
- NvimTreeOpenedFile = { fg = palette.text, bg = palette.highlight_med },
- NvimTreeOpenedFolderName = { fg = palette.foam },
- NvimTreeRootFolder = { fg = palette.iris },
- NvimTreeSpecialFile = { link = 'NvimTreeNormal' },
- NvimTreeGitDeleted = { fg = group.git_delete },
- NvimTreeGitDirty = { fg = group.git_dirty },
- NvimTreeGitIgnored = { fg = group.git_ignore },
- NvimTreeGitMerge = { fg = group.git_merge },
- NvimTreeGitNew = { fg = group.git_add },
- NvimTreeGitRenamed = { fg = group.git_rename },
- NvimTreeGitStaged = { fg = group.git_stage },
- NvimTreeWindowPicker = { fg = palette.base, bg = palette.iris },
-
- -- folke/which-key.nvim
- WhichKey = { fg = palette.iris },
- WhichKeyGroup = { fg = palette.foam },
- WhichKeySeparator = { fg = palette.subtle },
- WhichKeyDesc = { fg = palette.gold },
- WhichKeyFloat = { bg = palette.surface },
- WhichKeyValue = { fg = palette.rose },
-
- -- luka-reineke/indent-blankline.nvim
- IndentBlanklineChar = { fg = palette.muted },
-
- -- hrsh7th/nvim-cmp
- CmpItemKind = { fg = palette.iris },
- CmpItemAbbr = { fg = palette.subtle },
- CmpItemAbbrMatch = { fg = palette.text, style = 'bold' },
- CmpItemAbbrMatchFuzzy = { fg = palette.text, style = 'bold' },
- CmpItemAbbrDeprecated = { fg = palette.subtle, style = 'strikethrough' },
- CmpItemKindVariable = { fg = palette.foam },
- CmpItemKindClass = { fg = palette.gold },
- CmpItemKindInterface = { fg = palette.gold },
- CmpItemKindFunction = { fg = palette.iris },
- CmpItemKindMethod = { fg = palette.iris },
- CmpItemKindSnippet = { fg = palette.iris },
-
- -- TimUntersberger/neogit
- NeogitDiffAddHighlight = { fg = palette.foam, bg = palette.highlight_med },
- NeogitDiffDeleteHighlight = { fg = palette.love, bg = palette.highlight_med },
- NeogitDiffContextHighlight = { bg = palette.highlight_low },
- NeogitHunkHeader = { bg = palette.highlight_low },
- NeogitHunkHeaderHighlight = { bg = palette.highlight_low },
-
- -- vimwiki/vimwiki
- VimwikiHR = { fg = palette.subtle },
- VimwikiHeader1 = { fg = group.headings.h1, style = 'bold' },
- VimwikiHeader2 = { fg = group.headings.h2, style = 'bold' },
- VimwikiHeader3 = { fg = group.headings.h3, style = 'bold' },
- VimwikiHeader4 = { fg = group.headings.h4, style = 'bold' },
- VimwikiHeader5 = { fg = group.headings.h5, style = 'bold' },
- VimwikiHeader6 = { fg = group.headings.h6, style = 'bold' },
- VimwikiHeaderChar = { fg = palette.pine },
- VimwikiLink = { fg = group.link, style = 'underline' },
- VimwikiList = { fg = palette.iris },
- VimwikiNoExistsLink = { fg = palette.love },
-
- -- nvim-neorg/neorg
- NeorgHeading1Prefix = { fg = group.headings.h1, style = 'bold' },
- NeorgHeading1Title = { fg = group.headings.h1, style = 'bold' },
- NeorgHeading2Prefix = { fg = group.headings.h2, style = 'bold' },
- NeorgHeading2Title = { fg = group.headings.h2, style = 'bold' },
- NeorgHeading3Prefix = { fg = group.headings.h3, style = 'bold' },
- NeorgHeading3Title = { fg = group.headings.h3, style = 'bold' },
- NeorgHeading4Prefix = { fg = group.headings.h4, style = 'bold' },
- NeorgHeading4Title = { fg = group.headings.h4, style = 'bold' },
- NeorgHeading5Prefix = { fg = group.headings.h5, style = 'bold' },
- NeorgHeading5Title = { fg = group.headings.h5, style = 'bold' },
- NeorgHeading6Prefix = { fg = group.headings.h6, style = 'bold' },
- NeorgHeading6Title = { fg = group.headings.h6, style = 'bold' },
- NeorgMarkerTitle = { fg = palette.text, style = 'bold' },
-
- -- tami5/lspsaga.nvim (fork of glepnir/lspsaga.nvim)
- DefinitionCount = { fg = palette.rose },
- DefinitionIcon = { fg = palette.rose },
- DefintionPreviewTitle = { fg = palette.rose, style = 'bold' },
- LspFloatWinBorder = { fg = group.border },
- LspFloatWinNormal = { bg = palette.base },
- LspSagaAutoPreview = { fg = palette.subtle },
- LspSagaCodeActionBorder = { fg = group.border },
- LspSagaCodeActionContent = { fg = palette.foam },
- LspSagaCodeActionTitle = { fg = palette.gold, style = 'bold' },
- LspSagaCodeActionTruncateLine = { link = 'LspSagaCodeActionBorder' },
- LspSagaDefPreviewBorder = { fg = group.border },
- LspSagaDiagnosticBorder = { fg = group.border },
- LspSagaDiagnosticHeader = { fg = palette.gold, style = 'bold' },
- LspSagaDiagnosticTruncateLine = { link = 'LspSagaDiagnosticBorder' },
- LspSagaDocTruncateLine = { link = 'LspSagaHoverBorder' },
- LspSagaFinderSelection = { fg = palette.gold },
- LspSagaHoverBorder = { fg = group.border },
- LspSagaLspFinderBorder = { fg = group.border },
- LspSagaRenameBorder = { fg = palette.pine },
- LspSagaRenamePromptPrefix = { fg = palette.love },
- LspSagaShTruncateLine = { link = 'LspSagaSignatureHelpBorder' },
- LspSagaSignatureHelpBorder = { fg = palette.pine },
- ReferencesCount = { fg = palette.rose },
- ReferencesIcon = { fg = palette.rose },
- SagaShadow = { bg = palette.overlay },
- TargetWord = { fg = palette.iris },
-
- -- ray-x/lsp_signature.nvim
- LspSignatureActiveParameter = { bg = palette.overlay },
-
- -- rlane/pounce.nvim
- PounceAccept = { fg = palette.love, bg = palette.highlight_high },
- PounceAcceptBest = { fg = palette.base, bg = palette.gold },
- PounceGap = { link = 'Search' },
- PounceMatch = { link = 'Search' },
-
- -- nvim-telescope/telescope.nvim
- TelescopeBorder = { fg = group.border },
- TelescopeMatching = { fg = palette.rose },
- TelescopeNormal = { fg = palette.subtle },
- TelescopePromptNormal = { fg = palette.text },
- TelescopePromptPrefix = { fg = palette.subtle },
- TelescopeSelection = { fg = palette.text, bg = palette.highlight_low },
- TelescopeSelectionCaret = { fg = palette.rose, bg = palette.highlight_low },
- TelescopeTitle = { fg = palette.subtle },
-}
-
-vim.g.terminal_color_0 = palette.overlay -- black
-vim.g.terminal_color_8 = palette.subtle -- bright black
-vim.g.terminal_color_1 = palette.love -- red
-vim.g.terminal_color_9 = palette.love -- bright red
-vim.g.terminal_color_2 = palette.pine -- green
-vim.g.terminal_color_10 = palette.pine -- bright green
-vim.g.terminal_color_3 = palette.gold -- yellow
-vim.g.terminal_color_11 = palette.gold -- bright yellow
-vim.g.terminal_color_4 = palette.foam -- blue
-vim.g.terminal_color_12 = palette.foam -- bright blue
-vim.g.terminal_color_5 = palette.iris -- magenta
-vim.g.terminal_color_13 = palette.iris -- bright magenta
-vim.g.terminal_color_6 = palette.rose -- cyan
-vim.g.terminal_color_14 = palette.rose -- bright cyan
-vim.g.terminal_color_7 = palette.text -- white
-vim.g.terminal_color_15 = palette.text -- bright white
-
-return theme
+return M
diff --git a/readme.md b/readme.md
index 064f277..6de7b38 100644
--- a/readme.md
+++ b/readme.md
@@ -11,6 +11,8 @@
+> !!! You are looking at the canary branch. Documentation has not yet been updated on this branch and is NOT accurate.
+
## Usage
```lua
From c7303fda41fb6c96544bcb555de5f6a5155c0597 Mon Sep 17 00:00:00 2001
From: mvllow
Date: Sat, 5 Feb 2022 13:10:01 -0600
Subject: [PATCH 02/18] fix nil groups
---
lua/rose-pine/init.lua | 17 ++++++++---------
lua/rose-pine/theme.lua | 2 +-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua
index 748edce..8525305 100644
--- a/lua/rose-pine/init.lua
+++ b/lua/rose-pine/init.lua
@@ -91,15 +91,14 @@ function M.setup(opts)
},
}
- local groups = opts.groups or {}
- if type(groups.headings) == 'string' then
- groups.headings = {
- h1 = groups.headings,
- h2 = groups.headings,
- h3 = groups.headings,
- h4 = groups.headings,
- h5 = groups.headings,
- h6 = groups.headings,
+ if opts.groups and type(opts.groups.headings) == 'string' then
+ opts.groups.headings = {
+ h1 = opts.groups.headings,
+ h2 = opts.groups.headings,
+ h3 = opts.groups.headings,
+ h4 = opts.groups.headings,
+ h5 = opts.groups.headings,
+ h6 = opts.groups.headings,
}
end
diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua
index 1bd38a4..4a5429c 100644
--- a/lua/rose-pine/theme.lua
+++ b/lua/rose-pine/theme.lua
@@ -5,7 +5,7 @@ local M = {}
function M.get(config)
local theme = {}
- local groups = config.groups
+ local groups = config.groups or {}
local colors = palette[config.variant or 'main']
local styles = {
italic = (config.disable_italics and 'italic') or 'NONE',
From 940ffe52a5a8eafd6c8a729b5f4444f9a2fe5267 Mon Sep 17 00:00:00 2001
From: mvllow
Date: Sat, 5 Feb 2022 13:12:32 -0600
Subject: [PATCH 03/18] fix nil git groups
---
lua/rose-pine/init.lua | 20 +++++++++-----------
lua/rose-pine/theme.lua | 28 ++++++++++++++--------------
2 files changed, 23 insertions(+), 25 deletions(-)
diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua
index 8525305..72c5b70 100644
--- a/lua/rose-pine/init.lua
+++ b/lua/rose-pine/init.lua
@@ -68,17 +68,15 @@ function M.setup(opts)
info = 'foam',
warn = 'gold',
- git = {
- add = 'foam',
- change = 'rose',
- delete = 'love',
- dirty = 'rose',
- ignore = 'muted',
- merge = 'iris',
- rename = 'pine',
- stage = 'iris',
- text = 'rose',
- },
+ git_add = 'foam',
+ git_change = 'rose',
+ git_delete = 'love',
+ git_dirty = 'rose',
+ git_ignore = 'muted',
+ git_merge = 'iris',
+ git_rename = 'pine',
+ git_stage = 'iris',
+ git_text = 'rose',
headings = {
h1 = 'iris',
diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua
index 4a5429c..84a0868 100644
--- a/lua/rose-pine/theme.lua
+++ b/lua/rose-pine/theme.lua
@@ -5,7 +5,7 @@ local M = {}
function M.get(config)
local theme = {}
- local groups = config.groups or {}
+ local groups = config.groups
local colors = palette[config.variant or 'main']
local styles = {
italic = (config.disable_italics and 'italic') or 'NONE',
@@ -25,10 +25,10 @@ function M.get(config)
CursorLineNr = { fg = colors.text },
DarkenedPanel = { bg = colors.surface },
DarkenedStatusline = { bg = colors.surface },
- DiffAdd = { bg = blend(groups.git.add, colors.base, 0.5) },
+ DiffAdd = { bg = blend(groups.git_add, colors.base, 0.5) },
DiffChange = { bg = colors.overlay },
- DiffDelete = { bg = blend(groups.git.delete, colors.base, 0.5) },
- DiffText = { bg = blend(groups.git.text, colors.base, 0.5) },
+ DiffDelete = { bg = blend(groups.git_delete, colors.base, 0.5) },
+ DiffText = { bg = blend(groups.git_text, colors.base, 0.5) },
diffAdded = { link = 'DiffAdd' },
diffChanged = { link = 'DiffChange' },
diffRemoved = { link = 'DiffDelete' },
@@ -255,9 +255,9 @@ function M.get(config)
BufferVisibleTarget = { fg = colors.gold },
-- lewis6991/gitsigns.nvim
- GitSignsAdd = { fg = groups.git.add },
- GitSignsChange = { fg = groups.git.change },
- GitSignsDelete = { fg = groups.git.delete },
+ GitSignsAdd = { fg = groups.git_add },
+ GitSignsChange = { fg = groups.git_change },
+ GitSignsDelete = { fg = groups.git_delete },
SignAdd = { link = 'GitSignsAdd' },
SignChange = { link = 'GitSignsChange' },
SignDelete = { link = 'GitSignsDelete' },
@@ -278,13 +278,13 @@ function M.get(config)
NvimTreeFileStaged = { fg = colors.iris },
NvimTreeFolderIcon = { fg = colors.subtle },
NvimTreeFolderName = { fg = colors.foam },
- NvimTreeGitDeleted = { fg = groups.git.delete },
- NvimTreeGitDirty = { fg = groups.git.dirty },
- NvimTreeGitIgnored = { fg = groups.git.ignore },
- NvimTreeGitMerge = { fg = groups.git.merge },
- NvimTreeGitNew = { fg = groups.git.add },
- NvimTreeGitRenamed = { fg = groups.git.rename },
- NvimTreeGitStaged = { fg = groups.git.stage },
+ NvimTreeGitDeleted = { fg = groups.git_delete },
+ NvimTreeGitDirty = { fg = groups.git_dirty },
+ NvimTreeGitIgnored = { fg = groups.git_ignore },
+ NvimTreeGitMerge = { fg = groups.git_merge },
+ NvimTreeGitNew = { fg = groups.git_add },
+ NvimTreeGitRenamed = { fg = groups.git_rename },
+ NvimTreeGitStaged = { fg = groups.git_stage },
NvimTreeImageFile = { fg = colors.text },
NvimTreeNormal = { fg = colors.text },
NvimTreeOpenedFile = { fg = colors.text, bg = colors.highlight_med },
From 086ba6df576533ee60d652b0c3de617b5af6eff8 Mon Sep 17 00:00:00 2001
From: mvllow
Date: Sat, 5 Feb 2022 13:53:16 -0600
Subject: [PATCH 04/18] wip: rely on vim background for setting theme
---
colors/rose-pine.vim | 2 +
lua/lualine/themes/rose-pine.lua | 39 ++-
lua/rose-pine/init.lua | 19 +-
lua/rose-pine/palette.lua | 12 +-
lua/rose-pine/theme.lua | 452 +++++++++++++++----------------
5 files changed, 260 insertions(+), 264 deletions(-)
diff --git a/colors/rose-pine.vim b/colors/rose-pine.vim
index 6b86afa..0df6221 100644
--- a/colors/rose-pine.vim
+++ b/colors/rose-pine.vim
@@ -1 +1,3 @@
+lua package.loaded['rose-pine.palette'] = nil
+
lua require('rose-pine').colorscheme()
diff --git a/lua/lualine/themes/rose-pine.lua b/lua/lualine/themes/rose-pine.lua
index bb2b604..dde3075 100644
--- a/lua/lualine/themes/rose-pine.lua
+++ b/lua/lualine/themes/rose-pine.lua
@@ -1,35 +1,34 @@
-local palette = require('rose-pine.palette')
-local colors = palette[vim.g.rose_pine_variant or 'main']
+local p = require('rose-pine.palette')
return {
normal = {
- a = { bg = colors.rose, fg = colors.base, gui = 'bold' },
- b = { bg = colors.overlay, fg = colors.rose },
- c = { bg = colors.base, fg = colors.text },
+ a = { bg = p.rose, fg = p.base, gui = 'bold' },
+ b = { bg = p.overlay, fg = p.rose },
+ c = { bg = p.base, fg = p.text },
},
insert = {
- a = { bg = colors.foam, fg = colors.base, gui = 'bold' },
- b = { bg = colors.overlay, fg = colors.foam },
- c = { bg = colors.base, fg = colors.text },
+ a = { bg = p.foam, fg = p.base, gui = 'bold' },
+ b = { bg = p.overlay, fg = p.foam },
+ c = { bg = p.base, fg = p.text },
},
visual = {
- a = { bg = colors.iris, fg = colors.base, gui = 'bold' },
- b = { bg = colors.overlay, fg = colors.iris },
- c = { bg = colors.base, fg = colors.text },
+ a = { bg = p.iris, fg = p.base, gui = 'bold' },
+ b = { bg = p.overlay, fg = p.iris },
+ c = { bg = p.base, fg = p.text },
},
replace = {
- a = { bg = colors.pine, fg = colors.base, gui = 'bold' },
- b = { bg = colors.overlay, fg = colors.pine },
- c = { bg = colors.base, fg = colors.text },
+ a = { bg = p.pine, fg = p.base, gui = 'bold' },
+ b = { bg = p.overlay, fg = p.pine },
+ c = { bg = p.base, fg = p.text },
},
command = {
- a = { bg = colors.love, fg = colors.base, gui = 'bold' },
- b = { bg = colors.overlay, fg = colors.love },
- c = { bg = colors.base, fg = colors.text },
+ a = { bg = p.love, fg = p.base, gui = 'bold' },
+ b = { bg = p.overlay, fg = p.love },
+ c = { bg = p.base, fg = p.text },
},
inactive = {
- a = { bg = colors.base, fg = colors.muted, gui = 'bold' },
- b = { bg = colors.base, fg = colors.muted },
- c = { bg = colors.base, fg = colors.muted },
+ a = { bg = p.base, fg = p.muted, gui = 'bold' },
+ b = { bg = p.base, fg = p.muted },
+ c = { bg = p.base, fg = p.muted },
},
}
diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua
index 72c5b70..d91fd8d 100644
--- a/lua/rose-pine/init.lua
+++ b/lua/rose-pine/init.lua
@@ -1,5 +1,3 @@
-local palette = require('rose-pine.palette')
-
local M = {}
---@class RosePineConfig
@@ -47,6 +45,7 @@ local config = {}
---@param opts RosePineConfig
function M.setup(opts)
+ opts = opts or {}
vim.g.rose_pine_variant = opts.variant or 'main'
local default_config = {
@@ -112,22 +111,12 @@ function M.colorscheme()
vim.opt.termguicolors = true
vim.g.colors_name = 'rose-pine'
- -- match variant to vim background
- if config.user_variant == nil and vim.o.background == 'light' then
- config.variant = 'dawn'
- end
-
- -- match vim background to variant
- if config.user_variant == 'main' or config.user_variant == 'moon' then
- vim.o.background = 'dark'
- elseif config.user_variant == 'dawn' then
- vim.o.background = 'light'
- end
-
---@param color string
local function get_palette_color(color)
+ local p = require('rose-pine.palette')
+
if color and not color:find('#') then
- return palette[config.variant][color:lower()]
+ return p[color:lower()]
end
return color:lower()
diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua
index 13c0bcf..37eada9 100644
--- a/lua/rose-pine/palette.lua
+++ b/lua/rose-pine/palette.lua
@@ -1,6 +1,4 @@
-local palette = {}
-
-palette = {
+local variants = {
main = {
base = '#191724',
surface = '#1f1d2e',
@@ -57,6 +55,14 @@ palette = {
},
}
+local palette = {}
+
+if vim.o.background == 'light' then
+ palette = variants.dawn
+else
+ palette = variants[(vim.g.rose_pine_variant == 'moon' and 'moon') or 'main']
+end
+
vim.tbl_deep_extend('force', palette, { none = 'NONE' })
return palette
diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua
index 84a0868..8ba2ba8 100644
--- a/lua/rose-pine/theme.lua
+++ b/lua/rose-pine/theme.lua
@@ -1,124 +1,124 @@
-local palette = require('rose-pine.palette')
local blend = require('rose-pine.util').blend
local M = {}
function M.get(config)
+ local p = require('rose-pine.palette')
+
local theme = {}
- local groups = config.groups
- local colors = palette[config.variant or 'main']
+ local groups = config.groups or {}
local styles = {
italic = (config.disable_italics and 'italic') or 'NONE',
- vert_split = (config.bold_vert_split and colors.surface) or colors.none,
- background = (config.disable_background and colors.none) or colors.base,
- float_background = (config.disable_float_background and colors.none) or colors.surface,
- inactive_background = (config.dim_nc_background and colors.surface) or colors.base,
+ vert_split = (config.bold_vert_split and p.surface) or p.none,
+ background = (config.disable_background and p.none) or p.base,
+ float_background = (config.disable_float_background and p.none) or p.surface,
+ inactive_background = (config.dim_nc_background and p.surface) or p.base,
}
theme = {
- ColorColumn = { bg = colors.highlight_high },
- Conceal = { bg = colors.none },
+ ColorColumn = { bg = p.highlight_high },
+ Conceal = { bg = p.none },
-- Cursor = {},
- CursorColumn = { bg = colors.overlay },
+ CursorColumn = { bg = p.overlay },
-- CursorIM = {},
- CursorLine = { bg = colors.overlay },
- CursorLineNr = { fg = colors.text },
- DarkenedPanel = { bg = colors.surface },
- DarkenedStatusline = { bg = colors.surface },
- DiffAdd = { bg = blend(groups.git_add, colors.base, 0.5) },
- DiffChange = { bg = colors.overlay },
- DiffDelete = { bg = blend(groups.git_delete, colors.base, 0.5) },
- DiffText = { bg = blend(groups.git_text, colors.base, 0.5) },
+ CursorLine = { bg = p.overlay },
+ CursorLineNr = { fg = p.text },
+ DarkenedPanel = { bg = p.surface },
+ DarkenedStatusline = { bg = p.surface },
+ DiffAdd = { bg = blend(groups.git_add, p.base, 0.5) },
+ DiffChange = { bg = p.overlay },
+ DiffDelete = { bg = blend(groups.git_delete, p.base, 0.5) },
+ DiffText = { bg = blend(groups.git_text, p.base, 0.5) },
diffAdded = { link = 'DiffAdd' },
diffChanged = { link = 'DiffChange' },
diffRemoved = { link = 'DiffDelete' },
- Directory = { fg = colors.foam, bg = colors.none },
+ Directory = { fg = p.foam, bg = p.none },
-- EndOfBuffer = {},
- ErrorMsg = { fg = colors.love, style = 'bold' },
+ ErrorMsg = { fg = p.love, style = 'bold' },
FloatBorder = { fg = groups.border },
- FoldColumn = { fg = colors.muted },
- Folded = { fg = colors.text, bg = colors.surface },
- IncSearch = { fg = colors.base, bg = colors.rose },
- LineNr = { fg = colors.muted },
- MatchParen = { fg = colors.text, bg = colors.highlight_med },
- ModeMsg = { fg = colors.subtle },
- MoreMsg = { fg = colors.iris },
- NonText = { fg = colors.muted },
- Normal = { fg = colors.text, bg = styles.background },
- NormalFloat = { fg = colors.text, bg = styles.float_background },
- NormalNC = { fg = colors.text, bg = styles.inactive_background },
- NvimInternalError = { fg = '#ffffff', bg = colors.love },
- Pmenu = { fg = colors.subtle, bg = styles.float_background },
- PmenuSbar = { bg = colors.highlight_low },
- PmenuSel = { fg = colors.text, bg = colors.overlay },
- PmenuThumb = { bg = colors.highlight_med },
- Question = { fg = colors.gold },
+ FoldColumn = { fg = p.muted },
+ Folded = { fg = p.text, bg = p.surface },
+ IncSearch = { fg = p.base, bg = p.rose },
+ LineNr = { fg = p.muted },
+ MatchParen = { fg = p.text, bg = p.highlight_med },
+ ModeMsg = { fg = p.subtle },
+ MoreMsg = { fg = p.iris },
+ NonText = { fg = p.muted },
+ Normal = { fg = p.text, bg = styles.background },
+ NormalFloat = { fg = p.text, bg = styles.float_background },
+ NormalNC = { fg = p.text, bg = styles.inactive_background },
+ NvimInternalError = { fg = '#ffffff', bg = p.love },
+ Pmenu = { fg = p.subtle, bg = styles.float_background },
+ PmenuSbar = { bg = p.highlight_low },
+ PmenuSel = { fg = p.text, bg = p.overlay },
+ PmenuThumb = { bg = p.highlight_med },
+ Question = { fg = p.gold },
-- QuickFixLine = {},
-- RedrawDebugNormal = {}
- RedrawDebugClear = { fg = '#ffffff', bg = colors.gold },
- RedrawDebugComposed = { fg = '#ffffff', bg = colors.pine },
- RedrawDebugRecompose = { fg = '#ffffff', bg = colors.love },
- Search = { bg = colors.highlight_med },
- SpecialKey = { fg = colors.foam },
- SpellBad = { sp = colors.love, style = 'undercurl' },
- SpellCap = { sp = colors.subtle, style = 'undercurl' },
- SpellLocal = { sp = colors.subtle, style = 'undercurl' },
- SpellRare = { sp = colors.subtle, style = 'undercurl' },
- SignColumn = { fg = colors.text, bg = styles.background },
- StatusLine = { fg = colors.subtle, bg = colors.surface },
- StatusLineNC = { fg = colors.muted, bg = colors.base },
+ RedrawDebugClear = { fg = '#ffffff', bg = p.gold },
+ RedrawDebugComposed = { fg = '#ffffff', bg = p.pine },
+ RedrawDebugRecompose = { fg = '#ffffff', bg = p.love },
+ Search = { bg = p.highlight_med },
+ SpecialKey = { fg = p.foam },
+ SpellBad = { sp = p.love, style = 'undercurl' },
+ SpellCap = { sp = p.subtle, style = 'undercurl' },
+ SpellLocal = { sp = p.subtle, style = 'undercurl' },
+ SpellRare = { sp = p.subtle, style = 'undercurl' },
+ SignColumn = { fg = p.text, bg = styles.background },
+ StatusLine = { fg = p.subtle, bg = p.surface },
+ StatusLineNC = { fg = p.muted, bg = p.base },
StatusLineTerm = { link = 'StatusLine' },
StatusLineTermNC = { link = 'StatusLineNC' },
- TabLine = { fg = colors.subtle, bg = colors.surface },
- TabLineFill = { bg = colors.surface },
- TabLineSel = { fg = colors.text, bg = colors.overlay },
- Title = { fg = colors.text },
- VertSplit = { fg = colors.overlay, bg = styles.vert_split },
- Visual = { bg = colors.highlight_med },
+ TabLine = { fg = p.subtle, bg = p.surface },
+ TabLineFill = { bg = p.surface },
+ TabLineSel = { fg = p.text, bg = p.overlay },
+ Title = { fg = p.text },
+ VertSplit = { fg = p.overlay, bg = styles.vert_split },
+ Visual = { bg = p.highlight_med },
-- VisualNOS = {},
- WarningMsg = { fg = colors.gold },
+ WarningMsg = { fg = p.gold },
-- Whitespace = {},
-- WildMenu = {},
- Boolean = { fg = colors.rose },
- Character = { fg = colors.gold },
+ Boolean = { fg = p.rose },
+ Character = { fg = p.gold },
Comment = { fg = groups.comment, style = styles.italic },
- Conditional = { fg = colors.pine },
- Constant = { fg = colors.gold },
- Debug = { fg = colors.rose },
- Define = { fg = colors.iris },
- Delimiter = { fg = colors.subtle },
- Error = { fg = colors.love },
- Exception = { fg = colors.pine },
- Float = { fg = colors.gold },
- Function = { fg = colors.rose },
- Identifier = { fg = colors.rose },
+ Conditional = { fg = p.pine },
+ Constant = { fg = p.gold },
+ Debug = { fg = p.rose },
+ Define = { fg = p.iris },
+ Delimiter = { fg = p.subtle },
+ Error = { fg = p.love },
+ Exception = { fg = p.pine },
+ Float = { fg = p.gold },
+ Function = { fg = p.rose },
+ Identifier = { fg = p.rose },
-- Ignore = {},
- Include = { fg = colors.iris },
- Keyword = { fg = colors.pine },
- Label = { fg = colors.foam },
- Macro = { fg = colors.iris },
- Number = { fg = colors.gold },
- Operator = { fg = colors.subtle },
- PreCondit = { fg = colors.iris },
- PreProc = { fg = colors.iris },
- Repeat = { fg = colors.pine },
- Special = { fg = colors.rose },
- SpecialChar = { fg = colors.rose },
- SpecialComment = { fg = colors.iris },
- Statement = { fg = colors.pine },
- StorageClass = { fg = colors.foam },
- String = { fg = colors.gold },
- Structure = { fg = colors.foam },
- Tag = { fg = colors.rose },
- Todo = { fg = colors.iris },
- Type = { fg = colors.foam },
- Typedef = { fg = colors.foam },
+ Include = { fg = p.iris },
+ Keyword = { fg = p.pine },
+ Label = { fg = p.foam },
+ Macro = { fg = p.iris },
+ Number = { fg = p.gold },
+ Operator = { fg = p.subtle },
+ PreCondit = { fg = p.iris },
+ PreProc = { fg = p.iris },
+ Repeat = { fg = p.pine },
+ Special = { fg = p.rose },
+ SpecialChar = { fg = p.rose },
+ SpecialComment = { fg = p.iris },
+ Statement = { fg = p.pine },
+ StorageClass = { fg = p.foam },
+ String = { fg = p.gold },
+ Structure = { fg = p.foam },
+ Tag = { fg = p.rose },
+ Todo = { fg = p.iris },
+ Type = { fg = p.foam },
+ Typedef = { fg = p.foam },
Underlined = { style = 'underline' },
- htmlArg = { fg = colors.iris },
+ htmlArg = { fg = p.iris },
htmlBold = { style = 'bold' },
- htmlEndTag = { fg = colors.subtle },
+ htmlEndTag = { fg = p.subtle },
htmlH1 = { fg = groups.headings.h1, style = 'bold' },
htmlH2 = { fg = groups.headings.h2, style = 'bold' },
htmlH3 = { fg = groups.headings.h3, style = 'bold' },
@@ -126,11 +126,11 @@ function M.get(config)
htmlH5 = { fg = groups.headings.h5, style = 'bold' },
htmlItalic = { style = styles.italic },
htmlLink = { fg = groups.link },
- htmlTag = { fg = colors.subtle },
- htmlTagN = { fg = colors.text },
- htmlTagName = { fg = colors.foam },
+ htmlTag = { fg = p.subtle },
+ htmlTagN = { fg = p.text },
+ htmlTagName = { fg = p.foam },
- markdownDelimiter = { fg = colors.subtle },
+ markdownDelimiter = { fg = p.subtle },
markdownH1 = { fg = groups.headings.h1, style = 'bold' },
markdownH1Delimiter = { link = 'markdownH1' },
markdownH2 = { fg = groups.headings.h2, style = 'bold' },
@@ -146,17 +146,17 @@ function M.get(config)
markdownLinkText = { fg = groups.link, style = 'underline' },
markdownUrl = { link = 'markdownLinkText' },
- mkdCode = { fg = colors.foam, style = styles.italic },
- mkdCodeDelimiter = { fg = colors.rose },
- mkdCodeEnd = { fg = colors.foam },
- mkdCodeStart = { fg = colors.foam },
- mkdFootnotes = { fg = colors.foam },
- mkdID = { fg = colors.foam, style = 'underline' },
+ mkdCode = { fg = p.foam, style = styles.italic },
+ mkdCodeDelimiter = { fg = p.rose },
+ mkdCodeEnd = { fg = p.foam },
+ mkdCodeStart = { fg = p.foam },
+ mkdFootnotes = { fg = p.foam },
+ mkdID = { fg = p.foam, style = 'underline' },
mkdInlineURL = { fg = groups.link, style = 'underline' },
mkdLink = { link = 'mkdInlineURL' },
mkdLinkDef = { link = 'mkdInlineURL' },
- mkdListItemLine = { fg = colors.text },
- mkdRule = { fg = colors.subtle },
+ mkdListItemLine = { fg = p.text },
+ mkdRule = { fg = p.subtle },
mkdURL = { link = 'mkdInlineURL' },
DiagnosticError = { fg = groups.error },
@@ -189,70 +189,70 @@ function M.get(config)
TSCharacter = { link = 'Character' },
TSComment = { link = 'Comment' },
TSConditional = { link = 'Conditional' },
- TSConstBuiltin = { fg = colors.love },
+ TSConstBuiltin = { fg = p.love },
-- TSConstMacro = {},
- TSConstant = { fg = colors.foam },
- TSConstructor = { fg = colors.foam },
+ TSConstant = { fg = p.foam },
+ TSConstructor = { fg = p.foam },
-- TSEmphasis = {},
-- TSError = {},
-- TSException = {},
- TSField = { fg = colors.foam },
+ TSField = { fg = p.foam },
-- TSFloat = {},
- TSFuncBuiltin = { fg = colors.love },
+ TSFuncBuiltin = { fg = p.love },
-- TSFuncMacro = {},
- TSFunction = { fg = colors.rose },
- TSInclude = { fg = colors.pine },
- TSKeyword = { fg = colors.pine },
+ TSFunction = { fg = p.rose },
+ TSInclude = { fg = p.pine },
+ TSKeyword = { fg = p.pine },
-- TSKeywordFunction = {},
- TSKeywordOperator = { fg = colors.subtle },
- TSLabel = { fg = colors.foam },
+ TSKeywordOperator = { fg = p.subtle },
+ TSLabel = { fg = p.foam },
-- TSLiteral = {},
-- TSMethod = {},
-- TSNamespace = {},
-- TSNone = {},
TSNumber = { link = 'Number' },
- TSOperator = { fg = colors.subtle },
- TSParameter = { fg = colors.iris, style = styles.italic },
+ TSOperator = { fg = p.subtle },
+ TSParameter = { fg = p.iris, style = styles.italic },
-- TSParameterReference = {},
- TSProperty = { fg = colors.iris, style = styles.italic },
+ TSProperty = { fg = p.iris, style = styles.italic },
TSPunctBracket = { fg = groups.punctuation },
TSPunctDelimiter = { fg = groups.punctuation },
TSPunctSpecial = { fg = groups.punctuation },
-- TSRepeat = {},
-- TSStrike = {},
TSString = { link = 'String' },
- TSStringEscape = { fg = colors.pine },
+ TSStringEscape = { fg = p.pine },
-- TSStringRegex = {},
TSStringSpecial = { link = 'TSString' },
-- TSSymbol = {},
- TSTag = { fg = colors.foam },
- TSTagDelimiter = { fg = colors.subtle },
- TSText = { fg = colors.text },
+ TSTag = { fg = p.foam },
+ TSTagDelimiter = { fg = p.subtle },
+ TSText = { fg = p.text },
TSTitle = { fg = groups.headings.h1, style = 'bold' },
TSType = { link = 'Type' },
-- TSTypeBuiltin = {},
TSURI = { fg = groups.link },
-- TSUnderline = {},
- TSVariable = { fg = colors.text, style = styles.italic },
- TSVariableBuiltin = { fg = colors.love },
+ TSVariable = { fg = p.text, style = styles.italic },
+ TSVariableBuiltin = { fg = p.love },
-- romgrk/barbar.nvim
- BufferCurrent = { fg = colors.text, bg = colors.overlay },
- BufferCurrentIndex = { fg = colors.text, bg = colors.overlay },
- BufferCurrentMod = { fg = colors.foam, bg = colors.overlay },
- BufferCurrentSign = { fg = colors.subtle, bg = colors.overlay },
- BufferCurrentTarget = { fg = colors.gold, bg = colors.overlay },
- BufferInactive = { fg = colors.subtle },
- BufferInactiveIndex = { fg = colors.subtle },
- BufferInactiveMod = { fg = colors.foam },
- BufferInactiveSign = { fg = colors.muted },
- BufferInactiveTarget = { fg = colors.gold },
- BufferTabpageFill = { fg = colors.base, bg = colors.base },
- BufferVisible = { fg = colors.subtle },
- BufferVisibleIndex = { fg = colors.subtle },
- BufferVisibleMod = { fg = colors.foam },
- BufferVisibleSign = { fg = colors.muted },
- BufferVisibleTarget = { fg = colors.gold },
+ BufferCurrent = { fg = p.text, bg = p.overlay },
+ BufferCurrentIndex = { fg = p.text, bg = p.overlay },
+ BufferCurrentMod = { fg = p.foam, bg = p.overlay },
+ BufferCurrentSign = { fg = p.subtle, bg = p.overlay },
+ BufferCurrentTarget = { fg = p.gold, bg = p.overlay },
+ BufferInactive = { fg = p.subtle },
+ BufferInactiveIndex = { fg = p.subtle },
+ BufferInactiveMod = { fg = p.foam },
+ BufferInactiveSign = { fg = p.muted },
+ BufferInactiveTarget = { fg = p.gold },
+ BufferTabpageFill = { fg = p.base, bg = p.base },
+ BufferVisible = { fg = p.subtle },
+ BufferVisibleIndex = { fg = p.subtle },
+ BufferVisibleMod = { fg = p.foam },
+ BufferVisibleSign = { fg = p.muted },
+ BufferVisibleTarget = { fg = p.gold },
-- lewis6991/gitsigns.nvim
GitSignsAdd = { fg = groups.git_add },
@@ -263,21 +263,21 @@ function M.get(config)
SignDelete = { link = 'GitSignsDelete' },
-- mvllow/modes.nvim
- ModesCopy = { bg = colors.gold },
- ModesDelete = { bg = colors.love },
- ModesInsert = { bg = colors.foam },
- ModesVisual = { bg = colors.iris },
+ ModesCopy = { bg = p.gold },
+ ModesDelete = { bg = p.love },
+ ModesInsert = { bg = p.foam },
+ ModesVisual = { bg = p.iris },
-- kyazdani42/nvim-tree.lua
- NvimTreeEmptyFolderName = { fg = colors.muted },
- NvimTreeFileDeleted = { fg = colors.love },
- NvimTreeFileDirty = { fg = colors.rose },
- NvimTreeFileMerge = { fg = colors.iris },
- NvimTreeFileNew = { fg = colors.foam },
- NvimTreeFileRenamed = { fg = colors.pine },
- NvimTreeFileStaged = { fg = colors.iris },
- NvimTreeFolderIcon = { fg = colors.subtle },
- NvimTreeFolderName = { fg = colors.foam },
+ NvimTreeEmptyFolderName = { fg = p.muted },
+ NvimTreeFileDeleted = { fg = p.love },
+ NvimTreeFileDirty = { fg = p.rose },
+ NvimTreeFileMerge = { fg = p.iris },
+ NvimTreeFileNew = { fg = p.foam },
+ NvimTreeFileRenamed = { fg = p.pine },
+ NvimTreeFileStaged = { fg = p.iris },
+ NvimTreeFolderIcon = { fg = p.subtle },
+ NvimTreeFolderName = { fg = p.foam },
NvimTreeGitDeleted = { fg = groups.git_delete },
NvimTreeGitDirty = { fg = groups.git_dirty },
NvimTreeGitIgnored = { fg = groups.git_ignore },
@@ -285,57 +285,57 @@ function M.get(config)
NvimTreeGitNew = { fg = groups.git_add },
NvimTreeGitRenamed = { fg = groups.git_rename },
NvimTreeGitStaged = { fg = groups.git_stage },
- NvimTreeImageFile = { fg = colors.text },
- NvimTreeNormal = { fg = colors.text },
- NvimTreeOpenedFile = { fg = colors.text, bg = colors.highlight_med },
- NvimTreeOpenedFolderName = { fg = colors.foam },
- NvimTreeRootFolder = { fg = colors.iris },
+ NvimTreeImageFile = { fg = p.text },
+ NvimTreeNormal = { fg = p.text },
+ NvimTreeOpenedFile = { fg = p.text, bg = p.highlight_med },
+ NvimTreeOpenedFolderName = { fg = p.foam },
+ NvimTreeRootFolder = { fg = p.iris },
NvimTreeSpecialFile = { link = 'NvimTreeNormal' },
- NvimTreeWindowPicker = { fg = colors.base, bg = colors.iris },
+ NvimTreeWindowPicker = { fg = p.base, bg = p.iris },
-- folke/which-key.nvim
- WhichKey = { fg = colors.iris },
- WhichKeyGroup = { fg = colors.foam },
- WhichKeySeparator = { fg = colors.subtle },
- WhichKeyDesc = { fg = colors.gold },
- WhichKeyFloat = { bg = colors.surface },
- WhichKeyValue = { fg = colors.rose },
+ WhichKey = { fg = p.iris },
+ WhichKeyGroup = { fg = p.foam },
+ WhichKeySeparator = { fg = p.subtle },
+ WhichKeyDesc = { fg = p.gold },
+ WhichKeyFloat = { bg = p.surface },
+ WhichKeyValue = { fg = p.rose },
-- luka-reineke/indent-blankline.nvim
- IndentBlanklineChar = { fg = colors.muted },
+ IndentBlanklineChar = { fg = p.muted },
-- hrsh7th/nvim-cmp
- CmpItemAbbr = { fg = colors.subtle },
- CmpItemAbbrDeprecated = { fg = colors.subtle, style = 'strikethrough' },
- CmpItemAbbrMatch = { fg = colors.text, style = 'bold' },
- CmpItemAbbrMatchFuzzy = { fg = colors.text, style = 'bold' },
- CmpItemKind = { fg = colors.iris },
- CmpItemKindClass = { fg = colors.gold },
- CmpItemKindFunction = { fg = colors.iris },
- CmpItemKindInterface = { fg = colors.gold },
- CmpItemKindMethod = { fg = colors.iris },
- CmpItemKindSnippet = { fg = colors.iris },
- CmpItemKindVariable = { fg = colors.foam },
+ CmpItemAbbr = { fg = p.subtle },
+ CmpItemAbbrDeprecated = { fg = p.subtle, style = 'strikethrough' },
+ CmpItemAbbrMatch = { fg = p.text, style = 'bold' },
+ CmpItemAbbrMatchFuzzy = { fg = p.text, style = 'bold' },
+ CmpItemKind = { fg = p.iris },
+ CmpItemKindClass = { fg = p.gold },
+ CmpItemKindFunction = { fg = p.iris },
+ CmpItemKindInterface = { fg = p.gold },
+ CmpItemKindMethod = { fg = p.iris },
+ CmpItemKindSnippet = { fg = p.iris },
+ CmpItemKindVariable = { fg = p.foam },
-- TimUntersberger/neogit
- NeogitDiffAddHighlight = { fg = colors.foam, bg = colors.highlight_med },
- NeogitDiffContextHighlight = { bg = colors.highlight_low },
- NeogitDiffDeleteHighlight = { fg = colors.love, bg = colors.highlight_med },
- NeogitHunkHeader = { bg = colors.highlight_low },
- NeogitHunkHeaderHighlight = { bg = colors.highlight_low },
+ NeogitDiffAddHighlight = { fg = p.foam, bg = p.highlight_med },
+ NeogitDiffContextHighlight = { bg = p.highlight_low },
+ NeogitDiffDeleteHighlight = { fg = p.love, bg = p.highlight_med },
+ NeogitHunkHeader = { bg = p.highlight_low },
+ NeogitHunkHeaderHighlight = { bg = p.highlight_low },
-- vimwiki/vimwiki
- VimwikiHR = { fg = colors.subtle },
+ VimwikiHR = { fg = p.subtle },
VimwikiHeader1 = { fg = groups.headings.h1, style = 'bold' },
VimwikiHeader2 = { fg = groups.headings.h2, style = 'bold' },
VimwikiHeader3 = { fg = groups.headings.h3, style = 'bold' },
VimwikiHeader4 = { fg = groups.headings.h4, style = 'bold' },
VimwikiHeader5 = { fg = groups.headings.h5, style = 'bold' },
VimwikiHeader6 = { fg = groups.headings.h6, style = 'bold' },
- VimwikiHeaderChar = { fg = colors.pine },
+ VimwikiHeaderChar = { fg = p.pine },
VimwikiLink = { fg = groups.link, style = 'underline' },
- VimwikiList = { fg = colors.iris },
- VimwikiNoExistsLink = { fg = colors.love },
+ VimwikiList = { fg = p.iris },
+ VimwikiNoExistsLink = { fg = p.love },
-- nvim-neorg/neorg
NeorgHeading1Prefix = { fg = groups.headings.h1, style = 'bold' },
@@ -350,72 +350,72 @@ function M.get(config)
NeorgHeading5Title = { link = 'NeorgHeading5Prefix' },
NeorgHeading6Prefix = { fg = groups.headings.h6, style = 'bold' },
NeorgHeading6Title = { link = 'NeorgHeading6Prefix' },
- NeorgMarkerTitle = { fg = colors.text, style = 'bold' },
+ NeorgMarkerTitle = { fg = p.text, style = 'bold' },
-- tami5/lspsaga.nvim (fork of glepnir/lspsaga.nvim)
- DefinitionCount = { fg = colors.rose },
- DefinitionIcon = { fg = colors.rose },
- DefintionPreviewTitle = { fg = colors.rose, style = 'bold' },
+ DefinitionCount = { fg = p.rose },
+ DefinitionIcon = { fg = p.rose },
+ DefintionPreviewTitle = { fg = p.rose, style = 'bold' },
LspFloatWinBorder = { fg = groups.border },
- LspFloatWinNormal = { bg = colors.base },
- LspSagaAutoPreview = { fg = colors.subtle },
+ LspFloatWinNormal = { bg = p.base },
+ LspSagaAutoPreview = { fg = p.subtle },
LspSagaCodeActionBorder = { fg = groups.border },
- LspSagaCodeActionContent = { fg = colors.foam },
- LspSagaCodeActionTitle = { fg = colors.gold, style = 'bold' },
+ LspSagaCodeActionContent = { fg = p.foam },
+ LspSagaCodeActionTitle = { fg = p.gold, style = 'bold' },
LspSagaCodeActionTruncateLine = { link = 'LspSagaCodeActionBorder' },
LspSagaDefPreviewBorder = { fg = groups.border },
LspSagaDiagnosticBorder = { fg = groups.border },
- LspSagaDiagnosticHeader = { fg = colors.gold, style = 'bold' },
+ LspSagaDiagnosticHeader = { fg = p.gold, style = 'bold' },
LspSagaDiagnosticTruncateLine = { link = 'LspSagaDiagnosticBorder' },
LspSagaDocTruncateLine = { link = 'LspSagaHoverBorder' },
- LspSagaFinderSelection = { fg = colors.gold },
+ LspSagaFinderSelection = { fg = p.gold },
LspSagaHoverBorder = { fg = groups.border },
LspSagaLspFinderBorder = { fg = groups.border },
- LspSagaRenameBorder = { fg = colors.pine },
- LspSagaRenamePromptPrefix = { fg = colors.love },
+ LspSagaRenameBorder = { fg = p.pine },
+ LspSagaRenamePromptPrefix = { fg = p.love },
LspSagaShTruncateLine = { link = 'LspSagaSignatureHelpBorder' },
- LspSagaSignatureHelpBorder = { fg = colors.pine },
- ReferencesCount = { fg = colors.rose },
- ReferencesIcon = { fg = colors.rose },
- SagaShadow = { bg = colors.overlay },
- TargetWord = { fg = colors.iris },
+ LspSagaSignatureHelpBorder = { fg = p.pine },
+ ReferencesCount = { fg = p.rose },
+ ReferencesIcon = { fg = p.rose },
+ SagaShadow = { bg = p.overlay },
+ TargetWord = { fg = p.iris },
-- ray-x/lsp_signature.nvim
- LspSignatureActiveParameter = { bg = colors.overlay },
+ LspSignatureActiveParameter = { bg = p.overlay },
-- rlane/pounce.nvim
- PounceAccept = { fg = colors.love, bg = colors.highlight_high },
- PounceAcceptBest = { fg = colors.base, bg = colors.gold },
+ PounceAccept = { fg = p.love, bg = p.highlight_high },
+ PounceAcceptBest = { fg = p.base, bg = p.gold },
PounceGap = { link = 'Search' },
PounceMatch = { link = 'Search' },
-- nvim-telescope/telescope.nvim
TelescopeBorder = { fg = groups.border },
- TelescopeMatching = { fg = colors.rose },
- TelescopeNormal = { fg = colors.subtle },
- TelescopePromptNormal = { fg = colors.text },
- TelescopePromptPrefix = { fg = colors.subtle },
- TelescopeSelection = { fg = colors.text, bg = colors.overlay },
- TelescopeSelectionCaret = { fg = colors.rose, bg = colors.overlay },
- TelescopeTitle = { fg = colors.subtle },
+ TelescopeMatching = { fg = p.rose },
+ TelescopeNormal = { fg = p.subtle },
+ TelescopePromptNormal = { fg = p.text },
+ TelescopePromptPrefix = { fg = p.subtle },
+ TelescopeSelection = { fg = p.text, bg = p.overlay },
+ TelescopeSelectionCaret = { fg = p.rose, bg = p.overlay },
+ TelescopeTitle = { fg = p.subtle },
}
- vim.g.terminal_color_0 = colors.overlay -- black
- vim.g.terminal_color_8 = colors.subtle -- bright black
- vim.g.terminal_color_1 = colors.love -- red
- vim.g.terminal_color_9 = colors.love -- bright red
- vim.g.terminal_color_2 = colors.pine -- green
- vim.g.terminal_color_10 = colors.pine -- bright green
- vim.g.terminal_color_3 = colors.gold -- yellow
- vim.g.terminal_color_11 = colors.gold -- bright yellow
- vim.g.terminal_color_4 = colors.foam -- blue
- vim.g.terminal_color_12 = colors.foam -- bright blue
- vim.g.terminal_color_5 = colors.iris -- magenta
- vim.g.terminal_color_13 = colors.iris -- bright magenta
- vim.g.terminal_color_6 = colors.rose -- cyan
- vim.g.terminal_color_14 = colors.rose -- bright cyan
- vim.g.terminal_color_7 = colors.text -- white
- vim.g.terminal_color_15 = colors.text -- bright white
+ vim.g.terminal_color_0 = p.overlay -- black
+ vim.g.terminal_color_8 = p.subtle -- bright black
+ vim.g.terminal_color_1 = p.love -- red
+ vim.g.terminal_color_9 = p.love -- bright red
+ vim.g.terminal_color_2 = p.pine -- green
+ vim.g.terminal_color_10 = p.pine -- bright green
+ vim.g.terminal_color_3 = p.gold -- yellow
+ vim.g.terminal_color_11 = p.gold -- bright yellow
+ vim.g.terminal_color_4 = p.foam -- blue
+ vim.g.terminal_color_12 = p.foam -- bright blue
+ vim.g.terminal_color_5 = p.iris -- magenta
+ vim.g.terminal_color_13 = p.iris -- bright magenta
+ vim.g.terminal_color_6 = p.rose -- cyan
+ vim.g.terminal_color_14 = p.rose -- bright cyan
+ vim.g.terminal_color_7 = p.text -- white
+ vim.g.terminal_color_15 = p.text -- bright white
return theme
end
From a571e5aa2dfe340dde333370ebd17271c2b37519 Mon Sep 17 00:00:00 2001
From: fvrests
Date: Sat, 5 Feb 2022 14:38:15 -0600
Subject: [PATCH 05/18] add inverse theme
---
lua/lualine/themes/rose-pine-inverse.lua | 26 ++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 lua/lualine/themes/rose-pine-inverse.lua
diff --git a/lua/lualine/themes/rose-pine-inverse.lua b/lua/lualine/themes/rose-pine-inverse.lua
new file mode 100644
index 0000000..1e1ee36
--- /dev/null
+++ b/lua/lualine/themes/rose-pine-inverse.lua
@@ -0,0 +1,26 @@
+local p = require('rose-pine.palette')
+
+return {
+ normal = {
+ a = { bg = p.surface, fg = p.rose, gui = 'bold' },
+ b = { bg = p.surface, fg = p.text },
+ c = { bg = p.surface, fg = p.subtle, gui = 'italic' },
+ },
+ insert = {
+ a = { bg = p.surface, fg = p.foam, gui = 'bold' },
+ },
+ visual = {
+ a = { bg = p.surface, fg = p.iris, gui = 'bold' },
+ },
+ replace = {
+ a = { bg = p.surface, fg = p.pine, gui = 'bold' },
+ },
+ command = {
+ a = { bg = p.surface, fg = p.love, gui = 'bold' },
+ },
+ inactive = {
+ a = { bg = p.base, fg = p.subtle, gui = 'bold' },
+ b = { bg = p.base, fg = p.subtle },
+ c = { bg = p.base, fg = p.subtle, gui = 'italic' },
+ },
+}
From 41ed6a9a092ff373ef62da60c4c1a9aee98f900f Mon Sep 17 00:00:00 2001
From: fvrests
Date: Sat, 5 Feb 2022 17:46:43 -0600
Subject: [PATCH 06/18] update dawn overlay
---
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 37eada9..ccb8b1c 100644
--- a/lua/rose-pine/palette.lua
+++ b/lua/rose-pine/palette.lua
@@ -38,7 +38,7 @@ local variants = {
dawn = {
base = '#faf4ed',
surface = '#fffaf3',
- overlay = '#f2e9de',
+ overlay = '#f2e9e1',
muted = '#9893a5',
subtle = '#797593',
text = '#575279',
From 4d793edbdb56fc8d3c5bf3bfb57974bfb896975b Mon Sep 17 00:00:00 2001
From: mvllow
Date: Sun, 6 Feb 2022 16:25:45 -0600
Subject: [PATCH 07/18] remove bufferline
---
lua/rose-pine/bufferline/init.lua | 24 ------------------------
1 file changed, 24 deletions(-)
delete mode 100644 lua/rose-pine/bufferline/init.lua
diff --git a/lua/rose-pine/bufferline/init.lua b/lua/rose-pine/bufferline/init.lua
deleted file mode 100644
index 4eb8a9a..0000000
--- a/lua/rose-pine/bufferline/init.lua
+++ /dev/null
@@ -1,24 +0,0 @@
-local palette = require('rose-pine.palette')
-local colors = palette[vim.g.rose_pine_variant or 'main']
-
--- TODO: Someone who uses bufferline.nvim is free to PR with this addition
--- `:h bufferline-highlights`
---
--- The intended use would be (or any better solution):
---
--- ```
--- local highlights = require('rose-pine.bufferline')
--- require('bufferline').setup({
--- highlights = highlights
--- })
--- ```
-return {
- fill = {
- guifg = colors.text,
- guibg = colors.base,
- },
- background = {
- guifg = colors.text,
- guibg = colors.base,
- },
-}
From 69ff4aa901f47cf49391d19c9130ae9f611b74d1 Mon Sep 17 00:00:00 2001
From: mvllow
Date: Sun, 6 Feb 2022 21:17:16 -0600
Subject: [PATCH 08/18] rename alt lualine theme
---
lua/lualine/themes/{rose-pine-inverse.lua => rose-pine-alt.lua} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename lua/lualine/themes/{rose-pine-inverse.lua => rose-pine-alt.lua} (100%)
diff --git a/lua/lualine/themes/rose-pine-inverse.lua b/lua/lualine/themes/rose-pine-alt.lua
similarity index 100%
rename from lua/lualine/themes/rose-pine-inverse.lua
rename to lua/lualine/themes/rose-pine-alt.lua
From 53814928559a7697e3adb8418cdba050a5918584 Mon Sep 17 00:00:00 2001
From: mvllow
Date: Sun, 6 Feb 2022 21:17:35 -0600
Subject: [PATCH 09/18] use default config outside of setup function
ref #63
---
lua/rose-pine/init.lua | 82 +++++++++++++++++++++---------------------
1 file changed, 40 insertions(+), 42 deletions(-)
diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua
index d91fd8d..bd9e855 100644
--- a/lua/rose-pine/init.lua
+++ b/lua/rose-pine/init.lua
@@ -41,53 +41,51 @@ local M = {}
---@field h6 string
---@type RosePineConfig
-local config = {}
+local config = {
+ variant = 'main',
+ bold_vert_split = false,
+ dim_nc_background = false,
+ disable_background = false,
+ disable_float_background = false,
+ disable_italics = false,
+
+ groups = {
+ border = 'highlight_med',
+ comment = 'muted',
+ link = 'iris',
+ punctuation = 'subtle',
+
+ error = 'love',
+ hint = 'iris',
+ info = 'foam',
+ warn = 'gold',
+
+ git_add = 'foam',
+ git_change = 'rose',
+ git_delete = 'love',
+ git_dirty = 'rose',
+ git_ignore = 'muted',
+ git_merge = 'iris',
+ git_rename = 'pine',
+ git_stage = 'iris',
+ git_text = 'rose',
+
+ headings = {
+ h1 = 'iris',
+ h2 = 'foam',
+ h3 = 'rose',
+ h4 = 'gold',
+ h5 = 'pine',
+ h6 = 'foam',
+ },
+ },
+}
---@param opts RosePineConfig
function M.setup(opts)
opts = opts or {}
vim.g.rose_pine_variant = opts.variant or 'main'
- local default_config = {
- variant = 'main',
- bold_vert_split = false,
- dim_nc_background = false,
- disable_background = false,
- disable_float_background = false,
- disable_italics = false,
-
- groups = {
- border = 'highlight_med',
- comment = 'muted',
- link = 'iris',
- punctuation = 'subtle',
-
- error = 'love',
- hint = 'iris',
- info = 'foam',
- warn = 'gold',
-
- git_add = 'foam',
- git_change = 'rose',
- git_delete = 'love',
- git_dirty = 'rose',
- git_ignore = 'muted',
- git_merge = 'iris',
- git_rename = 'pine',
- git_stage = 'iris',
- git_text = 'rose',
-
- headings = {
- h1 = 'iris',
- h2 = 'foam',
- h3 = 'rose',
- h4 = 'gold',
- h5 = 'pine',
- h6 = 'foam',
- },
- },
- }
-
if opts.groups and type(opts.groups.headings) == 'string' then
opts.groups.headings = {
h1 = opts.groups.headings,
@@ -100,7 +98,7 @@ function M.setup(opts)
end
config.user_variant = opts.variant or nil
- config = vim.tbl_deep_extend('force', default_config, opts)
+ config = vim.tbl_deep_extend('force', config, opts)
end
function M.colorscheme()
From 5c7ef3e4c3513219ac856080125b20af372f7699 Mon Sep 17 00:00:00 2001
From: mvllow
Date: Sun, 6 Feb 2022 16:49:36 -0600
Subject: [PATCH 10/18] docs: add alt lualine theme
---
readme.md | 44 +++++++++++++++++++++++++++-----------------
1 file changed, 27 insertions(+), 17 deletions(-)
diff --git a/readme.md b/readme.md
index 6de7b38..709d40d 100644
--- a/readme.md
+++ b/readme.md
@@ -30,28 +30,38 @@ use({
> PR's are more than welcome if your favourite plugin is missing
-- [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
-- [Diagnostics](https://neovim.io/doc/user/lsp.html)
-- [Barbar](https://github.com/romgrk/barbar.nvim)
-- [Gitsigns](https://github.com/lewis6991/gitsigns.nvim)
-- [Modes](https://github.com/mvllow/modes.nvim)
-- [NvimTree](https://github.com/kyazdani42/nvim-tree.lua)
-- [WhichKey](https://github.com/folke/which-key.nvim)
-- [Indent-Blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim)
-- [Neogit](https://github.com/TimUntersberger/neogit)
-- [Neorg](https://github.com/nvim-neorg/neorg)
-- [Lspsaga](https://github.com/tami5/lspsaga.nvim)
-- [Pounce](https://github.com/rlane/pounce.nvim)
-- [Telescope](https://github.com/nvim-telescope/telescope.nvim)
-- [Lualine](https://github.com/hoob3rt/lualine.nvim)
+- [neovim diagnostics](https://neovim.io/doc/user/lsp.html)
+- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
+- [barbar.nvim](https://github.com/romgrk/barbar.nvim)
+- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
+- [mode.nvim](https://github.com/mvllow/modes.nvim)
+- [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua)
+- [which-key.nvim](https://github.com/folke/which-key.nvim)
+- [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim)
+- [neogit](https://github.com/TimUntersberger/neogit)
+- [neorg](https://github.com/nvim-neorg/neorg)
+- [lspsaga.nvim](https://github.com/tami5/lspsaga.nvim)
+- [pounce.nvim](https://github.com/rlane/pounce.nvim)
+- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
+- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim)
```lua
-require('lualine').setup({
- options = { theme = 'rose-pine' }
+use({
+ 'nvim-lualine/lualine.nvim',
+ -- Fix mismatch palette between variants
+ event = 'ColorScheme',
+ config = function()
+ require('lualine').setup({
+ options = {
+ ---@usage 'rose-pine' | 'rose-pine-alt'
+ theme = 'rose-pine'
+ }
+ })
+ end
})
```
-- [Galaxyline fork](https://github.com/NTBBloodbath/galaxyline.nvim)
+- [galaxyline.nvim fork](https://github.com/NTBBloodbath/galaxyline.nvim)
```lua
local colors = require("galaxyline.themes.colors")["rose-pine"]
From eee827ac4e11f488a8f0728838d0d31008e408ec Mon Sep 17 00:00:00 2001
From: mvllow
Date: Mon, 7 Feb 2022 11:26:02 -0600
Subject: [PATCH 11/18] fix reverse italic logic
---
lua/rose-pine/theme.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua
index 8ba2ba8..94298e3 100644
--- a/lua/rose-pine/theme.lua
+++ b/lua/rose-pine/theme.lua
@@ -8,7 +8,7 @@ function M.get(config)
local theme = {}
local groups = config.groups or {}
local styles = {
- italic = (config.disable_italics and 'italic') or 'NONE',
+ italic = (config.disable_italics and 'NONE') or 'italic',
vert_split = (config.bold_vert_split and p.surface) or p.none,
background = (config.disable_background and p.none) or p.base,
float_background = (config.disable_float_background and p.none) or p.surface,
From 19837b4f78c88e7ccacc4621843ae7494614310b Mon Sep 17 00:00:00 2001
From: mvllow
Date: Mon, 7 Feb 2022 11:26:10 -0600
Subject: [PATCH 12/18] check deprecated options
---
lua/rose-pine/init.lua | 56 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua
index bd9e855..834e199 100644
--- a/lua/rose-pine/init.lua
+++ b/lua/rose-pine/init.lua
@@ -1,4 +1,55 @@
local M = {}
+local show_init_messages = true
+
+local function check_for_deprecated_opts()
+ local alerts = {}
+ local should_alert = false
+
+ -- Deprecated options
+ if vim.g.rose_pine_bold_vertical_split_line ~= nil then
+ should_alert = true
+ table.insert(alerts, 'vim.g.rose_pine_bold_vertical_split_line renamed to bold_vert_split')
+ end
+
+ if vim.g.rose_pine_inactive_background ~= nil then
+ should_alert = true
+ table.insert(alerts, 'vim.g.rose_pine_inactive_background renamed to dim_nc_background')
+ end
+
+ if vim.g.rose_pine_disable_background ~= nil then
+ should_alert = true
+ table.insert(alerts, 'vim.g.rose_pine_disable_background renamed to disable_background')
+ end
+
+ if vim.g.rose_pine_disable_float_background ~= nil then
+ should_alert = true
+ table.insert(
+ alerts,
+ 'vim.g.rose_pine_disable_float_background renamed to disable_float_background'
+ )
+ end
+
+ if vim.g.rose_pine_disable_italics ~= nil then
+ should_alert = true
+ table.insert(alerts, 'vim.g.rose_pine_disable_italics renamed to disable_italics')
+ end
+
+ if vim.g.rose_pine_colors ~= nil then
+ should_alert = true
+ table.insert(alerts, 'vim.g.rose_pine_colors renamed to groups')
+ end
+
+ if should_alert then
+ local prefix = ' '
+ print('Rosé Pine – https://github.com/rose-pine/neovim')
+ print(prefix .. 'vim.g.rose_pine_