mirror of
https://github.com/gabehf/base46.git
synced 2026-03-18 19:56:27 -07:00
format stuff
This commit is contained in:
parent
38a47c27e3
commit
41434f352f
1 changed files with 260 additions and 255 deletions
|
|
@ -1,43 +1,48 @@
|
|||
local function highlight(group, guifg, guibg, attr, guisp)
|
||||
local parts = {group}
|
||||
if guifg then table.insert(parts, "guifg=#"..guifg) end
|
||||
if guibg then table.insert(parts, "guibg=#"..guibg) end
|
||||
if attr then
|
||||
table.insert(parts, "gui="..attr)
|
||||
local parts = { group }
|
||||
if guifg then
|
||||
table.insert(parts, "guifg=#" .. guifg)
|
||||
end
|
||||
if guibg then
|
||||
table.insert(parts, "guibg=#" .. guibg)
|
||||
end
|
||||
if attr then
|
||||
table.insert(parts, "gui=" .. attr)
|
||||
end
|
||||
if guisp then
|
||||
table.insert(parts, "guisp=#" .. guisp)
|
||||
end
|
||||
if guisp then table.insert(parts, "guisp=#"..guisp) end
|
||||
|
||||
-- nvim.ex.highlight(parts)
|
||||
vim.api.nvim_command('highlight '..table.concat(parts, ' '))
|
||||
vim.api.nvim_command("highlight " .. table.concat(parts, " "))
|
||||
end
|
||||
|
||||
-- Modified from https://github.com/chriskempson/base16-vim
|
||||
local function apply_base16_theme(theme)
|
||||
|
||||
-- Neovim terminal colours
|
||||
if vim.fn.has("nvim") then
|
||||
vim.g.terminal_color_0 = "#"..theme.base00
|
||||
vim.g.terminal_color_1 = "#"..theme.base08
|
||||
vim.g.terminal_color_2 = "#"..theme.base0B
|
||||
vim.g.terminal_color_3 = "#"..theme.base0A
|
||||
vim.g.terminal_color_4 = "#"..theme.base0D
|
||||
vim.g.terminal_color_5 = "#"..theme.base0E
|
||||
vim.g.terminal_color_6 = "#"..theme.base0C
|
||||
vim.g.terminal_color_7 = "#"..theme.base05
|
||||
vim.g.terminal_color_8 = "#"..theme.base03
|
||||
vim.g.terminal_color_9 = "#"..theme.base08
|
||||
vim.g.terminal_color_10 = "#"..theme.base0B
|
||||
vim.g.terminal_color_11 = "#"..theme.base0A
|
||||
vim.g.terminal_color_12 = "#"..theme.base0D
|
||||
vim.g.terminal_color_13 = "#"..theme.base0E
|
||||
vim.g.terminal_color_14 = "#"..theme.base0C
|
||||
vim.g.terminal_color_15 = "#"..theme.base07
|
||||
if vim.fn.has "nvim" then
|
||||
vim.g.terminal_color_0 = "#" .. theme.base00
|
||||
vim.g.terminal_color_1 = "#" .. theme.base08
|
||||
vim.g.terminal_color_2 = "#" .. theme.base0B
|
||||
vim.g.terminal_color_3 = "#" .. theme.base0A
|
||||
vim.g.terminal_color_4 = "#" .. theme.base0D
|
||||
vim.g.terminal_color_5 = "#" .. theme.base0E
|
||||
vim.g.terminal_color_6 = "#" .. theme.base0C
|
||||
vim.g.terminal_color_7 = "#" .. theme.base05
|
||||
vim.g.terminal_color_8 = "#" .. theme.base03
|
||||
vim.g.terminal_color_9 = "#" .. theme.base08
|
||||
vim.g.terminal_color_10 = "#" .. theme.base0B
|
||||
vim.g.terminal_color_11 = "#" .. theme.base0A
|
||||
vim.g.terminal_color_12 = "#" .. theme.base0D
|
||||
vim.g.terminal_color_13 = "#" .. theme.base0E
|
||||
vim.g.terminal_color_14 = "#" .. theme.base0C
|
||||
vim.g.terminal_color_15 = "#" .. theme.base07
|
||||
if vim.o.background == "light" then
|
||||
vim.g.terminal_color_background = "#"..theme.base05
|
||||
vim.g.terminal_color_foreground = "#"..theme.base0B
|
||||
vim.g.terminal_color_background = "#" .. theme.base05
|
||||
vim.g.terminal_color_foreground = "#" .. theme.base0B
|
||||
else
|
||||
vim.g.terminal_color_background = "#"..theme.base00
|
||||
vim.g.terminal_color_foreground = "#"..theme.base0E
|
||||
vim.g.terminal_color_background = "#" .. theme.base00
|
||||
vim.g.terminal_color_foreground = "#" .. theme.base0E
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -74,7 +79,7 @@ local function apply_base16_theme(theme)
|
|||
highlight("Title", theme.base0D, nil, "none", nil)
|
||||
highlight("Conceal", theme.base0D, theme.base00, nil, nil)
|
||||
highlight("Cursor", theme.base00, theme.base05, nil, nil)
|
||||
highlight("NonText", theme.base03, nil,nil, nil)
|
||||
highlight("NonText", theme.base03, nil, nil, nil)
|
||||
highlight("LineNr", theme.base03, "NONE", nil, nil)
|
||||
highlight("SignColumn", theme.base03, "NONE", nil, nil)
|
||||
highlight("StatusLine", theme.base04, "NONE", "none", nil)
|
||||
|
|
@ -279,9 +284,9 @@ return setmetatable({
|
|||
result[key] = value
|
||||
end
|
||||
return result
|
||||
end
|
||||
end,
|
||||
}, {
|
||||
__call = function (_, ...)
|
||||
__call = function(_, ...)
|
||||
apply_base16_theme(...)
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue