You can set/use the following predefined substitution variables in SQL*Plus:
NameUsage
_CONNECT_IDENTIFIERNet service name [9iR2+]
_DATECurrent date [10g+]
_EDITORExternal editor (invoked by the EDIT command)
_O_VERSIONVersion text
_O_RELEASERelease number
_PRIVILEGESYSDBA or SYSOPER privilege (or blank) [10g+]
_SQLPLUS_RELEASEsame as _O_VERSION
_USERLogin user name [10g+]


Example:
DEFINE _EDITOR=gvim