Skip to content

Commit

Permalink
feat: add support for special names (NONE, bg, etc)
Browse files Browse the repository at this point in the history
This backports:

- chriskempson/base16-vim@c8a7da6

From:

- chriskempson/base16-vim#217

How I did this:

1. Made changes to the template in the submodule in my dotfiles repo (at
   `aspects/nvim/files/.config/nvim/pack/bundle/opt/base16-nvim`).
2. Copied them up to the superproject working area with:
   `cp aspects/nvim/files/.config/nvim/pack/bundle/opt/base16-nvim/templates/default.mustache
   vendor/base16-templates/base16-nvim/templates`.
3. Ran `NO_CLONE=1 support/base16-builder.rb`.
  • Loading branch information
wincent committed Sep 3, 2022
1 parent e17c89c commit 3e732be
Show file tree
Hide file tree
Showing 186 changed files with 1,860 additions and 558 deletions.
13 changes: 10 additions & 3 deletions colors/base16-3024.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-apathy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-apprentice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-ashes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-cave-light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-cave.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-dune-light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-dune.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-estuary-light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-estuary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-forest-light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-forest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
13 changes: 10 additions & 3 deletions colors/base16-atelier-heath-light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)

local command = ""

if guifg ~= "" then
-- See `:help highlight-guifg`.
if guifg == "NONE" or guifg == "bg" or guifg == "background" or guifg == "fg" or guifg == "foreground" then
command = command .. " guifg=" .. guifg
elseif guifg ~= "" then
command = command .. " guifg=#" .. guifg
end
if guibg ~= "" then
if guibg == "NONE" or guibg == "bg" or guibg == "background" or guibg == "fg" or guibg == "foreground" then
command = command .. " guibg=" .. guibg
elseif guibg ~= "" then
command = command .. " guibg=#" .. guibg
end
if ctermfg ~= "" then
Expand All @@ -66,7 +71,9 @@ local highlight = function(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
if attr ~= "" then
command = command .. " gui=" .. attr .. " cterm=" .. attr
end
if guisp ~= "" then
if guisp == "NONE" or guisp == "bg" or guisp == "background" or guisp == "fg" or guisp == "foreground" then
command = command .. " guisp=" .. guisp
elseif guisp ~= "" then
command = command .. " guisp=#" .. guisp
end

Expand Down
Loading

0 comments on commit 3e732be

Please sign in to comment.