Initial theme scaffolding
This commit is contained in:
parent
2e3cec2b20
commit
3926adf70c
6 changed files with 92 additions and 0 deletions
2
colors/sumi-e-dark.lua
Normal file
2
colors/sumi-e-dark.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
vim.o.background = "dark"
|
||||
require("sumi-e").colorscheme()
|
2
colors/sumi-e-light.lua
Normal file
2
colors/sumi-e-light.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
vim.o.background = "light"
|
||||
require("sumi-e").colorscheme()
|
1
colors/sumi-e.lua
Normal file
1
colors/sumi-e.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require("sumi-e").colorscheme()
|
27
lua/sumi-e/colors.lua
Normal file
27
lua/sumi-e/colors.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
local colors = {
|
||||
white = "#ffffff",
|
||||
black = "#000000",
|
||||
gray500 = "#7f7f7f",
|
||||
}
|
||||
|
||||
function _colors_dark()
|
||||
colors.bg = "#11171d"
|
||||
colors.fg = "#e3e0cd"
|
||||
colors.string = colors.gray500
|
||||
colors.comment = colors.gray500
|
||||
end
|
||||
|
||||
function _colors_light()
|
||||
colors.bg = "#ffffff"
|
||||
colors.fg = "#000000"
|
||||
end
|
||||
|
||||
function colors.generate()
|
||||
if vim.o.background == "dark" then
|
||||
_colors_dark()
|
||||
else
|
||||
_colors_light()
|
||||
end
|
||||
end
|
||||
|
||||
return colors
|
9
lua/sumi-e/config.lua
Normal file
9
lua/sumi-e/config.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local config = {
|
||||
defaults = {
|
||||
overrides = {},
|
||||
},
|
||||
}
|
||||
|
||||
setmetatable(config, { __index = config.defaults })
|
||||
|
||||
return config
|
51
lua/sumi-e/init.lua
Normal file
51
lua/sumi-e/init.lua
Normal file
|
@ -0,0 +1,51 @@
|
|||
local colors = require("sumi-e.colors")
|
||||
local config = require("sumi-e.config")
|
||||
local sumi = {}
|
||||
|
||||
local function set_groups()
|
||||
local groups = {
|
||||
Normal = { fg = colors.fg, bg = colors.bg },
|
||||
NormalFloat = { bg = colors.bg },
|
||||
String = { fg = colors.string, italic = true },
|
||||
Comment = { fg = colors.comment, bold = true, italic = true },
|
||||
}
|
||||
|
||||
groups =
|
||||
vim.tbl_extend("force", groups, type(config.overrides) == "function" and config.overrides() or config.overrides)
|
||||
|
||||
for group, parameters in pairs(groups) do
|
||||
vim.api.nvim_set_hl(0, group, parameters)
|
||||
end
|
||||
end
|
||||
|
||||
--- Apply user settings.
|
||||
---@param values table
|
||||
function sumi.setup(values)
|
||||
setmetatable(config, { __index = vim.tbl_extend("force", config.defaults, values) })
|
||||
end
|
||||
|
||||
--- Set the colorscheme.
|
||||
function sumi.colorscheme()
|
||||
if vim.version().minor < 8 then
|
||||
vim.notify(
|
||||
"Neovim 0.8+ is required for sumi-e colorscheme",
|
||||
vim.log.levels.ERROR,
|
||||
{ title = "Sumi-e colorscheme" }
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command("hi clear")
|
||||
if vim.fn.exists("syntax_on") then
|
||||
vim.api.nvim_command("syntax reset")
|
||||
end
|
||||
|
||||
vim.g.VM_theme_set_by_colorscheme = true -- Required for Visual Multi
|
||||
vim.o.termguicolors = true
|
||||
vim.g.colors_name = "sumi-e"
|
||||
|
||||
colors.generate()
|
||||
set_groups()
|
||||
end
|
||||
|
||||
return sumi
|
Loading…
Reference in a new issue