Linux for Developers Course
Linux for Developers
/
Intermediate

Vim Basics

Definition

Vi Improved. A highly configurable, incredibly powerful terminal-based text editor built to enable efficient text editing. It is infamous for its steep learning curve and its modal nature.

Explain Like I'm New

A keyboard-only code editor. You don't use a mouse. You have to press 'i' just to start typing. It is very hard to learn, but once you do, you can edit text faster than anyone with a mouse.

Real World Example

An engineer SSHs into a remote server with no graphical interface. They need to fix a typo in a config file. They type `vim config.txt`, press `i` for Insert Mode, fix the typo, press `Esc`, and type `:wq` to save and quit.

Common Use Cases

  • •Editing files on headless servers
  • •High-speed coding

Interview Questions

basic

  • What is the most famous question in computer science regarding Vim?

intermediate

  • What is the difference between 'Normal Mode' and 'Insert Mode' in Vim?

Flash Cards

Question

Most famous question?

Click to reveal answer
Answer

'How do I exit Vim?' (Answer: Press `Esc`, type `:q!`, and press `Enter`).

Question

Normal vs Insert?

Click to reveal answer
Answer

In Insert Mode (pressed `i`), typing on the keyboard actually writes text into the document. In Normal Mode (pressed `Esc`), typing letters executes commands (e.g., pressing `dd` deletes an entire line instantly).