draft: initial implementation

This commit is contained in:
Marc Jakobi
2024-04-11 20:46:06 +02:00
parent ac72bb5c76
commit e61adde6ce
15 changed files with 904 additions and 102 deletions
+27
View File
@@ -0,0 +1,27 @@
---@mod lz.n
local M = {}
-- TODO: Is this necessary?
if not vim.loader or vim.fn.has('nvim-0.9.1') ~= 1 then
error('lz.n requires Neovim >= 0.9.1')
end
---@param spec string | LzSpec
function M.load(spec)
if vim.g.lzn_did_load then
return vim.notify('lz.n has already loaded your plugins.', vim.log.levels.WARN, { title = 'lz.n' })
end
vim.g.lzn_did_load = true
if type(spec) == 'string' then
spec = { import = spec }
end
---@cast spec LzSpec
local plugins = require('lz.n.spec').parse(spec)
require('lz.n.loader').load_startup_plugins(plugins)
require('lz.n.state').plugins = plugins
require('lz.n.handler').init(plugins)
end
return M