Vim without panic: a remote-server survival guide
The small set of Vim commands I need when SSH drops me into a server and a configuration file has to change safely.

Archive note: this guide was recovered from my former WordPress notebook. The original date is preserved; commands and links may be updated as I verify them.
Vim becomes intimidating when it appears unexpectedly on a remote server. The useful mental model is smaller than the editor: Normal mode is for navigation and commands, Insert mode is for typing, and Command-line mode is for saving or leaving.

The three modes that matter
- Normal mode: press Esc. Move, delete, copy, paste or start another command from here.
- Insert mode: press i to type before the cursor, a to type after it, or o to open a new line.
- Command-line mode: from Normal mode, press : and enter commands such as w, q or wq.
Navigation and editing
h left
j down
k up
l right
w next word
b previous word
0 start of line
$ end of linex delete character
dw delete to next word
dd delete line
u undo
Ctrl-r redo
yy copy line
p pasteSaving and escaping
:w save
:q quit when nothing changed
:wq save and quit
:q! quit and discard changesIf the editor seems frozen, press Esc first. That returns to a known state. Then use :wq to keep the change or :q! to abandon it.
A safe configuration-editing loop
- Copy the file before editing it, especially when it controls SSH, a proxy or a production service.
- Make the smallest possible change and save it.
- Run the service's configuration test before reloading it.
- Reload instead of restarting when the service supports it, then inspect logs and the public health check.
The editor is only the first half of the job. A production change is complete when the service still responds and monitoring confirms the expected behaviour. That is the same operating principle behind Ecreativ Monitoring: make failure visible before a visitor reports it.


