Skip to content

Commit

Permalink
feat: add opts for terminal colors (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
akiyosi committed Mar 9, 2024
1 parent 7b83422 commit 78a1024
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Lazy:
italic_comments = true,
hide_fillchars = true,
borderless_telescope = true,
terminal_colors = true,
})
vim.cmd("colorscheme cyberdream") -- set the colorscheme
end,
Expand Down
4 changes: 4 additions & 0 deletions doc/cyberdream.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Lazy:
italic_comments = true,
hide_fillchars = true,
borderless_telescope = true,
terminal_colors = true,
})
vim.cmd("colorscheme cyberdream") -- set the colorscheme
end,
Expand Down Expand Up @@ -90,6 +91,9 @@ Below is an example of all the available configuration options:

-- Modern borderless telescope theme
borderless_telescope = true, -- Default: true

-- Set terminal colors used in `:terminal`
terminal_colors = true, -- Default: true

theme = { -- Default: nil
highlights = {
Expand Down
1 change: 1 addition & 0 deletions lua/cyberdream/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local default_options = {
italic_comments = false,
hide_fillchars = false,
borderless_telescope = true,
terminal_colos = true,

theme = {
colors = {},
Expand Down
26 changes: 26 additions & 0 deletions lua/cyberdream/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,32 @@ function M.setup()
theme.highlights.TelescopeResultsTitle = { fg = t.bgAlt, bg = t.bgAlt }
end

if opts.terminal_colors then
vim.g.terminal_color_0 = t.bg
vim.g.terminal_color_8 = t.bgAlt

vim.g.terminal_color_7 = t.fg
vim.g.terminal_color_15 = t.grey

vim.g.terminal_color_1 = t.red
vim.g.terminal_color_9 = t.red

vim.g.terminal_color_2 = t.green
vim.g.terminal_color_10 = t.green

vim.g.terminal_color_3 = t.yellow
vim.g.terminal_color_11 = t.yellow

vim.g.terminal_color_4 = t.blue
vim.g.terminal_color_12 = t.blue

vim.g.terminal_color_5 = t.purple
vim.g.terminal_color_13 = t.purple

vim.g.terminal_color_6 = t.cyan
vim.g.terminal_color_14 = t.cyan
end

-- Override highlights with user defined highlights
theme.highlights = vim.tbl_deep_extend("force", theme.highlights, opts.theme.highlights or {})

Expand Down

0 comments on commit 78a1024

Please sign in to comment.