Compare commits

..

No commits in common. "main" and "v1.0.0" have entirely different histories.

27 changed files with 851 additions and 2173 deletions

View file

@ -1,12 +0,0 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
[*.{yaml,yml}]
indent_size = 2
indent_style = space

View file

@ -1,54 +0,0 @@
name: Bug Report
description: File a bug/issue
title: "bug: "
labels: [bug]
body:
- type: markdown
attributes:
value: |
**Before** reporting an issue, make sure to read the [documentation](https://github.com/rose-pine/neovim) and search [existing issues](https://github.com/rose-pine/neovim/issues). Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/rose-pine/neovim/discussions) and will be closed.
- type: input
attributes:
label: "Neovim version (nvim -v)"
placeholder: "0.8.0 commit db1b0ee3b30f"
validations:
required: true
- type: input
attributes:
label: "Terminal / multiplexer"
placeholder: "Kitty / tmux"
validations:
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. Please include screenshots if possible and any related errors you see in Neovim.
validations:
required: true
- type: textarea
attributes:
label: Repro
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
value: |
vim.o.packpath = "/tmp/nvim/site"
local plugins = {
rose_pine = "https://github.com/rose-pine/neovim",
-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
}
for name, url in pairs(plugins) do
local install_path = "/tmp/nvim/site/pack/test/start/" .. name
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
end
end
require("rose-pine").setup({
-- ADD ROSÉ PINE CONFIG THAT IS _NECESSARY_ TO REPRODUCE THE ISSUE
})
vim.cmd("colorscheme rose-pine")
render: Lua
validations:
required: false

View file

@ -1,17 +0,0 @@
name: Feature Request
description: Suggest a new feature
title: "feature: "
labels: [enhancement]
body:
- type: textarea
validations:
required: true
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
- type: textarea
validations:
required: false
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.

6
.stylua.toml Normal file
View file

@ -0,0 +1,6 @@
column_width = 100
indent_type = "Tabs"
indent_width = 3
line_endings = "Unix"
quote_style = "AutoPreferSingle"

View file

@ -1,82 +0,0 @@
# Changelog
## v2.0.0-next.1
### What's new
- Add proper support for `StatusLineTerm` & `StatusLineTermNC`, controlled via `enable.terminal`
- Add background glow to diagnostic virtual text
- Add `extend_background_behind_borders`
- Add `styles.bold` and alternatively styling when disabled
- Add `before_highlight` hook to allow changing palette values and behaviours
- Increase contrast of search, visual selections, and more
### Features
**extend_background_behind_borders**
Extend float backgrounds behind borders. Results vary depending on your border characters.
```lua
{
extend_background_behind_borders = true
}
```
**styles.transparency**
Enable a unique experience focused around transparent terminals, avoiding large backgrounds and differentiating selections with foreground colours when possible.
```lua
{
styles = {
transparency = true
}
}
```
**before_highlight**
```lua
{
before_highlight = function(group, highlight, palette)
-- Disable all undercurls
if highlight.undercurl then
highlight.undercurl = false
end
-- Change palette colour
if highlight.fg == palette.pine then
highlight.fg = palette.foam
end
end,
}
```
### Breaking changes
> [!WARNING]
> Removed or renamed options should continue to work via internal migrations but backwards compatibility is not tested and may break at any time.
```diff
- dim_nc_background = true,
+ dim_inactive_windows = true,
- disable_background = true,
- disable_float_background = true,
+ styles.transparency = true
- disable_italics = true,
+ styles.italic = false,
- groups = {
- background = "...",
- comment = "...",
- punctuation = "...",
- },
+ highlight_groups = {
+ Normal = { bg = "..." },
+ Comment = { fg = "..." },
+ ["@punctuation"] = { fg = "..." },
+ }
```

View file

@ -1,2 +0,0 @@
package.loaded["rose-pine.palette"] = nil
require("rose-pine").colorscheme("dawn")

View file

@ -1,2 +0,0 @@
package.loaded["rose-pine.palette"] = nil
require("rose-pine").colorscheme("main")

View file

@ -1,2 +0,0 @@
package.loaded["rose-pine.palette"] = nil
require("rose-pine").colorscheme("moon")

View file

@ -1,2 +0,0 @@
package.loaded["rose-pine.palette"] = nil
require("rose-pine").colorscheme()

3
colors/rose-pine.vim Normal file
View file

@ -0,0 +1,3 @@
lua package.loaded['rose-pine.palette'] = nil
lua require('rose-pine').colorscheme()

21
license
View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2023 Rosé Pine
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,32 +1,26 @@
local p = require("rose-pine.palette")
local config = require("rose-pine.config")
local bg_base = p.base
if config.options.styles.transparency then
bg_base = "NONE"
end
local p = require('rose-pine.palette')
return {
normal = {
a = { bg = p.surface, fg = p.rose, gui = "bold" },
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" },
c = { bg = p.surface, fg = p.subtle, gui = 'italic' },
},
insert = {
a = { bg = p.surface, fg = p.foam, gui = "bold" },
a = { bg = p.surface, fg = p.foam, gui = 'bold' },
},
visual = {
a = { bg = p.surface, fg = p.iris, gui = "bold" },
a = { bg = p.surface, fg = p.iris, gui = 'bold' },
},
replace = {
a = { bg = p.surface, fg = p.pine, gui = "bold" },
a = { bg = p.surface, fg = p.pine, gui = 'bold' },
},
command = {
a = { bg = p.surface, fg = p.love, gui = "bold" },
a = { bg = p.surface, fg = p.love, gui = 'bold' },
},
inactive = {
a = { bg = bg_base, fg = p.subtle, gui = "bold" },
b = { bg = bg_base, fg = p.subtle },
c = { bg = bg_base, fg = p.subtle, gui = "italic" },
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' },
},
}

View file

@ -1,40 +1,34 @@
local p = require("rose-pine.palette")
local config = require("rose-pine.config")
local bg_base = p.surface
if config.options.styles.transparency then
bg_base = "NONE"
end
local p = require('rose-pine.palette')
return {
normal = {
a = { bg = p.rose, fg = p.base, gui = "bold" },
a = { bg = p.rose, fg = p.base, gui = 'bold' },
b = { bg = p.overlay, fg = p.rose },
c = { bg = bg_base, fg = p.text },
c = { bg = p.base, fg = p.text },
},
insert = {
a = { bg = p.foam, fg = p.base, gui = "bold" },
a = { bg = p.foam, fg = p.base, gui = 'bold' },
b = { bg = p.overlay, fg = p.foam },
c = { bg = bg_base, fg = p.text },
c = { bg = p.base, fg = p.text },
},
visual = {
a = { bg = p.iris, fg = p.base, gui = "bold" },
a = { bg = p.iris, fg = p.base, gui = 'bold' },
b = { bg = p.overlay, fg = p.iris },
c = { bg = bg_base, fg = p.text },
c = { bg = p.base, fg = p.text },
},
replace = {
a = { bg = p.pine, fg = p.base, gui = "bold" },
a = { bg = p.pine, fg = p.base, gui = 'bold' },
b = { bg = p.overlay, fg = p.pine },
c = { bg = bg_base, fg = p.text },
c = { bg = p.base, fg = p.text },
},
command = {
a = { bg = p.love, fg = p.base, gui = "bold" },
a = { bg = p.love, fg = p.base, gui = 'bold' },
b = { bg = p.overlay, fg = p.love },
c = { bg = bg_base, fg = p.text },
c = { bg = p.base, fg = p.text },
},
inactive = {
a = { bg = bg_base, fg = p.muted, gui = "bold" },
b = { bg = bg_base, fg = p.muted },
c = { bg = bg_base, fg = p.muted },
a = { bg = p.base, fg = p.muted, gui = 'bold' },
b = { bg = p.base, fg = p.muted },
c = { bg = p.base, fg = p.muted },
},
}

File diff suppressed because it is too large Load diff

View file

@ -1,176 +0,0 @@
---@alias Variant "main" | "moon" | "dawn"
---@alias Palette { base: string, surface: string, overlay: string, muted: string, subtle: string, text: string, love: string, gold: string, rose: string, pine: string, foam: string, iris: string }
---@alias PaletteColor "base" | "surface" | "overlay" | "muted" | "subtle" | "text" | "love" | "gold" | "rose" | "pine" | "foam" | "iris" | "highlight_low" | "highlight_med" | "highlight_high"
---@alias Highlight { link: string, inherit: boolean } | { fg: string, bg: string, sp: string, bold: boolean, italic: boolean, undercurl: boolean, underline: boolean, underdouble: boolean, underdotted: boolean, underdashed: boolean, strikethrough: boolean, inherit: boolean }
local config = {}
---@class Options
config.options = {
---Set the desired variant: "auto" will follow the vim background,
---defaulting to `dark_variant` or "main" for dark and "dawn" for light.
---@type "auto" | Variant
variant = "auto",
---Set the desired dark variant when `options.variant` is set to "auto".
---@type Variant
dark_variant = "main",
---Differentiate between active and inactive windows and panels.
dim_inactive_windows = false,
---Extend background behind borders. Appearance differs based on which
---border characters you are using.
extend_background_behind_borders = true,
enable = {
legacy_highlights = true,
migrations = true,
terminal = true,
},
styles = {
bold = true,
italic = true,
transparency = false,
},
---@type table<string, table<string, string>>
palette = {},
---@type table<string, string | PaletteColor>
groups = {
border = "muted",
link = "iris",
panel = "surface",
error = "love",
hint = "iris",
info = "foam",
ok = "leaf",
warn = "gold",
note = "pine",
todo = "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",
git_untracked = "subtle",
---@type string | PaletteColor
h1 = "iris",
h2 = "foam",
h3 = "rose",
h4 = "gold",
h5 = "pine",
h6 = "leaf",
---@deprecated Replaced by `options.highlight_groups["Normal"]`
-- background = "base",
---@deprecated Replaced by `options.highlight_groups["Comment"]`
-- comment = "subtle",
---@deprecated Replaced by `options.highlight_groups["@punctuation"]`
-- punctuation = "muted",
---@deprecated Expects a table with values h1...h6
-- headings = "text",
},
---@type table<string, Highlight>
highlight_groups = {},
---Called before each highlight group, before setting the highlight.
---@param group string
---@param highlight Highlight
---@param palette Palette
---@diagnostic disable-next-line: unused-local
before_highlight = function(group, highlight, palette) end,
---@deprecated Replaced by `options.dim_inactive_windows`
-- dim_nc_background = false,
---@deprecated Replaced by `options.enable.transparency`
-- disable_background = false,
---@deprecated Replaced by `options.highlight_groups["NormalFloat"]`
-- disable_float_background = false,
---@deprecated Replaced by `options.styles.italic`
-- disable_italics = false,
---@deprecated Replaced by `options.highlight_groups`
-- bold_vert_split = false
}
local function migrate(options)
if options.bold_vert_split then
local border = options.groups.border or "muted"
options.highlight_groups["VertSplit"] = { fg = border, bg = border }
options.highlight_groups["WinSeparator"] = { fg = border, bg = border }
end
if options.disable_background then
options.highlight_groups["Normal"] = { bg = "NONE" }
end
if options.disable_float_background then
options.highlight_groups["NormalFloat"] = { bg = "NONE" }
end
options.dim_inactive_windows = options.dim_nc_background or options.dim_inactive_windows
if options.groups.background ~= nil then
options.highlight_groups["Normal"] = { bg = options.groups.background }
end
if options.groups.comment ~= nil then
options.highlight_groups["Comment"] = { fg = options.groups.comment }
end
if options.groups.punctuation ~= nil then
options.highlight_groups["@punctuation"] = { fg = options.groups.punctuation }
end
options.styles.transparency = (options.disable_background and options.disable_float_background)
or options.styles.transparency
-- These never actually existed, but may be set intuitively by the user
-- because of `disable_italics` existing.
options.styles.bold = not (options.disable_bold or options.disable_bolds) and options.styles.bold or false
-- Similar to bold options, `disable_italic` never existed but could be a
-- common typo of the actual `disable_italics`.
options.styles.italic = not (options.disable_italic or options.disable_italics) and options.styles.italic or false
-- Set h1 through h6 to the same color if only one is specified
if type(options.groups.headings) == "string" then
options.groups.h1 = options.groups.headings
options.groups.h2 = options.groups.headings
options.groups.h3 = options.groups.headings
options.groups.h4 = options.groups.headings
options.groups.h5 = options.groups.headings
options.groups.h6 = options.groups.headings
elseif options.groups.headings == "table" then
options.groups.h1 = options.groups.headings.h1 or options.groups.h1
options.groups.h2 = options.groups.headings.h2 or options.groups.h2
options.groups.h3 = options.groups.headings.h3 or options.groups.h3
options.groups.h4 = options.groups.headings.h4 or options.groups.h4
options.groups.h5 = options.groups.headings.h5 or options.groups.h5
options.groups.h6 = options.groups.headings.h6 or options.groups.h6
end
options.groups.headings = nil
return options
end
---@param options Options | nil
function config.extend_options(options)
config.options = vim.tbl_deep_extend("force", config.options, options or {})
if config.options.enable.migrations then
config.options = migrate(config.options)
end
end
return config

View file

@ -0,0 +1,19 @@
local present, galaxyline_colors = pcall(require, 'galaxyline.themes.colors')
if not present then
return
end
local p = require('rose-pine.palette')
galaxyline_colors['rose-pine'] = {
bg = p.overlay,
fg = p.text,
fg_alt = p.subtle,
blue = p.foam,
cyan = p.foam,
green = p.muted,
magenta = p.iris,
orange = p.rose,
red = p.love,
yellow = p.gold,
}

203
lua/rose-pine/init.lua Normal file
View file

@ -0,0 +1,203 @@
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_<option> moved to lua setup:')
print(prefix .. " require('rose-pine').setup({ ... })")
for _, message in ipairs(alerts) do
print(prefix .. message)
end
should_alert = false
end
end
---@class RosePineConfig
---@field bold_vert_split boolean
---@field dark_variant 'main'|'moon'
---@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 = {
bold_vert_split = false,
dark_variant = 'main',
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.dark_variant or 'main'
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
config.user_variant = opts.dark_variant or nil
config = vim.tbl_deep_extend('force', config, opts)
end
function M.colorscheme()
if vim.g.colors_name then
vim.cmd('hi clear')
end
vim.opt.termguicolors = true
vim.g.colors_name = 'rose-pine'
if show_init_messages then
check_for_deprecated_opts()
show_init_messages = false
end
---@param color string
local function get_palette_color(color)
local p = require('rose-pine.palette')
if color and not color:find('#') then
return p[color:lower()]
end
return color:lower()
end
---@param group string
---@param color table<string, string>
local function highlight(group, color)
local style = color.style and 'gui=' .. color.style or 'gui=NONE'
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
vim.cmd(hl)
if color.link then
vim.cmd('highlight! link ' .. group .. ' ' .. color.link)
end
end
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
return M

View file

@ -1,78 +1,68 @@
local options = require("rose-pine.config").options
local variants = {
main = {
_nc = "#16141f",
base = "#191724",
surface = "#1f1d2e",
overlay = "#26233a",
muted = "#6e6a86",
subtle = "#908caa",
text = "#e0def4",
love = "#eb6f92",
gold = "#f6c177",
rose = "#ebbcba",
pine = "#31748f",
foam = "#9ccfd8",
iris = "#c4a7e7",
leaf = "#95b1ac",
highlight_low = "#21202e",
highlight_med = "#403d52",
highlight_high = "#524f67",
none = "NONE",
base = '#191724',
surface = '#1f1d2e',
overlay = '#26233a',
muted = '#6e6a86',
subtle = '#908caa',
text = '#e0def4',
love = '#eb6f92',
gold = '#f6c177',
rose = '#ebbcba',
pine = '#31748f',
foam = '#9ccfd8',
iris = '#c4a7e7',
highlight_low = '#21202e',
highlight_med = '#403d52',
highlight_high = '#524f67',
opacity = 0.1,
},
moon = {
_nc = "#1f1d30",
base = "#232136",
surface = "#2a273f",
overlay = "#393552",
muted = "#6e6a86",
subtle = "#908caa",
text = "#e0def4",
love = "#eb6f92",
gold = "#f6c177",
rose = "#ea9a97",
pine = "#3e8fb0",
foam = "#9ccfd8",
iris = "#c4a7e7",
leaf = "#95b1ac",
highlight_low = "#2a283e",
highlight_med = "#44415a",
highlight_high = "#56526e",
none = "NONE",
base = '#232136',
surface = '#2a273f',
overlay = '#393552',
muted = '#6e6a86',
subtle = '#908caa',
text = '#e0def4',
love = '#eb6f92',
gold = '#f6c177',
rose = '#ea9a97',
pine = '#3e8fb0',
foam = '#9ccfd8',
iris = '#c4a7e7',
highlight_low = '#2a283e',
highlight_med = '#44415a',
highlight_high = '#56526e',
opacity = 0.1,
},
dawn = {
_nc = "#f8f0e7",
base = "#faf4ed",
surface = "#fffaf3",
overlay = "#f2e9e1",
muted = "#9893a5",
subtle = "#797593",
text = "#464261",
love = "#b4637a",
gold = "#ea9d34",
rose = "#d7827e",
pine = "#286983",
foam = "#56949f",
iris = "#907aa9",
leaf = "#6d8f89",
highlight_low = "#f4ede8",
highlight_med = "#dfdad9",
highlight_high = "#cecacd",
none = "NONE",
base = '#faf4ed',
surface = '#fffaf3',
overlay = '#f2e9e1',
muted = '#9893a5',
subtle = '#797593',
text = '#575279',
love = '#b4637a',
gold = '#ea9d34',
rose = '#d7827e',
pine = '#286983',
foam = '#56949f',
iris = '#907aa9',
highlight_low = '#f4ede8',
highlight_med = '#dfdad9',
highlight_high = '#cecacd',
opacity = 0.05,
},
}
if options.palette ~= nil and next(options.palette) then
-- handle variant specific overrides
for variant_name, override_palette in pairs(options.palette) do
if variants[variant_name] then
variants[variant_name] = vim.tbl_extend("force", variants[variant_name], override_palette or {})
end
end
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
if variants[options.variant] ~= nil then
return variants[options.variant]
end
vim.tbl_deep_extend('force', palette, { none = 'NONE' })
return vim.o.background == "light" and variants.dawn or variants[options.dark_variant or "main"]
return palette

View file

@ -1,223 +0,0 @@
--- Rosé Pine for bufferline
--- https://github.com/akinsho/bufferline.nvim
---
--- @usage
--- local highlights = require("rose-pine.plugins.bufferline")
--- require("bufferline").setup({ highlights = highlights })
local p = require("rose-pine.palette")
return {
-- fill = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- background = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- tab = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
tab_selected = {
fg = p.text,
bg = p.overlay,
},
-- tab_close = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- close_button = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- close_button_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- close_button_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
buffer_visible = {
fg = p.subtle,
bg = p.base,
},
buffer_selected = {
fg = p.text,
bg = p.surface,
bold = true,
italic = true,
},
-- diagnostic = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- diagnostic_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- diagnostic_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- },
-- info = {
-- fg = "<color-value-here>",
-- sp = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- info_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- info_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- sp = "<color-value-here>",
-- },
-- info_diagnostic = {
-- fg = "<color-value-here>",
-- sp = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- info_diagnostic_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- info_diagnostic_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- sp = "<color-value-here>",
-- },
-- warning = {
-- fg = "<color-value-here>",
-- sp = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- warning_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- warning_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- sp = "<color-value-here>",
-- },
-- warning_diagnostic = {
-- fg = "<color-value-here>",
-- sp = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- warning_diagnostic_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- warning_diagnostic_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- sp = warning_diagnostic_fg,
-- },
-- error = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- sp = "<color-value-here>",
-- },
-- error_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- error_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- sp = "<color-value-here>",
-- },
-- error_diagnostic = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- sp = "<color-value-here>",
-- },
-- error_diagnostic_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- error_diagnostic_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- sp = "<color-value-here>",
-- },
-- modified = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- modified_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- modified_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- duplicate_selected = {
-- fg = "<color-value-here>",
-- italic = true,
-- bg = "<color-value-here>",
-- },
-- duplicate_visible = {
-- fg = "<color-value-here>",
-- italic = true,
-- bg = "<color-value-here>",
-- },
-- duplicate = {
-- fg = "<color-value-here>",
-- italic = true,
-- bg = "<color-value-here>",
-- },
-- separator_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- separator_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- separator = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- indicator_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- },
-- pick_selected = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- italic = true,
-- },
-- pick_visible = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- },
-- pick = {
-- fg = "<color-value-here>",
-- bg = "<color-value-here>",
-- bold = true,
-- italic = true,
-- },
}

View file

@ -1,20 +0,0 @@
--- Rosé Pine for galaxyline fork
--- https://github.com/NTBBloodbath/galaxyline.nvim
---
--- @usage
--- local highlights = require("rose-pine.plugins.galaxyline")
local p = require("rose-pine.palette")
return {
bg = p.surface,
fg = p.text,
fg_alt = p.subtle,
yellow = p.gold,
cyan = p.rose,
green = p.pine,
orange = p.muted,
magenta = p.iris,
blue = p.foam,
red = p.love,
}

View file

@ -1,10 +0,0 @@
--- Rosé Pine for markid
--- https://github.com/David-Kunz/markid
---
--- @usage
--- local highlights = require("rose-pine.plugins.markid")
--- require("nvim-treesitter.configs").setup({ markid = { enable = true, colors = highlights } })
local p = require("rose-pine.palette")
return { p.foam, p.rose, p.iris }

View file

@ -1,14 +0,0 @@
--- Rosé Pine for Obsidian(epwalsh)
--- https://github.com/epwalsh/obsidian.nvim
---
--- @usage
--- local highlights = require("rose-pine.plugins.obsidian")
--- require("obsidian").setup({ ui = {hl_groups = highlights} })
local p = require("rose-pine.palette")
return {
ObsidianBullet = { fg = p.muted },
ObsidianRefText = { underline = true, fg = p.iris },
ObsidianDone = { bold = true, fg = p.foam }
}

View file

@ -1,15 +0,0 @@
--- Rosé Pine for toggleterm
--- https://github.com/akinsho/toggleterm.nvim
---
--- @usage
--- local highlights = require("rose-pine.plugins.toggleterm")
--- require("toggleterm").setup({ highlights = highlights })
return {
Normal = { link = "Normal" },
NormalFloat = { link = "Normal" },
FloatBorder = { link = "FloatBorder" },
SignColumn = { link = "SignColumn" },
StatusLine = { link = "StatusLine" },
StatusLineNC = { link = "StatusLineNC" },
}

427
lua/rose-pine/theme.lua Normal file
View file

@ -0,0 +1,427 @@
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 or {}
local styles = {
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,
nc_background = (config.dim_nc_background and p.surface) or p.base,
}
theme = {
ColorColumn = { bg = p.highlight_high },
Conceal = { bg = p.none },
-- Cursor = {},
CursorColumn = { bg = p.highlight_low },
-- CursorIM = {},
CursorLine = { bg = p.highlight_low },
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 = p.foam, bg = p.none },
-- EndOfBuffer = {},
ErrorMsg = { fg = p.love, style = 'bold' },
FloatBorder = { fg = groups.border },
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.nc_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 = 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 = 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 = p.gold },
-- Whitespace = {},
-- WildMenu = {},
Boolean = { fg = p.rose },
Character = { fg = p.gold },
Comment = { fg = groups.comment, style = styles.italic },
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 = 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 = p.iris },
htmlBold = { 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' },
htmlItalic = { style = styles.italic },
htmlLink = { fg = groups.link },
htmlTag = { fg = p.subtle },
htmlTagN = { fg = p.text },
htmlTagName = { fg = p.foam },
markdownDelimiter = { fg = p.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 = 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 = p.text },
mkdRule = { fg = p.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 },
DiagnosticStatusLineError = { fg = groups.error, bg = p.surface },
DiagnosticStatusLineHint = { fg = groups.hint, bg = p.surface },
DiagnosticStatusLineInfo = { fg = groups.info, bg = p.surface },
DiagnosticStatusLineWarn = { fg = groups.warn, bg = p.surface },
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 = p.love },
-- TSConstMacro = {},
TSConstant = { fg = p.foam },
TSConstructor = { fg = p.foam },
-- TSEmphasis = {},
-- TSError = {},
-- TSException = {},
TSField = { fg = p.foam },
-- TSFloat = {},
TSFuncBuiltin = { fg = p.love },
-- TSFuncMacro = {},
TSFunction = { fg = p.rose },
TSInclude = { fg = p.pine },
TSKeyword = { fg = p.pine },
-- TSKeywordFunction = {},
TSKeywordOperator = { fg = p.subtle },
TSLabel = { fg = p.foam },
-- TSLiteral = {},
-- TSMethod = {},
-- TSNamespace = {},
-- TSNone = {},
TSNumber = { link = 'Number' },
TSOperator = { fg = p.subtle },
TSParameter = { fg = p.iris, style = styles.italic },
-- TSParameterReference = {},
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 = p.pine },
-- TSStringRegex = {},
TSStringSpecial = { link = 'TSString' },
-- TSSymbol = {},
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 = p.text, style = styles.italic },
TSVariableBuiltin = { fg = p.love },
-- romgrk/barbar.nvim
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 },
GitSignsChange = { fg = groups.git_change },
GitSignsDelete = { fg = groups.git_delete },
SignAdd = { link = 'GitSignsAdd' },
SignChange = { link = 'GitSignsChange' },
SignDelete = { link = 'GitSignsDelete' },
-- mvllow/modes.nvim
ModesCopy = { bg = p.gold },
ModesDelete = { bg = p.love },
ModesInsert = { bg = p.foam },
ModesVisual = { bg = p.iris },
-- kyazdani42/nvim-tree.lua
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 },
NvimTreeGitMerge = { fg = groups.git_merge },
NvimTreeGitNew = { fg = groups.git_add },
NvimTreeGitRenamed = { fg = groups.git_rename },
NvimTreeGitStaged = { fg = groups.git_stage },
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 = p.base, bg = p.iris },
-- folke/which-key.nvim
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 = p.muted },
-- hrsh7th/nvim-cmp
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 = 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 = 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 = p.pine },
VimwikiLink = { fg = groups.link, style = 'underline' },
VimwikiList = { fg = p.iris },
VimwikiNoExistsLink = { fg = p.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 = p.text, style = 'bold' },
-- tami5/lspsaga.nvim (fork of glepnir/lspsaga.nvim)
DefinitionCount = { fg = p.rose },
DefinitionIcon = { fg = p.rose },
DefintionPreviewTitle = { fg = p.rose, style = 'bold' },
LspFloatWinBorder = { fg = groups.border },
LspFloatWinNormal = { bg = p.base },
LspSagaAutoPreview = { fg = p.subtle },
LspSagaCodeActionBorder = { fg = groups.border },
LspSagaCodeActionContent = { fg = p.foam },
LspSagaCodeActionTitle = { fg = p.gold, style = 'bold' },
LspSagaCodeActionTruncateLine = { link = 'LspSagaCodeActionBorder' },
LspSagaDefPreviewBorder = { fg = groups.border },
LspSagaDiagnosticBorder = { fg = groups.border },
LspSagaDiagnosticHeader = { fg = p.gold, style = 'bold' },
LspSagaDiagnosticTruncateLine = { link = 'LspSagaDiagnosticBorder' },
LspSagaDocTruncateLine = { link = 'LspSagaHoverBorder' },
LspSagaFinderSelection = { fg = p.gold },
LspSagaHoverBorder = { fg = groups.border },
LspSagaLspFinderBorder = { fg = groups.border },
LspSagaRenameBorder = { fg = p.pine },
LspSagaRenamePromptPrefix = { fg = p.love },
LspSagaShTruncateLine = { link = 'LspSagaSignatureHelpBorder' },
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 = p.overlay },
-- rlane/pounce.nvim
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 = 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 = 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
return M

32
lua/rose-pine/util.lua Normal file
View file

@ -0,0 +1,32 @@
local util = {}
local function get_byte(value, offset)
return bit.band(bit.rshift(value, offset), 0xFF)
end
local function get_color(color)
color = vim.api.nvim_get_color_by_name(color)
if color == -1 then
color = vim.opt.background:get() == 'dark' and 000 or 255255255
end
return { get_byte(color, 16), get_byte(color, 8), get_byte(color, 0) }
end
---@param fg string foreground color
---@param bg string background color
---@param alpha number number between 0 (background) and 1 (foreground)
function util.blend(fg, bg, alpha)
bg = get_color(bg)
fg = get_color(fg)
local function blend_channel(i)
local ret = (alpha * fg[i] + ((1 - alpha) * bg[i]))
return math.floor(math.min(math.max(0, ret), 255) + 0.5)
end
return string.format('#%02X%02X%02X', blend_channel(1), blend_channel(2), blend_channel(3))
end
return util

View file

@ -1,65 +0,0 @@
local utilities = {}
---@param color string
local function color_to_rgb(color)
local function byte(value, offset)
return bit.band(bit.rshift(value, offset), 0xFF)
end
local new_color = vim.api.nvim_get_color_by_name(color)
if new_color == -1 then
new_color = vim.opt.background:get() == "dark" and 000 or 255255255
end
return { byte(new_color, 16), byte(new_color, 8), byte(new_color, 0) }
end
local color_cache = {}
---@param color string Palette key or hex value
function utilities.parse_color(color)
if color_cache[color] then
return color_cache[color]
end
if color == nil then
print("Invalid color: " .. color)
return nil
end
color = color:lower()
if not color:find("#") and color ~= "NONE" then
color = require("rose-pine.palette")[color] or vim.api.nvim_get_color_by_name(color)
end
color_cache[color] = color
return color
end
local blend_cache = {}
---@param fg string Foreground color
---@param bg string Background color
---@param alpha number Between 0 (background) and 1 (foreground)
function utilities.blend(fg, bg, alpha)
local cache_key = fg .. bg .. alpha
if blend_cache[cache_key] then
return blend_cache[cache_key]
end
local fg_rgb = color_to_rgb(fg)
local bg_rgb = color_to_rgb(bg)
local function blend_channel(i)
local ret = (alpha * fg_rgb[i] + ((1 - alpha) * bg_rgb[i]))
return math.floor(math.min(math.max(0, ret), 255) + 0.5)
end
local result = string.format("#%02X%02X%02X", blend_channel(1), blend_channel(2), blend_channel(3))
blend_cache[cache_key] = result
return result
end
return utilities

187
readme.md
View file

@ -11,151 +11,120 @@
</a>
</p>
## Getting started
Install `rose-pine/neovim` using your favourite package manager:
### [pam.nvim](https://github.com/mvllow/pam.nvim)
## Usage
```lua
{ source = "rose-pine/neovim", as = "rose-pine" }
use({
'rose-pine/neovim',
as = 'rose-pine',
tag = 'v1.*',
config = function()
vim.cmd('colorscheme rose-pine')
end
})
```
### [lazy.nvim](https://lazy.folke.io/installation)
## Plugins
**Structured Setup**
> PR's are more than welcome if your favourite plugin is missing
- [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)
- [nvim-notify](https://github.com/rcarriga/nvim-notify)
- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim)
```lua
-- lua/plugins/rose-pine.lua
return {
"rose-pine/neovim",
name = "rose-pine",
use({
'nvim-lualine/lualine.nvim',
-- fix mismatch palette between variants
event = 'ColorScheme',
config = function()
vim.cmd("colorscheme rose-pine")
require('lualine').setup({
options = {
---@usage 'rose-pine' | 'rose-pine-alt'
theme = 'rose-pine'
}
})
end
}
})
```
**Single file**
- [galaxyline.nvim fork](https://github.com/NTBBloodbath/galaxyline.nvim)
```lua
{ "rose-pine/neovim", name = "rose-pine" }
local colors = require("galaxyline.themes.colors")["rose-pine"]
```
## Gallery
**Rosé Pine**
![Rosé Pine with Neovim](https://user-images.githubusercontent.com/1973/163921570-0f577baf-3199-4f09-9779-a7eb9238151a.png)
![Rosé Pine with Neovim](assets/rose-pine.png)
**Rosé Pine Moon**
![Rosé Pine Moon with Neovim](https://user-images.githubusercontent.com/1973/163921620-d3acd0d2-d227-4d28-a5e8-97ff22e56c6d.png)
![Rosé Pine Moon with Neovim](assets/rose-pine-moon.png)
**Rosé Pine Dawn**
![Rosé Pine Dawn with Neovim](https://user-images.githubusercontent.com/1973/163921656-644a2db3-c55c-4e89-9bdd-39cdd7a2681b.png)
![Rosé Pine Dawn with Neovim](assets/rose-pine-dawn.png)
## Options
> [!IMPORTANT]
> Configure options _before_ setting colorscheme.
Rosé Pine has three variants: main, moon, and dawn. By default, `vim.o.background` is followed, using dawn when light and `dark_variant` when dark.
Colour values accept named colours from the [Rosé Pine palette](https://rosepinetheme.com/palette/ingredients/), e.g. "foam", or valid hex, e.g. "#fa8072".
> Options should be set **before** colorscheme
```lua
require("rose-pine").setup({
variant = "auto", -- auto, main, moon, or dawn
dark_variant = "main", -- main, moon, or dawn
dim_inactive_windows = false,
extend_background_behind_borders = true,
require('rose-pine').setup({
---@usage 'main'|'moon'
dark_variant = 'main',
bold_vert_split = false,
dim_nc_background = false,
disable_background = false,
disable_float_background = false,
disable_italics = false,
---@usage string hex value or named color from rosepinetheme.com/palette
groups = {
border = 'highlight_med',
comment = 'muted',
link = 'iris',
punctuation = 'subtle',
enable = {
terminal = true,
legacy_highlights = true, -- Improve compatibility for previous versions of Neovim
migrations = true, -- Handle deprecated options automatically
},
error = 'love',
hint = 'iris',
info = 'foam',
warn = 'gold',
styles = {
bold = true,
italic = true,
transparency = false,
},
groups = {
border = "muted",
link = "iris",
panel = "surface",
error = "love",
hint = "iris",
info = "foam",
note = "pine",
todo = "rose",
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",
git_untracked = "subtle",
h1 = "iris",
h2 = "foam",
h3 = "rose",
h4 = "gold",
h5 = "pine",
h6 = "foam",
},
palette = {
-- Override the builtin palette per variant
-- moon = {
-- base = '#18191a',
-- overlay = '#363738',
-- },
},
-- NOTE: Highlight groups are extended (merged) by default. Disable this
-- per group via `inherit = false`
highlight_groups = {
-- Comment = { fg = "foam" },
-- StatusLine = { fg = "love", bg = "love", blend = 15 },
-- VertSplit = { fg = "muted", bg = "muted" },
-- Visual = { fg = "base", bg = "text", inherit = false },
},
before_highlight = function(group, highlight, palette)
-- Disable all undercurls
-- if highlight.undercurl then
-- highlight.undercurl = false
-- end
--
-- Change palette colour
-- if highlight.fg == palette.pine then
-- highlight.fg = palette.foam
-- end
end,
headings = {
h1 = 'iris',
h2 = 'foam',
h3 = 'rose',
h4 = 'gold',
h5 = 'pine',
h6 = 'foam',
}
-- or set all headings at once
-- headings = 'subtle'
}
})
vim.cmd("colorscheme rose-pine")
-- vim.cmd("colorscheme rose-pine-main")
-- vim.cmd("colorscheme rose-pine-moon")
-- vim.cmd("colorscheme rose-pine-dawn")
-- set colorscheme after options
vim.cmd('colorscheme rose-pine')
```
> [!NOTE]
> Visit the [wiki](https://github.com/rose-pine/neovim/wiki) for [plugin configurations](https://github.com/rose-pine/neovim/wiki/Plugin-configurations) and [recipes](https://github.com/rose-pine/neovim/wiki/Recipes).
## Contributing
We welcome and appreciate contributions of any kind. Create an issue or start a discussion for any proposed changes. Pull requests are encouraged for supporting additional plugins or [treesitter improvements](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights).
We welcome and appreciate any help in creating a lovely experience for all.
Feel free to update the [wiki](https://github.com/rose-pine/neovim/wiki/) with any [recipes](https://github.com/rose-pine/neovim/wiki/Recipes).
- [Get highlight groups under cursor](https://github.com/nvim-treesitter/playground#show-treesitter-and-syntax-highlight-groups-under-the-cursor)
- [Adding new highlight groups](https://github.com/rose-pine/neovim/issues/6#issuecomment-962466323)