Monday, January 14, 2013

Automatic backup of files using VI with a ~ (tilde)

When editing text files on my new Ubuntu Quantal Quetzal 64bit Linux install using the vi editor, I noticed that the original file was not saved as a backup with a ~ (tilde).

The solution was to enable backups in a vimrc :

% cat ~/.vimrc
:set backup

Now the original is saved as a backup after editing:

% vi test.txt
% ls test.txt*
test.txt test.txt~

1 comment:

  1. Nice and very interesting. Thank you for your sharing...........

    Automatic File Backup