Getting rlwrap to work on Mac OS X
CJ Travis has an excellent post on this:
Installing sqlplus, rlwrap on OS X Lion 10.7
To also get the VI keybindings to work with SQL*Plus do the following:
1. create a file in your home directory called .inputrc
2. add the following lines to .inputrc:
set editing-mode vi set keymap vi
3. save the file and source .bash_profile again:
source .bash_profile
Now you should have the VIkeybindings in SQL*Plus, too.
The link to the Moutain Lion version of ports is:
https://distfiles.macports.org/MacPorts/MacPorts-2.1.2-10.8-MountainLion.pkg
Also check out my other posts on rlwrap: