├── LICENSE ├── README.md ├── colors └── darcubox.lua ├── lua └── darcubox │ ├── groups.lua │ ├── init.lua │ └── palette.lua └── stylua.toml /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Silas Duarte 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # darcubox 2 | 3 | A color scheme for Neovim inspired by Gruvbox and Darcula written in Lua 4 | 5 | ![darcubox](https://github.com/dotsilas/darcubox-nvim/assets/84829590/e88ffbf6-a658-4def-83d3-90907f11f07c) 6 | 7 | **Note: This is under development.** 8 | 9 | Hello! Thanks for checking out Darcubox. 10 | 11 | The project's goal is to create a high-contrast colorscheme(s) for Neovim (and other tools) that has beautiful defaults but is also customizable. 12 | 13 | If you encounter issues or have ideas, please open an issue or send a pull request! 14 | 15 | ## Instalation 16 | 17 | Using [lazy.nvim](https://github.com/folke/lazy.nvim): 18 | 19 | ```lua 20 | { "dotsilas/darcubox-nvim" } 21 | ``` 22 | 23 | Using [packer.nvim](https://github.com/wbthomason/packer.nvim): 24 | 25 | ```lua 26 | use { "dotsilas/darcubox-nvim" } 27 | ``` 28 | 29 | ## Usage 30 | 31 | ### Lua 32 | 33 | ```lua 34 | vim.cmd[[colorscheme darcubox]] 35 | ``` 36 | 37 | ## Configuration 38 | 39 | The default configuration for darcubox is as follows: 40 | 41 | ```lua 42 | require('darcubox').setup({ 43 | options = { 44 | transparent = false, 45 | styles = { 46 | comments = {}, 47 | functions = {}, 48 | keywords = {}, 49 | types = {}, 50 | }, 51 | }, 52 | }) 53 | ``` 54 | 55 | You can change the background to transparent and the styles of `Comment`, `Function`, `Keyword` and `Type` syntax groups as follows: 56 | 57 | ```lua 58 | require('darcubox').setup({ 59 | options = { 60 | transparent = true, 61 | styles = { 62 | comments = { italic = true }, -- italic 63 | functions = { bold = true }, -- bold 64 | keywords = { italic = true }, 65 | types = { italic = true, bold = true }, -- italics and bold 66 | }, 67 | }, 68 | }) 69 | 70 | -- Set the configuration before loading the color scheme 71 | 72 | vim.cmd[[colorscheme darcubox]] 73 | ``` 74 | 75 | ## Thanks to: 76 | 77 | ### Palette inspiration 78 | 79 | - [Gruvbox](https://github.com/morhetz/gruvbox) 80 | - [Darcula](https://github.com/bulenkov/Darcula) 81 | 82 | ### Template ideas 83 | 84 | - [Material](https://github.com/marko-cerovac/material.nvim) 85 | - [Tokio Night](https://github.com/folke/tokyonight.nvim) 86 | 87 | ## Licence 88 | 89 | [MIT](./LICENCE) 90 | -------------------------------------------------------------------------------- /colors/darcubox.lua: -------------------------------------------------------------------------------- 1 | require("darcubox").load() 2 | -------------------------------------------------------------------------------- /lua/darcubox/groups.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | function M.setup() 4 | local config = require("darcubox").config 5 | local p = require("darcubox.palette").palette 6 | 7 | local background = config.options.transparent and "NONE" or p.background 8 | 9 | local groups = { 10 | 11 | -- ui elements 12 | Normal = { bg = background, fg = p.foreground }, 13 | NormalFloat = { link = "Normal" }, 14 | LineNr = { fg = p.surface2 }, 15 | VertSplit = { fg = p.surface2 }, 16 | CursorLine = { bg = p.surface1 }, 17 | CursorColumn = { link = "CursorLine" }, 18 | ColorColumn = { bg = background }, 19 | Directory = { fg = p.silver }, 20 | CursorLineNr = { fg = p.alabaster }, 21 | WinSeparator = { link = "VertSplit" }, 22 | SignColumn = { link = "ColorColumn" }, 23 | TabLine = { link = "StatusLine" }, 24 | TabLineSel = { fg = p.black, bg = p.foreground }, 25 | Title = { fg = p.alabaster }, 26 | StatusLine = { fg = p.silver, bg = p.black }, 27 | Visual = { bg = p.surface2 }, 28 | Conceal = { fg = p.foreground }, 29 | IncSearch = { fg = p.black, bg = p.gold }, 30 | Substitute = { fg = p.black, bg = p.sunshine }, 31 | MatchParen = { bg = p.gold, fg = p.black }, 32 | NonText = { fg = background }, 33 | Search = { bg = p.ember, fg = p.black }, 34 | Whitespace = { fg = p.surface1 }, 35 | Pmenu = { bg = p.surface1, fg = p.foreground }, 36 | menuSel = { bg = p.surface2, fg = p.alabaster }, 37 | PmenuSbar = { bg = p.surface2, fg = p.silver }, 38 | PmenuThumb = { bg = p.white, fg = p.alabaster }, 39 | Number = { fg = p.lime }, 40 | Float = { link = "Number" }, 41 | Boolean = { link = "Number" }, 42 | 43 | -- syntax 44 | Comment = { fg = p.silver }, 45 | Keyword = { fg = p.ember }, 46 | Conditional = { link = "Keyword" }, 47 | Repeat = { link = "Keyword" }, 48 | Constant = { fg = p.meadow }, 49 | Function = { fg = p.foreground }, 50 | Identifier = { fg = p.sunshine }, 51 | Operator = { fg = p.alabaster }, 52 | Parameter = { fg = p.alabaster }, 53 | Delimiter = { link = "Parameter" }, 54 | Field = { fg = p.sunshine }, 55 | Include = { link = "Keyword" }, 56 | Namespace = { fg = p.sapphire }, 57 | PreProc = { link = "Operator" }, 58 | Special = { fg = p.foreground }, 59 | Statement = { fg = p.gold }, 60 | String = { link = "Constant" }, 61 | Type = { fg = p.sapphire }, 62 | Typedef = { fg = p.lilac }, 63 | Warn = { fg = p.crimson }, 64 | 65 | -- alerts 66 | ErrorMsg = { fg = p.error }, 67 | MoreMsg = { fg = p.sapphire }, 68 | WarningMsg = { fg = p.warning_bg }, 69 | 70 | -- git 71 | DiffAdd = { fg = p.meadow }, 72 | DiffChange = { fg = p.hint_bg }, 73 | DiffDelete = { fg = p.crimson }, 74 | DiffText = { fg = p.gold }, 75 | diffAdded = { link = "DiffAdd" }, 76 | diffRemoved = { link = "DiffDelete" }, 77 | diffChanged = { link = "DiffChange" }, 78 | 79 | ["@tag"] = { fg = p.gold }, -- Tags like html tag names. 80 | ["@tag.attribute"] = { fg = p.sand }, -- Tags like html tag names. 81 | ["@tag.delimiter"] = { fg = p.gold }, -- Tag delimiter like < > / 82 | ["@constructor"] = { fg = p.gold }, -- Tag delimiter like < > / 83 | ["@property"] = { fg = p.gold }, -- Tag delimiter like < > / 84 | } 85 | 86 | -- apply userconfig 87 | groups.Comment = vim.tbl_extend("keep", groups.Comment, config.options.styles.comments) 88 | groups.Function = vim.tbl_extend("keep", groups.Function, config.options.styles.functions) 89 | groups.Keyword = vim.tbl_extend("keep", groups.Keyword, config.options.styles.keywords) 90 | groups.Type = vim.tbl_extend("keep", groups.Type, config.options.styles.types) 91 | 92 | for group, hl in pairs(config.overrides) do 93 | if groups[group] then 94 | -- "link" should not mix with other configs (:h hi-link) 95 | groups[group].link = nil 96 | end 97 | 98 | groups[group] = vim.tbl_extend("force", groups[group] or {}, hl) 99 | end 100 | 101 | return groups 102 | end 103 | 104 | return M 105 | -------------------------------------------------------------------------------- /lua/darcubox/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local defaults = { 4 | options = { 5 | transparent = false, 6 | styles = { 7 | comments = {}, 8 | functions = {}, 9 | keywords = {}, 10 | types = {}, 11 | }, 12 | }, 13 | overrides = {}, 14 | } 15 | 16 | M.config = defaults 17 | 18 | function M.setup(config) 19 | M.config = vim.tbl_deep_extend("force", M.config, config or {}) 20 | end 21 | 22 | function M.load() 23 | if vim.version().minor < 8 then 24 | vim.notify_once("darcubox.nvim: you must use neovim 0.8 or higher") 25 | return 26 | end 27 | 28 | -- reset colors 29 | if vim.g.colors_name then 30 | vim.cmd.hi("clear") 31 | end 32 | 33 | vim.g.colors_name = "darcubox" 34 | vim.o.termguicolors = true 35 | 36 | local groups = require("darcubox.groups").setup() 37 | 38 | -- add highlights 39 | for group, settings in pairs(groups) do 40 | -- if M.config.options.transparent then 41 | -- settings.bg = "NONE" -- Aplica la transparencia del fondo 42 | -- end 43 | vim.api.nvim_set_hl(0, group, settings) 44 | end 45 | end 46 | 47 | return M 48 | -------------------------------------------------------------------------------- /lua/darcubox/palette.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.palette = { 4 | -- UI 5 | contrast = "#0a0d0f", 6 | background = "#0e1214", 7 | surface1 = "#25262c", 8 | surface2 = "#404146", 9 | foreground = "#d0c6a5", 10 | 11 | -- Syntax 12 | black = "#16181c", 13 | sunshine = "#ffd072", 14 | gold = "#fb982e", 15 | ember = "#dd4e21", 16 | sand = "#e6a96b", 17 | meadow = "#52a260", 18 | lime = "#9cd750", 19 | sapphire = "#0f829d", 20 | crimson = "#d01c26", 21 | lilac = "#cd80b9", 22 | silver = "#8f8682", 23 | alabaster = "#efead9", 24 | 25 | -- TODO: 26 | -- diff, git and diagnostic colors 27 | 28 | error = "#eb5f6a", 29 | plus = "#5a9f81", 30 | error_bg = "#4d2d2c", 31 | warning_bg = "#42321b", 32 | info_bg = "#484040", 33 | hint_bg = "#263c50", 34 | } 35 | 36 | return M 37 | -------------------------------------------------------------------------------- /stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | # quote_style = "AutoPreferDouble" 6 | # no_call_parentheses = false 7 | # collapse_simple_statement = "Always" 8 | 9 | [sort_requires] 10 | enabled = true 11 | --------------------------------------------------------------------------------