
* feat: init lazy.nvim * refactor: easy plugin init * feat: user defined plugins * refactor: clean up user config * refactor: clean up lsp plugins * fix: lsp signature * fix: null ls user config * feat: replace commands * feat: optimize lazy loading * fix: lsp_signature working * fix: documentation hover/sig help * fix: autopairs * feat: clean up luasnips * fix auto complete * moar laziness * feat: add markdown_inline to ensured_installed for TS * clean up * clean up auto-session
47 lines
1.1 KiB
Lua
47 lines
1.1 KiB
Lua
local M = {}
|
|
|
|
local function get_install_dir()
|
|
local config_dir = os.getenv('COSMICNVIM_INSTALL_DIR')
|
|
if not config_dir then
|
|
return vim.fn.stdpath('config')
|
|
end
|
|
return config_dir
|
|
end
|
|
|
|
function M.sync_plugins()
|
|
vim.cmd(':Lazy sync')
|
|
end
|
|
|
|
-- update instance of CosmicNvim
|
|
function M.update()
|
|
local Logger = require('cosmic.utils.logger')
|
|
local Job = require('plenary.job')
|
|
local path = get_install_dir()
|
|
local errors = {}
|
|
|
|
Job
|
|
:new({
|
|
command = 'git',
|
|
args = { 'pull', '--ff-only' },
|
|
cwd = path,
|
|
on_start = function()
|
|
Logger:log('Updating...')
|
|
end,
|
|
on_exit = function()
|
|
if vim.tbl_isempty(errors) then
|
|
Logger:log('Updated! Running CosmicReloadSync...')
|
|
M.reload_user_config_sync()
|
|
else
|
|
table.insert(errors, 1, 'Something went wrong! Please pull changes manually.')
|
|
table.insert(errors, 2, '')
|
|
Logger:error('Update failed!', { timeout = 30000 })
|
|
end
|
|
end,
|
|
on_stderr = function(_, err)
|
|
table.insert(errors, err)
|
|
end,
|
|
})
|
|
:sync()
|
|
end
|
|
|
|
return M
|