LintaoAmons/scratch.nvim

[Feat]: Have an automatic backup option

Closed this issue · 1 comments

high level: on a scratch file save, write the output to some external service like github gists. on first init of this plugin, if the scratch save location is empty then pull from gists. if this implementation seems like too much maintenance then possibly provide some functions/autocommands that run on file save and on first load so this can be achieved.

Hi, Thanks for your ideas,

But sync ability is not my priority right now, you can use other service like google drive or syncthing etc. to sync the directory your are using for scratch files.

if this implementation seems like too much maintenance then possibly provide some functions/autocommands that run on file save and on first load so this can be achieved.

You can write a custom command to achieve this. Not limited to scratch.nvim, this command can be use under any buffer, to sync the file to the destination you want.

I recommend you to use my another plugin easy-command.nvim to achieve this, some thing like

function() 
  local editor = require("easy-commands.impl.util.editor")
  local sys = require("easy-commands.impl.util.base.sys")
  local path = editor.buf.read.get_buf_abs_path()
  sys.run_sync({"sync-command", path}, ".") -- change the sync-command to anything you like
end