From 7f919fd6a30e6db590f65bd720db4c72a8692e44 Mon Sep 17 00:00:00 2001 From: Michael Chris Lopez Date: Sat, 9 Oct 2021 19:16:56 +0800 Subject: [PATCH] breaking: remove -lush variants replaced with compat --- colors/zenbones-lush.lua | 22 --------------- colors/zenbones.vim | 50 ++++++++++++++++++++--------------- colors/zenflesh-lush.lua | 22 --------------- colors/zenflesh.vim | 50 ++++++++++++++++++++--------------- lua/zenbones/template/vim.lua | 14 +++++++--- 5 files changed, 66 insertions(+), 92 deletions(-) delete mode 100644 colors/zenbones-lush.lua delete mode 100644 colors/zenflesh-lush.lua diff --git a/colors/zenbones-lush.lua b/colors/zenbones-lush.lua deleted file mode 100644 index 83eb541..0000000 --- a/colors/zenbones-lush.lua +++ /dev/null @@ -1,22 +0,0 @@ -vim.opt.background = "light" -vim.g.colors_name = "zenbones-lush" - -require("zenbones.term").setup() - --- By setting our module to nil, we clear lua's cache, --- which means the require ahead will *always* occur. --- --- This isn't strictly required but it can be a useful trick if you are --- incrementally editing your config a lot and want to be sure your themes --- changes are being picked up without restarting neovim. --- --- Note if you're working in on your theme and have :Lushify'd the buffer, --- your changes will be applied with our without the following line. --- --- The performance impact of this call can be measured in the hundreds of --- *nanoseconds* and such could be considered "production safe". -package.loaded["zenbones.palette"] = nil -package.loaded["zenbones"] = nil - --- include our theme file and pass it to lush to apply -require "lush"(require "zenbones") diff --git a/colors/zenbones.vim b/colors/zenbones.vim index 5c2fc61..c8c22e5 100644 --- a/colors/zenbones.vim +++ b/colors/zenbones.vim @@ -5,7 +5,6 @@ if exists('g:colors_name') set t_Co=256 endif -set background=light let g:colors_name = 'zenbones' let g:terminal_color_0 = '#F0EDEC' @@ -25,27 +24,12 @@ let g:terminal_color_13 = '#7B3B70' let g:terminal_color_14 = '#2B747C' let g:terminal_color_15 = '#4F5E68' -if has('terminal') - let g:terminal_ansi_colors = [ - \ g:terminal_color_0, - \ g:terminal_color_1, - \ g:terminal_color_2, - \ g:terminal_color_3, - \ g:terminal_color_4, - \ g:terminal_color_5, - \ g:terminal_color_6, - \ g:terminal_color_7, - \ g:terminal_color_8, - \ g:terminal_color_9, - \ g:terminal_color_10, - \ g:terminal_color_11, - \ g:terminal_color_12, - \ g:terminal_color_13, - \ g:terminal_color_14, - \ g:terminal_color_15 - \ ] -endif - +if get(g:, "zenbones_compat") != v:true + let g:colors_name = 'zenbones' + lua package.loaded["zenbones"] = nil + lua require "lush"(require "zenbones", { force_clean = false }) + finish +else highlight Bold guifg=NONE guibg=NONE guisp=NONE gui=bold highlight BufferVisible guifg=#596A76 guibg=NONE guisp=NONE gui=NONE highlight BufferVisibleIndex guifg=#596A76 guibg=NONE guisp=NONE gui=NONE @@ -238,3 +222,25 @@ highlight! link markdownH4 Special highlight! link markdownH5 Special highlight! link markdownH6 Special highlight! link markdownLinkTextDelimiter Delimiter +endif + +if has('terminal') + let g:terminal_ansi_colors = [ + \ g:terminal_color_0, + \ g:terminal_color_1, + \ g:terminal_color_2, + \ g:terminal_color_3, + \ g:terminal_color_4, + \ g:terminal_color_5, + \ g:terminal_color_6, + \ g:terminal_color_7, + \ g:terminal_color_8, + \ g:terminal_color_9, + \ g:terminal_color_10, + \ g:terminal_color_11, + \ g:terminal_color_12, + \ g:terminal_color_13, + \ g:terminal_color_14, + \ g:terminal_color_15 + \ ] +endif diff --git a/colors/zenflesh-lush.lua b/colors/zenflesh-lush.lua deleted file mode 100644 index 82fa6f5..0000000 --- a/colors/zenflesh-lush.lua +++ /dev/null @@ -1,22 +0,0 @@ -vim.opt.background = "dark" -vim.g.colors_name = "zenflesh-lush" - -require("zenflesh.term").setup() - --- By setting our module to nil, we clear lua's cache, --- which means the require ahead will *always* occur. --- --- This isn't strictly required but it can be a useful trick if you are --- incrementally editing your config a lot and want to be sure your themes --- changes are being picked up without restarting neovim. --- --- Note if you're working in on your theme and have :Lushify'd the buffer, --- your changes will be applied with our without the following line. --- --- The performance impact of this call can be measured in the hundreds of --- *nanoseconds* and such could be considered "production safe". -package.loaded["zenflesh.palette"] = nil -package.loaded["zenflesh"] = nil - --- include our theme file and pass it to lush to apply -require "lush"(require "zenflesh") diff --git a/colors/zenflesh.vim b/colors/zenflesh.vim index 4d85f3f..0af64ba 100644 --- a/colors/zenflesh.vim +++ b/colors/zenflesh.vim @@ -5,7 +5,6 @@ if exists('g:colors_name') set t_Co=256 endif -set background=dark let g:colors_name = 'zenflesh' let g:terminal_color_0 = '#1C1918' @@ -25,27 +24,12 @@ let g:terminal_color_13 = '#CF86C1' let g:terminal_color_14 = '#65B8C1' let g:terminal_color_15 = '#888F94' -if has('terminal') - let g:terminal_ansi_colors = [ - \ g:terminal_color_0, - \ g:terminal_color_1, - \ g:terminal_color_2, - \ g:terminal_color_3, - \ g:terminal_color_4, - \ g:terminal_color_5, - \ g:terminal_color_6, - \ g:terminal_color_7, - \ g:terminal_color_8, - \ g:terminal_color_9, - \ g:terminal_color_10, - \ g:terminal_color_11, - \ g:terminal_color_12, - \ g:terminal_color_13, - \ g:terminal_color_14, - \ g:terminal_color_15 - \ ] -endif - +if get(g:, "zenbones_compat") != v:true + let g:colors_name = 'zenflesh' + lua package.loaded["zenflesh"] = nil + lua require "lush"(require "zenflesh", { force_clean = false }) + finish +else highlight Bold guifg=NONE guibg=NONE guisp=NONE gui=bold highlight BufferVisible guifg=#CAD0D4 guibg=NONE guisp=NONE gui=NONE highlight BufferVisibleIndex guifg=#CAD0D4 guibg=NONE guisp=NONE gui=NONE @@ -238,3 +222,25 @@ highlight! link markdownH4 Special highlight! link markdownH5 Special highlight! link markdownH6 Special highlight! link markdownLinkTextDelimiter Delimiter +endif + +if has('terminal') + let g:terminal_ansi_colors = [ + \ g:terminal_color_0, + \ g:terminal_color_1, + \ g:terminal_color_2, + \ g:terminal_color_3, + \ g:terminal_color_4, + \ g:terminal_color_5, + \ g:terminal_color_6, + \ g:terminal_color_7, + \ g:terminal_color_8, + \ g:terminal_color_9, + \ g:terminal_color_10, + \ g:terminal_color_11, + \ g:terminal_color_12, + \ g:terminal_color_13, + \ g:terminal_color_14, + \ g:terminal_color_15 + \ ] +endif diff --git a/lua/zenbones/template/vim.lua b/lua/zenbones/template/vim.lua index e906eeb..e75088a 100644 --- a/lua/zenbones/template/vim.lua +++ b/lua/zenbones/template/vim.lua @@ -5,10 +5,18 @@ if exists('g:colors_name') set t_Co=256 endif -set background=${background} let g:colors_name = '${name}' ${termcolors} +if get(g:, "zenbones_compat") != v:true + let g:colors_name = '${name}' + lua package.loaded["${specs_path}"] = nil + lua require "lush"(require "${specs_path}", { force_clean = false }) + finish +else +${vimcolors} +endif + if has('terminal') let g:terminal_ansi_colors = [ \ g:terminal_color_0, @@ -29,8 +37,6 @@ if has('terminal') \ g:terminal_color_15 \ ] endif - -${vimcolors} ]] local lush = require "lush" @@ -47,8 +53,8 @@ return function(name, theme, palette, term) string.format("colors/%s.vim", name), template, { - background = name == "zenbones" and "light" or "dark", name = name, + specs_path = name, termcolors = termcolors, vimcolors = vimcolors, },