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
dcommand to delete selected text in Visual mode. - Press
Shift + Ito enter insert mode at the beginning of the selected block. - Enter the desired text.
- Hit
Escto exit insert mode. - Move the cursor down to the next line.
- Use
yyto yank (copy) the selected line. - Press
pto paste the yanked line. - Use
dto delete the line if needed. - The command
:%w !pbcopysaves 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.