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 | [ |
Get vi and Vim Editors Pocket Reference, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.