Skip to content

Commit 943846c

Browse files
committed
feat(snacks): add nvchad style
Added a nvchad picker style option for the snacks.nvim plugin, as well as making the picker theme be consistent with the telescope theme.
1 parent 62de91b commit 943846c

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

doc/neopywal-plugins.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,7 @@ snacks.nvim>lua
14581458
-- e.g: function(C) return C.color1 end
14591459
scope_color = "",
14601460
current_scope_color = "",
1461+
-- style = "nvchad"
14611462
}
14621463
}
14631464
})

docs/neopywal-plugins.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,7 @@ require("neopywal").setup({
21792179
-- e.g: function(C) return C.color1 end
21802180
scope_color = "",
21812181
current_scope_color = "",
2182+
-- style = "nvchad"
21822183
}
21832184
}
21842185
})

lua/neopywal/theme/plugins/snacks.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ function M.get()
4242
SnacksDashboardTerminal = { fg = C.error, styles = { "bold" } },
4343
SnacksDashboardTitle = { fg = C.color4, styles = { "bold" } },
4444

45+
-- Picker
46+
SnacksTitle = { fg = C.color4 },
47+
SnacksPickerInputTitle = { link = "SnacksTitle" },
48+
SnacksPickerTitle = { fg = C.color3 },
49+
SnacksPickerPrompt = { fg = C.color4, styles = { "bold" } },
50+
SnacksPickerListCursorLine = { bg = U.blend(C.color4, C.background, 0.2), fg = C.color4 },
51+
SnacksPickerPreviewCursorLine = { link = "SnacksPickerListCursorLine" },
52+
4553
-- Notifier.
4654
SnacksNotifierInfo = { fg = C.info },
4755
SnacksNotifierIconInfo = { link = "SnacksNotifierInfo" },
@@ -74,6 +82,22 @@ function M.get()
7482
SnacksNotifierFooterDebug = { link = "DiagnosticUnnecessary" },
7583
}
7684

85+
hl = O.plugins.snacks.style ~= nil
86+
and string.lower(O.plugins.snacks.style) == "nvchad"
87+
and not O.transparent_background
88+
and vim.tbl_deep_extend("force", hl, {
89+
SnacksPickerBorder = {
90+
bg = C.background,
91+
fg = C.background,
92+
},
93+
SnacksTitle = { bg = C.color4, fg = C.background },
94+
SnacksPickerTitle = { bg = C.color3, fg = C.background },
95+
-- SnacksPickerBox = { bg = C.cursorline },
96+
SnacksPickerInput = { bg = C.cursorline },
97+
SnacksPickerInputBorder = { bg = C.cursorline, fg = C.cursorline },
98+
})
99+
or hl
100+
77101
for i, color in ipairs(require("neopywal.utils.rainbow").get()) do
78102
hl["SnacksIndent" .. i] = { fg = color, styles = { "nocombine" } }
79103
end

lua/neopywal/types.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@
306306
---@field rainbow BasicModule?
307307
---@field sandwich BasicModule?
308308
---@field scrollbar BasicModule?
309-
---@field snacks {enabled: boolean, scope_color: ValidColorOptions?, current_scope_color: ValidColorOptions?} | boolean?
309+
---@field snacks {enabled: boolean, style: "classic" | "nvchad" | nil?, scope_color: ValidColorOptions?, current_scope_color: ValidColorOptions?} | boolean?
310310
---@field sneak {enabled: boolean, sneak_color: ValidColorOptions?, style: HighlightStyles[]?} | boolean?
311311
---@field surround BasicModule?
312312
---@field symbols_outline BasicModule?

0 commit comments

Comments
 (0)