-
Notifications
You must be signed in to change notification settings - Fork 11
/
config.lua
58 lines (54 loc) · 1.08 KB
/
config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
local defaults = {
highlights = {
icon = "Include",
},
icons = {
history = " ",
command = " ",
number = " ",
system = "",
unknown = "",
},
picker = {
layout_config = {
width = 70,
height = 15,
}
},
completions = {
'command',
},
mappings = {
complete = '<Tab>',
run_selection = '<CR>',
run_input = '<C-CR>',
},
overseer = {
enabled = false,
},
output_pane = {
enabled = false,
min_lines = 5,
max_height = 25,
}
}
local config = {
namespace_id = vim.api.nvim_create_namespace('cmdline'),
values = {
mappings = {}
}
}
-- @param user_defaults table: user options
function config.set_defaults(user_defaults)
user_defaults = vim.F.if_nil(user_defaults, {})
config.values = vim.tbl_deep_extend("keep", user_defaults, defaults)
end
-- Retreives custom configuration or default setings
function config.get()
if config.values == nil or config.values == {} then
return config.defaults
else
return config.values
end
end
return config