Visual mode is used to select text as a block to delete, copy, and modify (e.g., capitalize the first character of each word). When Visual mode is launched, the screen shows -- VISUAL --
.
v
: start the Visual mode with selecting the current character
V
: start the Visual mode with selecting the current line
In Visual mode, you can mainly use arrows to extend the initial selection of a character or line (depending on how you start Visual mode).
You can use the d key, delete key, or backspace (delete + fn on Mac) to delete the selected text.
You can use the y key to copy (yank) selected text. Once you copy the selected text, Vim moves back to Normal mode. You can paste the copied text in Normal mode.
You can change the selected text to upper case or lower case using the U or u key.
U
: change the selected text to UPPER CASE
u
: change the selected text to lowercase
This is an example of changing the selected text to upper case.
To move back to Normal mode, press the esc key. Also, Vim moves back to Normal mode automatically after you run a command (e.g., delete or copy).
Visual mode is used to select text as a block to delete, copy, and modify (e.g., capitalize the first character of each word). When Visual mode is launched, the screen shows -- VISUAL --
.
v
: start the Visual mode with selecting the current character
V
: start the Visual mode with selecting the current line
In Visual mode, you can mainly use arrows to extend the initial selection of a character or line (depending on how you start Visual mode).
You can use the d key, delete key, or backspace (delete + fn on Mac) to delete the selected text.
You can use the y key to copy (yank) selected text. Once you copy the selected text, Vim moves back to Normal mode. You can paste the copied text in Normal mode.
You can change the selected text to upper case or lower case using the U or u key.
U
: change the selected text to UPPER CASE
u
: change the selected text to lowercase
This is an example of changing the selected text to upper case.
To move back to Normal mode, press the esc key. Also, Vim moves back to Normal mode automatically after you run a command (e.g., delete or copy).