A powerful version history plugin for Vim that automatically creates timestamped backups on every save!
This plugin automatically backs up your file every time you :write it, creating a comprehensive version history 🐶
For example, in /home/you/todo.md, and when you did :write at 2016-10-06 11:06, bakaup.vim creates:
~/.backup/vim_backup/2016-10-06/%home%you%todo.md_at_11:06
Save it again at 11:42? You are careful to overwrite?
Don't worry! You will get another backup file:
~/.backup/vim_backup/2016-10-06/%home%you%todo.md_at_11:42
Meaning, you'll get:
$ cd ~/.backup/vim_backup/2016-10-06 && ls %home%you%todo.md*
%home%you%todo.md_at_11:06
%home%you%todo.md_at_11:42
You can go back to any save point - perfect for when you realize you deleted something important hours ago!
- Recover accidentally deleted code from any previous save
- Review your work history and see how your document evolved
- Safe experimentation - try changes knowing you can always go back
- No git repository needed - works for config files, notes, scripts, anything!
- Finer granularity than git commits - every save is preserved
Unlike Vim's standard 'backup' option which only keeps one previous version per file, bakaup.vim creates a complete history of all your saves with precise timestamps!
| Feature | Vim's 'backup' |
bakaup.vim |
|---|---|---|
| Backup frequency | Only before overwrite | Every :write |
| History depth | 1 backup (latest only) | Unlimited backups |
| Timestamp precision | No timestamp | Hour:Minute precision |
| Organization | Same directory or simple backup dir | Date-organized directories |
| Recovery | Overwrite risk | Safe history browsing |
With Vim's standard backup: When you save todo.md multiple times, you only get todo.md~ - just the previous version.
With bakaup.vim: Every save creates a new timestamped backup, giving you a complete version history!
call dein#add('aiya000/bakaup.vim')Or if you use toml:
[[plugins]]
repo = 'aiya000/bakaup.vim'For lazy loading with toml:
[[plugins]]
repo = 'aiya000/bakaup.vim'
on_cmd = [
'BakaupBackupExecute',
'BakaupEnable',
'BakaupDisable',
'BakaupArchiveBackups',
'BakaupExplore',
'BakaupTexplore',
'BakaupVexplore',
'BakaupSexplore',
]{
'aiya000/bakaup.vim',
init = function()
vim.g.bakaup_auto_backup = 1
-- Optional: customize backup directory
-- vim.g.bakaup_backup_dir = vim.fn.expand('~/my_backups')
end,
}Important for lazy.nvim users: Use the init function (not config) to set g:bakaup_auto_backup before the plugin loads.
let g:bakaup_auto_backup = 1This value is 0 by default.
bakaup.vim is not enabled by default. Above line enables bakaup.vim!
More specs are available in ./doc (:help bakaup.vim) 🐕