Vim trick for when NFS is down

You may find yourself logged into a server, editing a way in vim only to find that you can’t write to the filesystem due to an NFS error. There is a quick and easy way around this by doing this:

:w !ssh user@someothermachine "cat > backup.txt"

It will prompt you for your password and then ask you to hit enter after the ssh command completes. Tada, a file named backup.txt will be sitting on ‘someothermachine’ and your work will be safe.

Leave a comment

0 Comments.

Leave a Reply

( Ctrl + Enter )