You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

76 lines
1.6 KiB

local NukeVim = {}
function NukeVim:new(obj)
obj = obj or {}
setmetatable(obj, self)
self.__index = self
return obj
end
function NukeVim:enableCaching()
self.lua_cache = require('impatient/impatient')
end
function NukeVim:enableProfiling()
self.lua_cache.enable_profile()
end
function NukeVim:initialize()
-- init dependencies
self.config = require('_config')
self.modules = require('modules'):new()
-- load modules based on config
for module, config in pairs(self.config) do
if (config.enable == nil or config.enable == true) then
self.modules:add(module, config)
end
end
-- Start up modules
self.modules:configure()
self.modules:call('initialize')
self.modules:call('register')
self.modules:call('commit')
self.modules:call('boot')
end
function NukeVim:run()
self.modules:call('run')
end
function NukeVim:gui()
self.modules:call('gui')
end
function NukeVim:install()
self.modules:call('install')
vim.cmd(':helptags ~/.config/nvim/doc/')
end
function NukeVim:help()
vim.cmd(':h nukevim')
end
function NukeVim:health()
health = vim.health or require "health"
-- TODO: Figure out a way to determine if a module is actually loaded
-- and/or add some error handling to some requires() so we can track that
-- and report it here.
for name, module in pairs(self.modules.modules) do
check = module.instance:health()
if (check ~= nil and check.messages ~= nil and #check.messages ~= 0) then
health.report_start(('Module: %s'):format(name))
for idx,message in ipairs(check.messages) do
health['report_' .. message[1]](message[2])
end
end
end
end
return NukeVim