Choosing an Editor: vim, nano, emacs, and VS Code
What you'll be able to do
- Explain how vim, nano, emacs, and VS Code differ
- Pick the editor that fits your own use
Prerequisites (read these first)
Which Editor Should You Use?
You typed vim, the screen changed, and suddenly you couldn't get out. Almost everyone learning Linux hits this wall once. There are so many text editors — vim, nano, emacs, VS Code — and yet nobody really tells you which one to use.
This guide untangles the differences between four popular editors (vim, nano, emacs, and VS Code) through a conversation between Lina and Linny-senpai. It also shows which one a beginner should start with. One note on wording: "editor," "text editor," and "editor program" all mean the same thing here.
What You'll Learn
- Why there are so many kinds of editors
- The strengths of nano, vim, emacs, and VS Code
- How the four editors differ in learning curve and use case
- Which editor a beginner should start with, and when to switch
- How to escape the dreaded "I'm stuck in vim" in one move
1. Why Are There So Many Editors?
Conclusion: Editors evolved for different jobs — "quickly fix something on a server" versus "settle in and develop" — so several options grew up for different purposes.
CUI editors vs GUI editors
- CUI (inside the terminal): nano, vim, emacs. They run even over SSH on a remote server.
- GUI (window app): VS Code. Mouse and menus, strong for large-scale development.
CUI editors run anywhere. GUI editors are comfortable for local development. Keeping that split in mind makes everything easier.
2. What Is nano?
Conclusion: nano is the most beginner-friendly CUI editor — it always shows the key commands along the bottom of the screen. Perfect for "just fix it."
^X means "hold Ctrl and press X" to quit. The ^ symbol stands for the Ctrl key.nano memo.txt
Once nano starts, you can just type to edit. To quit, press the keys shown below.
^X Exit ^O Save ^W Search ^K Cut line (^ means the Ctrl key)
nano basics
- Save:
Ctrl+O(Write Out), then Enter to confirm - Quit:
Ctrl+X - Search:
Ctrl+W
You move the cursor with the arrow keys, and there are no special "modes." It feels closest to Notepad on Windows.
When in doubt, start with nano. It comes pre-installed on most Linux systems, and for small edits to a config file on a server, nano is more than enough.
3. What Is vim?
Conclusion: vim is a powerful CUI editor that lets you edit fast with the keyboard alone. It has "modes" — once you get used to it, it's the fastest, but the learning curve is steep.
i to enter "insert mode."Esc to return to normal mode, then :q to quit. Once you know that, vim isn't scary anymore.vim config.txt
Here are the three most important commands for escaping vim safely.
i Enter insert mode (you can type now) Esc Return to normal mode :wq Save and quit :q! Quit without saving (force)
How to escape "I'm stuck!"
- Press
Escfirst (no matter which mode you're in, this returns you to normal mode) - To save and quit, type
:wqand press Enter - To discard your edits and quit, type
:q!and press Enter
Typing : lets you enter a command at the bottom of the screen. The trick is to stay calm and always start with Esc.
:q! throws your edits away for good
- Difference from the GUI: a GUI editor asks "save your changes?" when you close it.
:q!discards the edits with no confirmation. - How to choose: use
:wqwhen you want to keep the changes, and:q!only once you have decided to drop them. - One reassurance: practice on a throwaway file such as
memo.txt, and losing the contents costs you nothing.
vim is tough at first, but its biggest appeal is editing fast without lifting your hands from the home row. Server administration often assumes vim, so learning the minimum (open, edit, save, quit) gives you peace of mind.
4. What Is emacs?
Conclusion: emacs is a CUI editor that aims to "do everything" through extensions. Its customizability is unmatched, but there's a lot to learn.
Ctrl and Alt.Ctrl+X then Ctrl+C. To save, press Ctrl+X then Ctrl+S.emacs notes.txt
Here are the bare minimum emacs commands. C-x means "hold Ctrl and press x."
C-x C-s Save C-x C-c Quit C-g Cancel the current action (use this when stuck)
Where emacs fits
- No editing-mode switching like vim's — you can type from the moment it starts
- You operate it with
Ctrl/Altkey combinations - You can add endless features with its config language (Lisp)
It suits people who want to grow a tool that's truly their own. For quick fixes, though, nano is often handier, and for fast editing, vim.
5. What Is VS Code?
Conclusion: VS Code is a GUI editor you operate intuitively with mouse and menus. With rich completion, search, and extensions, it's the best fit for serious development.
You can also launch VS Code from the terminal. To open the entire current folderA container that organizes files. Same idea as a "folder" on Windows or macOS., use this command.
code .
When VS Code fits
- Developing an app that spans multiple files, on your local PC
- Wanting completion, debugging, and Git integration on one screen
- Not yet comfortable with command-line editing, preferring the mouse
See Setting Up Linux for Developers for how to build out a dev environment.
6. So Which One Should You Choose?
Conclusion: Start with nano to experience "I can fix it," then learn the minimum vim, and use VS Code for serious development. Touch emacs if and when it interests you.
| Editor | Type | Learning curve | Best for |
|---|---|---|---|
| nano | CUI | Low | Small server edits / a beginner's first |
| vim | CUI | High | Fast keyboard-only editing / server admin |
| emacs | CUI | High | Growing your own integrated workspace |
| VS Code | GUI | Medium | Serious local app development |
How to choose when in doubt
- Just need to fix something → nano
- vim opened on a server → remember
Esc→:wq - Developing locally → VS Code
- Want to grow your tool → dive into emacs / vim
Editors are switchable. Don't overthink your first one — learn the next when you need it.
Lina Can't Escape vim
Conclusion: Type
:qwith unsaved edits and vim refuses to quit. Use:wqto save and quit, or:q!to discard the edits.
vim as you showed me, pressed i, and typed some text. I pressed Esc, then tried :q to leave, and red text appeared. It won't let me out.E37: No write since last change (add ! to override)
:wq saves and quits; :q! discards the edits and quits. The ! means "I know what I'm doing, do it anyway.":wq save and quit :q! discard the edits and quit
:q! got me out. So it wasn't an error—it was a question.Esc first, then start with :. Remember that order and you'll never be locked in again.Mini Exercises
Conclusion: Save and quit in nano, escape from vim, and check which editors you have. Try these three by hand.
Exercise 1: Save and Quit a File in nano
Task: Open memo.txt in nano, write one line, save it, and quit the editor.
Show Hint 1 (Direction)
Read the key list at the bottom of the screen. Saving is "write out"; quitting is "exit."
Show Hint 2 (Command name)
Open it with nano memo.txt, save with Ctrl+O then Enter, and quit with Ctrl+X.
Show Answer
nano memo.txt
^O Write Out (press Enter to confirm) ^X Exit (^ means the Ctrl key)
Exercise 2: Quit vim Without Saving
Task: Open config.txt in vim, type something, then quit without saving those edits.
Show Hint 1 (Direction)
First leave the mode you're in. Then add the "force it" symbol to the quit command.
Show Hint 2 (Command name)
Press Esc, then type :q! and Enter.
Show Answer
vim config.txt
Esc return to normal mode :q! quit without saving
Exercise 3: Check Which Editors You Have
Task: Find out whether nano and vim are installed in your environment.
Show Hint 1 (Direction)
One command tells you where a command lives. Its name is the English word for "which one?"
Show Hint 2 (Command name)
Use which (it prints where a command is located) and pass the names you want to check.
Show Answer
which nano vim
/usr/bin/nano /usr/bin/vim
If a path appears, that editor is available. If nothing prints, it isn't installed.
Review
Conclusion: nano guides you with on-screen hints, vim lets you out with
Esc→:q!, and VS Code fits local development. Those three points are enough to choose.
Esc → :q! keeps you calm.Today's 3-Line Summary
Conclusion: Choose by the job, start with nano, and learn how to escape vim. That settles the editor question.
- Editors evolved for different jobs - choose by "when do I use which," not "which is best"
- Start with nano, then the vim minimum - nano shows its commands on screen; for vim, learn
Esc→:wq/:q!first - Use VS Code for serious development - but servers have no GUI, so keep nano and vim in your toolkit