Skip to content

Commit

Permalink
feat: add opts for colors highlights & telescope (#6)
Browse files Browse the repository at this point in the history
* feat: make borderless telescope theme optional

* chore: auto-generate vimdoc

* feat: add highlight and color override options

* docs: add configuring section with example options

* chore: auto-generate vimdoc

---------

Co-authored-by: scottmckendry <scottmckendry@users.noreply.github.com>
  • Loading branch information
scottmckendry and scottmckendry committed Dec 28, 2023
1 parent 329bac4 commit eedbda3
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 18 deletions.
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

0 comments on commit eedbda3

Please sign in to comment.