As programmers, we spend most of our time editing code, so it's worth taking the time to master an editor that works for you. Learning to use a new editor usually involves the following steps:
- Read a tutorial (like this one and the resources we provide for you)
- Stick to it for all your editing (even if it makes you less productive at first)
- Check it out: If it looks like there's a more convenient way to do something, there usually is.
Which editor should I learn?
Programmers are often very particular about the text editor they use.
What is the most popular editor right now? According to a Stack Overflow survey (which may not be as objective as we think, because Stack Overflow users are not representative of all programmers), Visual Studio Code is the most popular code editor. Vim is the most popular command-line editor.
Vim
All the instructors in this course use Vim as their editor. Vim has a long history; it started as the Vi editor in 1976 and is still under development. Vim has many clever design ideas, so many other tools support Vim mode (for example, 1.4 million people have installed Vim emulation for VS code). Even if you end up using another editor, Vim is worth learning.
The philosophy of Vim
When programming, you spend a lot of time reading/editing rather than writing code. Therefore, Vim is a multimodal editor: it has different modes for inserting text and manipulating text. Vim is programmable (using Vimscript or other programming languages like Python), and Vim's interface is also a programming language: typed operations (and their mnemonics) are commands, and these commands are also composable. Vim avoids using the mouse because it is too slow; Vim even avoids using the up, down, left, and right keys because it requires too much finger movement.
This design philosophy makes Vim an editor that can keep up with the speed of your thinking.