fix bug.
Add vi-mode feature, and feature of parameter completion by external script.
Did the refactoring.