From 661237348a9e5b6e2243cd82f4c01d51fd083895 Mon Sep 17 00:00:00 2001 From: Patrick Gingras <775.pg.12@gmail.com> Date: Wed, 11 Jan 2023 13:36:49 -0500 Subject: [PATCH] add global bones_compat option --- autoload/bones.vim | 9 +++++++++ colors/duckbones.vim | 2 +- colors/forestbones.vim | 2 +- colors/kanagawabones.vim | 2 +- colors/neobones.vim | 2 +- colors/nordbones.vim | 2 +- colors/rosebones.vim | 2 +- colors/seoulbones.vim | 2 +- colors/tokyobones.vim | 2 +- colors/vimbones.vim | 2 +- colors/zenbones.vim | 2 +- colors/zenburned.vim | 2 +- colors/zenwritten.vim | 2 +- 13 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 autoload/bones.vim diff --git a/autoload/bones.vim b/autoload/bones.vim new file mode 100644 index 0000000..563e62e --- /dev/null +++ b/autoload/bones.vim @@ -0,0 +1,9 @@ +function! bones#_compat(colors_name) + if exists('g:' . a:colors_name . '_compat') + return g:{a:colors_name}_compat != 0 + elseif exists('g:bones_compat') + return g:bones_compat != 0 + else + return 0 + endif +endfunction diff --git a/colors/duckbones.vim b/colors/duckbones.vim index 414a9f2..4bb072f 100644 --- a/colors/duckbones.vim +++ b/colors/duckbones.vim @@ -5,7 +5,7 @@ endif let g:colors_name = 'duckbones' set background=dark -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/forestbones.vim b/colors/forestbones.vim index 06b77fe..36b2d52 100644 --- a/colors/forestbones.vim +++ b/colors/forestbones.vim @@ -4,7 +4,7 @@ endif let g:colors_name = 'forestbones' -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim' && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/kanagawabones.vim b/colors/kanagawabones.vim index 2244c9f..09a7dba 100644 --- a/colors/kanagawabones.vim +++ b/colors/kanagawabones.vim @@ -5,7 +5,7 @@ endif let g:colors_name = 'kanagawabones' set background=dark -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/neobones.vim b/colors/neobones.vim index 4f67c3b..20c90e4 100644 --- a/colors/neobones.vim +++ b/colors/neobones.vim @@ -4,7 +4,7 @@ endif let g:colors_name = 'neobones' -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/nordbones.vim b/colors/nordbones.vim index fd075c8..3ccc313 100644 --- a/colors/nordbones.vim +++ b/colors/nordbones.vim @@ -5,7 +5,7 @@ endif let g:colors_name = 'nordbones' set background=dark -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/rosebones.vim b/colors/rosebones.vim index 08d028e..017e8ef 100644 --- a/colors/rosebones.vim +++ b/colors/rosebones.vim @@ -4,7 +4,7 @@ endif let g:colors_name = 'rosebones' -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/seoulbones.vim b/colors/seoulbones.vim index ef68c5d..3752642 100644 --- a/colors/seoulbones.vim +++ b/colors/seoulbones.vim @@ -4,7 +4,7 @@ endif let g:colors_name = 'seoulbones' -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/tokyobones.vim b/colors/tokyobones.vim index 3876920..1540af4 100644 --- a/colors/tokyobones.vim +++ b/colors/tokyobones.vim @@ -4,7 +4,7 @@ endif let g:colors_name = 'tokyobones' -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/vimbones.vim b/colors/vimbones.vim index ac10703..400cfe9 100644 --- a/colors/vimbones.vim +++ b/colors/vimbones.vim @@ -5,7 +5,7 @@ endif let g:colors_name = 'vimbones' set background=light -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/zenbones.vim b/colors/zenbones.vim index 21eb4c0..200af96 100644 --- a/colors/zenbones.vim +++ b/colors/zenbones.vim @@ -4,7 +4,7 @@ endif let g:colors_name = 'zenbones' -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/zenburned.vim b/colors/zenburned.vim index 0e12f42..9a488ef 100644 --- a/colors/zenburned.vim +++ b/colors/zenburned.vim @@ -5,7 +5,7 @@ endif let g:colors_name = 'zenburned' set background=dark -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif diff --git a/colors/zenwritten.vim b/colors/zenwritten.vim index f075b28..a527abb 100644 --- a/colors/zenwritten.vim +++ b/colors/zenwritten.vim @@ -4,7 +4,7 @@ endif let g:colors_name = 'zenwritten' -if has('nvim') && (!exists('g:' . g:colors_name . '_compat') || g:{g:colors_name}_compat == 0) +if has('nvim') && !bones#_compat(g:colors_name) lua require("zenbones.util").apply_colorscheme() finish endif