]> git.r.bdr.sh - rbdr/oleoboard.nvim/blame_incremental - lua/oleoboard/configuration.lua
Add plugin
[rbdr/oleoboard.nvim] / lua / oleoboard / configuration.lua
... / ...
CommitLineData
1-------------------------------------------------------------------------------
2-- Configuration for board
3-------------------------------------------------------------------------------
4local Configuration = {}
5
6-------------------------------------------------------------------------------
7-- Internal Functions
8-------------------------------------------------------------------------------
9local fs = vim.loop
10
11local defaults = {
12 default_keybinds = true, -- Whether or not to set the default keybinds
13}
14
15-- Recursively extends a table with another
16local function extend(target, extender)
17 for key, value in pairs(extender) do
18 if type(target[key]) == 'table' and type(value) == 'table' then
19 extend(target[key], value)
20 else
21 target[key] = value
22 end
23 end
24end
25
26-------------------------------------------------------------------------------
27-- Public Interface
28-------------------------------------------------------------------------------
29
30Configuration.configuration = {}
31extend(Configuration.configuration, defaults)
32
33--- Extends configuration with another configuration
34function Configuration.configure(configuration)
35 configuration = configuration or {}
36 extend(Configuration.configuration, configuration)
37end
38
39return Configuration