fix(commands): clean up
This commit is contained in:
parent
1d8f81b737
commit
461d5c9f12
2 changed files with 10 additions and 11 deletions
|
@ -1,6 +1,5 @@
|
|||
vim.cmd([[
|
||||
command! CosmicUpdate lua require('cosmic.utils').update()
|
||||
command! CosmicReloadConfig lua require('cosmic.utils').reload_user_config()
|
||||
command! CosmicReload lua require('cosmic.utils').reload_cosmic()
|
||||
command! CosmicReloadSync lua require('cosmic.utils').reload_cosmic(true)
|
||||
]])
|
||||
-- command! CosmicReloadSync lua require('cosmic.utils').reload_cosmic(true)
|
||||
|
|
|
@ -65,24 +65,24 @@ local function unload(module_pattern, reload)
|
|||
end
|
||||
end
|
||||
|
||||
function M.reload_user_config()
|
||||
unload('cosmic.config')
|
||||
function M.post_reload()
|
||||
unload('cosmic')
|
||||
require('cosmic')
|
||||
vim.cmd(':silent e')
|
||||
vim.notify('CosmicNvim reloaded!', vim.log.levels.INFO, {
|
||||
title = 'CosmicNvim',
|
||||
})
|
||||
end
|
||||
|
||||
function M.reload_cosmic(sync)
|
||||
unload('cosmic')
|
||||
require('cosmic')
|
||||
unload('cosmic.config')
|
||||
require('cosmic.config')
|
||||
vim.cmd([[autocmd User PackerCompileDone ++once lua require('cosmic.utils').post_reload()]])
|
||||
if sync then
|
||||
require('cosmic.packer').packer.sync()
|
||||
else
|
||||
require('cosmic.packer').packer.compile()
|
||||
end
|
||||
vim.cmd(':silent e')
|
||||
vim.notify('CosmicNvim reloaded!', vim.log.levels.INFO, {
|
||||
title = 'CosmicNvim',
|
||||
})
|
||||
-- vim.cmd(':silent bufdo e')
|
||||
end
|
||||
|
||||
function M.get_install_dir()
|
||||
|
|
Loading…
Add table
Reference in a new issue