2024-12-28 23:55:45 -08:00
|
|
|
vim.api.nvim_create_user_command("VaultSync", function()
|
|
|
|
local date = os.date("%Y-%m-%d %H:%M:%S")
|
|
|
|
local commit_commands = {
|
|
|
|
"git add -A",
|
2024-12-29 03:23:46 -08:00
|
|
|
string.format([[git commit -m "auto-update(nvim): %s"]], date),
|
2024-12-28 23:55:45 -08:00
|
|
|
}
|
|
|
|
for _, cmd in ipairs(commit_commands) do
|
|
|
|
vim.fn.system(cmd)
|
|
|
|
end
|
|
|
|
vim.notify("Committed all local changes.", vim.log.levels.INFO)
|
|
|
|
vim.cmd("Neogit push")
|
|
|
|
end, {})
|
|
|
|
|
|
|
|
vim.keymap.set("n", "<leader>vs", vim.cmd.VaultSync)
|