Skip to content

Commit 2310246

Browse files
committed
Merge branch 'main' into refactor/syntax-highlighting
2 parents ea74ecc + 278bfeb commit 2310246

File tree

11 files changed

+180
-40
lines changed

11 files changed

+180
-40
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,20 @@ pounce = false
11181118
</tr>
11191119
<!-- pounce.nvim -->
11201120

1121+
<!-- rainbow-delimiters.nvim -->
1122+
</tr>
1123+
<tr>
1124+
<td> <a href="https://github.com/HiPhish/rainbow-delimiters.nvim">rainbow-delimiters.nvim</a> </td>
1125+
<td>
1126+
1127+
```lua
1128+
rainbow_delimiters = true
1129+
```
1130+
1131+
</td>
1132+
</tr>
1133+
<!-- rainbow-delimiters.nvim -->
1134+
11211135
<!-- symbols-outline.nvim -->
11221136
</tr>
11231137
<tr>

doc/catppuccin.txt

+4
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,10 @@ pounce.nvim>lua
701701
pounce = false
702702
<
703703

704+
rainbow-delimiters.nvim>lua
705+
rainbow_delimiters = true
706+
<
707+
704708
symbols-outline.nvim>lua
705709
symbols_outline = false
706710
<

lua/catppuccin/groups/integrations/navic.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function M.get()
3232
NavicIconsEvent = { fg = C.blue, bg = background },
3333
NavicIconsOperator = { fg = C.sky, bg = background },
3434
NavicIconsTypeParameter = { fg = C.blue, bg = background },
35-
NavicText = { fg = C.teal, bg = background },
35+
NavicText = { fg = C.sapphire, bg = background },
3636
NavicSeparator = { fg = C.text, bg = background },
3737
}
3838
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
local M = {}
2+
3+
function M.get()
4+
return {
5+
RainbowDelimiterRed = { fg = C.red },
6+
RainbowDelimiterYellow = { fg = C.yellow },
7+
RainbowDelimiterBlue = { fg = C.blue },
8+
RainbowDelimiterOrange = { fg = C.peach },
9+
RainbowDelimiterGreen = { fg = C.green },
10+
RainbowDelimiterViolet = { fg = C.mauve },
11+
RainbowDelimiterCyan = { fg = C.teal },
12+
}
13+
end
14+
15+
return M

lua/catppuccin/groups/integrations/treesitter.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ If you want to stay on nvim 0.7, either disable the integration or pin catppucci
4848
["@method.call"] = { link = "Function" }, -- For method calls.
4949

5050
["@constructor"] = { fg = C.sapphire }, -- For constructor calls and definitions: = { } in Lua, and Java constructors.
51-
["@parameter"] = { fg = C.rosewater, style = { "italic" } }, -- For parameters of a function.
51+
["@parameter"] = { fg = C.rosewater, style = O.styles.variables or {} }, -- For parameters of a function.
5252

5353
-- Keywords
5454
["@keyword"] = { link = "Keyword" }, -- For keywords that don't fall in previous categories.

lua/catppuccin/groups/integrations/which_key.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function M.get()
66
WhichKeyBorder = { link = "FloatBorder" },
77

88
WhichKeyGroup = { fg = C.blue },
9-
WhichKeySeperator = { fg = C.overlay0 },
9+
WhichKeySeparator = { fg = C.overlay0 },
1010
WhichKeyDesc = { fg = C.pink },
1111
WhichKeyValue = { fg = C.overlay0 },
1212
}

lua/catppuccin/init.lua

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ local M = {
4141
gitsigns = true,
4242
markdown = true,
4343
nvimtree = true,
44+
rainbow_delimiters = true,
4445
semantic_tokens = not is_vim,
4546
telescope = {
4647
enabled = true,

lua/catppuccin/lib/mapper.lua

+25-37
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,12 @@
11
local M = {}
22

3-
local function get_integrations()
4-
local integrations = O["integrations"]
5-
local final_integrations = {}
6-
7-
for integration in pairs(integrations) do
8-
local cot = false
9-
if type(integrations[integration]) == "table" then
10-
if integrations[integration]["enabled"] == true then cot = true end
11-
else
12-
if integrations[integration] == true then cot = true end
13-
end
14-
15-
if cot then
16-
final_integrations = vim.tbl_deep_extend(
17-
"force",
18-
final_integrations,
19-
require("catppuccin.groups.integrations." .. integration).get()
20-
)
21-
end
22-
end
23-
24-
return final_integrations
25-
end
26-
273
function M.apply(flavour)
284
flavour = flavour or require("catppuccin").flavour
29-
-- Borrowing global var
30-
_G._O = O
31-
_G._C = C
32-
_G._U = U
335

34-
_G.O = require("catppuccin").options
35-
_G.C = require("catppuccin.palettes").get_palette(flavour)
36-
_G.U = require "catppuccin.utils.colors"
6+
local _O, _C, _U = O, C, U -- Borrowing global var (setfenv doesn't work with require)
7+
O = require("catppuccin").options
8+
C = require("catppuccin.palettes").get_palette(flavour)
9+
U = require "catppuccin.utils.colors"
3710

3811
C.none = "NONE"
3912

@@ -51,20 +24,35 @@ function M.apply(flavour)
5124
local theme = {}
5225
theme.syntax = require("catppuccin.groups.syntax").get()
5326
theme.editor = require("catppuccin.groups.editor").get()
54-
theme.integrations = get_integrations() -- plugins
27+
local final_integrations = {}
28+
29+
for integration in pairs(O.integrations) do
30+
local cot = false
31+
if type(O.integrations[integration]) == "table" then
32+
if O.integrations[integration].enabled == true then cot = true end
33+
else
34+
if O.integrations[integration] == true then cot = true end
35+
end
36+
37+
if cot then
38+
final_integrations = vim.tbl_deep_extend(
39+
"force",
40+
final_integrations,
41+
require("catppuccin.groups.integrations." .. integration).get()
42+
)
43+
end
44+
end
45+
theme.integrations = final_integrations -- plugins
5546
theme.terminal = require("catppuccin.groups.terminal").get() -- terminal colors
56-
local user_highlights = require("catppuccin").options.highlight_overrides
47+
local user_highlights = O.highlight_overrides
5748
if type(user_highlights[flavour]) == "function" then user_highlights[flavour] = user_highlights[flavour](C) end
5849
theme.custom_highlights = vim.tbl_deep_extend(
5950
"keep",
6051
user_highlights[flavour] or {},
6152
type(user_highlights.all) == "function" and user_highlights.all(C) or user_highlights.all or {}
6253
)
6354

64-
-- Returning global var
65-
_G.O = _G._O
66-
_G.C = _G._C
67-
_G.U = _G._U
55+
O, C, U = _O, _C, _U -- Returning global var
6856

6957
return theme
7058
end

lua/catppuccin/types.lua

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
---@field native_lsp CtpIntegrationNativeLsp
6161
---@field navic CtpIntegrationNavic
6262
---@field nvimtree boolean
63+
---@field rainbow_delimiters boolean
6364
---@field semantic_tokens boolean
6465
---@field telescope CtpIntegrationTelescope
6566
---@field treesitter boolean

tests/setup_spec.lua

+107
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,113 @@ local configs = {
125125
end,
126126
},
127127
},
128+
backwardspy = {
129+
flavour = os.getenv "appearance" == "light" and "latte" or "mocha",
130+
integrations = {
131+
gitsigns = true,
132+
indent_blankline = { enabled = true },
133+
leap = true,
134+
mini = true,
135+
neotree = true,
136+
noice = true,
137+
cmp = true,
138+
notify = true,
139+
treesitter = true,
140+
telescope = true,
141+
which_key = true,
142+
},
143+
color_overrides = {
144+
mocha = {
145+
base = "#171717",
146+
mantle = "#101010",
147+
crust = "#0C0C0C",
148+
},
149+
},
150+
custom_highlights = function(colors)
151+
local utils = require "catppuccin.utils.colors"
152+
local tint = function(color) return utils.blend(color, colors.base, 0.2) end
153+
154+
return {
155+
--
156+
-- notify
157+
--
158+
NotifyBackground = { bg = colors.mantle },
159+
--
160+
-- noice
161+
--
162+
NoiceCmdlinePopup = { bg = colors.mantle },
163+
NoiceCmdlinePopupBorder = { bg = colors.mantle, fg = colors.mantle },
164+
--
165+
-- telescope
166+
--
167+
TelescopeMatching = { fg = colors.yellow },
168+
TelescopeSelection = { fg = colors.text, bg = colors.surface0 },
169+
-- results
170+
TelescopeResultsNormal = { bg = colors.mantle },
171+
TelescopeResultsBorder = { bg = colors.mantle, fg = colors.mantle },
172+
TelescopeResultsTitle = { fg = colors.mantle },
173+
-- prompt
174+
TelescopePromptNormal = { bg = colors.surface0 },
175+
TelescopePromptBorder = { bg = colors.surface0, fg = colors.surface0 },
176+
TelescopePromptTitle = { bg = colors.teal, fg = colors.mantle },
177+
TelescopePromptPrefix = { bg = colors.surface0 },
178+
-- preview
179+
TelescopePreviewNormal = { bg = colors.crust },
180+
TelescopePreviewBorder = { bg = colors.crust, fg = colors.crust },
181+
TelescopePreviewTitle = { bg = colors.pink, fg = colors.mantle },
182+
--
183+
-- neotree
184+
--
185+
NeoTreeNormal = { bg = colors.mantle },
186+
NeoTreeNormalNC = { bg = colors.mantle },
187+
--
188+
-- cmp
189+
--
190+
PmenuSel = { bg = colors.mantle, fg = "NONE" },
191+
Pmenu = { fg = colors.text, bg = colors.crust },
192+
193+
CmpItemAbbrDeprecated = { fg = colors.overlay0, bg = "NONE", style = { "strikethrough" } },
194+
CmpItemAbbrMatch = { fg = colors.yellow, bg = "NONE", style = { "bold" } },
195+
CmpItemAbbrMatchFuzzy = { fg = colors.yellow, bg = "NONE", style = { "bold" } },
196+
CmpItemMenu = { fg = colors.lavender, bg = "NONE", style = { "italic" } },
197+
198+
CmpItemKindField = { fg = colors.rosewater, bg = tint(colors.rosewater) },
199+
CmpItemKindProperty = { fg = colors.rosewater, bg = tint(colors.rosewater) },
200+
CmpItemKindEvent = { fg = colors.rosewater, bg = tint(colors.rosewater) },
201+
202+
CmpItemKindText = { fg = colors.text, bg = tint(colors.text) },
203+
CmpItemKindModule = { fg = colors.text, bg = tint(colors.text) },
204+
CmpItemKindVariable = { fg = colors.text, bg = tint(colors.text) },
205+
CmpItemKindFile = { fg = colors.text, bg = tint(colors.text) },
206+
CmpItemKindUnit = { fg = colors.text, bg = tint(colors.text) },
207+
CmpItemKindValue = { fg = colors.text, bg = tint(colors.text) },
208+
209+
CmpItemKindEnum = { fg = colors.yellow, bg = tint(colors.yellow) },
210+
CmpItemKindReference = { fg = colors.yellow, bg = tint(colors.yellow) },
211+
CmpItemKindClass = { fg = colors.yellow, bg = tint(colors.yellow) },
212+
CmpItemKindFolder = { fg = colors.yellow, bg = tint(colors.yellow) },
213+
CmpItemKindEnumMember = { fg = colors.yellow, bg = tint(colors.yellow) },
214+
CmpItemKindInterface = { fg = colors.yellow, bg = tint(colors.yellow) },
215+
216+
CmpItemKindKeyword = { fg = colors.mauve, bg = tint(colors.mauve) },
217+
218+
CmpItemKindConstant = { fg = colors.peach, bg = tint(colors.peach) },
219+
220+
CmpItemKindConstructor = { fg = colors.lavender, bg = tint(colors.lavender) },
221+
222+
CmpItemKindFunction = { fg = colors.blue, bg = tint(colors.blue) },
223+
CmpItemKindMethod = { fg = colors.blue, bg = tint(colors.blue) },
224+
225+
CmpItemKindStruct = { fg = colors.teal, bg = tint(colors.teal) },
226+
CmpItemKindOperator = { fg = colors.teal, bg = tint(colors.teal) },
227+
228+
CmpItemKindSnippet = { fg = colors.flamingo, bg = tint(colors.flamingo) },
229+
230+
CmpItemKindColor = { fg = colors.pink, bg = tint(colors.pink) },
231+
CmpItemKindTypeParameter = { fg = colors.maroon, bg = tint(colors.maroon) },
232+
}
233+
end,
234+
},
128235
}
129236

130237
describe("setup", function()

vim.yml

+10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ globals:
3737
args:
3838
- type: function
3939

40+
C:
41+
property: full-write
42+
O:
43+
property: full-write
44+
U:
45+
property: full-write
46+
4047
C.rosewater:
4148
type: string
4249
property: read-only
@@ -244,6 +251,9 @@ globals:
244251
O.integrations.ts_rainbow2:
245252
type: bool
246253
property: read-only
254+
O.integrations.rainbow_delimiters:
255+
type: bool
256+
property: read-only
247257

248258
O.integrations.barbecue.dim_dirname:
249259
type: bool

0 commit comments

Comments
 (0)