23 lines
550 B
Lua
23 lines
550 B
Lua
local Config = {}
|
|
|
|
-- Default settings (user can override in setup{})
|
|
local defaults = {
|
|
config_file = ".gitea_nvim_token", -- local file containing the token
|
|
ignore_file = ".gitignore", -- file to which we can append the token file
|
|
server_url = nil, -- extracted from .git remote if possible
|
|
}
|
|
|
|
Config.values = {}
|
|
|
|
function Config.setup(user_opts)
|
|
for k, v in pairs(defaults) do
|
|
if user_opts[k] ~= nil then
|
|
Config.values[k] = user_opts[k]
|
|
else
|
|
Config.values[k] = v
|
|
end
|
|
end
|
|
end
|
|
|
|
return Config
|