Adds pull when entering notes

This commit is contained in:
Michel 2025-01-01 16:30:48 +01:00
parent c0cb36520e
commit fad0c5c6c1
7 changed files with 63 additions and 41 deletions

View file

@ -31,7 +31,7 @@ vim.api.nvim_create_autocmd("BufWritePost", {
})
vim.api.nvim_create_autocmd("VimLeavePre", {
callback = function(args)
callback = function()
print("Pushing changes...")
-- Push twice, in case the credentials expired. Ugly hack, but it works
local pushSuccess = os.execute("git push &> /dev/null")
@ -42,3 +42,14 @@ vim.api.nvim_create_autocmd("VimLeavePre", {
print("Done")
end,
})
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
print("Updating...")
local command = "git pull --rebase --quiet --no-edit &> /dev/null"
local pullSuccess = os.execute(command)
if pullSuccess > 0 then
os.execute(command)
end
end,
})

View file

@ -1,6 +1,6 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
if false then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--

View file

@ -0,0 +1,3 @@
return {
"nvim-neotest/nvim-nio",
}

View file

@ -8,6 +8,9 @@ return {
"nvim-lua/plenary.nvim",
},
opts = {
ui = {
enable = false,
},
workspaces = {
{
name = "notes",

View file

@ -2,4 +2,11 @@ return {
"MeanderingProgrammer/render-markdown.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
opts = {},
config = function()
require("render-markdown").setup({
bullet = {
right_pad = 1,
},
})
end,
}