Vim Visual Block
In Vim, the Visual Block mode is a powerful feature that allows you to select text in a block, enabling efficient text manipulation. Here are some essential commands and shortcuts for working with Visual Block:
Visual Modes and Text Manipulation Commands
- To enter Visual Block mode, press
Ctrl + V
. - To enter Visual Line mode, press
Shift + V
. - Use the
d
command to delete selected text in Visual mode. - Press
Shift + I
to enter insert mode at the beginning of the selected block. - Enter the desired text.
- Hit
Esc
to exit insert mode. - Move the cursor down to the next line.
- Use
yy
to yank (copy) the selected line. - Press
p
to paste the yanked line. - Use
d
to delete the line if needed. - The command
:%w !pbcopy
saves the modified note and copies it to the clipboard.
These commands and shortcuts make Vim a versatile text editor for various tasks, especially when dealing with blocks of text.