Choosing an Editor: vim, nano, emacs, and VS Code

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.

Lina: Linny-senpai, why are there so many text editors? One would be enough...
Linny-senpai: Good question. It's because the "right" editor changes depending on where and what you're editing.
Lina: It depends on the situation?
Linny-senpai: Right. Say you SSH into a server to fix one line in a config file. SSH is the mechanism that logs you into a distant server over the network from your own computer. Rather than launching a heavy development tool, you want something you can open and fix right inside the terminalAn interactive program that reads the commands you type and runs them..
Lina: And when you settle in to develop instead?
Linny-senpai: If you write an app with hundreds of files every day, an editor with strong completion — it offers candidates while you type — and strong search is far more comfortable.
Lina: I see — the "right tool" grew up for each situation.
Linny-senpai: Exactly. So the answer isn't "which one is best," but "when do I use which."

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."

Lina: I want to start with the easiest one!
Linny-senpai: Then that's nano. The great thing about nano is that the keys you can press are always shown at the bottom of the screen. So even if you don't remember the commands, you won't get lost.
Lina: It's like having a cheat sheet built in.
Linny-senpai: Exactly. For example, ^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.

Lina: Once I opened vim and couldn't get out. I panicked...
Linny-senpai: That's a classic. vim has this idea of "modes," and if you don't know about them, it's easy to panic.
Lina: Modes?
Linny-senpai: Right. When vim starts, it's in "normal mode," where keys act as commands, not text input. To type characters, you press i to enter "insert mode."
Lina: So that's why nothing worked normally when I typed...!
Linny-senpai: Exactly. And to get out, you first press 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!"

  1. Press Esc first (no matter which mode you're in, this returns you to normal mode)
  2. To save and quit, type :wq and press Enter
  3. 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

  1. Difference from the GUI: a GUI editor asks "save your changes?" when you close it. :q! discards the edits with no confirmation.
  2. How to choose: use :wq when you want to keep the changes, and :q! only once you have decided to drop them.
  3. 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.

Lina: How is emacs different from vim?
Linny-senpai: The big difference is that emacs lets you type text right away, with no editing-mode switching like vim's. Instead, you give commands with combinations of Ctrl and Alt.
Lina: So you don't get "stuck" like in vim?
Linny-senpai: Since there is no editing-mode switching, you rarely get confused while typing. To quit, press Ctrl+X then Ctrl+C. To save, press Ctrl+X then Ctrl+S.
Lina: You press keys in two steps.
Linny-senpai: Right, that's the emacs way. And emacs's real power is its extensibility. Rewrite its config and you can pull in email, file management, and more. It's less an editor and more a whole work environment.
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 / Alt key 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.

Lina: I hear about VS Code a lot. What makes it different?
Linny-senpai: Unlike the other three, VS Code is a GUI editor that opens in a window. You can click with the mouse, and it looks colorful and easy to read.
Lina: Then isn't VS Code the easiest of all?
Linny-senpai: For developing on your own computer, yes. Its completion is smart, and it highlights mistakes in color. Install extensions and you get language-specific help too.
Lina: It sounds like all upsides!
Linny-senpai: But it has a weakness. VS Code basically needs a GUI, so it won't run as-is on a server you just SSH'd into (a "remote" extension can cover that, but it takes extra setup). That's exactly why it's worth knowing nano and vim too.

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.

Lina: I understand the types now. But what should I actually use first?
Linny-senpai: As a beginner, starting with nano is my recommendation. Since the commands are shown on screen, you can safely build the experience of editing a file and saving it.
Lina: Can vim and emacs wait?
Linny-senpai: Just learn the vim minimum — open, edit, save, quit — ahead of time, so you're fine if vim suddenly launches on a server. Once you start writing code seriously, move to VS Code. That step-by-step pathA string that describes the location of a file or directory. is plenty.
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 :q with unsaved edits and vim refuses to quit. Use :wq to save and quit, or :q! to discard the edits.

Lina: I opened 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)
Lina: Did I break something?
Linny-senpai: Nothing is broken. This is vim asking you a question: "you haven't saved yet." You haven't told it what to do with your edits.
Lina: So I choose whether to keep them or throw them away.
Linny-senpai: Exactly. :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
Lina: :q! got me out. So it wasn't an error—it was a question.
Linny-senpai: Right. Press 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.

Linny-senpai: Let's confirm what you learned with your own hands. Here are three exercises.

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.

Lina: So the plan is: get comfortable editing in nano, and learn just the escape route for vim.
Linny-senpai: Exactly. If vim suddenly opens on a server, remembering Esc:q! keeps you calm.
Lina: And once I start writing code locally, I move on to VS Code.
Linny-senpai: Good. An editor is a tool you can switch, so don't agonize over the first one.

Today's 3-Line Summary

Conclusion: Choose by the job, start with nano, and learn how to escape vim. That settles the editor question.

  1. Editors evolved for different jobs - choose by "when do I use which," not "which is best"
  2. Start with nano, then the vim minimum - nano shows its commands on screen; for vim, learn Esc:wq / :q! first
  3. Use VS Code for serious development - but servers have no GUI, so keep nano and vim in your toolkit

Next Reading

Share this article

Next steps