Something went wrong. Try again.
A minimal colorscheme for neovim and more
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041local M = {}
---@param tbl table---@param path stringlocal function get_nested_value(tbl, path) for key in string.gmatch(path, "[^%.]+") do if tbl and tbl[key] then tbl = tbl[key] else return nil end end return tblend
---@param str string---@param tbl table---@return stringfunction M.template(str, tbl) return ( string.gsub(str, "${(.-)}", function(path) local value = get_nested_value(tbl, path) return value and tostring(value) or "${" .. path .. "}" end) )end
---@param name string filename to save extra---@param contents string file contents (extra theme)function M.write(name, contents) print("writing extra/" .. name) vim.fn.mkdir(vim.fs.dirname("extras/" .. name), "p") local file = io.open("extras/" .. name, "w") if file then file:write(contents) file:close() endend
return M