farout.nvim/lua/tokyonight/extra/init.lua

58 lines
1.5 KiB
Lua
Raw Normal View History

local M = {}
2021-04-20 12:24:44 +00:00
local function write(str, fileName)
2022-09-05 10:06:20 +00:00
print("[write] extra/" .. fileName)
vim.fn.mkdir(vim.fs.dirname("extras/" .. fileName), "p")
2022-09-05 10:06:20 +00:00
local file = io.open("extras/" .. fileName, "w")
file:write(str)
file:close()
2021-04-20 12:24:44 +00:00
end
function M.setup()
local config = require("tokyonight.config")
vim.o.background = "dark"
-- map of plugin name to plugin extension
local extras = {
kitty = "conf",
fish = "fish",
fish_themes = "theme",
alacritty = "yml",
wezterm = "toml",
tmux = "tmux",
xresources = "Xresources",
xfceterm = "theme",
foot = "ini",
tilix = "json",
iterm = "itermcolors",
lua = "lua",
sublime = "tmTheme",
delta = "gitconfig",
terminator = "conf",
2023-01-18 14:06:08 +00:00
prism = "js",
windows_terminal = "json",
}
-- map of style to style name
local styles = {
storm = " Storm",
night = "",
day = " Day",
moon = " Moon",
}
2021-04-20 12:24:44 +00:00
for extra, ext in pairs(extras) do
2023-01-18 14:06:08 +00:00
package.loaded["tokyonight.extra." .. extra] = nil
local plugin = require("tokyonight.extra." .. extra)
for style, style_name in pairs(styles) do
config.setup({ style = style })
local colors = require("tokyonight.colors").setup({ transform = true })
local fname = extra .. "/tokyonight_" .. style .. "." .. ext
colors["_upstream_url"] = "https://github.com/folke/tokyonight.nvim/raw/main/extras/" .. fname
colors["_style_name"] = "Tokyo Night" .. style_name
write(plugin.generate(colors), fname)
end
2022-09-05 10:06:20 +00:00
end
2021-05-21 12:51:45 +00:00
end
return M