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 colors highlights & telescope #6

Merged
merged 5 commits into from
Dec 28, 2023
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
49 changes: 46 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ Lazy:
priority = 1000,
config = function()
require("cyberdream").setup({
transparent = true, -- enable transparent background
italic_comments = true, -- italicize comments
hide_fillchars = true, -- replace all fillchars with ' ' for the ultimate clean look
-- Recommended - see "Configuring" below for more config options
transparent = true,
italic_comments = true,
hide_fillchars = true,
borderless_telescope = true,
})
vim.cmd("colorscheme cyberdream") -- set the colorscheme
end,
Expand All @@ -73,6 +75,47 @@ Lualine (optional):

See my personal lualine config [here](https://github.com/scottmckendry/Windots/blob/main/nvim/lua/plugins/lualine.lua) for an example.

## ⚙️ Configuring

Below is an example of all the available configuration options:

```lua
require("cyberdream").setup({
-- Enable transparent background
transparent = true, -- Default: false

-- Enable italics comments
italic_comments = true, -- Default: false

-- Replace all fillchars with ' ' for the ultimate clean look
hide_fillchars = true, -- Default: false

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

theme = { -- Default: nil
highlights = {
-- Highlight groups to override, adding new groups is also possible
-- See `:help highlight-groups` for a list of highlight groups

-- Example:
Comment = { fg = "#696969", bg = "NONE", italic = true },

-- Complete list can be found in `lua/cyberdream/theme.lua`
},

-- Override a color entirely
colors = {
-- For a list of colors see `lua/cyberdream/colours.lua`
-- Example:
bg = "#000000",
green = "#00ff00",
magenta = "#ff00ff",
},
},
})
```

## 🤝 Contributing

Pull requests are welcome. If a plugin you use is not supported, please open an issue and I'll try to add support for it. If you have any suggestions or feedback, please open an issue.
51 changes: 48 additions & 3 deletions doc/cyberdream.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Table of Contents *cyberdream.nvim-table-of-contents*

- Features |cyberdream.nvim-features|
- Installation |cyberdream.nvim-installation|
- Configuring |cyberdream.nvim-configuring|
- Contributing |cyberdream.nvim-contributing|

A high-contrast, futuristic & vibrant theme for neovim
Expand Down Expand Up @@ -35,9 +36,11 @@ Lazy:
priority = 1000,
config = function()
require("cyberdream").setup({
transparent = true, -- enable transparent background
italic_comments = true, -- italicize comments
hide_fillchars = true, -- replace all fillchars with ' ' for the ultimate clean look
-- Recommended - see "Configuring" below for more config options
transparent = true,
italic_comments = true,
hide_fillchars = true,
borderless_telescope = true,
})
vim.cmd("colorscheme cyberdream") -- set the colorscheme
end,
Expand All @@ -64,6 +67,48 @@ See my personal lualine config here
for an example.


CONFIGURING *cyberdream.nvim-configuring*

Below is an example of all the available configuration options:

>lua
require("cyberdream").setup({
-- Enable transparent background
transparent = true, -- Default: false

-- Enable italics comments
italic_comments = true, -- Default: false

-- Replace all fillchars with ' ' for the ultimate clean look
hide_fillchars = true, -- Default: false

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

theme = { -- Default: nil
highlights = {
-- Highlight groups to override, adding new groups is also possible
-- See `:help highlight-groups` for a list of highlight groups

-- Example:
Comment = { fg = "#696969", bg = "NONE", italic = true },

-- Complete list can be found in `lua/cyberdream/theme.lua`
},

-- Override a color entirely
colors = {
-- For a list of colors see `lua/cyberdream/colours.lua`
-- Example:
bg = "#000000",
green = "#00ff00",
magenta = "#ff00ff",
},
},
})
<


CONTRIBUTING *cyberdream.nvim-contributing*

Pull requests are welcome. If a plugin you use is not supported, please open an
Expand Down
6 changes: 6 additions & 0 deletions lua/cyberdream/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ local default_options = {
transparent = false,
italic_comments = false,
hide_fillchars = false,
borderless_telescope = true,

theme = {
colors = {},
highlights = {},
},
}

---@type Config
Expand Down
38 changes: 26 additions & 12 deletions lua/cyberdream/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ function M.setup()
local theme = {}
local t = colors.default

-- Override colors with user defined colors
t = vim.tbl_deep_extend("force", t, opts.theme.colors)

if opts.transparent then
t.bg = "NONE"
end
Expand Down Expand Up @@ -174,18 +177,11 @@ function M.setup()
AlphaButtons = { fg = t.blue },

-- Telescope
TelescopeBorder = { fg = t.bgAlt, bg = t.bgAlt },
TelescopeNormal = { bg = t.bgAlt },
TelescopePreviewBorder = { fg = t.bgAlt, bg = t.bgAlt },
TelescopePreviewNormal = { bg = t.bgAlt },
TelescopePreviewTitle = { fg = t.bgAlt, bg = t.green },
TelescopePromptBorder = { fg = t.bgAlt, bg = t.bgAlt },
TelescopePromptNormal = { fg = t.fg, bg = t.bgAlt },
TelescopePromptPrefix = { fg = t.red, bg = t.bgAlt },
TelescopePromptTitle = { fg = t.bgAlt, bg = t.red },
TelescopeResultsBorder = { fg = t.bgAlt, bg = t.bgAlt },
TelescopeResultsNormal = { bg = t.bgAlt },
TelescopeResultsTitle = { fg = t.bgAlt, bg = t.bgAlt },
TelescopeBorder = { fg = t.bgHighlight },
TelescopePromptTitle = { fg = t.blue },
TelescopeResultsTitle = { fg = t.cyan },
TelescopePromptPrefix = { fg = t.pink },
TelescopePreviewTitle = { fg = t.magenta },

-- Cmp
CmpDocumentation = { fg = t.grey, bg = t.bg },
Expand Down Expand Up @@ -222,6 +218,24 @@ function M.setup()
LazyProgressTodo = { bold = true, fg = t.grey },
}

if opts.borderless_telescope then
theme.highlights.TelescopeBorder = { fg = t.bgAlt, bg = t.bgAlt }
theme.highlights.TelescopeNormal = { bg = t.bgAlt }
theme.highlights.TelescopePreviewBorder = { fg = t.bgAlt, bg = t.bgAlt }
theme.highlights.TelescopePreviewNormal = { bg = t.bgAlt }
theme.highlights.TelescopePreviewTitle = { fg = t.bgAlt, bg = t.green }
theme.highlights.TelescopePromptBorder = { fg = t.bgAlt, bg = t.bgAlt }
theme.highlights.TelescopePromptNormal = { fg = t.fg, bg = t.bgAlt }
theme.highlights.TelescopePromptPrefix = { fg = t.red, bg = t.bgAlt }
theme.highlights.TelescopePromptTitle = { fg = t.bgAlt, bg = t.red }
theme.highlights.TelescopeResultsBorder = { fg = t.bgAlt, bg = t.bgAlt }
theme.highlights.TelescopeResultsNormal = { bg = t.bgAlt }
theme.highlights.TelescopeResultsTitle = { fg = t.bgAlt, bg = t.bgAlt }
end

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

return theme
end

Expand Down