mirror of
https://github.com/gabehf/base46.git
synced 2026-03-16 18:55:56 -07:00
format stuff
This commit is contained in:
parent
38a47c27e3
commit
41434f352f
1 changed files with 260 additions and 255 deletions
|
|
@ -1,21 +1,26 @@
|
||||||
local function highlight(group, guifg, guibg, attr, guisp)
|
local function highlight(group, guifg, guibg, attr, guisp)
|
||||||
local parts = { group }
|
local parts = { group }
|
||||||
if guifg then table.insert(parts, "guifg=#"..guifg) end
|
if guifg then
|
||||||
if guibg then table.insert(parts, "guibg=#"..guibg) end
|
table.insert(parts, "guifg=#" .. guifg)
|
||||||
|
end
|
||||||
|
if guibg then
|
||||||
|
table.insert(parts, "guibg=#" .. guibg)
|
||||||
|
end
|
||||||
if attr then
|
if attr then
|
||||||
table.insert(parts, "gui=" .. attr)
|
table.insert(parts, "gui=" .. attr)
|
||||||
end
|
end
|
||||||
if guisp then table.insert(parts, "guisp=#"..guisp) end
|
if guisp then
|
||||||
|
table.insert(parts, "guisp=#" .. guisp)
|
||||||
|
end
|
||||||
|
|
||||||
-- nvim.ex.highlight(parts)
|
-- nvim.ex.highlight(parts)
|
||||||
vim.api.nvim_command('highlight '..table.concat(parts, ' '))
|
vim.api.nvim_command("highlight " .. table.concat(parts, " "))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Modified from https://github.com/chriskempson/base16-vim
|
-- Modified from https://github.com/chriskempson/base16-vim
|
||||||
local function apply_base16_theme(theme)
|
local function apply_base16_theme(theme)
|
||||||
|
|
||||||
-- Neovim terminal colours
|
-- Neovim terminal colours
|
||||||
if vim.fn.has("nvim") then
|
if vim.fn.has "nvim" then
|
||||||
vim.g.terminal_color_0 = "#" .. theme.base00
|
vim.g.terminal_color_0 = "#" .. theme.base00
|
||||||
vim.g.terminal_color_1 = "#" .. theme.base08
|
vim.g.terminal_color_1 = "#" .. theme.base08
|
||||||
vim.g.terminal_color_2 = "#" .. theme.base0B
|
vim.g.terminal_color_2 = "#" .. theme.base0B
|
||||||
|
|
@ -279,7 +284,7 @@ return setmetatable({
|
||||||
result[key] = value
|
result[key] = value
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end,
|
||||||
}, {
|
}, {
|
||||||
__call = function(_, ...)
|
__call = function(_, ...)
|
||||||
apply_base16_theme(...)
|
apply_base16_theme(...)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue