Skip to content

Commit 78a1024

Browse files
authored
feat: add opts for terminal colors (#11)
1 parent 7b83422 commit 78a1024

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Lazy:
5858
italic_comments = true,
5959
hide_fillchars = true,
6060
borderless_telescope = true,
61+
terminal_colors = true,
6162
})
6263
vim.cmd("colorscheme cyberdream") -- set the colorscheme
6364
end,

doc/cyberdream.txt

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Lazy:
4747
italic_comments = true,
4848
hide_fillchars = true,
4949
borderless_telescope = true,
50+
terminal_colors = true,
5051
})
5152
vim.cmd("colorscheme cyberdream") -- set the colorscheme
5253
end,
@@ -90,6 +91,9 @@ Below is an example of all the available configuration options:
9091

9192
-- Modern borderless telescope theme
9293
borderless_telescope = true, -- Default: true
94+
95+
-- Set terminal colors used in `:terminal`
96+
terminal_colors = true, -- Default: true
9397

9498
theme = { -- Default: nil
9599
highlights = {

lua/cyberdream/config.lua

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ local default_options = {
66
italic_comments = false,
77
hide_fillchars = false,
88
borderless_telescope = true,
9+
terminal_colos = true,
910

1011
theme = {
1112
colors = {},

lua/cyberdream/theme.lua

+26
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,32 @@ function M.setup()
262262
theme.highlights.TelescopeResultsTitle = { fg = t.bgAlt, bg = t.bgAlt }
263263
end
264264

265+
if opts.terminal_colors then
266+
vim.g.terminal_color_0 = t.bg
267+
vim.g.terminal_color_8 = t.bgAlt
268+
269+
vim.g.terminal_color_7 = t.fg
270+
vim.g.terminal_color_15 = t.grey
271+
272+
vim.g.terminal_color_1 = t.red
273+
vim.g.terminal_color_9 = t.red
274+
275+
vim.g.terminal_color_2 = t.green
276+
vim.g.terminal_color_10 = t.green
277+
278+
vim.g.terminal_color_3 = t.yellow
279+
vim.g.terminal_color_11 = t.yellow
280+
281+
vim.g.terminal_color_4 = t.blue
282+
vim.g.terminal_color_12 = t.blue
283+
284+
vim.g.terminal_color_5 = t.purple
285+
vim.g.terminal_color_13 = t.purple
286+
287+
vim.g.terminal_color_6 = t.cyan
288+
vim.g.terminal_color_14 = t.cyan
289+
end
290+
265291
-- Override highlights with user defined highlights
266292
theme.highlights = vim.tbl_deep_extend("force", theme.highlights, opts.theme.highlights or {})
267293

0 commit comments

Comments
 (0)