martanne / vis

A vi-like editor based on Plan 9's structural regular expressions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I Wrote a New Backup Plugin

FOSSilizedDaemon opened this issue · comments

Hello,

I was unsure how to share this, but I have almost finished writing a new plugin for backing up files. In it's current form is works and backs up the current file every time you save it, but I am hoping that I can add the ability to backup files every Nth variation and then hopefully make this into its own independent lisp program. That said, for the time being here is a solid backup plugin which was inspired by the backup plugin on your wiki.

My backup plugin

Hope this helps someone else too! Thank you for writing a solid editor by the way. No editor will ever be perfect for one, but this is the closest I could find!

Edit

Oh I did have one question, I looked at your Lua API but did not seen any function to check if a specific directory exists. As you likely know Lua does not have any built-in function to check to see if a directory exists therefore you would have to implement your own. To rid the world of a million subpar functions attempting to implement this I was hoping you guys had one within the API? If not I can write my own, but a solid single version would be ideal.

You can always add your plugin to the wiki as well, next to the one you were inspired by.

As for the directory existence check, this indeed does not exist and adding it would be a possibility.

For testing if a directory exists you can use the lfs Lua module. lfs.attributes(), to be more precise.

What remains from this ticket as an action item?

@FOSSilizedDaemon would it be possible to isolate the plugin as a separate project, similar to another ones on the plugin page?