{"id":13898548,"url":"https://github.com/ZSaberLv0/ZFVimBackup","last_synced_at":"2025-07-17T15:33:59.154Z","repository":{"id":111991958,"uuid":"187756380","full_name":"ZSaberLv0/ZFVimBackup","owner":"ZSaberLv0","description":"more convenient file backup util for vim","archived":false,"fork":false,"pushed_at":"2024-06-19T16:06:44.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-25T04:37:04.779Z","etag":null,"topics":["backups","vim-script"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZSaberLv0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"ZSaberLv0","issuehunt":"ZSaberLv0","custom":["https://github.com/ZSaberLv0/ZSaberLv0"]}},"created_at":"2019-05-21T03:39:06.000Z","updated_at":"2024-06-19T16:06:47.000Z","dependencies_parsed_at":"2024-11-25T04:32:06.825Z","dependency_job_id":"b2dd8625-2ff2-461e-85d5-3983ecee1961","html_url":"https://github.com/ZSaberLv0/ZFVimBackup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZSaberLv0/ZFVimBackup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimBackup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimBackup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimBackup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimBackup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZSaberLv0","download_url":"https://codeload.github.com/ZSaberLv0/ZFVimBackup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimBackup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265622930,"owners_count":23800066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backups","vim-script"],"created_at":"2024-08-06T18:04:20.729Z","updated_at":"2025-07-17T15:33:58.870Z","avatar_url":"https://github.com/ZSaberLv0.png","language":"Vim Script","funding_links":["https://patreon.com/ZSaberLv0","https://issuehunt.io/r/ZSaberLv0","https://github.com/ZSaberLv0/ZSaberLv0"],"categories":["Vim Script"],"sub_categories":[],"readme":"\nmore convenient file backup util for vim\n\nif you like my work, [check here](https://github.com/ZSaberLv0?utf8=%E2%9C%93\u0026tab=repositories\u0026q=ZFVim) for a list of my vim plugins,\nor [buy me a coffee](https://github.com/ZSaberLv0/ZSaberLv0)\n\n# how to use\n\n1. use [Vundle](https://github.com/VundleVim/Vundle.vim) or any other plugin manager you like to install\n\n    ```\n    Plugin 'ZSaberLv0/ZFVimBackup'\n    ```\n\n1. edit your file, backups would be made automatically when you save files,\n    or, make backups manually by `:ZFBackupSave` or `:ZFBackupSaveDir`\n1. if anything wrong, use `:ZFBackupList` or `:ZFBackupListDir` to popup and choose backup to diff and restore\n\n# functions\n\n* `ZFBackup_backupDir()` : get backup dir\n* `ZFBackupSave [filePath]` or `call ZFBackupSave([filePath])` : save backup for specified file\n* `ZFBackupSaveDir [filePath]` or `call ZFBackupSaveDir([filePath])` : save backup for specified dir,\n    `wildignore` and `ZFIgnoreGet()` are applied\n* `ZFBackupRemove [filePath]` or `call ZFBackupRemove([filePath])` : remove backup for specified file\n* `ZFBackupRemoveDir [filePath]` or `call ZFBackupRemoveDir([filePath])` : remove backup for specified dir\n* `ZFBackupList [filePath]` or `call ZFBackupList([filePath])` : restore backup for specified file\n* `ZFBackupListDir [filePath]` or `call ZFBackupListDir([filePath])` : restore backup for specified dir\n* `ZFBackup_getBackupInfoList([filePath])` or `ZFBackup_getAllBackupInfoList()` :\n    get a list of backup info for specified file:\n    ```\n    [\n      {\n        'backupFile' : 'backup file name under backupDir',\n        'name' : 'original file's name',\n        'path' : 'original file's parent's abs path, may be empty when local config file messed up',\n        'pathMD5' : 'original file's parent's abs path's md5',\n        'time' : 'backup saved time, string',\n        'info' : 'a short info to show the backup',\n      },\n    ]\n    ```\n* `ZFBackup_clean()` : remove all backup files\n* `ZFBackup_enable()` : enable auto backup\n* `ZFBackup_disable()` : disable auto backup\n* `ZFBackup_autoClean()` : clean outdated backup\n\n# configs\n\n* `g:ZFBackup_autoEnable` : whether enable by default, default: `1`\n* `g:ZFBackup_stateFilePath` : path for local state file, default: `~/.vim_cache`\n* `g:ZFBackup_path` : path for backups, default: `~/.vim_cache`\n* `g:ZFBackup_backupFunc` : function to perform actual backup, default: `ZFBackup_backupFunc`\n* `g:ZFBackup_hashFunc` : function to get file's hash, default: `ZFBackup_hashFunc`\n    * you need one of thse command to make backup available:\n        * `md5` or `md5sum` (for Linux like systems)\n        * `certutil` (for Windows)\n    * if none of them are available,\n        you may supply your own,\n        or use the builtin vim script version by `let g:ZFBackup_hashFunc_fallback_enable = 1`\n        (which may be slow)\n* `g:ZFBackup_backupFilter` : Dictonary that contain filter functions to filter files to backup,\n    key is any module name you like,\n    value is filter function `function(filePath)`,\n    return `1` to prevent the file from being backup,\n    return `0` means the file needs backup,\n    return `-1` means pass to next filter,\n    if all filter return `-1`, then it means the file needs backup\n    * `g:ZFBackup_backupFilterEnableDefault` : whether enable the default filter,\n        which use [ZSaberLv0/ZFVimIgnore](https://github.com/ZSaberLv0/ZFVimIgnore) to filter,\n        default: `1`\n\n        to specify custom ignore for ZFBackup only:\n\n        ```\n        if !exists('g:ZFIgnoreData')\n            let g:ZFIgnoreData = {}\n        endif\n        let g:ZFIgnoreData['MyCustomIgnore'] = {\n                    \\   'ZFBackup' : {\n                    \\     'file' : {\n                    \\       '*.png' : 1,\n                    \\     },\n                    \\     'dir' : {\n                    \\     },\n                    \\   },\n                    \\ }\n        ```\n\n* `g:ZFBackup_includeTempname` : whether backup files created by `tempname()`, default: `0`\n* `g:ZFBackup_maxFileSize` : if file large than this size, do not backup, default: `2 * 1024 * 1024` (2MB)\n* `g:ZFBackup_maxBackupPerFile` : max number of backups for one file, default: `10`\n* `g:ZFBackup_maxBackup` : max number of backups, default: `500`\n* `g:ZFBackup_autoClean` : auto clean outdated backup, use 0 to disable auto clean, default: `7 * 24 * 60 * 60` (7 day)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZSaberLv0%2FZFVimBackup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZSaberLv0%2FZFVimBackup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZSaberLv0%2FZFVimBackup/lists"}