Use the following command to setup your shell to have similar key behavior to
vi. If you’re already familiar with the keybindings of
vi, then you may appreciate the ability to quickly search/edit your history, or navigate through your commands quickly. One example I heard about was being able to change a single character in a massive 200 character command.
set -o vi
You could include this command within your ~/.bashrc or ~/.bash_profile files as well so you have it when you login to a shell.