Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add opts for terminal colors #11

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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