Replaced hardcoded call to vi with $EDITOR to allow the user to use their favourite editing tool.