VI operates in three modes for performing different functions.
—-The Command Mode is used to enter commands that operates on text or control cursor motion.
—-The Input Mode is used to enter text.
—-The ex Mode (or last line mode) is used for line handling and substitution.
Input mode is used to insert (i and I), append (a and A), replace (r and R), change (s and S) text and open a line (o and O). This mode is terminated by pressing [Esc] .
The ex Mode is invoked by pressing a: in the command mode. You can save your work (:w) , exit the editor after saving (😡) and quit without saving (:q and :q!).