SQL> edit
Wrote file afiedt. buf
40
As shown in the preceding figure,
After setting vi as the default editor, there is no problem:
SQL> set _ EDITOR = vi
SQL> ed
However, in this case, I only set session settings, which will expire after re-login. If you want to save the configuration, you can save the editor settings to the configuration file and use the configuration automatically each time.
Modify the $ ORACLE_HOME/sqlplus/admin/glogin. SQL configuration file and add define _ editor = vi. When sqlplus is started, it will read the glogin. SQL script.
In Linux sqlplus, if you use edit to edit the current script, the default editor ed is called. If you want to use vi as the default editor, you can edit the file $ ORACLE_HOME/sqlplus/admin/glogin. SQL, add the following lines
DEFINE _ EDITOR = vi
After sqlplus is restarted, vi is called as the editor when the edit command is run. When sqlplus is started, $ ORACLE_HOME/sqlplus/admin/glogin is run first. SQL, so we can also set other variables in this file
Author: Tan