Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create local backup when editing remote files via netrw in vim

I work with many files remotely using vim and the netrw plugin. I also keep timestamped backups by changing the &backupext (found in the documentation).

While working in a remote file (scp://server//folder/file.txt), I noticed that when I save it, a backup isn't even being made.

Is there a way I can have a backup automatically made locally (according to vim backup settings) every time I save a remote file?

like image 743
matpie Avatar asked Feb 18 '09 23:02

matpie


1 Answers

I don't think there's a simple setting to toggle. You could try to script something though - add your own BufWriteCmd autocommand to write a backup. Try using set verbose=9 for debugging (and to see how netrw does it).

like image 143
rampion Avatar answered Nov 08 '22 04:11

rampion