In Normal mode, Vim interprets keys as commands. Insert mode inserts typed text into the buffer. Several Normal-mode commands enter Insert mode at different positions, letting you begin typing without separate navigation.
Advanced Text-Fu · Lesson 6
Vim Inserting and Appending Text
Learn how Vim enters Insert mode before, after, above, or below the current cursor position.
Press Esc to leave Insert mode and return to Normal mode. If you are unsure which mode is active, pressing Esc is a safe way to reestablish Normal mode, although it can cancel a pending operation.
Which key normally returns from Insert mode to Normal mode?
Inserting before or after the Cursor
From Normal mode:
i: Enter Insert mode before the cursor.a: Enter Insert mode after the cursor.
For example, if the cursor is on b in abc, i begins before b, while a begins after b. Both commands change modes; the text you type afterward performs the insertion.
Which Normal-mode key enters Insert mode immediately before the cursor?
Inserting at Line Boundaries
Uppercase commands target meaningful positions on the current line:
I: Enter Insert mode before the first nonblank character.A: Enter Insert mode at the end of the line.
On an indented line, I skips indentation and begins before the first nonblank text. Use 0i if you specifically need to insert at column zero.
Which Normal-mode command begins insertion before the first nonblank character of the current line?
Which Normal-mode command moves to the end of the current line and enters Insert mode?
Opening a New Line
From Normal mode:
o: Open a new line below the current line and enter Insert mode.O: Open a new line above the current line and enter Insert mode.
Vim applies indentation according to current settings and filetype rules. A count can repeat the open-line operation, but first learn the single-line form so the resulting cursor position is predictable.
Which Normal-mode command opens a new line above the current line and enters Insert mode?
To practice moving between Normal and Insert modes, try this hands-on lab:
- Edit Text Files in Linux with Vim and Nano - Practice creating files, editing text, saving files, and navigating with both vi/vim and nano. This lab will help you master the fundamental skills of using Vim's Normal and Insert modes.
Lesson complete
You finished Vim Inserting and Appending Text
You can now enter Insert mode at the position where new text belongs.
Return to Normal mode with
Esc.Insert before or after the cursor with
iora.Insert at the first text or line end with
IorA.Open a line below with
o.Open a line above with
O.
Keep your learning progress
Create a free account to save this lesson and continue learning on any device.
Create a free account