This commit is contained in:
Jaroslaw Konik 2024-05-26 14:44:52 +02:00
parent d2fc8672d0
commit e2d5df96f1

View file

@ -331,14 +331,14 @@ vim.api.nvim_create_autocmd('BufEnter', {
}) })
vim.api.nvim_create_autocmd('BufEnter', { vim.api.nvim_create_autocmd('BufEnter', {
pattern = { "/home/jaroslaw/notes/**" }, pattern = { "*/notes/**" },
callback = function() callback = function()
vim.loop.spawn("git", { args = { "pull" } }) vim.loop.spawn("git", { args = { "pull" } })
end, end,
}) })
vim.api.nvim_create_autocmd('BufWritePost', { vim.api.nvim_create_autocmd('BufWritePost', {
pattern = { "/home/jaroslaw/notes/**" }, pattern = { "*/notes/**" },
callback = function() callback = function()
local filename = vim.fn.expand('%') local filename = vim.fn.expand('%')
local command = 'git add ' .. filename .. '; git commit -m "Auto-commit: saved ' .. filename .. '"' local command = 'git add ' .. filename .. '; git commit -m "Auto-commit: saved ' .. filename .. '"'