From 9bfddd6290c9a76c63effe72e91c5ebdcf2166ce Mon Sep 17 00:00:00 2001 From: blob42 Date: Fri, 11 Aug 2023 14:41:07 +0200 Subject: [PATCH] update theme, blankline, zenmode --- after/plugin/highlight.vim | 1 + lua/core/mappings.lua | 15 ++- lua/core/options.lua | 2 +- lua/custom/chadrc.lua | 1 - lua/custom/highlights.lua | 12 +- lua/custom/plugins/configs/noirbuddy.lua | 6 +- lua/plugins/configs/others.lua | 1 + lua/plugins/init.lua | 2 +- lua/spike/utils/init.lua | 20 +-- lua/theme/highlights/init.lua | 155 ++++++++++++++--------- 10 files changed, 126 insertions(+), 89 deletions(-) diff --git a/after/plugin/highlight.vim b/after/plugin/highlight.vim index caaf8a3..9f1bbd2 100644 --- a/after/plugin/highlight.vim +++ b/after/plugin/highlight.vim @@ -12,3 +12,4 @@ au BufEnter * hi GuihuaListSelHl gui=underline guibg=bg au BufEnter * hi TabLineFill NONE au BufEnter * hi TabLine NONE + diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 3fee900..0f4fd67 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -110,7 +110,7 @@ M.general = { --{{{ opt.signcolumn="yes" g.sign_column_enbaled = true end - + end, "toggle sign column" }, ["z"] = { function() @@ -129,6 +129,19 @@ M.general = { --{{{ -- option toggle cursor line ["l"] = { " set cul!", "toggle cursor line" }, + -- toggle list mode (shows listchars) + -- ["L"] = { " set list!", "toggle list mode" }, + ["L"] = { function() + if vim.o.list then + vim.o.list = false + require"theme.highlights".blankline() + else + vim.o.list = true + require"theme.highlights".show_blank_tabs() + end + end, "toggle list mode" }, + + ["c"] = { "ccloselclose", "close quickfix" }, diff --git a/lua/core/options.lua b/lua/core/options.lua index fa8bbea..c98c9d2 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -77,7 +77,7 @@ opt.foldminlines = 2 opt.foldlevelstart = 1 opt.conceallevel=1 -- how to show text with :syn-conceal syntax -opt.list = true -- show tabs,trailing spaces and non-breakable spaces +opt.list = false -- show tabs,trailing spaces and non-breakable spaces opt.listchars = "tab: ,trail:,extends:#,nbsp:⋅,eol:" -- Highlight problematic whitespace opt.diffopt:append("vertical") opt.completeopt = "menu,menuone,noselect" diff --git a/lua/custom/chadrc.lua b/lua/custom/chadrc.lua index 65757e4..5f7ed58 100644 --- a/lua/custom/chadrc.lua +++ b/lua/custom/chadrc.lua @@ -66,7 +66,6 @@ M.plugins = { } }, ["nvim-treesitter/nvim-treesitter"] = require "custom.plugins.configs.treesitter", - ["lukas-reineke/indent-blankline.nvim"] = {}, } } diff --git a/lua/custom/highlights.lua b/lua/custom/highlights.lua index abd9bcc..7220d03 100644 --- a/lua/custom/highlights.lua +++ b/lua/custom/highlights.lua @@ -1,10 +1,14 @@ local M = {} M.override = { - IndentBlanklineContextChar = { - fg = "baby_pink", - nocombine = true, - }, + -- IndentBlanklineContextChar = { + -- fg = "baby_pink", + -- nocombine = true, + -- }, + -- IndentBlanklineChar= { + -- fg = "black", + -- nocombine = true, + -- }, Comment = { fg = "light_grey" }, diff --git a/lua/custom/plugins/configs/noirbuddy.lua b/lua/custom/plugins/configs/noirbuddy.lua index 0c0d9a5..d00a50c 100644 --- a/lua/custom/plugins/configs/noirbuddy.lua +++ b/lua/custom/plugins/configs/noirbuddy.lua @@ -24,6 +24,7 @@ M.palette = { noir_9 = "#222430", } + local config = { preset = 'slate', colors = M.palette @@ -37,10 +38,7 @@ M.setup = function() base46.load_highlight "defaults" base46.load_highlight "statusline" base46.load_highlight(base46.turn_str_to_color(g_config.ui.hl_add)) - require('theme.highlights') + require('theme.highlights').setup() end return M - - - diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 572f579..b4caf33 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -62,6 +62,7 @@ M.blankline = function() options = load_override(options, "lukas-reineke/indent-blankline.nvim") blankline.setup(options) + require("theme.highlights").blankline() end M.colorizer = function() diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 116f77e..1caf7b4 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -53,7 +53,7 @@ local plugins = { }, ["lukas-reineke/indent-blankline.nvim"] = { - lock = true, + lock = false, opt = true, setup = function() require("core.lazy_load").on_file_open "indent-blankline.nvim" diff --git a/lua/spike/utils/init.lua b/lua/spike/utils/init.lua index e6674b8..5edd138 100644 --- a/lua/spike/utils/init.lua +++ b/lua/spike/utils/init.lua @@ -100,21 +100,12 @@ end ---@param full? boolean maximum zen M.zenmode = function(full) opt.colorcolumn= '0' - g.indent_blankline_show_current_context = false - local ok, indent = pcall(require, "indent_blankline") - if ok then - indent.refresh() - end - opt.listchars:remove("eol") - opt.listchars:append("tab: ") vim.cmd("TSDisable highlight") if full then + vim.cmd("IndentBlanklineDisable") opt.signcolumn = 'no' opt.number = false opt.relativenumber = false - -- opt.listchars:append("tab: ") - -- opt.listchars:remove("eol") - opt.fillchars:append("eob: ") opt.cmdheight = 0 end g.zenmode = true @@ -124,18 +115,11 @@ end M.exitzen = function() opt.colorcolumn= '+0' opt.signcolumn = 'yes' - g.indent_blankline_show_current_context = true - local ok, indent = pcall(require, "indent_blankline") - if ok then - indent.refresh() - end - opt.listchars:append("eol:") - opt.listchars:append("tab: ") opt.number = true opt.relativenumber = true - opt.fillchars:append("eob:∼") opt.cmdheight = 1 g.zenmode = false + vim.cmd("IndentBlanklineEnable") vim.cmd("TSEnable highlight") end diff --git a/lua/theme/highlights/init.lua b/lua/theme/highlights/init.lua index 26d7c99..4e6c5d3 100644 --- a/lua/theme/highlights/init.lua +++ b/lua/theme/highlights/init.lua @@ -3,83 +3,120 @@ local modifiers = require('colorbuddy.modifiers').modifiers local blob42 = require("custom.themes.blob42") -Color.new("green", blob42.base_30.green) -Color.new("yellow", blob42.base_30.yellow) -Color.new("sun", blob42.base_30.sun) -Color.new("base03", blob42.base_16.base03) -Color.new("dap_stop", "#ff4848") -Color.new("dap_virtual_text", "#f99540") +local import_theme_colors = function() + for i, color in pairs(blob42.base_16) do + Color.new(i, color) + end + for i, color in pairs(blob42.base_30) do + Color.new(i, color) + end +end --- text -Group.new("MatchWord", colors.primary, colors.noir_8, styles.bold) -Group.link("MatchParen", groups.MatchWord ) +import_theme_colors() -Group.new("Error", colors.primary, nil, styles.underline) +-- Color.new("green", blob42.base_30.green) +-- Color.new("yellow", blob42.base_30.yellow) +-- Color.new("orange", blob42.base_30.orange) +-- Color.new("sun", blob42.base_30.sun) +-- Color.new("base03", blob42.base_16.base03) +-- Color.new("base0E", blob42.base_16.base0E) +Color.new("dap_stop", "#ff4848", {}) +Color.new("dap_virtual_text", "#f99540", {}) +local M = {} --- search --- select +M.blankline = function() + -- indentline + Group.new("IndentBlanklineChar", colors.background) + Group.new("IndentBlanklineContextChar", colors.primary) +end --- menus -Group.new("PmenuSel", nil, colors.noir_8 ) +M.show_blank_tabs = function() + -- indentline + P("showing blank tabs") + Group.new("IndentBlanklineChar", colors.base01) +end -Group.new('LineNr', colors.gray2:light()) -Group.new('CursorLineNr', colors.gray3) +M.setup = function() -Group.new('telescopepromptcounter', colors.gray3) -Group.new('DiagnosticUnderlineError', colors.primary, nil, styles.underline) + -- text + Group.new("MatchWord", colors.primary, colors.noir_8, styles.bold) + Group.link("MatchParen", groups.MatchWord ) + -- Group.new("NonText", colors.background:light()) --- 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("Error", colors.primary, nil, styles.underline) -Group.new("Type", colors.secondary, nil) -Group.link("@type", groups.Type) -Group.new("Macro", colors.primary) -Group.link("@function.macro", groups.Macro) + -- search + -- select -Group.new("String", colors.sun) -Group.link("@string", groups.String) -Group.new("@string.escape", colors.secondary) + -- menus + Group.new("PmenuSel", nil, colors.noir_8 ) -Group.link("@constant.builtin", groups.Constant) -Group.link("@constant", groups.Constant) + Group.new('LineNr', colors.gray2:light()) + Group.new('CursorLineNr', colors.gray3) -Group.new("@variable", colors.noir_0) + 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) --- indentline -Group.new("IndentBlanklineContextStart", colors.base03) + Group.new("Return", colors.primary, nil) + Group.link("@keyword.return", groups.Return) --- 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) + Group.new("Type", colors.secondary, nil) + Group.link("@type", groups.Type) + Group.new("Macro", colors.primary) + Group.link("@function.macro", groups.Macro) - --- 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) + Group.new("String", colors.orange) + Group.link("@string", groups.String) + Group.new("@string.escape", colors.secondary) --- Link highlight groups... --- Group.link('SignifySignAdd', groups.DiffAdd) --- Group.link('SignifySignChange', groups.DiffChange) --- Group.link('SignifySignDelete', groups.DiffDelete) --- + Group.link("@constant.builtin", groups.Constant) + Group.link("@constant", groups.Constant) --- etc. + Group.new("@variable", colors.noir_0) + + + -- defined in chadrc custom + + -- 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. + +end + +return M