Skip to content

Commit c1085d7

Browse files
feat(telescope): add nvchad borderless telescope style (#75)
* feat(ci): run ci checks on pull requests * feat(telescope): added option to use `nvchad` style telescope * feat(telescope): add flat style for the 'catch-all' default --------- Co-authored-by: Scott McKendry <[email protected]>
1 parent 99746e8 commit c1085d7

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

lua/cyberdream/config.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ local M = {}
2020
---@field highlights? table<string, table<string, string>>
2121
---@field overrides? CyberdreamOverrideFn
2222

23+
---@alias CyberdreamTelescopeStyle "nvchad" | "flat"
24+
2325
---@class Config
2426
---@field transparent? boolean
2527
---@field italic_comments? boolean
2628
---@field hide_fillchars? boolean
27-
---@field borderless_telescope? boolean
29+
---@field borderless_telescope? boolean | { border: boolean, style: CyberdreamTelescopeStyle }
2830
---@field terminal_colors? boolean
2931
---@field theme? ThemeConfig
3032
local default_options = {

lua/cyberdream/theme.lua

+21-6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ function M.setup()
4848
})
4949
end
5050

51+
local borderless_telescope = opts.borderless_telescope
52+
local telescope_style = ""
53+
if type(opts.borderless_telescope) == "table" then
54+
borderless_telescope = not opts.borderless_telescope.border
55+
telescope_style = opts.borderless_telescope.style
56+
end
57+
5158
theme.highlights = {
5259
Comment = { fg = t.grey, italic = opts.italic_comments },
5360
ColorColumn = { bg = t.bgHighlight },
@@ -343,16 +350,24 @@ function M.setup()
343350
["@keyword"] = { link = "Keyword" },
344351
}
345352

346-
if opts.borderless_telescope then
353+
if borderless_telescope then
347354
theme.highlights.TelescopeBorder = { fg = t.bgAlt, bg = t.bgAlt }
348355
theme.highlights.TelescopeNormal = { bg = t.bgAlt }
349356
theme.highlights.TelescopePreviewBorder = { fg = t.bgAlt, bg = t.bgAlt }
350357
theme.highlights.TelescopePreviewNormal = { bg = t.bgAlt }
351-
theme.highlights.TelescopePreviewTitle = { fg = t.bgAlt, bg = t.green }
352-
theme.highlights.TelescopePromptBorder = { fg = t.bgAlt, bg = t.bgAlt }
353-
theme.highlights.TelescopePromptNormal = { fg = t.fg, bg = t.bgAlt }
354-
theme.highlights.TelescopePromptPrefix = { fg = t.red, bg = t.bgAlt }
355-
theme.highlights.TelescopePromptTitle = { fg = t.bgAlt, bg = t.red }
358+
if telescope_style == "nvchad" then
359+
theme.highlights.TelescopePreviewTitle = { fg = t.bgAlt, bg = t.green, bold = true }
360+
theme.highlights.TelescopePromptBorder = { fg = t.bgHighlight, bg = t.bgHighlight }
361+
theme.highlights.TelescopePromptNormal = { fg = t.fg, bg = t.bgHighlight }
362+
theme.highlights.TelescopePromptPrefix = { fg = t.red, bg = t.bgHighlight }
363+
theme.highlights.TelescopePromptTitle = { fg = t.bgAlt, bg = t.red, bold = true }
364+
else
365+
theme.highlights.TelescopePreviewTitle = { fg = t.bgAlt, bg = t.green }
366+
theme.highlights.TelescopePromptBorder = { fg = t.bgAlt, bg = t.bgAlt }
367+
theme.highlights.TelescopePromptNormal = { fg = t.fg, bg = t.bgAlt }
368+
theme.highlights.TelescopePromptPrefix = { fg = t.red, bg = t.bgAlt }
369+
theme.highlights.TelescopePromptTitle = { fg = t.bgAlt, bg = t.red }
370+
end
356371
theme.highlights.TelescopeResultsBorder = { fg = t.bgAlt, bg = t.bgAlt }
357372
theme.highlights.TelescopeResultsNormal = { bg = t.bgAlt }
358373
theme.highlights.TelescopeResultsTitle = { fg = t.bgAlt, bg = t.bgAlt }

0 commit comments

Comments
 (0)