Updates nvim setup
This commit is contained in:
parent
1c38c7b171
commit
6f069d32e1
13 changed files with 285 additions and 4 deletions
|
|
@ -4,21 +4,35 @@ local git = require("functions.git")
|
|||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
-- Add any additional autocmds here
|
||||
|
||||
local enabledGit = os.getenv("ENABLE_GIT_SETUP") or false
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = { "*.md" },
|
||||
callback = function(args)
|
||||
if not enabledGit then
|
||||
return
|
||||
end
|
||||
|
||||
git.commitFile(args.file)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("VimLeavePre", {
|
||||
callback = function()
|
||||
if not enabledGit then
|
||||
return
|
||||
end
|
||||
|
||||
git.push()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = function()
|
||||
if not enabledGit then
|
||||
return
|
||||
end
|
||||
|
||||
git.pull()
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue