------------------------------------------------------------------------------- -- Configuration for board ------------------------------------------------------------------------------- local Configuration = {} ------------------------------------------------------------------------------- -- Internal Functions ------------------------------------------------------------------------------- local fs = vim.loop local defaults = { default_keybinds = true, -- Whether or not to set the default keybinds } -- Recursively extends a table with another local function extend(target, extender) for key, value in pairs(extender) do if type(target[key]) == 'table' and type(value) == 'table' then extend(target[key], value) else target[key] = value end end end ------------------------------------------------------------------------------- -- Public Interface ------------------------------------------------------------------------------- Configuration.configuration = {} extend(Configuration.configuration, defaults) --- Extends configuration with another configuration function Configuration.configure(configuration) configuration = configuration or {} extend(Configuration.configuration, configuration) end return Configuration