mirror of
https://github.com/rose-pine/neovim.git
synced 2025-10-15 12:38:53 +02:00
Compare commits
No commits in common. "main" and "v1.2.0" have entirely different histories.
22 changed files with 1086 additions and 1907 deletions
61
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
61
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -15,14 +15,30 @@ body:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: "Terminal / multiplexer"
|
label: "Terminal"
|
||||||
placeholder: "Kitty / tmux"
|
placeholder: "Kitty"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Describe the bug
|
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.
|
description: A clear and concise description of what the bug is. Please include any related errors you see in Neovim.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Steps To Reproduce
|
||||||
|
description: Steps to reproduce the behavior.
|
||||||
|
placeholder: |
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Expected Behavior
|
||||||
|
description: A concise description of what you expected to happen.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
|
@ -30,25 +46,36 @@ body:
|
||||||
label: Repro
|
label: Repro
|
||||||
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
|
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
|
||||||
value: |
|
value: |
|
||||||
vim.o.packpath = "/tmp/nvim/site"
|
-- DO NOT change the paths and do not remove the colorscheme
|
||||||
|
local root = vim.fn.fnamemodify("./.repro", ":p")
|
||||||
|
|
||||||
local plugins = {
|
-- Set stdpaths to use .repro
|
||||||
rose_pine = "https://github.com/rose-pine/neovim",
|
for _, name in ipairs({ "config", "data", "state", "cache" }) do
|
||||||
-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
|
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
|
||||||
}
|
|
||||||
|
|
||||||
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
|
end
|
||||||
|
|
||||||
require("rose-pine").setup({
|
-- Bootstrap lazy.nvim
|
||||||
-- ADD ROSÉ PINE CONFIG THAT IS _NECESSARY_ TO REPRODUCE THE ISSUE
|
local lazypath = root .. "/plugins/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
|
||||||
|
end
|
||||||
|
vim.opt.runtimepath:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Install plugins
|
||||||
|
local plugins = {
|
||||||
|
"rose-pine/neovim",
|
||||||
|
name = "rose-pine",
|
||||||
|
config = function()
|
||||||
|
-- Add relevant Rosé Pine config below
|
||||||
|
require("rose-pine").setup({})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
require("lazy").setup(plugins, {
|
||||||
|
root = root .. "/plugins",
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd("colorscheme rose-pine")
|
vim.cmd.colorscheme("rose-pine")
|
||||||
|
-- Add anything else here
|
||||||
render: Lua
|
render: Lua
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
|
|
||||||
12
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
12
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
|
|
@ -3,12 +3,24 @@ description: Suggest a new feature
|
||||||
title: "feature: "
|
title: "feature: "
|
||||||
labels: [enhancement]
|
labels: [enhancement]
|
||||||
body:
|
body:
|
||||||
|
- type: textarea
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: Is your feature request related to a problem? Please describe.
|
||||||
|
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
- type: textarea
|
- type: textarea
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
attributes:
|
attributes:
|
||||||
label: Describe the solution you'd like
|
label: Describe the solution you'd like
|
||||||
description: A clear and concise description of what you want to happen.
|
description: A clear and concise description of what you want to happen.
|
||||||
|
- type: textarea
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: Describe alternatives you've considered
|
||||||
|
description: A clear and concise description of any alternative solutions or features you've considered.
|
||||||
- type: textarea
|
- type: textarea
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
|
|
||||||
4
.stylua.toml
Normal file
4
.stylua.toml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
column_width = 80
|
||||||
|
indent_type = "Tabs"
|
||||||
|
line_endings = "Unix"
|
||||||
|
quote_style = "AutoPreferSingle"
|
||||||
82
changelog.md
82
changelog.md
|
|
@ -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 = "..." },
|
|
||||||
+ }
|
|
||||||
```
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
package.loaded["rose-pine.palette"] = nil
|
require('rose-pine').colorscheme({ variant = 'dawn' })
|
||||||
require("rose-pine").colorscheme("dawn")
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
package.loaded["rose-pine.palette"] = nil
|
require('rose-pine').colorscheme({ variant = 'main' })
|
||||||
require("rose-pine").colorscheme("main")
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
package.loaded["rose-pine.palette"] = nil
|
require('rose-pine').colorscheme({ variant = 'moon' })
|
||||||
require("rose-pine").colorscheme("moon")
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
package.loaded["rose-pine.palette"] = nil
|
package.loaded['rose-pine.palette'] = nil
|
||||||
require("rose-pine").colorscheme()
|
|
||||||
|
require('rose-pine').colorscheme()
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,26 @@
|
||||||
local p = require("rose-pine.palette")
|
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
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
normal = {
|
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 },
|
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 = {
|
insert = {
|
||||||
a = { bg = p.surface, fg = p.foam, gui = "bold" },
|
a = { bg = p.surface, fg = p.foam, gui = 'bold' },
|
||||||
},
|
},
|
||||||
visual = {
|
visual = {
|
||||||
a = { bg = p.surface, fg = p.iris, gui = "bold" },
|
a = { bg = p.surface, fg = p.iris, gui = 'bold' },
|
||||||
},
|
},
|
||||||
replace = {
|
replace = {
|
||||||
a = { bg = p.surface, fg = p.pine, gui = "bold" },
|
a = { bg = p.surface, fg = p.pine, gui = 'bold' },
|
||||||
},
|
},
|
||||||
command = {
|
command = {
|
||||||
a = { bg = p.surface, fg = p.love, gui = "bold" },
|
a = { bg = p.surface, fg = p.love, gui = 'bold' },
|
||||||
},
|
},
|
||||||
inactive = {
|
inactive = {
|
||||||
a = { bg = bg_base, fg = p.subtle, gui = "bold" },
|
a = { bg = p.base, fg = p.subtle, gui = 'bold' },
|
||||||
b = { bg = bg_base, fg = p.subtle },
|
b = { bg = p.base, fg = p.subtle },
|
||||||
c = { bg = bg_base, fg = p.subtle, gui = "italic" },
|
c = { bg = p.base, fg = p.subtle, gui = 'italic' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,34 @@
|
||||||
local p = require("rose-pine.palette")
|
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
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
normal = {
|
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 },
|
b = { bg = p.overlay, fg = p.rose },
|
||||||
c = { bg = bg_base, fg = p.text },
|
c = { bg = p.base, fg = p.text },
|
||||||
},
|
},
|
||||||
insert = {
|
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 },
|
b = { bg = p.overlay, fg = p.foam },
|
||||||
c = { bg = bg_base, fg = p.text },
|
c = { bg = p.base, fg = p.text },
|
||||||
},
|
},
|
||||||
visual = {
|
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 },
|
b = { bg = p.overlay, fg = p.iris },
|
||||||
c = { bg = bg_base, fg = p.text },
|
c = { bg = p.base, fg = p.text },
|
||||||
},
|
},
|
||||||
replace = {
|
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 },
|
b = { bg = p.overlay, fg = p.pine },
|
||||||
c = { bg = bg_base, fg = p.text },
|
c = { bg = p.base, fg = p.text },
|
||||||
},
|
},
|
||||||
command = {
|
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 },
|
b = { bg = p.overlay, fg = p.love },
|
||||||
c = { bg = bg_base, fg = p.text },
|
c = { bg = p.base, fg = p.text },
|
||||||
},
|
},
|
||||||
inactive = {
|
inactive = {
|
||||||
a = { bg = bg_base, fg = p.muted, gui = "bold" },
|
a = { bg = p.base, fg = p.muted, gui = 'bold' },
|
||||||
b = { bg = bg_base, fg = p.muted },
|
b = { bg = p.base, fg = p.muted },
|
||||||
c = { bg = bg_base, fg = p.muted },
|
c = { bg = p.base, fg = p.muted },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1240
lua/rose-pine.lua
1240
lua/rose-pine.lua
File diff suppressed because it is too large
Load diff
|
|
@ -1,176 +1,104 @@
|
||||||
---@alias Variant "main" | "moon" | "dawn"
|
local M = {}
|
||||||
---@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 Groups
|
||||||
|
---@field background string
|
||||||
|
---@field background_nc string
|
||||||
|
---@field panel string
|
||||||
|
---@field panel_nc string
|
||||||
|
---@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_add string
|
||||||
|
---@field git_change string
|
||||||
|
---@field git_delete string
|
||||||
|
---@field git_dirty string
|
||||||
|
---@field git_ignore string
|
||||||
|
---@field git_merge string
|
||||||
|
---@field git_rename string
|
||||||
|
---@field git_stage string
|
||||||
|
---@field git_text string
|
||||||
|
---@field headings Headings|string
|
||||||
|
|
||||||
---@class Options
|
---@class Headings
|
||||||
config.options = {
|
---@field h1 string
|
||||||
---Set the desired variant: "auto" will follow the vim background,
|
---@field h2 string
|
||||||
---defaulting to `dark_variant` or "main" for dark and "dawn" for light.
|
---@field h3 string
|
||||||
---@type "auto" | Variant
|
---@field h4 string
|
||||||
variant = "auto",
|
---@field h5 string
|
||||||
|
---@field h6 string
|
||||||
|
|
||||||
---Set the desired dark variant when `options.variant` is set to "auto".
|
---@class Config
|
||||||
---@type Variant
|
---@field variant 'auto'|'main'|'moon'|'dawn'
|
||||||
dark_variant = "main",
|
---@field dark_variant 'main'|'moon'|'dawn'
|
||||||
|
---@field bold_vert_split boolean
|
||||||
---Differentiate between active and inactive windows and panels.
|
---@field dim_nc_background boolean
|
||||||
dim_inactive_windows = false,
|
---@field disable_background boolean
|
||||||
|
---@field disable_float_background boolean
|
||||||
---Extend background behind borders. Appearance differs based on which
|
---@field disable_italics boolean
|
||||||
---border characters you are using.
|
---@field groups Groups
|
||||||
extend_background_behind_borders = true,
|
---@field highlight_groups table<string, any>
|
||||||
|
local defaults = {
|
||||||
enable = {
|
variant = 'auto',
|
||||||
legacy_highlights = true,
|
dark_variant = 'main',
|
||||||
migrations = true,
|
bold_vert_split = false,
|
||||||
terminal = true,
|
dim_nc_background = false,
|
||||||
},
|
disable_background = false,
|
||||||
|
disable_float_background = false,
|
||||||
styles = {
|
disable_italics = false,
|
||||||
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 = {},
|
highlight_groups = {},
|
||||||
|
|
||||||
---Called before each highlight group, before setting the highlight.
|
groups = {
|
||||||
---@param group string
|
background = 'base',
|
||||||
---@param highlight Highlight
|
background_nc = '_experimental_nc',
|
||||||
---@param palette Palette
|
panel = 'surface',
|
||||||
---@diagnostic disable-next-line: unused-local
|
panel_nc = 'base',
|
||||||
before_highlight = function(group, highlight, palette) end,
|
border = 'highlight_med',
|
||||||
|
comment = 'muted',
|
||||||
---@deprecated Replaced by `options.dim_inactive_windows`
|
link = 'iris',
|
||||||
-- dim_nc_background = false,
|
punctuation = 'muted',
|
||||||
---@deprecated Replaced by `options.enable.transparency`
|
error = 'love',
|
||||||
-- disable_background = false,
|
hint = 'iris',
|
||||||
---@deprecated Replaced by `options.highlight_groups["NormalFloat"]`
|
info = 'foam',
|
||||||
-- disable_float_background = false,
|
warn = 'gold',
|
||||||
---@deprecated Replaced by `options.styles.italic`
|
git_add = 'foam',
|
||||||
-- disable_italics = false,
|
git_change = 'rose',
|
||||||
---@deprecated Replaced by `options.highlight_groups`
|
git_delete = 'love',
|
||||||
-- bold_vert_split = false
|
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',
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local function migrate(options)
|
---@type Config
|
||||||
if options.bold_vert_split then
|
M.options = {}
|
||||||
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
|
---@param options Config|nil
|
||||||
options.highlight_groups["Normal"] = { bg = "NONE" }
|
function M.setup(options)
|
||||||
end
|
M.options = vim.tbl_deep_extend('force', {}, defaults, options or {})
|
||||||
|
|
||||||
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
|
end
|
||||||
|
|
||||||
---@param options Options | nil
|
---@param options Config|nil
|
||||||
function config.extend_options(options)
|
function M.extend(options)
|
||||||
config.options = vim.tbl_deep_extend("force", config.options, options or {})
|
M.options =
|
||||||
|
vim.tbl_deep_extend('force', {}, M.options or defaults, options or {})
|
||||||
if config.options.enable.migrations then
|
|
||||||
config.options = migrate(config.options)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return config
|
M.setup()
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
|
||||||
|
|
@ -1,78 +1,80 @@
|
||||||
local options = require("rose-pine.config").options
|
local options = require('rose-pine.config').options
|
||||||
|
|
||||||
local variants = {
|
local variants = {
|
||||||
main = {
|
main = {
|
||||||
_nc = "#16141f",
|
---@deprecated for backwards compatibility
|
||||||
base = "#191724",
|
_experimental_nc = '#16141f',
|
||||||
surface = "#1f1d2e",
|
nc = '#16141f',
|
||||||
overlay = "#26233a",
|
base = '#191724',
|
||||||
muted = "#6e6a86",
|
surface = '#1f1d2e',
|
||||||
subtle = "#908caa",
|
overlay = '#26233a',
|
||||||
text = "#e0def4",
|
muted = '#6e6a86',
|
||||||
love = "#eb6f92",
|
subtle = '#908caa',
|
||||||
gold = "#f6c177",
|
text = '#e0def4',
|
||||||
rose = "#ebbcba",
|
love = '#eb6f92',
|
||||||
pine = "#31748f",
|
gold = '#f6c177',
|
||||||
foam = "#9ccfd8",
|
rose = '#ebbcba',
|
||||||
iris = "#c4a7e7",
|
pine = '#31748f',
|
||||||
leaf = "#95b1ac",
|
foam = '#9ccfd8',
|
||||||
highlight_low = "#21202e",
|
iris = '#c4a7e7',
|
||||||
highlight_med = "#403d52",
|
highlight_low = '#21202e',
|
||||||
highlight_high = "#524f67",
|
highlight_med = '#403d52',
|
||||||
none = "NONE",
|
highlight_high = '#524f67',
|
||||||
|
none = 'NONE',
|
||||||
},
|
},
|
||||||
moon = {
|
moon = {
|
||||||
_nc = "#1f1d30",
|
---@deprecated for backwards compatibility
|
||||||
base = "#232136",
|
_experimental_nc = '#1f1d30',
|
||||||
surface = "#2a273f",
|
nc = '#1f1d30',
|
||||||
overlay = "#393552",
|
base = '#232136',
|
||||||
muted = "#6e6a86",
|
surface = '#2a273f',
|
||||||
subtle = "#908caa",
|
overlay = '#393552',
|
||||||
text = "#e0def4",
|
muted = '#6e6a86',
|
||||||
love = "#eb6f92",
|
subtle = '#908caa',
|
||||||
gold = "#f6c177",
|
text = '#e0def4',
|
||||||
rose = "#ea9a97",
|
love = '#eb6f92',
|
||||||
pine = "#3e8fb0",
|
gold = '#f6c177',
|
||||||
foam = "#9ccfd8",
|
rose = '#ea9a97',
|
||||||
iris = "#c4a7e7",
|
pine = '#3e8fb0',
|
||||||
leaf = "#95b1ac",
|
foam = '#9ccfd8',
|
||||||
highlight_low = "#2a283e",
|
iris = '#c4a7e7',
|
||||||
highlight_med = "#44415a",
|
highlight_low = '#2a283e',
|
||||||
highlight_high = "#56526e",
|
highlight_med = '#44415a',
|
||||||
none = "NONE",
|
highlight_high = '#56526e',
|
||||||
|
none = 'NONE',
|
||||||
},
|
},
|
||||||
dawn = {
|
dawn = {
|
||||||
_nc = "#f8f0e7",
|
---@deprecated for backwards compatibility
|
||||||
base = "#faf4ed",
|
_experimental_nc = '#f8f0e7',
|
||||||
surface = "#fffaf3",
|
nc = '#f8f0e7',
|
||||||
overlay = "#f2e9e1",
|
base = '#faf4ed',
|
||||||
muted = "#9893a5",
|
surface = '#fffaf3',
|
||||||
subtle = "#797593",
|
overlay = '#f2e9e1',
|
||||||
text = "#464261",
|
muted = '#9893a5',
|
||||||
love = "#b4637a",
|
subtle = '#797593',
|
||||||
gold = "#ea9d34",
|
text = '#575279',
|
||||||
rose = "#d7827e",
|
love = '#b4637a',
|
||||||
pine = "#286983",
|
gold = '#ea9d34',
|
||||||
foam = "#56949f",
|
rose = '#d7827e',
|
||||||
iris = "#907aa9",
|
pine = '#286983',
|
||||||
leaf = "#6d8f89",
|
foam = '#56949f',
|
||||||
highlight_low = "#f4ede8",
|
iris = '#907aa9',
|
||||||
highlight_med = "#dfdad9",
|
highlight_low = '#f4ede8',
|
||||||
highlight_high = "#cecacd",
|
highlight_med = '#dfdad9',
|
||||||
none = "NONE",
|
highlight_high = '#cecacd',
|
||||||
|
none = 'NONE',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.palette ~= nil and next(options.palette) then
|
if options.variant == 'main' then
|
||||||
-- handle variant specific overrides
|
return variants.main
|
||||||
for variant_name, override_palette in pairs(options.palette) do
|
end
|
||||||
if variants[variant_name] then
|
if options.variant == 'moon' then
|
||||||
variants[variant_name] = vim.tbl_extend("force", variants[variant_name], override_palette or {})
|
return variants.moon
|
||||||
end
|
end
|
||||||
end
|
if options.variant == 'dawn' then
|
||||||
|
return variants.dawn
|
||||||
end
|
end
|
||||||
|
|
||||||
if variants[options.variant] ~= nil then
|
return vim.o.background == 'light' and variants.dawn
|
||||||
return variants[options.variant]
|
or variants[options.dark_variant or 'main']
|
||||||
end
|
|
||||||
|
|
||||||
return vim.o.background == "light" and variants.dawn or variants[options.dark_variant or "main"]
|
|
||||||
|
|
|
||||||
|
|
@ -2,43 +2,43 @@
|
||||||
--- https://github.com/akinsho/bufferline.nvim
|
--- https://github.com/akinsho/bufferline.nvim
|
||||||
---
|
---
|
||||||
--- @usage
|
--- @usage
|
||||||
--- local highlights = require("rose-pine.plugins.bufferline")
|
--- local highlights = require('rose-pine.plugins.bufferline')
|
||||||
--- require("bufferline").setup({ highlights = highlights })
|
--- require('bufferline').setup({ highlights = highlights })
|
||||||
|
|
||||||
local p = require("rose-pine.palette")
|
local p = require('rose-pine.palette')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
-- fill = {
|
-- fill = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- background = {
|
-- background = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- tab = {
|
-- tab = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
|
-- },
|
||||||
|
-- tab_selected = {
|
||||||
|
-- fg = '<color-value-here>',
|
||||||
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
tab_selected = {
|
|
||||||
fg = p.text,
|
|
||||||
bg = p.overlay,
|
|
||||||
},
|
|
||||||
-- tab_close = {
|
-- tab_close = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- close_button = {
|
-- close_button = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- close_button_visible = {
|
-- close_button_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- close_button_selected = {
|
-- close_button_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
buffer_visible = {
|
buffer_visible = {
|
||||||
fg = p.subtle,
|
fg = p.subtle,
|
||||||
|
|
@ -51,172 +51,172 @@ return {
|
||||||
italic = true,
|
italic = true,
|
||||||
},
|
},
|
||||||
-- diagnostic = {
|
-- diagnostic = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- diagnostic_visible = {
|
-- diagnostic_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- diagnostic_selected = {
|
-- diagnostic_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- },
|
-- },
|
||||||
-- info = {
|
-- info = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- info_visible = {
|
-- info_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- info_selected = {
|
-- info_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- info_diagnostic = {
|
-- info_diagnostic = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- info_diagnostic_visible = {
|
-- info_diagnostic_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- info_diagnostic_selected = {
|
-- info_diagnostic_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- warning = {
|
-- warning = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- warning_visible = {
|
-- warning_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- warning_selected = {
|
-- warning_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- warning_diagnostic = {
|
-- warning_diagnostic = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- warning_diagnostic_visible = {
|
-- warning_diagnostic_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- warning_diagnostic_selected = {
|
-- warning_diagnostic_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- sp = warning_diagnostic_fg,
|
-- sp = warning_diagnostic_fg,
|
||||||
-- },
|
-- },
|
||||||
-- error = {
|
-- error = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- error_visible = {
|
-- error_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- error_selected = {
|
-- error_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- error_diagnostic = {
|
-- error_diagnostic = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- error_diagnostic_visible = {
|
-- error_diagnostic_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- error_diagnostic_selected = {
|
-- error_diagnostic_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- sp = "<color-value-here>",
|
-- sp = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- modified = {
|
-- modified = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- modified_visible = {
|
-- modified_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- modified_selected = {
|
-- modified_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- duplicate_selected = {
|
-- duplicate_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- duplicate_visible = {
|
-- duplicate_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- duplicate = {
|
-- duplicate = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- separator_selected = {
|
-- separator_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- separator_visible = {
|
-- separator_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- separator = {
|
-- separator = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- indicator_selected = {
|
-- indicator_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- },
|
-- },
|
||||||
-- pick_selected = {
|
-- pick_selected = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- },
|
-- },
|
||||||
-- pick_visible = {
|
-- pick_visible = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- },
|
-- },
|
||||||
-- pick = {
|
-- pick = {
|
||||||
-- fg = "<color-value-here>",
|
-- fg = '<color-value-here>',
|
||||||
-- bg = "<color-value-here>",
|
-- bg = '<color-value-here>',
|
||||||
-- bold = true,
|
-- bold = true,
|
||||||
-- italic = true,
|
-- italic = true,
|
||||||
-- },
|
-- },
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
--- https://github.com/NTBBloodbath/galaxyline.nvim
|
--- https://github.com/NTBBloodbath/galaxyline.nvim
|
||||||
---
|
---
|
||||||
--- @usage
|
--- @usage
|
||||||
--- local highlights = require("rose-pine.plugins.galaxyline")
|
--- local highlights = require('rose-pine.plugins.galaxyline')
|
||||||
|
|
||||||
local p = require("rose-pine.palette")
|
local p = require('rose-pine.palette')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
bg = p.surface,
|
bg = p.surface,
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
--- https://github.com/David-Kunz/markid
|
--- https://github.com/David-Kunz/markid
|
||||||
---
|
---
|
||||||
--- @usage
|
--- @usage
|
||||||
--- local highlights = require("rose-pine.plugins.markid")
|
--- local highlights = require('rose-pine.plugins.markid')
|
||||||
--- require("nvim-treesitter.configs").setup({ markid = { enable = true, colors = highlights } })
|
--- require("nvim-treesitter.configs").setup({ markid = { enable = true, colors = highlights } })
|
||||||
|
|
||||||
local p = require("rose-pine.palette")
|
local p = require('rose-pine.palette')
|
||||||
|
|
||||||
return { p.foam, p.rose, p.iris }
|
return { p.foam, p.rose, p.iris }
|
||||||
|
|
|
||||||
|
|
@ -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 }
|
|
||||||
}
|
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
--- https://github.com/akinsho/toggleterm.nvim
|
--- https://github.com/akinsho/toggleterm.nvim
|
||||||
---
|
---
|
||||||
--- @usage
|
--- @usage
|
||||||
--- local highlights = require("rose-pine.plugins.toggleterm")
|
--- local highlights = require('rose-pine.plugins.toggleterm')
|
||||||
--- require("toggleterm").setup({ highlights = highlights })
|
--- require('toggleterm').setup({ highlights = highlights })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
Normal = { link = "Normal" },
|
Normal = { link = 'Normal' },
|
||||||
NormalFloat = { link = "Normal" },
|
NormalFloat = { link = 'Normal' },
|
||||||
FloatBorder = { link = "FloatBorder" },
|
FloatBorder = { link = 'FloatBorder' },
|
||||||
SignColumn = { link = "SignColumn" },
|
SignColumn = { link = 'SignColumn' },
|
||||||
StatusLine = { link = "StatusLine" },
|
StatusLine = { link = 'StatusLine' },
|
||||||
StatusLineNC = { link = "StatusLineNC" },
|
StatusLineNC = { link = 'StatusLineNC' },
|
||||||
}
|
}
|
||||||
|
|
|
||||||
574
lua/rose-pine/theme.lua
Normal file
574
lua/rose-pine/theme.lua
Normal file
|
|
@ -0,0 +1,574 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
---@param options Config
|
||||||
|
function M._load(options)
|
||||||
|
local h = require('rose-pine.util').highlight
|
||||||
|
local p = require('rose-pine.palette')
|
||||||
|
|
||||||
|
local groups = options.groups or {}
|
||||||
|
local maybe = {
|
||||||
|
base = (options.disable_background and p.none) or groups.background,
|
||||||
|
surface = (options.disable_float_background and p.none) or groups.panel,
|
||||||
|
italic = not options.disable_italics,
|
||||||
|
}
|
||||||
|
maybe.bold_vert_split = (options.bold_vert_split and groups.border)
|
||||||
|
or p.none
|
||||||
|
maybe.dim_nc_background = (
|
||||||
|
options.dim_nc_background and groups.background_nc
|
||||||
|
) or maybe.base
|
||||||
|
|
||||||
|
h('ColorColumn', { bg = p.overlay })
|
||||||
|
h('Conceal', { bg = p.none })
|
||||||
|
h('CurSearch', { link = 'IncSearch' })
|
||||||
|
h('Cursor', { fg = p.text, bg = p.highlight_high })
|
||||||
|
h('CursorColumn', { bg = p.highlight_low })
|
||||||
|
-- CursorIM = {},
|
||||||
|
h('CursorLine', { bg = p.highlight_low })
|
||||||
|
h('CursorLineNr', { fg = p.text })
|
||||||
|
h('DarkenedPanel', { bg = maybe.surface })
|
||||||
|
h('DarkenedStatusline', { bg = maybe.surface })
|
||||||
|
h('DiffAdd', { bg = groups.git_add, blend = 20 })
|
||||||
|
|
||||||
|
h('DiffChange', { bg = p.overlay })
|
||||||
|
h('DiffDelete', { bg = groups.git_delete, blend = 20 })
|
||||||
|
h('DiffText', { bg = groups.git_text, blend = 20 })
|
||||||
|
h('diffAdded', { link = 'DiffAdd' })
|
||||||
|
h('diffChanged', { link = 'DiffChange' })
|
||||||
|
h('diffRemoved', { link = 'DiffDelete' })
|
||||||
|
h('Directory', { fg = p.foam, bg = p.none })
|
||||||
|
-- EndOfBuffer = {},
|
||||||
|
h('ErrorMsg', { fg = p.love, bold = true })
|
||||||
|
h('FloatBorder', { fg = groups.border, bg = maybe.surface })
|
||||||
|
h('FloatTitle', { fg = p.muted })
|
||||||
|
h('FoldColumn', { fg = p.muted })
|
||||||
|
h('Folded', { fg = p.text, bg = maybe.surface })
|
||||||
|
h('IncSearch', { fg = groups.background, bg = p.rose })
|
||||||
|
h('LineNr', { fg = p.muted })
|
||||||
|
h('MatchParen', { fg = p.text, bg = p.highlight_med })
|
||||||
|
h('ModeMsg', { fg = p.subtle })
|
||||||
|
h('MoreMsg', { fg = p.iris })
|
||||||
|
h('NonText', { fg = p.muted })
|
||||||
|
h('Normal', { fg = p.text, bg = maybe.base })
|
||||||
|
h('NormalFloat', { fg = p.text, bg = maybe.surface })
|
||||||
|
h('NormalNC', { fg = p.text, bg = maybe.dim_nc_background })
|
||||||
|
h('NvimInternalError', { fg = '#ffffff', bg = p.love })
|
||||||
|
h('Pmenu', { fg = p.subtle, bg = maybe.surface })
|
||||||
|
h('PmenuSbar', { bg = p.highlight_low })
|
||||||
|
h('PmenuSel', { fg = p.text, bg = p.overlay })
|
||||||
|
h('PmenuThumb', { bg = p.highlight_med })
|
||||||
|
h('Question', { fg = p.gold })
|
||||||
|
-- QuickFixLine = {},
|
||||||
|
-- RedrawDebugNormal = {}
|
||||||
|
h('RedrawDebugClear', { fg = '#ffffff', bg = p.gold })
|
||||||
|
h('RedrawDebugComposed', { fg = '#ffffff', bg = p.pine })
|
||||||
|
h('RedrawDebugRecompose', { fg = '#ffffff', bg = p.love })
|
||||||
|
h('Search', { bg = p.highlight_med })
|
||||||
|
h('SpecialKey', { fg = p.foam })
|
||||||
|
h('SpellBad', { sp = p.subtle, undercurl = true })
|
||||||
|
h('SpellCap', { sp = p.subtle, undercurl = true })
|
||||||
|
h('SpellLocal', { sp = p.subtle, undercurl = true })
|
||||||
|
h('SpellRare', { sp = p.subtle, undercurl = true })
|
||||||
|
h('SignColumn', {
|
||||||
|
fg = p.text,
|
||||||
|
bg = (options.dim_nc_background and p.none) or maybe.base,
|
||||||
|
})
|
||||||
|
h('StatusLine', { fg = p.subtle, bg = groups.panel })
|
||||||
|
h('StatusLineNC', { fg = p.muted, bg = groups.panel_nc })
|
||||||
|
h('StatusLineTerm', { link = 'StatusLine' })
|
||||||
|
h('StatusLineTermNC', { link = 'StatusLineNC' })
|
||||||
|
h('TabLine', { fg = p.subtle, bg = groups.panel })
|
||||||
|
h('TabLineFill', { bg = groups.panel })
|
||||||
|
h('TabLineSel', { fg = p.text, bg = p.overlay })
|
||||||
|
h('Title', { fg = p.text })
|
||||||
|
h('VertSplit', { fg = groups.border, bg = maybe.bold_vert_split })
|
||||||
|
h('Visual', { bg = p.highlight_med })
|
||||||
|
-- VisualNOS = {},
|
||||||
|
h('WarningMsg', { fg = p.gold })
|
||||||
|
-- Whitespace = {},
|
||||||
|
h('WildMenu', { link = 'IncSearch' })
|
||||||
|
|
||||||
|
h('Boolean', { fg = p.rose })
|
||||||
|
h('Character', { fg = p.gold })
|
||||||
|
h('Comment', { fg = groups.comment, italic = maybe.italic })
|
||||||
|
h('Conditional', { fg = p.pine })
|
||||||
|
h('Constant', { fg = p.gold })
|
||||||
|
h('Debug', { fg = p.rose })
|
||||||
|
h('Define', { fg = p.iris })
|
||||||
|
h('Delimiter', { fg = p.subtle })
|
||||||
|
h('Error', { fg = p.love })
|
||||||
|
h('Exception', { fg = p.pine })
|
||||||
|
h('Float', { fg = p.gold })
|
||||||
|
h('Function', { fg = p.rose })
|
||||||
|
h('Identifier', { fg = p.rose })
|
||||||
|
-- Ignore = {},
|
||||||
|
h('Include', { fg = p.iris })
|
||||||
|
h('Keyword', { fg = p.pine })
|
||||||
|
h('Label', { fg = p.foam })
|
||||||
|
h('Macro', { fg = p.iris })
|
||||||
|
h('Number', { fg = p.gold })
|
||||||
|
h('Operator', { fg = p.subtle })
|
||||||
|
h('PreCondit', { fg = p.iris })
|
||||||
|
h('PreProc', { fg = p.iris })
|
||||||
|
h('Repeat', { fg = p.pine })
|
||||||
|
h('Special', { fg = p.rose })
|
||||||
|
h('SpecialChar', { fg = p.rose })
|
||||||
|
h('SpecialComment', { fg = p.iris })
|
||||||
|
h('Statement', { fg = p.pine })
|
||||||
|
h('StorageClass', { fg = p.foam })
|
||||||
|
h('String', { fg = p.gold })
|
||||||
|
h('Structure', { fg = p.foam })
|
||||||
|
h('Tag', { fg = p.rose })
|
||||||
|
h('Todo', { fg = p.iris })
|
||||||
|
h('Type', { fg = p.foam })
|
||||||
|
h('Typedef', { link = 'Type' })
|
||||||
|
h('Underlined', { underline = true })
|
||||||
|
|
||||||
|
h('htmlArg', { fg = p.iris })
|
||||||
|
h('htmlBold', { bold = true })
|
||||||
|
h('htmlEndTag', { fg = p.subtle })
|
||||||
|
h('htmlH1', { fg = groups.headings.h1, bold = true })
|
||||||
|
h('htmlH2', { fg = groups.headings.h2, bold = true })
|
||||||
|
h('htmlH3', { fg = groups.headings.h3, bold = true })
|
||||||
|
h('htmlH4', { fg = groups.headings.h4, bold = true })
|
||||||
|
h('htmlH5', { fg = groups.headings.h5, bold = true })
|
||||||
|
h('htmlItalic', { italic = maybe.italic })
|
||||||
|
h('htmlLink', { fg = groups.link })
|
||||||
|
h('htmlTag', { fg = p.subtle })
|
||||||
|
h('htmlTagN', { fg = p.text })
|
||||||
|
h('htmlTagName', { fg = p.foam })
|
||||||
|
|
||||||
|
h('markdownDelimiter', { fg = p.subtle })
|
||||||
|
h('markdownH1', { fg = groups.headings.h1, bold = true })
|
||||||
|
h('markdownH1Delimiter', { link = 'markdownH1' })
|
||||||
|
h('markdownH2', { fg = groups.headings.h2, bold = true })
|
||||||
|
h('markdownH2Delimiter', { link = 'markdownH2' })
|
||||||
|
h('markdownH3', { fg = groups.headings.h3, bold = true })
|
||||||
|
h('markdownH3Delimiter', { link = 'markdownH3' })
|
||||||
|
h('markdownH4', { fg = groups.headings.h4, bold = true })
|
||||||
|
h('markdownH4Delimiter', { link = 'markdownH4' })
|
||||||
|
h('markdownH5', { fg = groups.headings.h5, bold = true })
|
||||||
|
h('markdownH5Delimiter', { link = 'markdownH5' })
|
||||||
|
h('markdownH6', { fg = groups.headings.h6, bold = true })
|
||||||
|
h('markdownH6Delimiter', { link = 'markdownH6' })
|
||||||
|
h(
|
||||||
|
'markdownLinkText',
|
||||||
|
{ fg = groups.link, sp = groups.link, underline = true }
|
||||||
|
)
|
||||||
|
h('markdownUrl', { link = 'markdownLinkText' })
|
||||||
|
|
||||||
|
h('mkdCode', { fg = p.foam, italic = maybe.italic })
|
||||||
|
h('mkdCodeDelimiter', { fg = p.rose })
|
||||||
|
h('mkdCodeEnd', { fg = p.foam })
|
||||||
|
h('mkdCodeStart', { fg = p.foam })
|
||||||
|
h('mkdFootnotes', { fg = p.foam })
|
||||||
|
h('mkdID', { fg = p.foam, underline = true })
|
||||||
|
h('mkdInlineURL', { fg = groups.link, underline = true })
|
||||||
|
h('mkdLink', { link = 'mkdInlineURL' })
|
||||||
|
h('mkdLinkDef', { link = 'mkdInlineURL' })
|
||||||
|
h('mkdListItemLine', { fg = p.text })
|
||||||
|
h('mkdRule', { fg = p.subtle })
|
||||||
|
h('mkdURL', { link = 'mkdInlineURL' })
|
||||||
|
|
||||||
|
h('DiagnosticError', { fg = groups.error })
|
||||||
|
h('DiagnosticHint', { fg = groups.hint })
|
||||||
|
h('DiagnosticInfo', { fg = groups.info })
|
||||||
|
h('DiagnosticWarn', { fg = groups.warn })
|
||||||
|
h('DiagnosticDefaultError', { fg = groups.error })
|
||||||
|
h('DiagnosticDefaultHint', { fg = groups.hint })
|
||||||
|
h('DiagnosticDefaultInfo', { fg = groups.info })
|
||||||
|
h('DiagnosticDefaultWarn', { fg = groups.warn })
|
||||||
|
h('DiagnosticFloatingError', { fg = groups.error })
|
||||||
|
h('DiagnosticFloatingHint', { fg = groups.hint })
|
||||||
|
h('DiagnosticFloatingInfo', { fg = groups.info })
|
||||||
|
h('DiagnosticFloatingWarn', { fg = groups.warn })
|
||||||
|
h('DiagnosticSignError', { fg = groups.error })
|
||||||
|
h('DiagnosticSignHint', { fg = groups.hint })
|
||||||
|
h('DiagnosticSignInfo', { fg = groups.info })
|
||||||
|
h('DiagnosticSignWarn', { fg = groups.warn })
|
||||||
|
h('DiagnosticStatusLineError', { fg = groups.error, bg = groups.panel })
|
||||||
|
h('DiagnosticStatusLineHint', { fg = groups.hint, bg = groups.panel })
|
||||||
|
h('DiagnosticStatusLineInfo', { fg = groups.info, bg = groups.panel })
|
||||||
|
h('DiagnosticStatusLineWarn', { fg = groups.warn, bg = groups.panel })
|
||||||
|
h('DiagnosticUnderlineError', { sp = groups.error, undercurl = true })
|
||||||
|
h('DiagnosticUnderlineHint', { sp = groups.hint, undercurl = true })
|
||||||
|
h('DiagnosticUnderlineInfo', { sp = groups.info, undercurl = true })
|
||||||
|
h('DiagnosticUnderlineWarn', { sp = groups.warn, undercurl = true })
|
||||||
|
h('DiagnosticVirtualTextError', { fg = groups.error })
|
||||||
|
h('DiagnosticVirtualTextHint', { fg = groups.hint })
|
||||||
|
h('DiagnosticVirtualTextInfo', { fg = groups.info })
|
||||||
|
h('DiagnosticVirtualTextWarn', { fg = groups.warn })
|
||||||
|
|
||||||
|
-- healthcheck
|
||||||
|
h('healthError', { fg = groups.error })
|
||||||
|
h('healthSuccess', { fg = groups.info })
|
||||||
|
h('healthWarning', { fg = groups.warn })
|
||||||
|
|
||||||
|
-- Treesitter
|
||||||
|
h('@boolean', { link = 'Boolean' })
|
||||||
|
h('@character', { link = 'Character' })
|
||||||
|
h('@character.special', { link = '@character' })
|
||||||
|
h('@class', { fg = p.foam })
|
||||||
|
h('@comment', { link = 'Comment' })
|
||||||
|
h('@conditional', { link = 'Conditional' })
|
||||||
|
h('@constant', { link = 'Constant' })
|
||||||
|
h('@constant.builtin', { fg = p.love })
|
||||||
|
h('@constant.macro', { link = '@constant' })
|
||||||
|
h('@constructor', { fg = p.foam })
|
||||||
|
h('@field', { fg = p.foam })
|
||||||
|
h('@function', { link = 'Function' })
|
||||||
|
h('@function.builtin', { fg = p.love })
|
||||||
|
h('@function.macro', { link = '@function' })
|
||||||
|
h('@include', { link = 'Include' })
|
||||||
|
h('@interface', { fg = p.foam })
|
||||||
|
h('@keyword', { link = 'Keyword' })
|
||||||
|
h('@keyword.operator', { fg = p.subtle })
|
||||||
|
h('@label', { link = 'Label' })
|
||||||
|
h('@macro', { link = 'Macro' })
|
||||||
|
h('@method', { fg = p.iris })
|
||||||
|
h('@number', { link = 'Number' })
|
||||||
|
h('@operator', { link = 'Operator' })
|
||||||
|
h('@parameter', { fg = p.iris, italic = maybe.italic })
|
||||||
|
h('@preproc', { link = 'PreProc' })
|
||||||
|
h('@property', { fg = p.foam, italic = maybe.italic })
|
||||||
|
h('@punctuation', { fg = groups.punctuation })
|
||||||
|
h('@punctuation.bracket', { link = '@punctuation' })
|
||||||
|
h('@punctuation.delimiter', { link = '@punctuation' })
|
||||||
|
h('@punctuation.special', { link = '@punctuation' })
|
||||||
|
h('@regexp', { link = 'String' })
|
||||||
|
h('@repeat', { link = 'Repeat' })
|
||||||
|
h('@storageclass', { link = 'StorageClass' })
|
||||||
|
h('@string', { link = 'String' })
|
||||||
|
h('@string.escape', { fg = p.pine })
|
||||||
|
h('@string.special', { link = '@string' })
|
||||||
|
h('@symbol', { link = 'Identifier' })
|
||||||
|
h('@tag', { link = 'Tag' })
|
||||||
|
h('@tag.attribute', { fg = p.iris })
|
||||||
|
h('@tag.delimiter', { fg = p.subtle })
|
||||||
|
h('@text', { fg = p.text })
|
||||||
|
h('@text.strong', { bold = true })
|
||||||
|
h('@text.emphasis', { italic = true })
|
||||||
|
h('@text.underline', { underline = true })
|
||||||
|
h('@text.strike', { strikethrough = true })
|
||||||
|
h('@text.math', { link = 'Special' })
|
||||||
|
h('@text.environment', { link = 'Macro' })
|
||||||
|
h('@text.environment.name', { link = 'Type' })
|
||||||
|
h('@text.title', { link = 'Title' })
|
||||||
|
h('@text.uri', { fg = groups.link })
|
||||||
|
h('@text.note', { link = 'SpecialComment' })
|
||||||
|
h('@text.warning', { fg = groups.warn })
|
||||||
|
h('@text.danger', { fg = groups.error })
|
||||||
|
h('@todo', { link = 'Todo' })
|
||||||
|
h('@type', { link = 'Type' })
|
||||||
|
h('@variable', { fg = p.text, italic = maybe.italic })
|
||||||
|
h('@variable.builtin', { fg = p.love })
|
||||||
|
h('@namespace', { link = '@include' })
|
||||||
|
|
||||||
|
-- LSP Semantic Token Groups
|
||||||
|
h('@lsp.type.enum', { link = '@type' })
|
||||||
|
h('@lsp.type.keyword', { link = '@keyword' })
|
||||||
|
h('@lsp.type.interface', { link = '@interface' })
|
||||||
|
h('@lsp.type.namespace', { link = '@namespace' })
|
||||||
|
h('@lsp.type.parameter', { link = '@parameter' })
|
||||||
|
h('@lsp.type.property', { link = '@property' })
|
||||||
|
h('@lsp.type.variable', {}) -- use treesitter styles for regular variables
|
||||||
|
h('@lsp.typemod.function.defaultLibrary', { link = 'Special' })
|
||||||
|
h('@lsp.typemod.variable.defaultLibrary', { link = '@variable.builtin' })
|
||||||
|
|
||||||
|
-- vim.lsp.buf.document_highlight()
|
||||||
|
h('LspReferenceText', { bg = p.highlight_med })
|
||||||
|
h('LspReferenceRead', { bg = p.highlight_med })
|
||||||
|
h('LspReferenceWrite', { bg = p.highlight_med })
|
||||||
|
|
||||||
|
-- lsp-highlight-codelens
|
||||||
|
h('LspCodeLens', { fg = p.subtle }) -- virtual text of code len
|
||||||
|
h('LspCodeLensSeparator', { fg = p.highlight_high }) -- separator between two or more code len
|
||||||
|
|
||||||
|
-- romgrk/barbar.nvim
|
||||||
|
h('BufferCurrent', { fg = p.text, bg = p.overlay })
|
||||||
|
h('BufferCurrentIndex', { fg = p.text, bg = p.overlay })
|
||||||
|
h('BufferCurrentMod', { fg = p.foam, bg = p.overlay })
|
||||||
|
h('BufferCurrentSign', { fg = p.subtle, bg = p.overlay })
|
||||||
|
h('BufferCurrentTarget', { fg = p.gold, bg = p.overlay })
|
||||||
|
h('BufferInactive', { fg = p.subtle })
|
||||||
|
h('BufferInactiveIndex', { fg = p.subtle })
|
||||||
|
h('BufferInactiveMod', { fg = p.foam })
|
||||||
|
h('BufferInactiveSign', { fg = p.muted })
|
||||||
|
h('BufferInactiveTarget', { fg = p.gold })
|
||||||
|
h('BufferTabpageFill', { fg = groups.background, bg = groups.background })
|
||||||
|
h('BufferVisible', { fg = p.subtle })
|
||||||
|
h('BufferVisibleIndex', { fg = p.subtle })
|
||||||
|
h('BufferVisibleMod', { fg = p.foam })
|
||||||
|
h('BufferVisibleSign', { fg = p.muted })
|
||||||
|
h('BufferVisibleTarget', { fg = p.gold })
|
||||||
|
|
||||||
|
-- lewis6991/gitsigns.nvim
|
||||||
|
h('GitSignsAdd', { fg = groups.git_add })
|
||||||
|
h('GitSignsChange', { fg = groups.git_change })
|
||||||
|
h('GitSignsDelete', { fg = groups.git_delete })
|
||||||
|
h('SignAdd', { link = 'GitSignsAdd' })
|
||||||
|
h('SignChange', { link = 'GitSignsChange' })
|
||||||
|
h('SignDelete', { link = 'GitSignsDelete' })
|
||||||
|
|
||||||
|
-- mvllow/modes.nvim
|
||||||
|
h('ModesCopy', { bg = p.gold })
|
||||||
|
h('ModesDelete', { bg = p.love })
|
||||||
|
h('ModesInsert', { bg = p.foam })
|
||||||
|
h('ModesVisual', { bg = p.iris })
|
||||||
|
|
||||||
|
-- kyazdani42/nvim-tree.lua
|
||||||
|
h('NvimTreeEmptyFolderName', { fg = p.muted })
|
||||||
|
h('NvimTreeFileDeleted', { fg = p.love })
|
||||||
|
h('NvimTreeFileDirty', { fg = p.rose })
|
||||||
|
h('NvimTreeFileMerge', { fg = p.iris })
|
||||||
|
h('NvimTreeFileNew', { fg = p.foam })
|
||||||
|
h('NvimTreeFileRenamed', { fg = p.pine })
|
||||||
|
h('NvimTreeFileStaged', { fg = p.iris })
|
||||||
|
h('NvimTreeFolderIcon', { fg = p.subtle })
|
||||||
|
h('NvimTreeFolderName', { fg = p.foam })
|
||||||
|
h('NvimTreeGitDeleted', { fg = groups.git_delete })
|
||||||
|
h('NvimTreeGitDirty', { fg = groups.git_dirty })
|
||||||
|
h('NvimTreeGitIgnored', { fg = groups.git_ignore })
|
||||||
|
h('NvimTreeGitMerge', { fg = groups.git_merge })
|
||||||
|
h('NvimTreeGitNew', { fg = groups.git_add })
|
||||||
|
h('NvimTreeGitRenamed', { fg = groups.git_rename })
|
||||||
|
h('NvimTreeGitStaged', { fg = groups.git_stage })
|
||||||
|
h('NvimTreeImageFile', { fg = p.text })
|
||||||
|
h('NvimTreeNormal', { fg = p.text })
|
||||||
|
h('NvimTreeOpenedFile', { fg = p.text, bg = p.highlight_med })
|
||||||
|
h('NvimTreeOpenedFolderName', { link = 'NvimTreeFolderName' })
|
||||||
|
h('NvimTreeRootFolder', { fg = p.iris })
|
||||||
|
h('NvimTreeSpecialFile', { link = 'NvimTreeNormal' })
|
||||||
|
h('NvimTreeWindowPicker', { fg = p.love, bg = p.love, blend = 10 })
|
||||||
|
|
||||||
|
-- nvim-neo-tree/neo-tree.nvim
|
||||||
|
h('NeoTreeTitleBar', { fg = p.surface, bg = p.pine })
|
||||||
|
|
||||||
|
-- folke/which-key.nvim
|
||||||
|
h('WhichKey', { fg = p.iris })
|
||||||
|
h('WhichKeyGroup', { fg = p.foam })
|
||||||
|
h('WhichKeySeparator', { fg = p.subtle })
|
||||||
|
h('WhichKeyDesc', { fg = p.gold })
|
||||||
|
h('WhichKeyFloat', { bg = maybe.surface })
|
||||||
|
h('WhichKeyValue', { fg = p.rose })
|
||||||
|
|
||||||
|
-- luka-reineke/indent-blankline.nvim
|
||||||
|
h('IndentBlanklineChar', { fg = p.muted })
|
||||||
|
h('IndentBlanklineSpaceChar', { fg = p.muted })
|
||||||
|
h('IndentBlanklineSpaceCharBlankline', { fg = p.muted })
|
||||||
|
|
||||||
|
-- hrsh7th/nvim-cmp
|
||||||
|
h('CmpItemAbbr', { fg = p.subtle })
|
||||||
|
h('CmpItemAbbrDeprecated', { fg = p.subtle, strikethrough = true })
|
||||||
|
h('CmpItemAbbrMatch', { fg = p.text, bold = true })
|
||||||
|
h('CmpItemAbbrMatchFuzzy', { fg = p.text, bold = true })
|
||||||
|
h('CmpItemKind', { fg = p.subtle })
|
||||||
|
h('CmpItemKindClass', { fg = p.pine })
|
||||||
|
h('CmpItemKindFunction', { fg = p.rose })
|
||||||
|
h('CmpItemKindInterface', { fg = p.foam })
|
||||||
|
h('CmpItemKindMethod', { fg = p.iris })
|
||||||
|
h('CmpItemKindSnippet', { fg = p.gold })
|
||||||
|
h('CmpItemKindVariable', { fg = p.text })
|
||||||
|
|
||||||
|
-- TimUntersberger/neogit
|
||||||
|
h('NeogitDiffAddHighlight', { fg = p.foam, bg = p.highlight_med })
|
||||||
|
h('NeogitDiffContextHighlight', { bg = p.highlight_low })
|
||||||
|
h('NeogitDiffDeleteHighlight', { fg = p.love, bg = p.highlight_med })
|
||||||
|
h('NeogitHunkHeader', { bg = p.highlight_low })
|
||||||
|
h('NeogitHunkHeaderHighlight', { bg = p.highlight_low })
|
||||||
|
|
||||||
|
-- vimwiki/vimwiki
|
||||||
|
h('VimwikiHR', { fg = p.subtle })
|
||||||
|
h('VimwikiHeader1', { fg = groups.headings.h1, bold = true })
|
||||||
|
h('VimwikiHeader2', { fg = groups.headings.h2, bold = true })
|
||||||
|
h('VimwikiHeader3', { fg = groups.headings.h3, bold = true })
|
||||||
|
h('VimwikiHeader4', { fg = groups.headings.h4, bold = true })
|
||||||
|
h('VimwikiHeader5', { fg = groups.headings.h5, bold = true })
|
||||||
|
h('VimwikiHeader6', { fg = groups.headings.h6, bold = true })
|
||||||
|
h('VimwikiHeaderChar', { fg = p.pine })
|
||||||
|
h('VimwikiLink', { fg = groups.link, underline = true })
|
||||||
|
h('VimwikiList', { fg = p.iris })
|
||||||
|
h('VimwikiNoExistsLink', { fg = p.love })
|
||||||
|
|
||||||
|
-- nvim-neorg/neorg
|
||||||
|
h('NeorgHeading1Prefix', { fg = groups.headings.h1, bold = true })
|
||||||
|
h('NeorgHeading1Title', { link = 'NeorgHeading1Prefix' })
|
||||||
|
h('NeorgHeading2Prefix', { fg = groups.headings.h2, bold = true })
|
||||||
|
h('NeorgHeading2Title', { link = 'NeorgHeading2Prefix' })
|
||||||
|
h('NeorgHeading3Prefix', { fg = groups.headings.h3, bold = true })
|
||||||
|
h('NeorgHeading3Title', { link = 'NeorgHeading3Prefix' })
|
||||||
|
h('NeorgHeading4Prefix', { fg = groups.headings.h4, bold = true })
|
||||||
|
h('NeorgHeading4Title', { link = 'NeorgHeading4Prefix' })
|
||||||
|
h('NeorgHeading5Prefix', { fg = groups.headings.h5, bold = true })
|
||||||
|
h('NeorgHeading5Title', { link = 'NeorgHeading5Prefix' })
|
||||||
|
h('NeorgHeading6Prefix', { fg = groups.headings.h6, bold = true })
|
||||||
|
h('NeorgHeading6Title', { link = 'NeorgHeading6Prefix' })
|
||||||
|
h('NeorgMarkerTitle', { fg = p.text, bold = true })
|
||||||
|
|
||||||
|
-- tami5/lspsaga.nvim (fork of glepnir/lspsaga.nvim)
|
||||||
|
h('DefinitionCount', { fg = p.rose })
|
||||||
|
h('DefinitionIcon', { fg = p.rose })
|
||||||
|
h('DefintionPreviewTitle', { fg = p.rose, bold = true })
|
||||||
|
h('LspFloatWinBorder', { fg = groups.border })
|
||||||
|
h('LspFloatWinNormal', { bg = maybe.surface })
|
||||||
|
h('LspSagaAutoPreview', { fg = p.subtle })
|
||||||
|
h('LspSagaCodeActionBorder', { fg = groups.border })
|
||||||
|
h('LspSagaCodeActionContent', { fg = p.foam })
|
||||||
|
h('LspSagaCodeActionTitle', { fg = p.gold, bold = true })
|
||||||
|
h('LspSagaCodeActionTruncateLine', { link = 'LspSagaCodeActionBorder' })
|
||||||
|
h('LspSagaDefPreviewBorder', { fg = groups.border })
|
||||||
|
h('LspSagaDiagnosticBorder', { fg = groups.border })
|
||||||
|
h('LspSagaDiagnosticHeader', { fg = p.gold, bold = true })
|
||||||
|
h('LspSagaDiagnosticTruncateLine', { link = 'LspSagaDiagnosticBorder' })
|
||||||
|
h('LspSagaDocTruncateLine', { link = 'LspSagaHoverBorder' })
|
||||||
|
h('LspSagaFinderSelection', { fg = p.gold })
|
||||||
|
h('LspSagaHoverBorder', { fg = groups.border })
|
||||||
|
h('LspSagaLspFinderBorder', { fg = groups.border })
|
||||||
|
h('LspSagaRenameBorder', { fg = p.pine })
|
||||||
|
h('LspSagaRenamePromptPrefix', { fg = p.love })
|
||||||
|
h('LspSagaShTruncateLine', { link = 'LspSagaSignatureHelpBorder' })
|
||||||
|
h('LspSagaSignatureHelpBorder', { fg = p.pine })
|
||||||
|
h('ReferencesCount', { fg = p.rose })
|
||||||
|
h('ReferencesIcon', { fg = p.rose })
|
||||||
|
h('SagaShadow', { bg = p.overlay })
|
||||||
|
h('TargetWord', { fg = p.iris })
|
||||||
|
|
||||||
|
-- ray-x/lsp_signature.nvim
|
||||||
|
h('LspSignatureActiveParameter', { bg = p.overlay })
|
||||||
|
|
||||||
|
-- rlane/pounce.nvim
|
||||||
|
h('PounceAccept', { fg = p.love, bg = p.highlight_high })
|
||||||
|
h('PounceAcceptBest', { fg = p.base, bg = p.gold })
|
||||||
|
h('PounceGap', { link = 'Search' })
|
||||||
|
h('PounceMatch', { link = 'Search' })
|
||||||
|
|
||||||
|
local float_background = options.dim_nc_background
|
||||||
|
and (options.disable_float_background and groups.panel_nc or groups.panel)
|
||||||
|
or maybe.surface
|
||||||
|
|
||||||
|
-- ggandor/leap.nvim
|
||||||
|
h('LeapMatch', { link = 'MatchParen' })
|
||||||
|
h('LeapLabelPrimary', { link = 'IncSearch' })
|
||||||
|
h('LeapLabelSecondary', { fg = p.base, bg = p.pine })
|
||||||
|
|
||||||
|
-- nvim-telescope/telescope.nvim
|
||||||
|
h('TelescopeBorder', { fg = groups.border, bg = float_background })
|
||||||
|
h('TelescopeMatching', { fg = p.rose })
|
||||||
|
h('TelescopeNormal', { fg = p.subtle, bg = float_background })
|
||||||
|
h('TelescopePromptNormal', { fg = p.text, bg = float_background })
|
||||||
|
h('TelescopePromptPrefix', { fg = p.subtle })
|
||||||
|
h('TelescopeSelection', { fg = p.text, bg = p.overlay })
|
||||||
|
h('TelescopeSelectionCaret', { fg = p.rose, bg = p.overlay })
|
||||||
|
h('TelescopeTitle', { fg = p.subtle })
|
||||||
|
|
||||||
|
-- rcarriga/nvim-notify
|
||||||
|
h('NotifyINFOBorder', { fg = p.foam })
|
||||||
|
h('NotifyINFOTitle', { link = 'NotifyINFOBorder' })
|
||||||
|
h('NotifyINFOIcon', { link = 'NotifyINFOBorder' })
|
||||||
|
h('NotifyWARNBorder', { fg = p.gold })
|
||||||
|
h('NotifyWARNTitle', { link = 'NotifyWARNBorder' })
|
||||||
|
h('NotifyWARNIcon', { link = 'NotifyWARNBorder' })
|
||||||
|
h('NotifyDEBUGBorder', { fg = p.muted })
|
||||||
|
h('NotifyDEBUGTitle', { link = 'NotifyDEBUGBorder' })
|
||||||
|
h('NotifyDEBUGIcon', { link = 'NotifyDEBUGBorder' })
|
||||||
|
h('NotifyTRACEBorder', { fg = p.iris })
|
||||||
|
h('NotifyTRACETitle', { link = 'NotifyTRACEBorder' })
|
||||||
|
h('NotifyTRACEIcon', { link = 'NotifyTRACEBorder' })
|
||||||
|
h('NotifyERRORBorder', { fg = p.love })
|
||||||
|
h('NotifyERRORTitle', { link = 'NotifyERRORBorder' })
|
||||||
|
h('NotifyERRORIcon', { link = 'NotifyERRORBorder' })
|
||||||
|
|
||||||
|
-- rcarriga/nvim-dap-ui
|
||||||
|
h('DapUIVariable', { link = 'Normal' })
|
||||||
|
h('DapUIValue', { link = 'Normal' })
|
||||||
|
h('DapUIFrameName', { link = 'Normal' })
|
||||||
|
h('DapUIThread', { fg = p.gold })
|
||||||
|
h('DapUIWatchesValue', { link = 'DapUIThread' })
|
||||||
|
h('DapUIBreakpointsInfo', { link = 'DapUIThread' })
|
||||||
|
h('DapUIBreakpointsCurrentLine', { fg = p.gold, bold = true })
|
||||||
|
h('DapUIWatchesEmpty', { fg = p.love })
|
||||||
|
h('DapUIWatchesError', { link = 'DapUIWatchesEmpty' })
|
||||||
|
h('DapUIBreakpointsDisabledLine', { fg = p.muted })
|
||||||
|
h('DapUISource', { fg = p.iris })
|
||||||
|
h('DapUIBreakpointsPath', { fg = p.foam })
|
||||||
|
h('DapUIScope', { link = 'DapUIBreakpointsPath' })
|
||||||
|
h('DapUILineNumber', { link = 'DapUIBreakpointsPath' })
|
||||||
|
h('DapUIBreakpointsLine', { link = 'DapUIBreakpointsPath' })
|
||||||
|
h('DapUIFloatBorder', { link = 'DapUIBreakpointsPath' })
|
||||||
|
h('DapUIStoppedThread', { link = 'DapUIBreakpointsPath' })
|
||||||
|
h('DapUIDecoration', { link = 'DapUIBreakpointsPath' })
|
||||||
|
h('DapUIModifiedValue', { fg = p.foam, bold = true })
|
||||||
|
|
||||||
|
-- glepnir/dashboard-nvim
|
||||||
|
h('DashboardShortcut', { fg = p.love })
|
||||||
|
h('DashboardHeader', { fg = p.pine })
|
||||||
|
h('DashboardCenter', { fg = p.gold })
|
||||||
|
h('DashboardFooter', { fg = p.iris })
|
||||||
|
|
||||||
|
-- SmiteshP/nvim-navic
|
||||||
|
h('NavicIconsFile', { fg = p.base })
|
||||||
|
h('NavicIconsModule', { fg = p.rose })
|
||||||
|
h('NavicIconsNamespace', { fg = p.base })
|
||||||
|
h('NavicIconsPackage', { fg = p.base })
|
||||||
|
h('NavicIconsClass', { fg = p.foam })
|
||||||
|
h('NavicIconsMethod', { fg = p.iris })
|
||||||
|
h('NavicIconsProperty', { fg = p.foam })
|
||||||
|
h('NavicIconsField', { fg = p.foam })
|
||||||
|
h('NavicIconsConstructor', { fg = p.gold })
|
||||||
|
h('NavicIconsEnum', { fg = p.gold })
|
||||||
|
h('NavicIconsInterface', { fg = p.foam })
|
||||||
|
h('NavicIconsFunction', { fg = p.pine })
|
||||||
|
h('NavicIconsVariable', { fg = p.text })
|
||||||
|
h('NavicIconsConstant', { fg = p.gold })
|
||||||
|
h('NavicIconsString', { fg = p.gold })
|
||||||
|
h('NavicIconsNumber', { fg = p.gold })
|
||||||
|
h('NavicIconsBoolean', { fg = p.rose })
|
||||||
|
h('NavicIconsArray', { fg = p.gold })
|
||||||
|
h('NavicIconsObject', { fg = p.gold })
|
||||||
|
h('NavicIconsKey', { fg = p.iris })
|
||||||
|
h('NavicIconsKeyword', { fg = p.pine })
|
||||||
|
h('NavicIconsNull', { fg = p.love })
|
||||||
|
h('NavicIconsEnumMember', { fg = p.foam })
|
||||||
|
h('NavicIconsStruct', { fg = p.foam })
|
||||||
|
h('NavicIconsEvent', { fg = p.gold })
|
||||||
|
h('NavicIconsOperator', { fg = p.subtle })
|
||||||
|
h('NavicIconsTypeParameter', { fg = p.foam })
|
||||||
|
h('NavicText', { fg = p.subtle })
|
||||||
|
h('NavicSeparator', { fg = p.subtle })
|
||||||
|
|
||||||
|
-- folke/noice.nvim
|
||||||
|
h('NoiceCursor', { fg = p.highlight_high, bg = p.text })
|
||||||
|
|
||||||
|
-- echasnovski/mini.indentscope
|
||||||
|
h('MiniIndentscopeSymbol', { fg = p.highlight_med })
|
||||||
|
h('MiniIndentscopeSymbolOff', { fg = p.highlight_med })
|
||||||
|
|
||||||
|
-- goolord/alpha-nvim
|
||||||
|
h('AlphaHeader', { fg = p.pine })
|
||||||
|
h('AlphaButtons', { fg = p.foam })
|
||||||
|
h('AlphaShortcut', { fg = p.rose })
|
||||||
|
h('AlphaFooter', { fg = p.gold })
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
-- Set user highlights
|
||||||
|
for group, color in pairs(options.highlight_groups) do
|
||||||
|
h(group, color)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
71
lua/rose-pine/util.lua
Normal file
71
lua/rose-pine/util.lua
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
local util = {}
|
||||||
|
|
||||||
|
local function byte(value, offset)
|
||||||
|
return bit.band(bit.rshift(value, offset), 0xFF)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function rgb(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 { byte(color, 16), byte(color, 8), byte(color, 0) }
|
||||||
|
end
|
||||||
|
|
||||||
|
local function parse_color(color)
|
||||||
|
if color == nil then
|
||||||
|
return print('invalid color')
|
||||||
|
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
|
||||||
|
|
||||||
|
return color
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param fg string foreground color
|
||||||
|
---@param bg string background color
|
||||||
|
---@param alpha number number between 0 (background) and 1 (foreground)
|
||||||
|
util.blend = function(fg, bg, alpha)
|
||||||
|
local fg_rgb = rgb(parse_color(fg))
|
||||||
|
local bg_rgb = rgb(parse_color(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
|
||||||
|
|
||||||
|
return string.format(
|
||||||
|
'#%02X%02X%02X',
|
||||||
|
blend_channel(1),
|
||||||
|
blend_channel(2),
|
||||||
|
blend_channel(3)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param group string
|
||||||
|
---@param color table<string, any>
|
||||||
|
util.highlight = function(group, color)
|
||||||
|
local fg = color.fg and parse_color(color.fg) or 'none'
|
||||||
|
local bg = color.bg and parse_color(color.bg) or 'none'
|
||||||
|
local sp = color.sp and parse_color(color.sp) or ''
|
||||||
|
|
||||||
|
if
|
||||||
|
color.blend ~= nil
|
||||||
|
and (color.blend >= 0 or color.blend <= 100)
|
||||||
|
and bg ~= nil
|
||||||
|
then
|
||||||
|
bg = util.blend(bg, parse_color('base') or '', color.blend / 100)
|
||||||
|
end
|
||||||
|
|
||||||
|
color = vim.tbl_extend('force', color, { fg = fg, bg = bg, sp = sp })
|
||||||
|
vim.api.nvim_set_hl(0, group, color)
|
||||||
|
end
|
||||||
|
|
||||||
|
return util
|
||||||
|
|
@ -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
|
|
||||||
170
readme.md
170
readme.md
|
|
@ -11,36 +11,27 @@
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Getting started
|
## Usage
|
||||||
|
|
||||||
Install `rose-pine/neovim` using your favourite package manager:
|
> With [lazy.nvim](https://github.com/folke/lazy.nvim)
|
||||||
|
|
||||||
### [pam.nvim](https://github.com/mvllow/pam.nvim)
|
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
{ source = "rose-pine/neovim", as = "rose-pine" }
|
require("lazy").setup({
|
||||||
|
{ 'rose-pine/neovim', name = 'rose-pine' }
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd('colorscheme rose-pine')
|
||||||
```
|
```
|
||||||
|
|
||||||
### [lazy.nvim](https://lazy.folke.io/installation)
|
> With [packer.nvim](https://github.com/wbthomason/packer.nvim)
|
||||||
|
|
||||||
**Structured Setup**
|
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
-- lua/plugins/rose-pine.lua
|
use({ 'rose-pine/neovim', as = 'rose-pine' })
|
||||||
return {
|
|
||||||
"rose-pine/neovim",
|
vim.cmd('colorscheme rose-pine')
|
||||||
name = "rose-pine",
|
|
||||||
config = function()
|
|
||||||
vim.cmd("colorscheme rose-pine")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Single file**
|
_Supported plugins are listed in the [wiki](https://github.com/rose-pine/neovim/wiki#supported-plugins)_
|
||||||
|
|
||||||
```lua
|
|
||||||
{ "rose-pine/neovim", name = "rose-pine" }
|
|
||||||
```
|
|
||||||
|
|
||||||
## Gallery
|
## Gallery
|
||||||
|
|
||||||
|
|
@ -58,104 +49,69 @@ return {
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> Options should be set **before** colorscheme
|
||||||
> 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.
|
Variant respects `vim.o.background`, 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".
|
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require("rose-pine").setup({
|
require('rose-pine').setup({
|
||||||
variant = "auto", -- auto, main, moon, or dawn
|
--- @usage 'auto'|'main'|'moon'|'dawn'
|
||||||
dark_variant = "main", -- main, moon, or dawn
|
variant = 'auto',
|
||||||
dim_inactive_windows = false,
|
--- @usage 'main'|'moon'|'dawn'
|
||||||
extend_background_behind_borders = true,
|
dark_variant = 'main',
|
||||||
|
bold_vert_split = false,
|
||||||
|
dim_nc_background = false,
|
||||||
|
disable_background = false,
|
||||||
|
disable_float_background = false,
|
||||||
|
disable_italics = false,
|
||||||
|
|
||||||
enable = {
|
--- @usage string hex value or named color from rosepinetheme.com/palette
|
||||||
terminal = true,
|
groups = {
|
||||||
legacy_highlights = true, -- Improve compatibility for previous versions of Neovim
|
background = 'base',
|
||||||
migrations = true, -- Handle deprecated options automatically
|
background_nc = '_experimental_nc',
|
||||||
},
|
panel = 'surface',
|
||||||
|
panel_nc = 'base',
|
||||||
|
border = 'highlight_med',
|
||||||
|
comment = 'muted',
|
||||||
|
link = 'iris',
|
||||||
|
punctuation = 'subtle',
|
||||||
|
|
||||||
styles = {
|
error = 'love',
|
||||||
bold = true,
|
hint = 'iris',
|
||||||
italic = true,
|
info = 'foam',
|
||||||
transparency = false,
|
warn = 'gold',
|
||||||
},
|
|
||||||
|
|
||||||
groups = {
|
headings = {
|
||||||
border = "muted",
|
h1 = 'iris',
|
||||||
link = "iris",
|
h2 = 'foam',
|
||||||
panel = "surface",
|
h3 = 'rose',
|
||||||
|
h4 = 'gold',
|
||||||
|
h5 = 'pine',
|
||||||
|
h6 = 'foam',
|
||||||
|
}
|
||||||
|
-- or set all headings at once
|
||||||
|
-- headings = 'subtle'
|
||||||
|
},
|
||||||
|
|
||||||
error = "love",
|
-- Change specific vim highlight groups
|
||||||
hint = "iris",
|
-- https://github.com/rose-pine/neovim/wiki/Recipes
|
||||||
info = "foam",
|
highlight_groups = {
|
||||||
note = "pine",
|
ColorColumn = { bg = 'rose' },
|
||||||
todo = "rose",
|
|
||||||
warn = "gold",
|
|
||||||
|
|
||||||
git_add = "foam",
|
-- Blend colours against the "base" background
|
||||||
git_change = "rose",
|
CursorLine = { bg = 'foam', blend = 10 },
|
||||||
git_delete = "love",
|
StatusLine = { fg = 'love', bg = 'love', blend = 10 },
|
||||||
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,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd("colorscheme rose-pine")
|
-- Set colorscheme after options
|
||||||
-- vim.cmd("colorscheme rose-pine-main")
|
vim.cmd('colorscheme rose-pine')
|
||||||
-- vim.cmd("colorscheme rose-pine-moon")
|
|
||||||
-- vim.cmd("colorscheme rose-pine-dawn")
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!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
|
## 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 via `:Inspect` in Neovim 0.9 or [nvim-treesitter/playground](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)
|
||||||
|
- [Palette reference by name](https://rosepinetheme.com/palette)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue