Writebackup is a Vim plugin that automatically creates file backups with a date file extension for the current file. It simplifies the process of preserving the latest version of files within the Vim text editor.
The plugin boasts a convenient ':WriteBackup' command that saves subsequent backups of the current file with a 'current date + counter' file extension, formatted as '.YYYYMMDD[a-z]'. The first backup of the day will have the letter 'a' appended, with 'b' appended to the second, and so on. This means that up to 26 backups can be created on any given day.
Backups are created by default in the same directory as the original file. However, they can also be placed in a directory relative to the original file, or in a common backup directory for all files, similar to VIM's 'backupdir' option. To use Writebackup, simply enter the command ':WriteBackup'.
Users wishing to make a permanent configuration should add the following commands to their vimrc file. To create backups in a different directory, specify a backup directory with 'let g:writebackup_BackupDir = 'D:backups''. Users should be aware that backing up files with the same name from different directories using this setting may result in name clashes. A directory starting with "./" puts the backup file relative to the backed-up file.
Users can override global settings for specific buffers by setting a buffer-scoped variable, which can be done manually or through an autocmd or ftplugin. Developers may find it helpful to define a shorter command alias ':W' in their .vimrc to save on keystrokes.
Writebackup requires only Vim to work, and this latest release features a minor adjustment that adds '-bar' to ':WriteBackup' to facilitate chaining commands together.
Version 1.20.006: N/A