diff --git a/README.md b/README.md index fe7c9a8..c66bac0 100644 --- a/README.md +++ b/README.md @@ -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, diff --git a/doc/cyberdream.txt b/doc/cyberdream.txt index d124fbf..151eab9 100644 --- a/doc/cyberdream.txt +++ b/doc/cyberdream.txt @@ -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, @@ -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 = { diff --git a/lua/cyberdream/config.lua b/lua/cyberdream/config.lua index a798654..58e5b75 100644 --- a/lua/cyberdream/config.lua +++ b/lua/cyberdream/config.lua @@ -6,6 +6,7 @@ local default_options = { italic_comments = false, hide_fillchars = false, borderless_telescope = true, + terminal_colos = true, theme = { colors = {}, diff --git a/lua/cyberdream/theme.lua b/lua/cyberdream/theme.lua index 8e09121..de2fd40 100644 --- a/lua/cyberdream/theme.lua +++ b/lua/cyberdream/theme.lua @@ -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 {})