From 1f8c20a7821e44c34763fcbe23c404510f4c49b7 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 19 Nov 2021 13:25:44 -0600 Subject: [PATCH 01/29] fix: float background mismatch --- lua/rose-pine/theme.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index a912123..4f9d5b0 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -164,6 +164,11 @@ theme.base = { mkdRule = { fg = p.subtle }, mkdURL = { fg = p.foam, style = 'underline' }, + -- Fix background mismatch if user sets custom float background + -- In LSP hover float: (paramater) + -- ^ ^ + typescriptParens = { bg = p.none }, + DiagnosticHint = { fg = groups.hint }, DiagnosticInfo = { fg = groups.info }, DiagnosticWarn = { fg = groups.warn }, From 25283901777df7b597d6f8b5ec3e37328c383b29 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 19 Nov 2021 13:36:11 -0600 Subject: [PATCH 02/29] feat: add `NormalFloat` --- 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 4f9d5b0..9054f1d 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -67,7 +67,7 @@ theme.base = { MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, Normal = { fg = p.text, bg = maybe_base }, - -- NormalFloat = {}, + NormalFloat = { fg = p.text, bg = p.surface }, Pmenu = { fg = p.subtle, bg = p.surface }, PmenuSbar = { bg = p.overlay }, PmenuSel = { fg = p.text, bg = p.overlay }, From c5d27ccd6226d0809cb4bf8587264175f20cfd87 Mon Sep 17 00:00:00 2001 From: Piers Olenski <1285419+piersolenski@users.noreply.github.com> Date: Sat, 20 Nov 2021 16:04:48 +0000 Subject: [PATCH 03/29] Add VimWiki support (#35) --- lua/rose-pine/theme.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 9054f1d..f688027 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -422,6 +422,20 @@ theme.plugins = { NeogitDiffContextHighlight = { bg = p.highlight }, NeogitHunkHeader = { bg = p.highlight }, NeogitHunkHeaderHighlight = { bg = p.highlight }, + + -- VimWiki + -- https://github.com/vimwiki/vimwiki + VimwikiHR = { fg = p.subtle }, + VimwikiHeader1 = { fg = p.foam, style = 'bold' }, + VimwikiHeader2 = { fg = p.foam, style = 'bold' }, + VimwikiHeader3 = { fg = p.foam, style = 'bold' }, + VimwikiHeader4 = { fg = p.foam, style = 'bold' }, + VimwikiHeader5 = { fg = p.foam, style = 'bold' }, + VimwikiHeader6 = { fg = p.foam, style = 'bold' }, + VimwikiHeaderChar = { fg = p.pine }, + VimwikiLink = { fg = p.rose }, + VimwikiList = { fg = p.iris }, + VimwikiNoExistsLink = { fg = p.love }, } return theme From 8a1fe154167a8094a3b2944bc04f513029e65a08 Mon Sep 17 00:00:00 2001 From: Daniel Mathiot Date: Wed, 1 Dec 2021 00:31:36 +0100 Subject: [PATCH 04/29] feat: Add more highlights to nvim-cmp (#37) * feat: Add more highlights to nvim-cmp This should close #36. For information sake, the colors and the arrangement is very personal, and can be subject to changes. Feel free to complete the list of supported CmpItemKind from there: https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/types/lsp.lua#L108 * fix: Remove subtle hl for CmpItemKinds --- lua/rose-pine/theme.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index f688027..ea297b8 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -414,6 +414,12 @@ theme.plugins = { CmpItemAbbrMatch = { fg = p.text, style = 'bold' }, CmpItemAbbrMatchFuzzy = { fg = p.text, style = 'bold' }, CmpItemAbbrDeprecated = { fg = p.subtle, style = 'strikethrough' }, + CmpItemKindVariable = { fg = p.foam }, + CmpItemKindClass = { fg = p.gold }, + CmpItemKindInterface = { fg = p.gold }, + CmpItemKindFunction = { fg = p.iris }, + CmpItemKindMethod = { fg = p.iris }, + CmpItemKindSnippet = { fg = p.iris }, -- neogit -- https://github.com/TimUntersberger/neogit From fe1974e950cb363146c22bab496fb1c47576d71b Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 1 Dec 2021 13:07:56 -0600 Subject: [PATCH 05/29] fix: improve highlight contrast closes #40 --- lua/rose-pine/palette.lua | 18 +++++++++--------- lua/rose-pine/theme.lua | 30 +++++++++++++++--------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua index bf00deb..000d24f 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -11,9 +11,9 @@ local palette = { pine = '#31748f', foam = '#9ccfd8', iris = '#c4a7e7', - highlight = '#2a2837', - highlight_inactive = '#211f2d', - highlight_overlay = '#3a384a', + highlight_low = '#21202e', + highlight_med = '#403d52', + highlight_high = '#524f67', none = 'NONE', } @@ -34,9 +34,9 @@ then pine = '#286983', foam = '#56949f', iris = '#907aa9', - highlight = '#eee9e6', - highlight_inactive = '#f2ede9', - highlight_overlay = '#e4dfde', + highlight_low = '#f4ede8', + highlight_med = '#dfdad9', + highlight_high = '#cecacd', } elseif vim.g.rose_pine_variant == 'moon' @@ -55,9 +55,9 @@ then pine = '#3e8fb0', foam = '#9ccfd8', iris = '#c4a7e7', - highlight = '#312f44', - highlight_inactive = '#2a283d', - highlight_overlay = '#3f3c53', + highlight_low = '#2a283e', + highlight_med = '#44415a', + highlight_high = '#56526E', } end diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index ea297b8..0eb7dda 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -41,12 +41,12 @@ if vim.g.rose_pine_bold_vertical_split_line then end theme.base = { - ColorColumn = { bg = p.highlight_overlay }, + ColorColumn = { bg = p.highlight_high }, Conceal = { bg = p.none }, -- Cursor = {}, - CursorColumn = { bg = p.highlight }, + CursorColumn = { bg = p.highlight_med }, -- CursorIM = {}, - CursorLine = { bg = p.highlight_inactive }, + CursorLine = { bg = p.highlight_low }, CursorLineNr = { fg = p.text }, DarkenedPanel = { bg = p.surface }, DarkenedStatusline = { bg = p.surface }, @@ -60,7 +60,7 @@ theme.base = { FloatBorder = { fg = p.subtle }, FoldColumn = {}, Folded = { fg = p.text, bg = p.surface }, - IncSearch = { bg = p.highlight }, + IncSearch = { bg = p.highlight_med }, LineNr = { fg = p.inactive }, MatchParen = { fg = p.text, bg = p.overlay }, -- ModeMsg = {}, @@ -74,7 +74,7 @@ theme.base = { PmenuThumb = { bg = p.inactive }, Question = { fg = p.gold }, -- QuickFixLine = {}, - Search = { fg = p.iris, bg = p.highlight_overlay }, + Search = { fg = p.iris, bg = p.highlight_high }, SpecialKey = { fg = p.foam }, SpellBad = { style = 'undercurl', sp = p.love }, SpellCap = { style = 'undercurl', sp = p.subtle }, @@ -90,7 +90,7 @@ theme.base = { TabLineSel = { fg = p.text, bg = p.inactive }, Title = { fg = p.text }, VertSplit = maybe_bold_vert_split, - Visual = { bg = p.highlight }, + Visual = { bg = p.highlight_med }, -- VisualNOS = {}, WarningMsg = { fg = p.gold }, -- Whitespace = {}, @@ -199,9 +199,9 @@ theme.base = { DiagnosticVirtualTextWarn = { fg = groups.warn }, DiagnosticVirtualTextError = { fg = groups.error }, - LspReferenceText = { fg = p.rose, bg = p.highlight }, - LspReferenceRead = { fg = p.rose, bg = p.highlight }, - LspReferenceWrite = { fg = p.rose, bg = p.highlight }, + LspReferenceText = { fg = p.rose, bg = p.highlight_med }, + LspReferenceRead = { fg = p.rose, bg = p.highlight_med }, + LspReferenceWrite = { fg = p.rose, bg = p.highlight_med }, --Lsp color groups for nvim 0.5.x LspDiagnosticsSignWarning = { link = 'DiagnosticSignWarn' }, @@ -379,7 +379,7 @@ theme.plugins = { NvimTreeFolderIcon = { fg = p.subtle }, NvimTreeFolderName = { fg = p.foam }, NvimTreeImageFile = { fg = p.text }, - NvimTreeOpenedFile = { fg = p.text, bg = p.highlight }, + NvimTreeOpenedFile = { fg = p.text, bg = p.highlight_med }, NvimTreeOpenedFolderName = { fg = p.foam }, NvimTreeRootFolder = { fg = p.iris }, NvimTreeSpecialFile = { link = 'NvimTreeNormal' }, @@ -423,11 +423,11 @@ theme.plugins = { -- neogit -- https://github.com/TimUntersberger/neogit - NeogitDiffAddHighlight = { fg = p.foam, bg = p.highlight_overlay }, - NeogitDiffDeleteHighlight = { fg = p.love, bg = p.highlight_overlay }, - NeogitDiffContextHighlight = { bg = p.highlight }, - NeogitHunkHeader = { bg = p.highlight }, - NeogitHunkHeaderHighlight = { bg = p.highlight }, + NeogitDiffAddhighlight_med = { fg = p.foam, bg = p.highlight_high }, + NeogitDiffDeletehighlight_med = { fg = p.love, bg = p.highlight_high }, + NeogitDiffContexthighlight_med = { bg = p.highlight_med }, + NeogitHunkHeader = { bg = p.highlight_med }, + NeogitHunkHeaderhighlight_med = { bg = p.highlight_med }, -- VimWiki -- https://github.com/vimwiki/vimwiki From a7376ca116dc89acecd39740f78db81390a10328 Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 1 Dec 2021 13:51:24 -0600 Subject: [PATCH 06/29] chore: format --- 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 000d24f..985d321 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -57,7 +57,7 @@ then iris = '#c4a7e7', highlight_low = '#2a283e', highlight_med = '#44415a', - highlight_high = '#56526E', + highlight_high = '#56526e', } end From 44054042a243a9ca949f62e24215bf5bd0cdd94c Mon Sep 17 00:00:00 2001 From: Devin <47056144+ikws4@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:54:09 +0800 Subject: [PATCH 07/29] Fix neogit highlight and adjust the highlight contrast (#41) * fix: neogit highlight broken after #fe1974e * feat(neogit): adjust highlight contrast --- lua/rose-pine/theme.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 0eb7dda..6d08482 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -423,11 +423,11 @@ theme.plugins = { -- neogit -- https://github.com/TimUntersberger/neogit - NeogitDiffAddhighlight_med = { fg = p.foam, bg = p.highlight_high }, - NeogitDiffDeletehighlight_med = { fg = p.love, bg = p.highlight_high }, - NeogitDiffContexthighlight_med = { bg = p.highlight_med }, - NeogitHunkHeader = { bg = p.highlight_med }, - NeogitHunkHeaderhighlight_med = { bg = p.highlight_med }, + NeogitDiffAddhighlight = { fg = p.foam, bg = p.highlight_med }, + NeogitDiffDeletehighlight = { fg = p.love, bg = p.highlight_med }, + NeogitDiffContexthighlight = { bg = p.highlight_low }, + NeogitHunkHeader = { bg = p.highlight_low }, + NeogitHunkHeaderhighlight = { bg = p.highlight_low }, -- VimWiki -- https://github.com/vimwiki/vimwiki From 5605d5fe1fc173fef2968e15210424c987553059 Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 1 Dec 2021 23:58:50 -0600 Subject: [PATCH 08/29] chore: format group name --- lua/rose-pine/theme.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 6d08482..23491ac 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -423,11 +423,11 @@ theme.plugins = { -- neogit -- https://github.com/TimUntersberger/neogit - NeogitDiffAddhighlight = { fg = p.foam, bg = p.highlight_med }, - NeogitDiffDeletehighlight = { fg = p.love, bg = p.highlight_med }, - NeogitDiffContexthighlight = { bg = p.highlight_low }, + NeogitDiffAddHighlight = { fg = p.foam, bg = p.highlight_med }, + NeogitDiffDeleteHighlight = { fg = p.love, bg = p.highlight_med }, + NeogitDiffContextHighlight = { bg = p.highlight_low }, NeogitHunkHeader = { bg = p.highlight_low }, - NeogitHunkHeaderhighlight = { bg = p.highlight_low }, + NeogitHunkHeaderHighlight = { bg = p.highlight_low }, -- VimWiki -- https://github.com/vimwiki/vimwiki From 19fcb371dcaa3feb4f4265a32a78a056a279ab5f Mon Sep 17 00:00:00 2001 From: Daniel Mathiot Date: Thu, 2 Dec 2021 18:33:09 +0100 Subject: [PATCH 09/29] Remove background for popups (#38) --- lua/rose-pine/theme.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 23491ac..ef92623 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -67,8 +67,8 @@ theme.base = { MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, Normal = { fg = p.text, bg = maybe_base }, - NormalFloat = { fg = p.text, bg = p.surface }, - Pmenu = { fg = p.subtle, bg = p.surface }, + NormalFloat = { fg = p.subtle }, + Pmenu = { fg = p.subtle }, PmenuSbar = { bg = p.overlay }, PmenuSel = { fg = p.text, bg = p.overlay }, PmenuThumb = { bg = p.inactive }, @@ -410,6 +410,7 @@ theme.plugins = { -- nvim-cmp -- https://github.com/hrsh7th/nvim-cmp CmpItemKind = { fg = p.iris }, + CmpItemMenu = { fg = p.subtle }, CmpItemAbbr = { fg = p.subtle }, CmpItemAbbrMatch = { fg = p.text, style = 'bold' }, CmpItemAbbrMatchFuzzy = { fg = p.text, style = 'bold' }, From 7bd39afcd1c88bde3658895c7b5c9e2ae03dcd60 Mon Sep 17 00:00:00 2001 From: Joonas Korhonen Date: Fri, 3 Dec 2021 16:15:12 +0200 Subject: [PATCH 10/29] Link legacy diff groups for git.vim and diff.vim syntax (#42) --- lua/rose-pine/theme.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index ef92623..1b5c497 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -54,6 +54,9 @@ theme.base = { DiffChange = { fg = p.rose }, DiffDelete = { fg = p.love }, DiffText = { fg = p.text }, + diffAdded = { link = 'DiffAdd' }, + diffChanged = { link = 'DiffChange' }, + diffRemoved = { link = 'DiffDelete' }, Directory = { fg = p.foam, bg = p.none }, -- EndOfBuffer = {}, ErrorMsg = { fg = p.love, style = 'bold' }, From da95f1bad5fdc5fe56ba3609249d91dff5a8f8b5 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:29:42 -0600 Subject: [PATCH 11/29] refactor: palette --- lua/rose-pine/palette.lua | 91 ++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua index 985d321..e73caee 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -1,48 +1,22 @@ -local palette = { - base = '#191724', - surface = '#1f1d2e', - overlay = '#26233a', - inactive = '#555169', - subtle = '#6e6a86', - text = '#e0def4', - love = '#eb6f92', - gold = '#f6c177', - rose = '#ebbcba', - pine = '#31748f', - foam = '#9ccfd8', - iris = '#c4a7e7', - highlight_low = '#21202e', - highlight_med = '#403d52', - highlight_high = '#524f67', - none = 'NONE', -} - -if - vim.g.rose_pine_variant == 'dawn' - or vim.g.rose_pine_variant == 'rose-pine-dawn' -then - palette = { - base = '#faf4ed', - surface = '#fffaf3', - overlay = '#f2e9de', - inactive = '#9893a5', +local variants = { + main = { + base = '#191724', + surface = '#1f1d2e', + overlay = '#26233a', + inactive = '#555169', subtle = '#6e6a86', - text = '#575279', - love = '#b4637a', - gold = '#ea9d34', - rose = '#d7827e', - pine = '#286983', - foam = '#56949f', - iris = '#907aa9', - highlight_low = '#f4ede8', - highlight_med = '#dfdad9', - highlight_high = '#cecacd', - } -elseif - vim.g.rose_pine_variant == 'moon' - or vim.g.rose_pine_variant == 'rose-pine-moon' -then - palette = { + text = '#e0def4', + love = '#eb6f92', + gold = '#f6c177', + rose = '#ebbcba', + pine = '#31748f', + foam = '#9ccfd8', + iris = '#c4a7e7', + highlight_low = '#21202e', + highlight_med = '#403d52', + highlight_high = '#524f67', + }, + moon = { base = '#232136', surface = '#2a273f', overlay = '#393552', @@ -58,7 +32,34 @@ then highlight_low = '#2a283e', highlight_med = '#44415a', highlight_high = '#56526e', - } + }, + dawn = { + base = '#faf4ed', + surface = '#fffaf3', + overlay = '#f2e9de', + inactive = '#9893a5', + subtle = '#6e6a86', + text = '#575279', + love = '#b4637a', + gold = '#ea9d34', + rose = '#d7827e', + pine = '#286983', + foam = '#56949f', + iris = '#907aa9', + highlight_low = '#f4ede8', + highlight_med = '#dfdad9', + highlight_high = '#cecacd', + }, +} + +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 From 6bdbe52159e2a2fc21c830a3ac8bd25c4cd42085 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:30:47 -0600 Subject: [PATCH 12/29] refactor: simplify init --- colors/rose-pine.vim | 13 ++++----- lua/rose-pine/init.lua | 49 +++++++++++++++++++++++++++++--- lua/rose-pine/util.lua | 63 ------------------------------------------ 3 files changed, 50 insertions(+), 75 deletions(-) delete mode 100644 lua/rose-pine/util.lua diff --git a/colors/rose-pine.vim b/colors/rose-pine.vim index 4b06354..af1ddba 100644 --- a/colors/rose-pine.vim +++ b/colors/rose-pine.vim @@ -1,9 +1,6 @@ -lua << EOF -package.loaded['rose-pine'] = nil -package.loaded['rose-pine.functions'] = nil -package.loaded['rose-pine.palette'] = nil -package.loaded['rose-pine.theme'] = nil -package.loaded['rose-pine.util'] = nil +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 -require('rose-pine').set() -EOF +lua require('rose-pine').colorscheme() diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua index 10a37b0..99d59c5 100644 --- a/lua/rose-pine/init.lua +++ b/lua/rose-pine/init.lua @@ -1,9 +1,50 @@ -local util = require('rose-pine.util') - local M = {} -function M.set() - util.load() +function M.colorscheme() + if vim.g.colors_name then + vim.cmd('hi clear') + end + + 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 + vim.o.background = 'light' + 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 hl = 'highlight ' + .. group + .. ' ' + .. style + .. ' ' + .. fg + .. ' ' + .. bg + .. ' ' + .. sp + + vim.cmd(hl) + if color.link then + vim.cmd('highlight! link ' .. group .. ' ' .. color.link) + end + end + + for group, colors in pairs(require('rose-pine.theme')) do + highlight(group, colors) + end + + require('rose-pine.galaxyline.theme') end return M diff --git a/lua/rose-pine/util.lua b/lua/rose-pine/util.lua deleted file mode 100644 index ba7b117..0000000 --- a/lua/rose-pine/util.lua +++ /dev/null @@ -1,63 +0,0 @@ -local util = {} - -util.highlight = function(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 hl = 'highlight ' - .. group - .. ' ' - .. style - .. ' ' - .. fg - .. ' ' - .. bg - .. ' ' - .. sp - - vim.cmd(hl) - if color.link then - vim.cmd('highlight! link ' .. group .. ' ' .. color.link) - end -end - -function util.load() - if vim.g.colors_name then - vim.cmd('hi clear') - end - - vim.o.termguicolors = true - vim.g.colors_name = 'rose-pine' - - if vim.o.background == 'light' and vim.g.rose_pine_variant == nil then - vim.g.rose_pine_variant = 'dawn' - elseif - vim.g.rose_pine_variant == 'dawn' - or vim.g.rose_pine_variant == 'rose-pine-dawn' - then - vim.o.background = 'light' - end - - local theme = require('rose-pine.theme') - - theme.load_terminal() - - for group, colors in pairs(theme.base) do - util.highlight(group, colors) - end - - for group, colors in pairs(theme.treesitter) do - util.highlight(group, colors) - end - - for group, colors in pairs(theme.plugins) do - util.highlight(group, colors) - end - - -- Load galaxyline theme - require("rose-pine.galaxyline.theme") -end - -return util From 34aeab3b8e8f12151b7320e26c80bac706e38256 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:32:08 -0600 Subject: [PATCH 13/29] chore!: rename functions - `rose-pine.functions.select_variant` -> `rose-pine.set` - `rose-pine.functions.toggle_variant` -> `rose-pine.toggle` --- lua/rose-pine/functions.lua | 35 ----------------------------------- lua/rose-pine/init.lua | 24 ++++++++++++++++++++++++ readme.md | 28 +++++++++++++++------------- 3 files changed, 39 insertions(+), 48 deletions(-) delete mode 100644 lua/rose-pine/functions.lua diff --git a/lua/rose-pine/functions.lua b/lua/rose-pine/functions.lua deleted file mode 100644 index 1e20594..0000000 --- a/lua/rose-pine/functions.lua +++ /dev/null @@ -1,35 +0,0 @@ -local select_variant = function(variant) - vim.g.rose_pine_variant = variant - local formatted_variant = '' - if variant == 'base' then - formatted_variant = '' - else - formatted_variant = variant:sub(1, 1):upper() .. variant:sub(2) - end - print('Rosé Pine', formatted_variant) - vim.cmd([[colorscheme rose-pine]]) -end - -local toggle_variant = function(variants) - local options = variants or { 'base', 'moon', 'dawn' } - local index = {} - for k, v in pairs(options) do - index[v] = k - end - - if vim.g.rose_pine_variant_switch == nil then - -- Ensure theme toggles from correct position - vim.g.rose_pine_variant_switch = index[vim.g.rose_pine_variant] or 0 - end - - vim.g.rose_pine_variant_switch = ( - vim.g.rose_pine_variant_switch % table.getn(options) - ) + 1 - - select_variant(options[vim.g.rose_pine_variant_switch]) -end - -return { - select_variant = select_variant, - toggle_variant = toggle_variant, -} diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua index 99d59c5..f07ee01 100644 --- a/lua/rose-pine/init.lua +++ b/lua/rose-pine/init.lua @@ -47,4 +47,28 @@ function M.colorscheme() require('rose-pine.galaxyline.theme') end +function M.set(variant) + vim.g.rose_pine_variant = variant + vim.cmd([[colorscheme rose-pine]]) +end + +function M.toggle(variants) + variants = variants or { 'main', 'moon', 'dawn' } + + local index = {} + for k, v in pairs(variants) do + index[v] = k + end + + if vim.g.rose_pine_current_variant == nil then + vim.g.rose_pine_current_variant = index[vim.g.rose_pine_variant] or 0 + end + + vim.g.rose_pine_current_variant = ( + vim.g.rose_pine_current_variant % #variants + ) + 1 + + M.set(variants[vim.g.rose_pine_current_variant]) +end + return M diff --git a/readme.md b/readme.md index 490c6e9..92e921e 100644 --- a/readme.md +++ b/readme.md @@ -119,26 +119,28 @@ vim.cmd('colorscheme rose-pine') ## Functions ```lua --- Toggle between the three variants -require('rose-pine.functions').toggle_variant() +-- Toggle between all variants +require('rose-pine').toggle() --- Toggle between base and dawn -require('rose-pine.functions').toggle_variant({'base', 'dawn'}) +-- Toggle between some variants +require('rose-pine').toggle({'main', 'dawn'}) --- Switch to specified variant -require('rose-pine.functions').select_variant('moon') +-- Set specific variant +require('rose-pine').set('moon') ``` ## Keymaps -```lua --- Toggle variant -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').toggle_variant()]], { noremap = true, silent = true }) +> These are only suggestions; no keymaps are set by the theme --- Select each variant -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').select_variant('dawn')]], { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').select_variant('moon')]], { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').select_variant('base')]], { noremap = true, silent = true }) +```lua +-- Toggle variants +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').toggle()]], { noremap = true, silent = true }) + +-- Set variant +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').set('main')]], { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').set('moon')]], { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').set('dawn')]], { noremap = true, silent = true }) ``` ## Contributing From 6470d8c35253ea1d1e5f92556e3e7b731a2663a2 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:33:53 -0600 Subject: [PATCH 14/29] docs: update options --- readme.md | 57 +++++++++++++++++++++---------------------------------- 1 file changed, 22 insertions(+), 35 deletions(-) diff --git a/readme.md b/readme.md index 92e921e..4434eef 100644 --- a/readme.md +++ b/readme.md @@ -69,49 +69,36 @@ use({ ## Options -> Options should be set before colorscheme - -### Interface +> Options should be set **before** colorscheme ```lua --- Set variant --- Defaults to 'dawn' if vim background is light --- @usage 'base' | 'moon' | 'dawn' | 'rose-pine[-moon][-dawn]' -vim.g.rose_pine_variant = 'base' +-- Set theme variant +-- Matches terminal theme if unset +-- @usage 'main' | 'moon' | 'dawn' +vim.g.rose_pine_variant = 'dawn' --- Disable italics +vim.g.rose_pine_bold_vertical_split_line = true +vim.g.rose_pine_disable_background = false vim.g.rose_pine_disable_italics = false --- Use terminal background -vim.g.rose_pine_disable_background = false - --- Use bold vertical split line -vim.g.rose_pine_bold_vertical_split_line = true -``` - -### Custom colours - -```lua +local p = require('rose-pine.palette') vim.g.rose_pine_colors = { - punctuation = '#fa8072', - comment = '#ffffff', - hint = '#9745be', - info = '#78ccc5', - warn = '#f5c359', - error = '#c75c6a', - headings = { - h1 = '#999999', - h2 = '#888888', - h3 = '#777777', - h4 = '#666666', - h5 = '#555555', - } + punctuation = p.subtle, + comment = p.subtle, + hint = p.iris, + info = p.foam, + warn = p.gold, + error = p.love, + headings = { + h1 = p.foam, + h2 = p.foam, + h3 = p.foam, + h4 = p.foam, + h5 = p.foam, + h6 = p.foam, + }, } -``` -Be sure to set the colorscheme _after_ options - -```lua -- Set colorscheme after options vim.cmd('colorscheme rose-pine') ``` From 9bbb42eb181094706c788c365e62867d99fb2338 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:36:08 -0600 Subject: [PATCH 15/29] chore: update config with shared headings --- lua/rose-pine/config.lua | 49 ++++++++++ lua/rose-pine/theme.lua | 198 +++++++++++++++------------------------ 2 files changed, 127 insertions(+), 120 deletions(-) create mode 100644 lua/rose-pine/config.lua diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua new file mode 100644 index 0000000..668ade7 --- /dev/null +++ b/lua/rose-pine/config.lua @@ -0,0 +1,49 @@ +local palette = require('rose-pine.palette') + +local config = { + bold_vert_split = vim.g.rose_pine_bold_verical_split_line or false, + no_background = vim.g.rose_pine_disable_background or false, + no_italics = vim.g.rose_pine_disable_italics or false, + colors = { + punctuation = palette.subtle, + comment = palette.subtle, + hint = palette.iris, + info = palette.foam, + warn = palette.gold, + error = palette.love, + + -- TODO: Expose these once matched with syntax and cmp kind + -- variable = '', + -- class = '', + -- interface = '', + -- ['function'] = '', + -- method = '', + + ---@type string|table + headings = { + h1 = palette.foam, + h2 = palette.foam, + h3 = palette.foam, + h4 = palette.foam, + h5 = palette.foam, + 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/theme.lua b/lua/rose-pine/theme.lua index ef92623..03e2719 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -1,46 +1,24 @@ +local config = require('rose-pine.config') local p = require('rose-pine.palette') -local user_colors = vim.g.rose_pine_colors or {} -local groups = { - punctuation = user_colors.punctuation or p.subtle, - comment = user_colors.comment or p.subtle, - hint = user_colors.hint or p.iris, - info = user_colors.info or p.foam, - warn = user_colors.warn or p.gold, - error = user_colors.error or p.love, - headings = { - h1 = p.love, - h2 = p.rose, - h3 = p.iris, - h4 = p.pine, - h5 = p.foam, - }, -} - -groups.headings = vim.tbl_extend( - 'force', - groups.headings, - user_colors.headings or {} -) - -local theme = {} +-- TODO: Refactor `maybe` logic local maybe_base = p.base local maybe_italic = 'italic' local maybe_bold_vert_split = { fg = p.overlay } -if vim.g.rose_pine_disable_background then - maybe_base = p.none -end - -if vim.g.rose_pine_disable_italics then - maybe_italic = nil -end - -if vim.g.rose_pine_bold_vertical_split_line then +if config.bold_vert_split then maybe_bold_vert_split = { fg = p.surface, bg = p.surface } end -theme.base = { +if config.no_background then + maybe_base = p.none +end + +if config.no_italics then + maybe_italic = nil +end + +local theme = { ColorColumn = { bg = p.highlight_high }, Conceal = { bg = p.none }, -- Cursor = {}, @@ -63,7 +41,7 @@ theme.base = { IncSearch = { bg = p.highlight_med }, LineNr = { fg = p.inactive }, MatchParen = { fg = p.text, bg = p.overlay }, - -- ModeMsg = {}, + ModeMsg = { fg = p.subtle }, MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, Normal = { fg = p.text, bg = maybe_base }, @@ -99,7 +77,7 @@ theme.base = { Boolean = { fg = p.gold }, Character = { fg = p.gold }, Comment = { - fg = groups.comment, + fg = config.colors.comment, style = maybe_italic, }, Conditional = { fg = p.pine }, @@ -138,11 +116,11 @@ theme.base = { htmlArg = { fg = p.iris }, htmlBold = { fg = p.text, style = 'bold' }, 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' }, - htmlH4 = { fg = groups.headings.h4, style = 'bold' }, - htmlH5 = { fg = groups.headings.h5, style = 'bold' }, + htmlH1 = { fg = config.colors.headings.h1, style = 'bold' }, + htmlH2 = { fg = config.colors.headings.h2, style = 'bold' }, + htmlH3 = { fg = config.colors.headings.h3, style = 'bold' }, + htmlH4 = { fg = config.colors.headings.h4, style = 'bold' }, + htmlH5 = { fg = config.colors.headings.h5, style = 'bold' }, htmlItalic = { fg = p.text, style = maybe_italic }, htmlLink = { fg = p.text }, htmlTag = { fg = p.subtle }, @@ -169,59 +147,54 @@ theme.base = { -- ^ ^ typescriptParens = { bg = p.none }, - DiagnosticHint = { fg = groups.hint }, - DiagnosticInfo = { fg = groups.info }, - DiagnosticWarn = { fg = groups.warn }, - DiagnosticError = { fg = groups.error }, - - DiagnosticDefaultHint = { fg = groups.hint }, - DiagnosticDefaultInfo = { fg = groups.info }, - DiagnosticDefaultWarn = { fg = groups.warn }, - DiagnosticDefaultError = { fg = groups.error }, - - DiagnosticFloatingHint = { fg = groups.hint }, - DiagnosticFloatingInfo = { fg = groups.info }, - DiagnosticFloatingWarn = { fg = groups.warn }, - DiagnosticFloatingError = { fg = groups.error }, - - DiagnosticSignHint = { fg = groups.hint }, - DiagnosticSignInfo = { fg = groups.info }, - DiagnosticSignWarn = { fg = groups.warn }, - DiagnosticSignError = { fg = groups.error }, - - DiagnosticUnderlineHint = { style = 'undercurl', sp = groups.hint }, - DiagnosticUnderlineInfo = { style = 'undercurl', sp = groups.info }, - DiagnosticUnderlineWarn = { style = 'undercurl', sp = groups.warn }, - DiagnosticUnderlineError = { style = 'undercurl', sp = groups.error }, - - DiagnosticVirtualTextHint = { fg = groups.hint }, - DiagnosticVirtualTextInfo = { fg = groups.info }, - DiagnosticVirtualTextWarn = { fg = groups.warn }, - DiagnosticVirtualTextError = { fg = groups.error }, + DiagnosticHint = { fg = config.colors.hint }, + DiagnosticInfo = { fg = config.colors.info }, + DiagnosticWarn = { fg = config.colors.warn }, + DiagnosticError = { fg = config.colors.error }, + DiagnosticDefaultHint = { fg = config.colors.hint }, + DiagnosticDefaultInfo = { fg = config.colors.info }, + DiagnosticDefaultWarn = { fg = config.colors.warn }, + DiagnosticDefaultError = { fg = config.colors.error }, + DiagnosticFloatingHint = { fg = config.colors.hint }, + DiagnosticFloatingInfo = { fg = config.colors.info }, + DiagnosticFloatingWarn = { fg = config.colors.warn }, + DiagnosticFloatingError = { fg = config.colors.error }, + DiagnosticSignHint = { fg = config.colors.hint }, + DiagnosticSignInfo = { fg = config.colors.info }, + DiagnosticSignWarn = { fg = config.colors.warn }, + DiagnosticSignError = { fg = config.colors.error }, + DiagnosticUnderlineHint = { style = 'undercurl', sp = config.colors.hint }, + DiagnosticUnderlineInfo = { style = 'undercurl', sp = config.colors.info }, + DiagnosticUnderlineWarn = { style = 'undercurl', sp = config.colors.warn }, + DiagnosticUnderlineError = { + style = 'undercurl', + sp = config.colors.error, + }, + DiagnosticVirtualTextHint = { fg = config.colors.hint }, + DiagnosticVirtualTextInfo = { fg = config.colors.info }, + DiagnosticVirtualTextWarn = { fg = config.colors.warn }, + DiagnosticVirtualTextError = { fg = config.colors.error }, LspReferenceText = { fg = p.rose, bg = p.highlight_med }, LspReferenceRead = { fg = p.rose, bg = p.highlight_med }, LspReferenceWrite = { fg = p.rose, bg = p.highlight_med }, - --Lsp color groups for nvim 0.5.x + -- 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' }, @@ -236,42 +209,13 @@ theme.base = { RedrawDebugRecompose = { fg = '#ffffff', bg = p.love }, NvimInternalError = { fg = '#ffffff', bg = p.love }, -} -function theme.load_terminal() - -- black - vim.g.terminal_color_0 = p.overlay - vim.g.terminal_color_8 = p.subtle - -- red - vim.g.terminal_color_1 = p.love - vim.g.terminal_color_9 = p.love - -- green - vim.g.terminal_color_2 = p.pine - vim.g.terminal_color_10 = p.pine - -- yellow - vim.g.terminal_color_3 = p.gold - vim.g.terminal_color_11 = p.gold - -- blue - vim.g.terminal_color_4 = p.foam - vim.g.terminal_color_12 = p.foam - -- magenta - vim.g.terminal_color_5 = p.iris - vim.g.terminal_color_13 = p.iris - -- cyan - vim.g.terminal_color_6 = p.rose - vim.g.terminal_color_14 = p.rose - -- white - vim.g.terminal_color_7 = p.text - vim.g.terminal_color_15 = p.text -end - -theme.treesitter = { -- TSAnnotation = {}, -- TSAttribute = {}, TSBoolean = { fg = p.rose }, -- TSCharacter = {}, TSComment = { - fg = groups.comment, + fg = config.colors.comment, style = maybe_italic, }, -- TSConditional = {}, @@ -307,9 +251,9 @@ theme.treesitter = { fg = p.iris, style = maybe_italic, }, - TSPunctBracket = { fg = groups.punctuation }, - TSPunctDelimiter = { fg = groups.punctuation }, - TSPunctSpecial = { fg = groups.punctuation }, + TSPunctBracket = { fg = config.colors.punctuation }, + TSPunctDelimiter = { fg = config.colors.punctuation }, + TSPunctSpecial = { fg = config.colors.punctuation }, -- TSRepeat = {}, -- TSStrike = {}, TSString = { fg = p.gold }, @@ -329,9 +273,7 @@ theme.treesitter = { style = maybe_italic, }, TSVariableBuiltin = { fg = p.love }, -} -theme.plugins = { -- barbar.nvim -- https://github.com/romgrk/barbar.nvim BufferTabpageFill = { fg = p.base, bg = p.base }, @@ -367,14 +309,12 @@ theme.plugins = { -- nvim-tree.lua -- https://github.com/kyazdani42/nvim-tree.lua NvimTreeNormal = { fg = p.text }, - NvimTreeFileDeleted = { fg = p.love }, NvimTreeFileDirty = { fg = p.rose }, NvimTreeFileMerge = { fg = p.iris }, NvimTreeFileNew = { fg = p.foam }, NvimTreeFileRenamed = { fg = p.pine }, NvimTreeFileStaged = { fg = p.iris }, - NvimTreeEmptyFolderName = { fg = p.inactive }, NvimTreeFolderIcon = { fg = p.subtle }, NvimTreeFolderName = { fg = p.foam }, @@ -383,7 +323,6 @@ theme.plugins = { NvimTreeOpenedFolderName = { fg = p.foam }, NvimTreeRootFolder = { fg = p.iris }, NvimTreeSpecialFile = { link = 'NvimTreeNormal' }, - NvimTreeGitDeleted = { fg = p.love }, NvimTreeGitDirty = { fg = p.rose }, NvimTreeGitIgnored = { fg = p.subtle }, @@ -391,7 +330,6 @@ theme.plugins = { NvimTreeGitNew = { fg = p.foam }, NvimTreeGitRenamed = { fg = p.pine }, NvimTreeGitStaged = { fg = p.iris }, - NvimTreeWindowPicker = { fg = p.base, bg = p.iris }, -- which-key.nvim @@ -425,7 +363,10 @@ theme.plugins = { -- neogit -- https://github.com/TimUntersberger/neogit NeogitDiffAddHighlight = { fg = p.foam, bg = p.highlight_med }, - NeogitDiffDeleteHighlight = { fg = p.love, bg = p.highlight_med }, + NeogitDiffDeleteHighlight = { + fg = p.love, + bg = p.highlight_med, + }, NeogitDiffContextHighlight = { bg = p.highlight_low }, NeogitHunkHeader = { bg = p.highlight_low }, NeogitHunkHeaderHighlight = { bg = p.highlight_low }, @@ -433,16 +374,33 @@ theme.plugins = { -- VimWiki -- https://github.com/vimwiki/vimwiki VimwikiHR = { fg = p.subtle }, - VimwikiHeader1 = { fg = p.foam, style = 'bold' }, - VimwikiHeader2 = { fg = p.foam, style = 'bold' }, - VimwikiHeader3 = { fg = p.foam, style = 'bold' }, - VimwikiHeader4 = { fg = p.foam, style = 'bold' }, - VimwikiHeader5 = { fg = p.foam, style = 'bold' }, - VimwikiHeader6 = { fg = p.foam, style = 'bold' }, + VimwikiHeader1 = { fg = config.colors.headings.h1, style = 'bold' }, + VimwikiHeader2 = { fg = config.colors.headings.h2, style = 'bold' }, + VimwikiHeader3 = { fg = config.colors.headings.h3, style = 'bold' }, + VimwikiHeader4 = { fg = config.colors.headings.h4, style = 'bold' }, + VimwikiHeader5 = { fg = config.colors.headings.h5, style = 'bold' }, + VimwikiHeader6 = { fg = config.colors.headings.h6, style = 'bold' }, VimwikiHeaderChar = { fg = p.pine }, VimwikiLink = { fg = p.rose }, VimwikiList = { fg = p.iris }, VimwikiNoExistsLink = { fg = p.love }, } +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 From 62567755fd9211c3e5da19e9a045f5a0c6c4ea01 Mon Sep 17 00:00:00 2001 From: not Date: Fri, 3 Dec 2021 09:38:34 -0600 Subject: [PATCH 16/29] Refactor structure (#43) * refactor: palette * refactor: simplify init * chore!: rename functions - `rose-pine.functions.select_variant` -> `rose-pine.set` - `rose-pine.functions.toggle_variant` -> `rose-pine.toggle` * docs: update options * chore: update config with shared headings --- colors/rose-pine.vim | 13 +-- lua/rose-pine/config.lua | 49 +++++++++ lua/rose-pine/functions.lua | 35 ------- lua/rose-pine/init.lua | 73 ++++++++++++- lua/rose-pine/palette.lua | 91 +++++++++-------- lua/rose-pine/theme.lua | 198 ++++++++++++++---------------------- lua/rose-pine/util.lua | 63 ------------ readme.md | 85 +++++++--------- 8 files changed, 284 insertions(+), 323 deletions(-) create mode 100644 lua/rose-pine/config.lua delete mode 100644 lua/rose-pine/functions.lua delete mode 100644 lua/rose-pine/util.lua diff --git a/colors/rose-pine.vim b/colors/rose-pine.vim index 4b06354..af1ddba 100644 --- a/colors/rose-pine.vim +++ b/colors/rose-pine.vim @@ -1,9 +1,6 @@ -lua << EOF -package.loaded['rose-pine'] = nil -package.loaded['rose-pine.functions'] = nil -package.loaded['rose-pine.palette'] = nil -package.loaded['rose-pine.theme'] = nil -package.loaded['rose-pine.util'] = nil +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 -require('rose-pine').set() -EOF +lua require('rose-pine').colorscheme() diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua new file mode 100644 index 0000000..668ade7 --- /dev/null +++ b/lua/rose-pine/config.lua @@ -0,0 +1,49 @@ +local palette = require('rose-pine.palette') + +local config = { + bold_vert_split = vim.g.rose_pine_bold_verical_split_line or false, + no_background = vim.g.rose_pine_disable_background or false, + no_italics = vim.g.rose_pine_disable_italics or false, + colors = { + punctuation = palette.subtle, + comment = palette.subtle, + hint = palette.iris, + info = palette.foam, + warn = palette.gold, + error = palette.love, + + -- TODO: Expose these once matched with syntax and cmp kind + -- variable = '', + -- class = '', + -- interface = '', + -- ['function'] = '', + -- method = '', + + ---@type string|table + headings = { + h1 = palette.foam, + h2 = palette.foam, + h3 = palette.foam, + h4 = palette.foam, + h5 = palette.foam, + 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/functions.lua b/lua/rose-pine/functions.lua deleted file mode 100644 index 1e20594..0000000 --- a/lua/rose-pine/functions.lua +++ /dev/null @@ -1,35 +0,0 @@ -local select_variant = function(variant) - vim.g.rose_pine_variant = variant - local formatted_variant = '' - if variant == 'base' then - formatted_variant = '' - else - formatted_variant = variant:sub(1, 1):upper() .. variant:sub(2) - end - print('Rosé Pine', formatted_variant) - vim.cmd([[colorscheme rose-pine]]) -end - -local toggle_variant = function(variants) - local options = variants or { 'base', 'moon', 'dawn' } - local index = {} - for k, v in pairs(options) do - index[v] = k - end - - if vim.g.rose_pine_variant_switch == nil then - -- Ensure theme toggles from correct position - vim.g.rose_pine_variant_switch = index[vim.g.rose_pine_variant] or 0 - end - - vim.g.rose_pine_variant_switch = ( - vim.g.rose_pine_variant_switch % table.getn(options) - ) + 1 - - select_variant(options[vim.g.rose_pine_variant_switch]) -end - -return { - select_variant = select_variant, - toggle_variant = toggle_variant, -} diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua index 10a37b0..f07ee01 100644 --- a/lua/rose-pine/init.lua +++ b/lua/rose-pine/init.lua @@ -1,9 +1,74 @@ -local util = require('rose-pine.util') - local M = {} -function M.set() - util.load() +function M.colorscheme() + if vim.g.colors_name then + vim.cmd('hi clear') + end + + 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 + vim.o.background = 'light' + 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 hl = 'highlight ' + .. group + .. ' ' + .. style + .. ' ' + .. fg + .. ' ' + .. bg + .. ' ' + .. sp + + vim.cmd(hl) + if color.link then + vim.cmd('highlight! link ' .. group .. ' ' .. color.link) + end + end + + for group, colors in pairs(require('rose-pine.theme')) do + highlight(group, colors) + end + + require('rose-pine.galaxyline.theme') +end + +function M.set(variant) + vim.g.rose_pine_variant = variant + vim.cmd([[colorscheme rose-pine]]) +end + +function M.toggle(variants) + variants = variants or { 'main', 'moon', 'dawn' } + + local index = {} + for k, v in pairs(variants) do + index[v] = k + end + + if vim.g.rose_pine_current_variant == nil then + vim.g.rose_pine_current_variant = index[vim.g.rose_pine_variant] or 0 + end + + vim.g.rose_pine_current_variant = ( + vim.g.rose_pine_current_variant % #variants + ) + 1 + + M.set(variants[vim.g.rose_pine_current_variant]) end return M diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua index 985d321..e73caee 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -1,48 +1,22 @@ -local palette = { - base = '#191724', - surface = '#1f1d2e', - overlay = '#26233a', - inactive = '#555169', - subtle = '#6e6a86', - text = '#e0def4', - love = '#eb6f92', - gold = '#f6c177', - rose = '#ebbcba', - pine = '#31748f', - foam = '#9ccfd8', - iris = '#c4a7e7', - highlight_low = '#21202e', - highlight_med = '#403d52', - highlight_high = '#524f67', - none = 'NONE', -} - -if - vim.g.rose_pine_variant == 'dawn' - or vim.g.rose_pine_variant == 'rose-pine-dawn' -then - palette = { - base = '#faf4ed', - surface = '#fffaf3', - overlay = '#f2e9de', - inactive = '#9893a5', +local variants = { + main = { + base = '#191724', + surface = '#1f1d2e', + overlay = '#26233a', + inactive = '#555169', subtle = '#6e6a86', - text = '#575279', - love = '#b4637a', - gold = '#ea9d34', - rose = '#d7827e', - pine = '#286983', - foam = '#56949f', - iris = '#907aa9', - highlight_low = '#f4ede8', - highlight_med = '#dfdad9', - highlight_high = '#cecacd', - } -elseif - vim.g.rose_pine_variant == 'moon' - or vim.g.rose_pine_variant == 'rose-pine-moon' -then - palette = { + text = '#e0def4', + love = '#eb6f92', + gold = '#f6c177', + rose = '#ebbcba', + pine = '#31748f', + foam = '#9ccfd8', + iris = '#c4a7e7', + highlight_low = '#21202e', + highlight_med = '#403d52', + highlight_high = '#524f67', + }, + moon = { base = '#232136', surface = '#2a273f', overlay = '#393552', @@ -58,7 +32,34 @@ then highlight_low = '#2a283e', highlight_med = '#44415a', highlight_high = '#56526e', - } + }, + dawn = { + base = '#faf4ed', + surface = '#fffaf3', + overlay = '#f2e9de', + inactive = '#9893a5', + subtle = '#6e6a86', + text = '#575279', + love = '#b4637a', + gold = '#ea9d34', + rose = '#d7827e', + pine = '#286983', + foam = '#56949f', + iris = '#907aa9', + highlight_low = '#f4ede8', + highlight_med = '#dfdad9', + highlight_high = '#cecacd', + }, +} + +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 1b5c497..2e33579 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -1,46 +1,24 @@ +local config = require('rose-pine.config') local p = require('rose-pine.palette') -local user_colors = vim.g.rose_pine_colors or {} -local groups = { - punctuation = user_colors.punctuation or p.subtle, - comment = user_colors.comment or p.subtle, - hint = user_colors.hint or p.iris, - info = user_colors.info or p.foam, - warn = user_colors.warn or p.gold, - error = user_colors.error or p.love, - headings = { - h1 = p.love, - h2 = p.rose, - h3 = p.iris, - h4 = p.pine, - h5 = p.foam, - }, -} - -groups.headings = vim.tbl_extend( - 'force', - groups.headings, - user_colors.headings or {} -) - -local theme = {} +-- TODO: Refactor `maybe` logic local maybe_base = p.base local maybe_italic = 'italic' local maybe_bold_vert_split = { fg = p.overlay } -if vim.g.rose_pine_disable_background then - maybe_base = p.none -end - -if vim.g.rose_pine_disable_italics then - maybe_italic = nil -end - -if vim.g.rose_pine_bold_vertical_split_line then +if config.bold_vert_split then maybe_bold_vert_split = { fg = p.surface, bg = p.surface } end -theme.base = { +if config.no_background then + maybe_base = p.none +end + +if config.no_italics then + maybe_italic = nil +end + +local theme = { ColorColumn = { bg = p.highlight_high }, Conceal = { bg = p.none }, -- Cursor = {}, @@ -66,7 +44,7 @@ theme.base = { IncSearch = { bg = p.highlight_med }, LineNr = { fg = p.inactive }, MatchParen = { fg = p.text, bg = p.overlay }, - -- ModeMsg = {}, + ModeMsg = { fg = p.subtle }, MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, Normal = { fg = p.text, bg = maybe_base }, @@ -102,7 +80,7 @@ theme.base = { Boolean = { fg = p.gold }, Character = { fg = p.gold }, Comment = { - fg = groups.comment, + fg = config.colors.comment, style = maybe_italic, }, Conditional = { fg = p.pine }, @@ -141,11 +119,11 @@ theme.base = { htmlArg = { fg = p.iris }, htmlBold = { fg = p.text, style = 'bold' }, 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' }, - htmlH4 = { fg = groups.headings.h4, style = 'bold' }, - htmlH5 = { fg = groups.headings.h5, style = 'bold' }, + htmlH1 = { fg = config.colors.headings.h1, style = 'bold' }, + htmlH2 = { fg = config.colors.headings.h2, style = 'bold' }, + htmlH3 = { fg = config.colors.headings.h3, style = 'bold' }, + htmlH4 = { fg = config.colors.headings.h4, style = 'bold' }, + htmlH5 = { fg = config.colors.headings.h5, style = 'bold' }, htmlItalic = { fg = p.text, style = maybe_italic }, htmlLink = { fg = p.text }, htmlTag = { fg = p.subtle }, @@ -172,59 +150,54 @@ theme.base = { -- ^ ^ typescriptParens = { bg = p.none }, - DiagnosticHint = { fg = groups.hint }, - DiagnosticInfo = { fg = groups.info }, - DiagnosticWarn = { fg = groups.warn }, - DiagnosticError = { fg = groups.error }, - - DiagnosticDefaultHint = { fg = groups.hint }, - DiagnosticDefaultInfo = { fg = groups.info }, - DiagnosticDefaultWarn = { fg = groups.warn }, - DiagnosticDefaultError = { fg = groups.error }, - - DiagnosticFloatingHint = { fg = groups.hint }, - DiagnosticFloatingInfo = { fg = groups.info }, - DiagnosticFloatingWarn = { fg = groups.warn }, - DiagnosticFloatingError = { fg = groups.error }, - - DiagnosticSignHint = { fg = groups.hint }, - DiagnosticSignInfo = { fg = groups.info }, - DiagnosticSignWarn = { fg = groups.warn }, - DiagnosticSignError = { fg = groups.error }, - - DiagnosticUnderlineHint = { style = 'undercurl', sp = groups.hint }, - DiagnosticUnderlineInfo = { style = 'undercurl', sp = groups.info }, - DiagnosticUnderlineWarn = { style = 'undercurl', sp = groups.warn }, - DiagnosticUnderlineError = { style = 'undercurl', sp = groups.error }, - - DiagnosticVirtualTextHint = { fg = groups.hint }, - DiagnosticVirtualTextInfo = { fg = groups.info }, - DiagnosticVirtualTextWarn = { fg = groups.warn }, - DiagnosticVirtualTextError = { fg = groups.error }, + DiagnosticHint = { fg = config.colors.hint }, + DiagnosticInfo = { fg = config.colors.info }, + DiagnosticWarn = { fg = config.colors.warn }, + DiagnosticError = { fg = config.colors.error }, + DiagnosticDefaultHint = { fg = config.colors.hint }, + DiagnosticDefaultInfo = { fg = config.colors.info }, + DiagnosticDefaultWarn = { fg = config.colors.warn }, + DiagnosticDefaultError = { fg = config.colors.error }, + DiagnosticFloatingHint = { fg = config.colors.hint }, + DiagnosticFloatingInfo = { fg = config.colors.info }, + DiagnosticFloatingWarn = { fg = config.colors.warn }, + DiagnosticFloatingError = { fg = config.colors.error }, + DiagnosticSignHint = { fg = config.colors.hint }, + DiagnosticSignInfo = { fg = config.colors.info }, + DiagnosticSignWarn = { fg = config.colors.warn }, + DiagnosticSignError = { fg = config.colors.error }, + DiagnosticUnderlineHint = { style = 'undercurl', sp = config.colors.hint }, + DiagnosticUnderlineInfo = { style = 'undercurl', sp = config.colors.info }, + DiagnosticUnderlineWarn = { style = 'undercurl', sp = config.colors.warn }, + DiagnosticUnderlineError = { + style = 'undercurl', + sp = config.colors.error, + }, + DiagnosticVirtualTextHint = { fg = config.colors.hint }, + DiagnosticVirtualTextInfo = { fg = config.colors.info }, + DiagnosticVirtualTextWarn = { fg = config.colors.warn }, + DiagnosticVirtualTextError = { fg = config.colors.error }, LspReferenceText = { fg = p.rose, bg = p.highlight_med }, LspReferenceRead = { fg = p.rose, bg = p.highlight_med }, LspReferenceWrite = { fg = p.rose, bg = p.highlight_med }, - --Lsp color groups for nvim 0.5.x + -- 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' }, @@ -239,42 +212,13 @@ theme.base = { RedrawDebugRecompose = { fg = '#ffffff', bg = p.love }, NvimInternalError = { fg = '#ffffff', bg = p.love }, -} -function theme.load_terminal() - -- black - vim.g.terminal_color_0 = p.overlay - vim.g.terminal_color_8 = p.subtle - -- red - vim.g.terminal_color_1 = p.love - vim.g.terminal_color_9 = p.love - -- green - vim.g.terminal_color_2 = p.pine - vim.g.terminal_color_10 = p.pine - -- yellow - vim.g.terminal_color_3 = p.gold - vim.g.terminal_color_11 = p.gold - -- blue - vim.g.terminal_color_4 = p.foam - vim.g.terminal_color_12 = p.foam - -- magenta - vim.g.terminal_color_5 = p.iris - vim.g.terminal_color_13 = p.iris - -- cyan - vim.g.terminal_color_6 = p.rose - vim.g.terminal_color_14 = p.rose - -- white - vim.g.terminal_color_7 = p.text - vim.g.terminal_color_15 = p.text -end - -theme.treesitter = { -- TSAnnotation = {}, -- TSAttribute = {}, TSBoolean = { fg = p.rose }, -- TSCharacter = {}, TSComment = { - fg = groups.comment, + fg = config.colors.comment, style = maybe_italic, }, -- TSConditional = {}, @@ -310,9 +254,9 @@ theme.treesitter = { fg = p.iris, style = maybe_italic, }, - TSPunctBracket = { fg = groups.punctuation }, - TSPunctDelimiter = { fg = groups.punctuation }, - TSPunctSpecial = { fg = groups.punctuation }, + TSPunctBracket = { fg = config.colors.punctuation }, + TSPunctDelimiter = { fg = config.colors.punctuation }, + TSPunctSpecial = { fg = config.colors.punctuation }, -- TSRepeat = {}, -- TSStrike = {}, TSString = { fg = p.gold }, @@ -332,9 +276,7 @@ theme.treesitter = { style = maybe_italic, }, TSVariableBuiltin = { fg = p.love }, -} -theme.plugins = { -- barbar.nvim -- https://github.com/romgrk/barbar.nvim BufferTabpageFill = { fg = p.base, bg = p.base }, @@ -370,14 +312,12 @@ theme.plugins = { -- nvim-tree.lua -- https://github.com/kyazdani42/nvim-tree.lua NvimTreeNormal = { fg = p.text }, - NvimTreeFileDeleted = { fg = p.love }, NvimTreeFileDirty = { fg = p.rose }, NvimTreeFileMerge = { fg = p.iris }, NvimTreeFileNew = { fg = p.foam }, NvimTreeFileRenamed = { fg = p.pine }, NvimTreeFileStaged = { fg = p.iris }, - NvimTreeEmptyFolderName = { fg = p.inactive }, NvimTreeFolderIcon = { fg = p.subtle }, NvimTreeFolderName = { fg = p.foam }, @@ -386,7 +326,6 @@ theme.plugins = { NvimTreeOpenedFolderName = { fg = p.foam }, NvimTreeRootFolder = { fg = p.iris }, NvimTreeSpecialFile = { link = 'NvimTreeNormal' }, - NvimTreeGitDeleted = { fg = p.love }, NvimTreeGitDirty = { fg = p.rose }, NvimTreeGitIgnored = { fg = p.subtle }, @@ -394,7 +333,6 @@ theme.plugins = { NvimTreeGitNew = { fg = p.foam }, NvimTreeGitRenamed = { fg = p.pine }, NvimTreeGitStaged = { fg = p.iris }, - NvimTreeWindowPicker = { fg = p.base, bg = p.iris }, -- which-key.nvim @@ -428,7 +366,10 @@ theme.plugins = { -- neogit -- https://github.com/TimUntersberger/neogit NeogitDiffAddHighlight = { fg = p.foam, bg = p.highlight_med }, - NeogitDiffDeleteHighlight = { fg = p.love, bg = p.highlight_med }, + NeogitDiffDeleteHighlight = { + fg = p.love, + bg = p.highlight_med, + }, NeogitDiffContextHighlight = { bg = p.highlight_low }, NeogitHunkHeader = { bg = p.highlight_low }, NeogitHunkHeaderHighlight = { bg = p.highlight_low }, @@ -436,16 +377,33 @@ theme.plugins = { -- VimWiki -- https://github.com/vimwiki/vimwiki VimwikiHR = { fg = p.subtle }, - VimwikiHeader1 = { fg = p.foam, style = 'bold' }, - VimwikiHeader2 = { fg = p.foam, style = 'bold' }, - VimwikiHeader3 = { fg = p.foam, style = 'bold' }, - VimwikiHeader4 = { fg = p.foam, style = 'bold' }, - VimwikiHeader5 = { fg = p.foam, style = 'bold' }, - VimwikiHeader6 = { fg = p.foam, style = 'bold' }, + VimwikiHeader1 = { fg = config.colors.headings.h1, style = 'bold' }, + VimwikiHeader2 = { fg = config.colors.headings.h2, style = 'bold' }, + VimwikiHeader3 = { fg = config.colors.headings.h3, style = 'bold' }, + VimwikiHeader4 = { fg = config.colors.headings.h4, style = 'bold' }, + VimwikiHeader5 = { fg = config.colors.headings.h5, style = 'bold' }, + VimwikiHeader6 = { fg = config.colors.headings.h6, style = 'bold' }, VimwikiHeaderChar = { fg = p.pine }, VimwikiLink = { fg = p.rose }, VimwikiList = { fg = p.iris }, VimwikiNoExistsLink = { fg = p.love }, } +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 diff --git a/lua/rose-pine/util.lua b/lua/rose-pine/util.lua deleted file mode 100644 index ba7b117..0000000 --- a/lua/rose-pine/util.lua +++ /dev/null @@ -1,63 +0,0 @@ -local util = {} - -util.highlight = function(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 hl = 'highlight ' - .. group - .. ' ' - .. style - .. ' ' - .. fg - .. ' ' - .. bg - .. ' ' - .. sp - - vim.cmd(hl) - if color.link then - vim.cmd('highlight! link ' .. group .. ' ' .. color.link) - end -end - -function util.load() - if vim.g.colors_name then - vim.cmd('hi clear') - end - - vim.o.termguicolors = true - vim.g.colors_name = 'rose-pine' - - if vim.o.background == 'light' and vim.g.rose_pine_variant == nil then - vim.g.rose_pine_variant = 'dawn' - elseif - vim.g.rose_pine_variant == 'dawn' - or vim.g.rose_pine_variant == 'rose-pine-dawn' - then - vim.o.background = 'light' - end - - local theme = require('rose-pine.theme') - - theme.load_terminal() - - for group, colors in pairs(theme.base) do - util.highlight(group, colors) - end - - for group, colors in pairs(theme.treesitter) do - util.highlight(group, colors) - end - - for group, colors in pairs(theme.plugins) do - util.highlight(group, colors) - end - - -- Load galaxyline theme - require("rose-pine.galaxyline.theme") -end - -return util diff --git a/readme.md b/readme.md index 490c6e9..4434eef 100644 --- a/readme.md +++ b/readme.md @@ -69,49 +69,36 @@ use({ ## Options -> Options should be set before colorscheme - -### Interface +> Options should be set **before** colorscheme ```lua --- Set variant --- Defaults to 'dawn' if vim background is light --- @usage 'base' | 'moon' | 'dawn' | 'rose-pine[-moon][-dawn]' -vim.g.rose_pine_variant = 'base' +-- Set theme variant +-- Matches terminal theme if unset +-- @usage 'main' | 'moon' | 'dawn' +vim.g.rose_pine_variant = 'dawn' --- Disable italics +vim.g.rose_pine_bold_vertical_split_line = true +vim.g.rose_pine_disable_background = false vim.g.rose_pine_disable_italics = false --- Use terminal background -vim.g.rose_pine_disable_background = false - --- Use bold vertical split line -vim.g.rose_pine_bold_vertical_split_line = true -``` - -### Custom colours - -```lua +local p = require('rose-pine.palette') vim.g.rose_pine_colors = { - punctuation = '#fa8072', - comment = '#ffffff', - hint = '#9745be', - info = '#78ccc5', - warn = '#f5c359', - error = '#c75c6a', - headings = { - h1 = '#999999', - h2 = '#888888', - h3 = '#777777', - h4 = '#666666', - h5 = '#555555', - } + punctuation = p.subtle, + comment = p.subtle, + hint = p.iris, + info = p.foam, + warn = p.gold, + error = p.love, + headings = { + h1 = p.foam, + h2 = p.foam, + h3 = p.foam, + h4 = p.foam, + h5 = p.foam, + h6 = p.foam, + }, } -``` -Be sure to set the colorscheme _after_ options - -```lua -- Set colorscheme after options vim.cmd('colorscheme rose-pine') ``` @@ -119,26 +106,28 @@ vim.cmd('colorscheme rose-pine') ## Functions ```lua --- Toggle between the three variants -require('rose-pine.functions').toggle_variant() +-- Toggle between all variants +require('rose-pine').toggle() --- Toggle between base and dawn -require('rose-pine.functions').toggle_variant({'base', 'dawn'}) +-- Toggle between some variants +require('rose-pine').toggle({'main', 'dawn'}) --- Switch to specified variant -require('rose-pine.functions').select_variant('moon') +-- Set specific variant +require('rose-pine').set('moon') ``` ## Keymaps -```lua --- Toggle variant -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').toggle_variant()]], { noremap = true, silent = true }) +> These are only suggestions; no keymaps are set by the theme --- Select each variant -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').select_variant('dawn')]], { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').select_variant('moon')]], { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine.functions').select_variant('base')]], { noremap = true, silent = true }) +```lua +-- Toggle variants +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').toggle()]], { noremap = true, silent = true }) + +-- Set variant +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').set('main')]], { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').set('moon')]], { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', [[lua require('rose-pine').set('dawn')]], { noremap = true, silent = true }) ``` ## Contributing From 81dc77e3c1310487bf4727f03731bdf5869c4c48 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:39:40 -0600 Subject: [PATCH 17/29] Revert "Remove background for popups (#38)" This reverts commit 19fcb371dcaa3feb4f4265a32a78a056a279ab5f. --- lua/rose-pine/theme.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 2e33579..8997c81 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -48,8 +48,8 @@ local theme = { MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, Normal = { fg = p.text, bg = maybe_base }, - NormalFloat = { fg = p.subtle }, - Pmenu = { fg = p.subtle }, + NormalFloat = { fg = p.text, bg = p.surface }, + Pmenu = { fg = p.subtle, bg = p.surface }, PmenuSbar = { bg = p.overlay }, PmenuSel = { fg = p.text, bg = p.overlay }, PmenuThumb = { bg = p.inactive }, @@ -351,7 +351,6 @@ local theme = { -- nvim-cmp -- https://github.com/hrsh7th/nvim-cmp CmpItemKind = { fg = p.iris }, - CmpItemMenu = { fg = p.subtle }, CmpItemAbbr = { fg = p.subtle }, CmpItemAbbrMatch = { fg = p.text, style = 'bold' }, CmpItemAbbrMatchFuzzy = { fg = p.text, style = 'bold' }, From 279df9ff18228064c958c5fe03d40b3c4cd8eab0 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:45:02 -0600 Subject: [PATCH 18/29] docs: update variant name --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 4434eef..40772a9 100644 --- a/readme.md +++ b/readme.md @@ -19,7 +19,7 @@ use({ as = 'rose-pine', config = function() -- Options (see available options below) - vim.g.rose_pine_variant = 'base' + vim.g.rose_pine_variant = 'main' -- Load colorscheme after options vim.cmd('colorscheme rose-pine') From 7b3678a17c1f79a332fe785354781c0974351591 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:45:20 -0600 Subject: [PATCH 19/29] feat: add `vim.g.rose_pine_disable_float_background` option --- lua/rose-pine/config.lua | 1 + lua/rose-pine/theme.lua | 9 +++++++-- readme.md | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua index 668ade7..e7bde86 100644 --- a/lua/rose-pine/config.lua +++ b/lua/rose-pine/config.lua @@ -3,6 +3,7 @@ local palette = require('rose-pine.palette') local config = { bold_vert_split = vim.g.rose_pine_bold_verical_split_line or false, no_background = vim.g.rose_pine_disable_background or false, + no_float_background = vim.g.rose_pine_disable_float_background or false, no_italics = vim.g.rose_pine_disable_italics or false, colors = { punctuation = palette.subtle, diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 8997c81..9601e94 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -3,6 +3,7 @@ local p = require('rose-pine.palette') -- TODO: Refactor `maybe` logic local maybe_base = p.base +local maybe_surface = p.surface local maybe_italic = 'italic' local maybe_bold_vert_split = { fg = p.overlay } @@ -14,6 +15,10 @@ if config.no_background then maybe_base = p.none end +if config.no_float_background then + maybe_surface = p.none +end + if config.no_italics then maybe_italic = nil end @@ -48,8 +53,8 @@ local theme = { MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, Normal = { fg = p.text, bg = maybe_base }, - NormalFloat = { fg = p.text, bg = p.surface }, - Pmenu = { fg = p.subtle, bg = p.surface }, + NormalFloat = { fg = p.text, bg = maybe_surface }, + Pmenu = { fg = p.subtle, bg = maybe_surface }, PmenuSbar = { bg = p.overlay }, PmenuSel = { fg = p.text, bg = p.overlay }, PmenuThumb = { bg = p.inactive }, diff --git a/readme.md b/readme.md index 40772a9..60556bf 100644 --- a/readme.md +++ b/readme.md @@ -79,6 +79,7 @@ vim.g.rose_pine_variant = 'dawn' vim.g.rose_pine_bold_vertical_split_line = true vim.g.rose_pine_disable_background = false +vim.g.rose_pine_disable_float_background = false vim.g.rose_pine_disable_italics = false local p = require('rose-pine.palette') From 4b63d8d0e5438c8000d94efd559a034e707053f1 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 09:57:52 -0600 Subject: [PATCH 20/29] feat: add `vim.g.rose_pine_inactive_background` closes #39 --- lua/rose-pine/config.lua | 1 + lua/rose-pine/theme.lua | 22 ++++++++++++++-------- readme.md | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua index e7bde86..3726b4b 100644 --- a/lua/rose-pine/config.lua +++ b/lua/rose-pine/config.lua @@ -2,6 +2,7 @@ local palette = require('rose-pine.palette') local config = { bold_vert_split = vim.g.rose_pine_bold_verical_split_line or false, + inactive_background = vim.g.rose_pine_inactive_background or false, no_background = vim.g.rose_pine_disable_background or false, no_float_background = vim.g.rose_pine_disable_float_background or false, no_italics = vim.g.rose_pine_disable_italics or false, diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 9601e94..45dff64 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -2,8 +2,9 @@ local config = require('rose-pine.config') local p = require('rose-pine.palette') -- TODO: Refactor `maybe` logic -local maybe_base = p.base -local maybe_surface = p.surface +local maybe_inactive_background = p.none +local maybe_background = p.base +local maybe_float_background = p.surface local maybe_italic = 'italic' local maybe_bold_vert_split = { fg = p.overlay } @@ -11,12 +12,16 @@ if config.bold_vert_split then maybe_bold_vert_split = { fg = p.surface, bg = p.surface } end +if config.inactive_background then + maybe_inactive_background = p.surface +end + if config.no_background then - maybe_base = p.none + maybe_background = p.none end if config.no_float_background then - maybe_surface = p.none + maybe_float_background = p.none end if config.no_italics then @@ -52,9 +57,10 @@ local theme = { ModeMsg = { fg = p.subtle }, MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, - Normal = { fg = p.text, bg = maybe_base }, - NormalFloat = { fg = p.text, bg = maybe_surface }, - Pmenu = { fg = p.subtle, bg = maybe_surface }, + Normal = { fg = p.text, bg = maybe_background }, + NormalNC = { fg = p.text, bg = maybe_inactive_background }, + NormalFloat = { fg = p.text, bg = maybe_float_background }, + Pmenu = { fg = p.subtle, bg = maybe_float_background }, PmenuSbar = { bg = p.overlay }, PmenuSel = { fg = p.text, bg = p.overlay }, PmenuThumb = { bg = p.inactive }, @@ -66,7 +72,7 @@ local theme = { SpellCap = { style = 'undercurl', sp = p.subtle }, SpellLocal = { style = 'undercurl', sp = p.subtle }, SpellRare = { style = 'undercurl', sp = p.subtle }, - SignColumn = { fg = p.text, bg = maybe_base }, + SignColumn = { fg = p.text, bg = maybe_background }, StatusLine = { fg = p.text, bg = p.surface }, StatusLineNC = { fg = p.subtle, bg = p.surface }, -- StatusLineTerm = {}, diff --git a/readme.md b/readme.md index 60556bf..73da318 100644 --- a/readme.md +++ b/readme.md @@ -78,6 +78,7 @@ use({ vim.g.rose_pine_variant = 'dawn' vim.g.rose_pine_bold_vertical_split_line = true +vim.g.rose_pine_inactive_background = false vim.g.rose_pine_disable_background = false vim.g.rose_pine_disable_float_background = false vim.g.rose_pine_disable_italics = false From a580fd95aa917bfc6957af17976fa9046299c5d8 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 11:00:45 -0600 Subject: [PATCH 21/29] docs: encourage tagged releases --- readme.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 73da318..8d59f6e 100644 --- a/readme.md +++ b/readme.md @@ -17,11 +17,8 @@ use({ 'rose-pine/neovim', as = 'rose-pine', + tag = 'v0.1.0', -- Optional tag release config = function() - -- Options (see available options below) - vim.g.rose_pine_variant = 'main' - - -- Load colorscheme after options vim.cmd('colorscheme rose-pine') end }) From f19ee5d710aaa63a106993ba4efbe743cf4ca738 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 14:43:58 -0600 Subject: [PATCH 22/29] chore: update headings --- lua/rose-pine/config.lua | 8 ++++---- readme.md | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua index 3726b4b..3418757 100644 --- a/lua/rose-pine/config.lua +++ b/lua/rose-pine/config.lua @@ -23,11 +23,11 @@ local config = { ---@type string|table headings = { - h1 = palette.foam, + h1 = palette.iris, h2 = palette.foam, - h3 = palette.foam, - h4 = palette.foam, - h5 = palette.foam, + h3 = palette.rose, + h4 = palette.gold, + h5 = palette.pine, h6 = palette.foam, }, }, diff --git a/readme.md b/readme.md index 8d59f6e..caec84c 100644 --- a/readme.md +++ b/readme.md @@ -88,12 +88,13 @@ vim.g.rose_pine_colors = { info = p.foam, warn = p.gold, error = p.love, + -- Or set all headings to one colour: `headings = p.text` headings = { - h1 = p.foam, + h1 = p.iris, h2 = p.foam, - h3 = p.foam, - h4 = p.foam, - h5 = p.foam, + h3 = p.rose, + h4 = p.gold, + h5 = p.pine, h6 = p.foam, }, } From 5329dbb5d0e1681520a06963a4cae1aad3544c05 Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 14:44:21 -0600 Subject: [PATCH 23/29] feat: add `vim.g.rose_pine_colors.heading_prefix` --- lua/rose-pine/config.lua | 1 + lua/rose-pine/theme.lua | 2 +- readme.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua index 3418757..3f135f4 100644 --- a/lua/rose-pine/config.lua +++ b/lua/rose-pine/config.lua @@ -21,6 +21,7 @@ local config = { -- ['function'] = '', -- method = '', + heading_prefix = palette.subtle, ---@type string|table headings = { h1 = palette.iris, diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 45dff64..4b440b0 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -98,7 +98,7 @@ local theme = { Constant = { fg = p.gold }, Debug = { fg = p.rose }, Define = { fg = p.iris }, - Delimiter = { fg = p.rose }, + Delimiter = { fg = config.colors.heading_prefix }, Error = { fg = p.love }, Exception = { fg = p.pine }, Float = { fg = p.gold }, diff --git a/readme.md b/readme.md index caec84c..dec5fee 100644 --- a/readme.md +++ b/readme.md @@ -88,6 +88,7 @@ vim.g.rose_pine_colors = { info = p.foam, warn = p.gold, error = p.love, + heading_prefix = p.subtle -- Or set all headings to one colour: `headings = p.text` headings = { h1 = p.iris, From 587d0ba26f2cd27bd4af68391b543e984ae296ea Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 15:02:46 -0600 Subject: [PATCH 24/29] chore!: match heading prefix to text --- lua/rose-pine/config.lua | 1 - lua/rose-pine/theme.lua | 15 ++++++++++++++- readme.md | 2 +- test.md | 11 +++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 test.md diff --git a/lua/rose-pine/config.lua b/lua/rose-pine/config.lua index 3f135f4..3418757 100644 --- a/lua/rose-pine/config.lua +++ b/lua/rose-pine/config.lua @@ -21,7 +21,6 @@ local config = { -- ['function'] = '', -- method = '', - heading_prefix = palette.subtle, ---@type string|table headings = { h1 = palette.iris, diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 4b440b0..f58c3d4 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -98,7 +98,7 @@ local theme = { Constant = { fg = p.gold }, Debug = { fg = p.rose }, Define = { fg = p.iris }, - Delimiter = { fg = config.colors.heading_prefix }, + Delimiter = { fg = p.subtle }, Error = { fg = p.love }, Exception = { fg = p.pine }, Float = { fg = p.gold }, @@ -141,6 +141,19 @@ local theme = { htmlTagN = { fg = p.text }, htmlTagName = { fg = p.foam }, + markdownH1 = { fg = config.colors.headings.h1, style = 'bold' }, + markdownH1Delimiter = { fg = config.colors.headings.h1 }, + markdownH2 = { fg = config.colors.headings.h2, style = 'bold' }, + markdownH2Delimiter = { fg = config.colors.headings.h2 }, + markdownH3 = { fg = config.colors.headings.h3, style = 'bold' }, + markdownH3Delimiter = { fg = config.colors.headings.h3 }, + markdownH4 = { fg = config.colors.headings.h4, style = 'bold' }, + markdownH4Delimiter = { fg = config.colors.headings.h4 }, + markdownH5 = { fg = config.colors.headings.h5, style = 'bold' }, + markdownH5Delimiter = { fg = config.colors.headings.h5 }, + markdownH6 = { fg = config.colors.headings.h6, style = 'bold' }, + markdownH6Delimiter = { fg = config.colors.headings.h6 }, + markdownDelimiter = { fg = p.subtle }, markdownLinkText = { fg = p.iris, style = 'underline' }, markdownUrl = { fg = p.iris, style = 'underline' }, mkdCode = { fg = p.foam, style = maybe_italic }, diff --git a/readme.md b/readme.md index dec5fee..8264c0d 100644 --- a/readme.md +++ b/readme.md @@ -88,7 +88,7 @@ vim.g.rose_pine_colors = { info = p.foam, warn = p.gold, error = p.love, - heading_prefix = p.subtle + -- Or set all headings to one colour: `headings = p.text` headings = { h1 = p.iris, diff --git a/test.md b/test.md new file mode 100644 index 0000000..e303d2e --- /dev/null +++ b/test.md @@ -0,0 +1,11 @@ +# Test + +## Test + +### Test + +#### Test + +##### Test + +###### Test From 33f244fa4b7cf438b7f98c4f2004343c376cf4b2 Mon Sep 17 00:00:00 2001 From: not Date: Fri, 3 Dec 2021 15:03:47 -0600 Subject: [PATCH 25/29] docs: format --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 8264c0d..ece397d 100644 --- a/readme.md +++ b/readme.md @@ -17,7 +17,7 @@ use({ 'rose-pine/neovim', as = 'rose-pine', - tag = 'v0.1.0', -- Optional tag release + tag = 'v0.1.0', -- Optional tag release config = function() vim.cmd('colorscheme rose-pine') end From dcd9846ef63397666ba8a703cacaabe942b8266c Mon Sep 17 00:00:00 2001 From: not Date: Fri, 3 Dec 2021 15:04:41 -0600 Subject: [PATCH 26/29] docs: use default config as example --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index ece397d..9d2942e 100644 --- a/readme.md +++ b/readme.md @@ -72,9 +72,9 @@ use({ -- Set theme variant -- Matches terminal theme if unset -- @usage 'main' | 'moon' | 'dawn' -vim.g.rose_pine_variant = 'dawn' +vim.g.rose_pine_variant = '' -vim.g.rose_pine_bold_vertical_split_line = true +vim.g.rose_pine_bold_vertical_split_line = false vim.g.rose_pine_inactive_background = false vim.g.rose_pine_disable_background = false vim.g.rose_pine_disable_float_background = false From 6fe2a605caabc05b98a7f5f235f864f87594cc2a Mon Sep 17 00:00:00 2001 From: mvllow Date: Fri, 3 Dec 2021 15:10:01 -0600 Subject: [PATCH 27/29] chore: remove markdown test --- test.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test.md diff --git a/test.md b/test.md deleted file mode 100644 index e303d2e..0000000 --- a/test.md +++ /dev/null @@ -1,11 +0,0 @@ -# Test - -## Test - -### Test - -#### Test - -##### Test - -###### Test From b4bb4d0574549a8dd806fef41360e89368b86878 Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 8 Dec 2021 11:51:26 -0600 Subject: [PATCH 28/29] fix: matching parenthesis contrast closes #47 --- 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 f58c3d4..53db8b2 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -53,7 +53,7 @@ local theme = { Folded = { fg = p.text, bg = p.surface }, IncSearch = { bg = p.highlight_med }, LineNr = { fg = p.inactive }, - MatchParen = { fg = p.text, bg = p.overlay }, + MatchParen = { fg = p.text, bg = p.highlight_med }, ModeMsg = { fg = p.subtle }, MoreMsg = { fg = p.iris }, NonText = { fg = p.inactive }, From a95bf37486b9f8f82a8ed07eec05ba09e257b23b Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 14 Dec 2021 20:26:36 +0100 Subject: [PATCH 29/29] fix: match Markdown headings for TS plugin (#49) --- 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 53db8b2..5971211 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -290,7 +290,7 @@ local theme = { TSTag = { fg = p.foam }, TSTagDelimiter = { fg = p.subtle }, TSText = { fg = p.text }, - -- TSTitle = {}, + TSTitle = { fg = config.colors.headings.h1, style = 'bold' }, -- TSType = {}, -- TSTypeBuiltin = {}, TSURI = { fg = p.gold },