obsidian.nvim icon indicating copy to clipboard operation
obsidian.nvim copied to clipboard

How to add autobackup using obsidian git?

Open ljudina opened this issue 1 year ago • 3 comments

Hi,

I have installed Obsidian git plugin which automatically backups vaults one hour after file changed. This only works when Obsidian application is active, but if I change vaults inside neovim it does not run backups.

Is there any way to trigger backup changes in neovim as well?

Sincerely, Marko

ljudina avatar Jan 27 '24 18:01 ljudina

Hey @ljudina not at the moment. Personally I just have my own shortcut command that I call periodically to create commits via fugitive.

epwalsh avatar Jan 29 '24 17:01 epwalsh

Owner

Could you share them please?

NikolaM-Dev avatar Jan 31 '24 03:01 NikolaM-Dev

@NikolaM-Dev Probably something like this I'd imagine:

mappings = {
  ['<c-s>'] = {
    action = function() vim.cmd 'Git commit -am "This is a routine Obsidian commit"' end,
    opts = { buffer = true }
  }
}

But if you want automation you'd be better off setting up an hourly service that runs outside of Neovim to make these commits, that way they will always run as long as your computer is on. On linux a systemd user service would be great for this.

stelcodes avatar Feb 29 '24 00:02 stelcodes