Lecture notes · The Missing Semester · Lecture 3

Editors (Vim)

MIT 6.NULL The Missing Semester of Your CS Education, lecture 3, explained in plain English

Want this lecture to stick? In LessonBound you get checked practice questions for every part, can ask about anything you don't get, and can listen with your screen off. Free, no ads.

Learn this lecture free

Watch or read the original lecture: MIT OpenCourseWare.

Part 1

This part introduces Vim, a text editor built for programmers, and explains its main ideas and basic controls.

Key ideas

Words to know

modal editor
A text editor that works in different modes. The same key can do different jobs depending on which mode you are in.
buffer
A file that Vim has open. Vim keeps a set of these open at once, and a window is just a view of one.
Insert mode
The mode where you type text normally, like in any everyday word processor, until you press Escape.
verb
In Vim, an action word such as d (delete) or c (change). It acts on a noun, which is a movement that picks out a piece of text.

Example

Think of Vim commands like short instructions to a helper. Saying 'delete word' is quicker than pointing and dragging with a mouse, and 'delete' plus 'word' can be mixed with other words, like 'delete 3 words'. Vim's keys work the same way: d plus w gives dw, and adding a 3 makes 3dw.

3 checked practice questions for this part are in the app.

Part 2

This part shows how to make Vim your own with a config file, add-ons, Vim-style keys in other tools, and macros that repeat edits for you.

Key ideas

Words to know

plugin
An add-on that gives a program extra features. Someone else usually writes it, and you add it to your program.
macro
A saved list of key presses that you can replay with one command, so you do not have to repeat the same steps by hand.
readline
A shared piece of code that many command-line programs use to handle typing at the prompt. It can also be set to use Vim-style keys.
Vimscript
The simple command language that Vim uses for its settings and configuration.

Example

Think of a macro like a recipe you write down once. If you need to make the same sandwich ten times, you follow the written steps each time instead of working out every move again. Vim records your key presses the same way and plays them back whenever you ask.

3 checked practice questions for this part are in the app.

← Lecture 2: Shell Tools and Scripting · Lecture 4: Data Wrangling →

Notes written by AI (Claude) from the lecture's official transcript, so check anything important against the lecture. MIT CSAIL · CC BY-NC-SA 4.0 · not affiliated with or endorsed by MIT. These notes are shared under the same license.

LessonBound · Free lecture notes · Privacy · Terms · New York