Open peter-bread opened 3 weeks ago
local t1 = {
servers = {
lua_ls = {
inlay_hints = true,
},
vtsls = {},
},
}
local t2 = {
servers = {
gopls = {},
lua_ls = {
inlay_hints = false,
},
},
}
local t3 = vim.tbl_deep_extend("force", t1, t2)
print(vim.inspect(t1))
print(vim.inspect(t2))
print(vim.inspect(t3))
-- t1
{
servers = {
lua_ls = {
inlay_hints = true
},
vtsls = {}
}
}
-- t2
{
servers = {
gopls = {},
lua_ls = {
inlay_hints = false
}
}
}
-- t3
{
servers = {
gopls = {},
lua_ls = {
inlay_hints = false
},
vtsls = {}
}
}
Test out looping through files in a directory and using
vim.tbl_deep_extend
to merge them, e.g. some lsp configs and formatter setup (usingvim.list_extend
).If this works, then I can use
vim.g
to store configs for plugins and also mirror theopts
merging from lazy.nvim to potentially be used with vim plug.