vim — stdin stdout - file -- opt --help --version
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
$ 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 character |
|
|
Delete next word |
|
|
Delete previous word |
|
|
Delete current line |
|
|
Delete to end of line |
|
|
Define region (type this keystroke to mark the beginning of the region, then move the cursor to the end of the desired region) |
|
|
Cut region |
|
|
Copy region |
|
|
Paste region |
|
|
Get help |
|
|
View the manual |
|
|
18.118.120.109