Name
vim — stdin stdout - file -- opt --help --version
Synopsis
vim [options
] [files
]
vim is an enhanced version of the old standard Unix editor vi. To invoke the editor in a new X window, run:
$ gvim
To run in a existing shell window:
$ vim
To run the vim tutorial, run:
$ vimtutor
vim is a mode-based editor. It operates in two modes, insert and normal. Insert mode is for entering text in the usual manner, while normal mode is for running commands like “delete a line” or copy/paste. For basic keystrokes in normal mode, see Table 1-1.
Table 1-1. Basic keystrokes in emacs and vim
Task |
emacs |
vim |
---|---|---|
Type text |
Just type |
Type |
Save and quit |
|
|
Quit without saving |
Respond “no” when asked to save buffers |
|
Save |
|
|
Save As |
|
|
Undo |
|
|
Suspend editor (not in X) |
|
|
Switch to edit mode |
(N/A) |
|
Switch to command mode |
|
: |
Abort command in progress |
|
|
Move forward |
|
|
Move backward |
|
|
Move up |
|
|
Move down |
|
|
Move to next word |
|
|
Move to previous word |
|
|
Move to beginning of line |
|
|
Move to end of line |
|
|
Move down one screen |
|
|
Move up one screen |
|
|
Move to beginning of buffer |
|
|
Move to end of buffer |
|
|
Delete next character |
^d |
|
Delete previous ... |
Get Linux Pocket Guide, 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.