From 45ae32d392bf0fef50238dcce31ffef73d40fd61 Mon Sep 17 00:00:00 2001 From: blob42 Date: Wed, 9 Aug 2023 04:01:11 +0200 Subject: [PATCH] theme udpates --- after/plugin/theme.lua | 21 ++--- lua/core/options.lua | 3 +- lua/custom/highlights.lua | 20 ++--- lua/custom/plugins/configs/neodev.lua | 2 +- lua/custom/plugins/configs/noirbuddy.lua | 40 ++++++++-- lua/custom/plugins/configs/todo-comments.lua | 12 ++- lua/custom/plugins/init.lua | 15 ++-- lua/custom/themes/blob42.lua | 45 +++++------ lua/plugins/configs/treesitter.lua | 2 +- lua/plugins/init.lua | 10 +-- lua/theme/highlights/init.lua | 82 ++++++++++++++++++++ 11 files changed, 181 insertions(+), 71 deletions(-) create mode 100644 lua/theme/highlights/init.lua diff --git a/after/plugin/theme.lua b/after/plugin/theme.lua index ba8256b..2258321 100644 --- a/after/plugin/theme.lua +++ b/after/plugin/theme.lua @@ -1,3 +1,4 @@ +--TODO: migrate to noirbuddy local c = require("base46.colors") local colors = require("base46").get_theme_tb "base_30" @@ -11,20 +12,20 @@ local highlights = { -- TreesitterContext = { -- bg = ts_context_hl, -- }, - InlayHint = { - fg = "#a9a19a", - }, - Comment = { - fg = c.change_hex_lightness(colors["one_bg"], 20), - }, + -- InlayHint = { + -- fg = "#a9a19a", + -- }, + -- Comment = { + -- fg = c.change_hex_lightness(colors["one_bg"], 20), + -- }, St_file_sep_rev = { fg = colors.statusline_bg, bg = colors.lightbg, }, - DiagnosticUnderlineError = { - fg = c.change_hex_lightness(colors["red"], 5), - underline = true, - }, + -- DiagnosticUnderlineError = { + -- fg = c.change_hex_lightness(colors["red"], 5), + -- underline = true, + -- }, } diff --git a/lua/core/options.lua b/lua/core/options.lua index 3298ee6..fa8bbea 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -25,7 +25,8 @@ opt.showmode = false opt.title = true opt.clipboard = "unnamed" -opt.cul = false -- cursor line +opt.cul = true -- cursor line +opt.cursorlineopt="number" -- opt.colorcolumn = "80" opt.colorcolumn = '+0' -- make colorcolumn follow text width opt.textwidth = 80 diff --git a/lua/custom/highlights.lua b/lua/custom/highlights.lua index 0e48fd3..abd9bcc 100644 --- a/lua/custom/highlights.lua +++ b/lua/custom/highlights.lua @@ -46,10 +46,10 @@ M.override = { } M.add = { - Visual = { - bg = "cyan", - fg = "black", - }, + -- Visual = { + -- bg = "cyan", + -- fg = "black", + -- }, BookmarkSign = { fg = "blue", }, @@ -101,9 +101,9 @@ M.add = { DapBreakpoint = { fg = "green" }, - DapStopped = { - fg = "#ff4848" - }, + -- DapStopped = { + -- fg = "#ff4848" + -- }, DapLogPoint = { fg = "vibrant_green" }, @@ -121,9 +121,9 @@ M.add = { fg = "teal", -- bg = "one_bg3", }, - NvimDapVirtualText = { - fg = '#f99540' - }, + -- NvimDapVirtualText = { + -- fg = '#f99540' + -- }, TabLineSel = { fg = "white", bold = true diff --git a/lua/custom/plugins/configs/neodev.lua b/lua/custom/plugins/configs/neodev.lua index 5e9315a..5b5fc91 100644 --- a/lua/custom/plugins/configs/neodev.lua +++ b/lua/custom/plugins/configs/neodev.lua @@ -15,7 +15,7 @@ local config = { runtime = true, -- runtime path types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others -- plugins = true, -- installed opt or start plugins in packpath - plugins = {"plenary.nvim", "grapple.nvim", "nvim-dap", "nvchad_ui", "base46"}, + plugins = {"plenary.nvim", "grapple.nvim", "nvim-dap", "nvchad_ui", "base46", "colorbuddy.nvim"}, -- -- plugins = {"navigator.lua", "guihua.lua", "go.nvim", "plenary.nvim"}, -- you can also specify the list of plugins to make available as a workspace library -- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" }, diff --git a/lua/custom/plugins/configs/noirbuddy.lua b/lua/custom/plugins/configs/noirbuddy.lua index e7e0073..0c0d9a5 100644 --- a/lua/custom/plugins/configs/noirbuddy.lua +++ b/lua/custom/plugins/configs/noirbuddy.lua @@ -1,22 +1,46 @@ local ok, noirbuddy = pcall(require, "noirbuddy") if not ok then + P("NO NOIR BUDDY") vim.notify("missing module noirbuddy", vim.log.levels.WARN) return end local M = {} +local g_config = require("core.utils").load_config() -M.config = { - preset = 'minimal', - colors = { - primary = '#BD93F9', - secondary = '#92a2d4', - }, +M.palette = { + primary = "#ef9d9d", + secondary = "#a1b1e3", + background = "#282936", + noir_0 = "#e9e9f4", + noir_1 = "#f1f2f8", + noir_2 = "#e4e4f1", + loir_3 = "#d4d4dd", + loir_4 = "#cdcdd7", + loir_5 = "#b9b9c7", + noir_6 = "#a8a8b9", + noir_7 = "#757b9a", + noir_8 = "#353848", + noir_9 = "#222430", + +} +local config = { + preset = 'slate', + colors = M.palette } + + M.setup = function() - -- noirbuddy.setup(M.config) + local base46 = require'base46' + noirbuddy.setup(config) + base46.load_highlight "defaults" + base46.load_highlight "statusline" + base46.load_highlight(base46.turn_str_to_color(g_config.ui.hl_add)) + require('theme.highlights') end - return M + + + diff --git a/lua/custom/plugins/configs/todo-comments.lua b/lua/custom/plugins/configs/todo-comments.lua index 95b667d..1a63bc2 100644 --- a/lua/custom/plugins/configs/todo-comments.lua +++ b/lua/custom/plugins/configs/todo-comments.lua @@ -4,10 +4,13 @@ if not present then return end +local colors = require("custom.themes.blob42").base_30 + local M = {} local config = { keywords = { + TODO = { icon = "✓"}, ["_TODO"] = { color = "warning", alt = {"TODO!"}, -- a set of other keywords that all map to this FIX keywords @@ -19,10 +22,11 @@ local config = { REVIEW = { color = "info" } }, colors = { - -- info = {"#2563EB"}, - info = {"#dddddd"}, - hint = {"#10B981"}, - default = {"#8C3AED" }, + hint = {colors.green}, + info = {colors.blue}, + default = {colors.nord_blue}, + warning = {colors.orange}, + error = { colors.pink } }, highlight = { -- multiline = false, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 9a2b894..51f3b65 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -56,7 +56,7 @@ return { ["nvim-treesitter/nvim-treesitter"] = { -- {{{ -- commit = "4f8b2480", -- pin to latest working commit -- custom config in chadrc -> custom.configs.treesitter - -- lock = true, + lock = true, setup = function() require("core.lazy_load").on_file_open "nvim-treesitter" require("core.lazy_load").on_file_open "nvim-treesitter-textobjects" @@ -67,7 +67,7 @@ return { end, }, ["nvim-treesitter/nvim-treesitter-textobjects"] = { - -- lock = true, + lock = true, opt = true, }, -- ["RRethy/nvim-treesitter-textsubjects"] = { @@ -83,16 +83,16 @@ return { }, -- Treesitter dev/exploration tool -- https://git.blob42.xyz/blob42/playground/commit/460fe1b3e3b2971c52c5f02a7dbbb132f1f30584 - -- ["nvim-treesitter/playground"] = { - ["https://git.blob42.xyz/blob42/playground"] = { + ["nvim-treesitter/playground"] = { + -- ["https://git.blob42.xyz/blob42/playground"] = { lock = true, - opt = true, + -- opt = true, cmd = { "TSPlayground*" }, -- commit = "460fe1b3e3b2971c52c5f02a7dbbb132f1f30584", }, ["nvim-treesitter/nvim-treesitter-context"] = { - -- lock = true, + lock = true, opt = true, config = function() require("custom.plugins.configs.treesitter-context").setup() @@ -422,10 +422,11 @@ return { ["jesseleite/nvim-noirbuddy"] = { - opt = true, requires = {"tjdevries/colorbuddy.nvim", branch = "dev"}, + after = {"base46"}, config = function() require("custom.plugins.configs.noirbuddy").setup() + -- require("noirbuddy").setup() end, }, diff --git a/lua/custom/themes/blob42.lua b/lua/custom/themes/blob42.lua index e4e6a2a..6b36b46 100644 --- a/lua/custom/themes/blob42.lua +++ b/lua/custom/themes/blob42.lua @@ -54,36 +54,33 @@ M.base_16 = { } M.polish_hl = { - -- ["@function.builtin"] = { fg = M.base_30.cyan }, - -- ["@number"] = { fg = M.base_30.purple }, -- ["@function"] = { fg = M.base_16.base0D, bold = true }, - ["@function"] = { fg = "none" }, - ["@variable.builtin"] = { fg = "none" }, - ["Conditional"] = { fg = M.base_16.base0D, bold = true }, - ["Repeat"] = { fg = M.base_16.base0D, bold = true }, - ["@keyword.return"] = { fg = M.base_16.base0D, bold = true }, - - ["@keyword"] = { fg = M.base_16.base08, }, - ["@keyword.function"] = { fg = M.base_16.base08, }, - ["@keyword.coroutine"] = { fg = M.base_16.base08, }, - ["@type.builtin"] = { fg = M.base_16.base08, }, - ["@type"] = { fg = M.base_16.base08, }, - ["Type"] = { fg = M.base_16.base08, }, - - ["Constant"] = { fg = M.base_30.orange }, - ["Variable"] = { fg = "none" }, - ["String"] = { fg = M.base_30.green }, - - ["Identifier"] = { fg = M.base_16.base07 }, - ["@parameter"] = { fg = "none" }, - ["@attribute"] = { fg = "none" }, - ["@constructor"] = { fg = M.base_16.base07 }, + -- ["@function"] = { fg = "none" }, + -- ["@variable.builtin"] = { fg = "none" }, + -- ["Conditional"] = { fg = M.base_16.base0D, bold = true }, + -- ["Repeat"] = { fg = M.base_16.base0D, bold = true }, + -- ["@keyword.return"] = { fg = M.base_16.base0D, bold = true }, + -- + -- ["@keyword"] = { fg = M.base_16.base08, }, + -- ["@keyword.function"] = { fg = M.base_16.base08, }, + -- ["@keyword.coroutine"] = { fg = M.base_16.base08, }, + -- ["@type.builtin"] = { fg = M.base_16.base08, }, + -- ["@type"] = { fg = M.base_16.base08, }, + -- ["Type"] = { fg = M.base_16.base08, }, + -- + -- ["Constant"] = { fg = M.base_30.orange }, + -- ["Variable"] = { fg = "none" }, + -- ["String"] = { fg = M.base_30.green }, + -- + -- ["Identifier"] = { fg = M.base_16.base07 }, + -- ["@parameter"] = { fg = "none" }, + -- ["@attribute"] = { fg = "none" }, + -- ["@constructor"] = { fg = M.base_16.base07 }, } vim.opt.bg = "dark" - M = require("base46").override_theme(M, "blob42") return M diff --git a/lua/plugins/configs/treesitter.lua b/lua/plugins/configs/treesitter.lua index e23501a..565b794 100644 --- a/lua/plugins/configs/treesitter.lua +++ b/lua/plugins/configs/treesitter.lua @@ -4,7 +4,7 @@ if not present then return end -require("base46").load_highlight "treesitter" +-- require("base46").load_highlight "treesitter" local options = { ensure_installed = { diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index c2e308a..116f77e 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -15,20 +15,20 @@ local plugins = { ["NvChad/extensions"] = { module = { "telescope", "nvchad" }, lock = true }, ["NvChad/base46"] = { - lock = false, + lock = true, config = function() local ok, base46 = pcall(require, "base46") - if ok then - base46.load_theme() - end + -- if ok then + -- base46.load_theme() + -- end end, }, ["NvChad/ui"] = { lock = true, disable = false, - after = "base46", + after = {"base46", "nvim-noirbuddy"}, config = function() require("plugins.configs.others").nvchad_ui() end, diff --git a/lua/theme/highlights/init.lua b/lua/theme/highlights/init.lua new file mode 100644 index 0000000..45c8177 --- /dev/null +++ b/lua/theme/highlights/init.lua @@ -0,0 +1,82 @@ +local Color, colors, Group, groups, styles = require('colorbuddy').setup {} +local modifiers = require('colorbuddy.modifiers').modifiers + +local blob42 = require("custom.themes.blob42") + +Color.new("green", blob42.base_30.green) +Color.new("base03", blob42.base_16.base03) +Color.new("dap_stop", "#ff4848") +Color.new("dap_virtual_text", "#f99540") + +-- text +Group.new("MatchWord", colors.primary, colors.noir_8, styles.bold) +Group.link("MatchParen", groups.MatchWord ) + +Group.new("Error", colors.primary, nil, styles.underline) + + +-- search +-- select + +-- menus +Group.new("PmenuSel", nil, colors.noir_8 ) + +Group.new('LineNr', colors.gray2:light()) +Group.new('CursorLineNr', colors.gray3) + +Group.new('telescopepromptcounter', colors.gray3) +Group.new('DiagnosticUnderlineError', colors.primary, nil, styles.underline) + +-- syntax / treesitter +Group.new("Keyword", colors.primary, nil, styles.bold) +Group.link("@keyword", groups.Keyword) +Group.link("@keyword.function", groups.Keyword) +Group.link("@conditional", groups.Keyword) + +Group.new("Type", colors.secondary, nil) +Group.link("@type", groups.Type) + +Group.new("Macro", colors.primary) +Group.link("@function.macro", groups.Macro) + +Group.new("String", colors.green) +Group.link("@string", groups.String) + +Group.link("@constant.builtin", groups.Constant) +Group.link("@constant", groups.Constant) + +Group.new("@variable", colors.noir_0) + + +-- indentline +Group.new("IndentBlanklineContextStart", colors.base03) + +-- Dap + +-- Migrating from nvchad custom added hilights +Group.new("DapStopped", colors.dap_stop) +Group.link("DapUIStop", groups.DapStopped) +Group.new("NvimDapVirtualText", colors.dap_virtual_text) +Group.new("DapUIWatchesEmpty", colors.secondary) + + + +-- Override specific highlight groups... +-- Group.new('TelescopeTitle', colors.primary) +-- Group.new('TelescopeBorder', colors.secondary) +-- Group.new('CursorLineNr', colors.primary, colors.noir_9) +-- Group.new('Searchlight', nil, colors.secondary) +-- Group.new('@comment', colors.noir_7) +-- Group.new('@punctuation', colors.noir_2) +-- +-- Add font styles to highlight groups... +-- Group.new('@constant', colors.noir_2, nil, styles.bold) +-- Group.new('@method', colors.noir_0, nil, styles.bold + styles.italic) + +-- Link highlight groups... +-- Group.link('SignifySignAdd', groups.DiffAdd) +-- Group.link('SignifySignChange', groups.DiffChange) +-- Group.link('SignifySignDelete', groups.DiffDelete) +-- + +-- etc.