An improved 'edit' alias

Vaidas Kascėnas <[email protected]> Mon, 31 Aug 2009 12:19:12 +0300
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
Hello,
I've noticed today that the 'edit' alias that was somehow included in
the lftp package on gentoo lost the file extension and therefore vim
(and possibly other editors) doesn't detect the stuff to highlight, so
I (with a bit of help from another person) improved it a bit:

alias edit "eval -f \"get $0 -o ~/.lftp/edit.tmp.$$.$0 && shell \\\"cp
-p ~/.lftp/edit.tmp.$$.$0 ~/.lftp/edit.tmp.$$.$0.orig && $EDITOR
~~/.lftp/edit.tmp.$$.$0 && test ~/.lftp/edit.tmp.$$.$0 -nt
~~/.lftp/edit.tmp.$$.$0.orig\\\" && put ~/.lftp/edit.tmp.$$.$0 -o $0;
shell rm -f ~/.lftp/edit.tmp.$$.$0*\""

I think many people would appreciate it. Vim users should at least. :)