2021-08-10 21:50:49 +02:00
|
|
|
local M = {}
|
|
|
|
local cmd = vim.cmd
|
|
|
|
|
|
|
|
function M.create_augroup(autocmds, name)
|
2021-12-18 14:41:37 +01:00
|
|
|
cmd("augroup " .. name)
|
|
|
|
cmd("autocmd!")
|
|
|
|
for _, autocmd in ipairs(autocmds) do
|
|
|
|
cmd("autocmd " .. table.concat(autocmd, " "))
|
|
|
|
end
|
|
|
|
cmd("augroup END")
|
2021-08-10 21:50:49 +02:00
|
|
|
end
|
|
|
|
|
2021-10-08 11:16:06 +02:00
|
|
|
function M.ReloadConfig()
|
2021-12-18 14:41:37 +01:00
|
|
|
for name, _ in pairs(package.loaded) do
|
|
|
|
if name:match("^cnull") then
|
|
|
|
package.loaded[name] = nil
|
|
|
|
end
|
|
|
|
end
|
2021-10-08 11:16:06 +02:00
|
|
|
|
2021-12-18 14:41:37 +01:00
|
|
|
dofile(vim.env.MYVIMRC)
|
2021-10-08 11:16:06 +02:00
|
|
|
end
|
|
|
|
|
2022-05-13 19:19:05 +02:00
|
|
|
local inspect = require("inspect")
|
2021-08-19 15:57:07 +02:00
|
|
|
|
2022-05-13 19:19:05 +02:00
|
|
|
function M.dump(o)
|
|
|
|
print(inspect.inspect(o))
|
|
|
|
end
|
2022-01-26 20:42:58 +01:00
|
|
|
|
2021-08-19 15:57:07 +02:00
|
|
|
function M.has_plugin(pluginName)
|
2021-12-18 14:41:37 +01:00
|
|
|
local status = pcall(require, pluginName)
|
|
|
|
return status
|
2021-08-19 15:57:07 +02:00
|
|
|
end
|
|
|
|
|
2021-11-08 01:29:28 +01:00
|
|
|
return M
|