restructure init.lua | lspconfig
This commit is contained in:
parent
a256591e90
commit
8de3f4e84c
6 changed files with 69 additions and 72 deletions
|
@ -1,5 +0,0 @@
|
|||
local moduleExists = pcall(require, "custom")
|
||||
|
||||
if moduleExists then
|
||||
require "custom"
|
||||
end
|
|
@ -1,16 +0,0 @@
|
|||
local core_modules = {
|
||||
"core.custom",
|
||||
"core.options",
|
||||
"core.autocmds",
|
||||
"core.mappings",
|
||||
}
|
||||
|
||||
for _, module in ipairs(core_modules) do
|
||||
local ok, err = pcall(require, module)
|
||||
if not ok then
|
||||
error("Error loading " .. module .. "\n\n" .. err)
|
||||
end
|
||||
end
|
||||
|
||||
-- set all the non plugin mappings
|
||||
require("core.mappings").misc()
|
|
@ -258,13 +258,13 @@ M.merge_table = function(into, from, nodes_to_replace)
|
|||
-- function that will be executed with loadstring
|
||||
local replace_fn = function(node)
|
||||
local base_fn = [[
|
||||
return function(table1, table2)
|
||||
local t1, t2 = table1_node or false , table2_node or false
|
||||
if t1 and t2 then
|
||||
table1_node = table2_node
|
||||
end
|
||||
return table1
|
||||
end]]
|
||||
return function(table1, table2)
|
||||
local t1, t2 = table1_node or false , table2_node or false
|
||||
if t1 and t2 then
|
||||
table1_node = table2_node
|
||||
end
|
||||
return table1
|
||||
end]]
|
||||
|
||||
-- replace the _node in base_fn to actual given node value
|
||||
local fn = base_fn:gsub("_node", node)
|
||||
|
@ -374,9 +374,9 @@ M.override_req = function(name, default_req)
|
|||
result = result:sub(2)
|
||||
result = result:gsub("%)%.", "').", 1)
|
||||
return "require('" .. result
|
||||
else
|
||||
return "require('" .. result .. "')"
|
||||
end
|
||||
|
||||
return "require('" .. result .. "')"
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue