How to avoid getting lost between vi and Emacs#
Two major editors for Linux: Vi and Emacs. There are few opportunities to use either of them, and if you are unfamiliar with them, you can easily get lost. Therefore, we have put together an article with the aim of covering even the bare minimum of operations.
vi - If you have trouble, press ESC key to normal mode#
Note
The vi system has the concept of modes, and operations differ depending on the mode. First, it is important to check the current mode.
operation |
key |
|---|---|
Mode switching |
|
keep |
|
end |
|
Save + Exit |
|
Move (character) |
|
Move (global) |
|
search |
|
cancel |
|
Hint
ESC for now — If in doubt, use ESC to return to normal mode
hjkl = cursor key — Beginners can use the D-pad. Those who want to master it should learn hjkl
Emacs - If in doubt, press C-g to cancel#
Note
C-x or C-c means hold down the Ctrl key and press x or c.
operation |
key |
|---|---|
keep |
|
end |
|
cancel |
|
cancel |
|
Move (character) |
|
Move (beginning/end of line) |
|
search |
|
Help |
|
Hint
C-g interrupts anyway — “emergency exit” in case of incorrect operation
30 minute tutorial —
C-h tstarts the tutorial
Reference information
Article information
- Post date:
2025-05-07
- author:
Mr. Takagi