24 lines
577 B
Lua
24 lines
577 B
Lua
local git = require("functions.git")
|
|
|
|
-- Autocmds are automatically loaded on the VeryLazy event
|
|
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
|
-- Add any additional autocmds here
|
|
|
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
|
pattern = { "*.md" },
|
|
callback = function(args)
|
|
git.commitFile(args.file)
|
|
end,
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("VimLeavePre", {
|
|
callback = function()
|
|
git.push()
|
|
end,
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("VimEnter", {
|
|
callback = function()
|
|
git.pull()
|
|
end,
|
|
})
|