ex Commands
This section summarizes the ex commands used from the colon prompt in vi.
Command Syntax
:[address]command[options]
Address Symbols
Address | Includes |
|---|---|
| All lines in the file |
| Lines x through y |
| Lines x through y, with current line reset to x |
| Top of file |
| Current line |
| Absolute line number n |
| Last line |
| All lines; same as
|
| n lines before x |
| n lines after x |
| One or n lines previous |
| One or n lines ahead |
| Line marked with x (single quote) |
| Previous mark (two single quotes) |
| Ahead or back to the line where pat matches |
Command Option Symbols
Symbol | Meaning |
|---|---|
| A variant form of the command |
| Repeat the command count times |
| Filename: |
Alphabetical List of Commands
The following table of ex commands covers both standard ex commands and selected commands specific to Vim. Commands covered in Vim—vi Improved are omitted here.
| Full name | Command | Vim only |
|---|---|---|
| Abbrev |
| |
| Append |
[ | |
| Args |
| |
| Args |
| ✓ |
| Bdelete | [ | ✓ |
| Buffer | [ | ✓ |
| Buffers | [ | ✓ |
| Center | [ | ✓ |
| Change |
[ | |
| Chdir | | |
| Copy | [ | |
| Delete | [ | |
| Edit |
| |
| File |
| |
| Global | [ | |
| Insert |
[ | |
| Join | [ | |
| K (mark) | [ | |
| Left | [ | ✓ |
| List | [ | |
| Map |
| |
| Mark | [ | |
| Mkexrc |
| ✓ |
| Move | [ |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access