Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. UNIX(Linux)Beginner - What is the vi Editor?

What is the vi Editor? - Images: Japanese

Hey there, everyone!

This time we're diving into vi — one of the most important topics in the UNIX-like OS world.

First, a note on pronunciation. "vi" is commonly read as "vee-eye," though you'll also hear "vye" in some circles. The official pronunciation is "vee-eye," but since its successor 'vim' (Vim) has become so widespread, a lot of people have started just calling it "vi" (rhyming with "my") — essentially Vim without the "m." All pronunciations are understood, so go with whatever feels natural.

Now, we've been poking around CentOS in CUI mode for a while now. At some point, you may have wondered: "So... how do you actually edit text in CUI?" That's a very reasonable question.

Since CUI OSes have no graphical interface, none of the editors you might be used to — Sublime Text, Notepad, Dreamweaver, Visual Studio Code, Atom — are available. Not a single one.

"So what do you use to edit text?" That's exactly where 'vi' comes in. It's a text editor that works entirely in CUI mode.

And why is a text editor such a critical topic? Because in CUI-based OSes, most system and software configuration is stored in plain text files.

On Windows and macOS, you configure things by opening settings panels and clicking around with your mouse. But CUI OSes don't assume a mouse, so that approach doesn't work. Instead, configuration is done by editing text files — which means if you can't edit text files, you can't change any settings at all.

You might be thinking: "Do I really need to learn a specific editor? I've been using Windows and macOS for years — I can just figure it out as I go." But that reasoning won't hold here. The vi editor is so unconventional that without some prior knowledge, you literally cannot type even a single character. That's what makes it so important to cover properly.

These days, with the internet and the spread of Linux, a quick search will turn up plenty of vi guides. But back in the 1990s, information was hard to come by, and mastering vi was a real challenge on its own.

Another reason vi is essential: it comes pre-installed on nearly every UNIX-like OS. In fact, it's not uncommon on production servers to find environments where vi is the only editor available. If you can't use vi, you can't edit any text files — which means you can't change settings, which means you can't install other editors, which means... well, you're kind of stuck. (There's a certain dark humor to that situation.)

That said, once you get comfortable with vi (Vim), it's genuinely efficient. The author has been using vi and Vim since around age 12 — that's decades at this point. What makes it stand out is that you barely have to move your hands from the home position on the keyboard. No mouse, no reaching for the arrow keys — just your hands staying put and getting things done.

Vim is also portable: it runs on nearly every OS, and you can drop a config file in the right spot and instantly have your familiar setup ready to go on any machine. If the author were told they could only use one editor for the rest of their life, Vim would be the answer without a moment's hesitation.

Vim is a text editor derived from vi.

Vim has far more features than the original vi, and for the past 30 or so years it's been the more commonly used of the two. The core usage is similar enough that learning one gets you most of the way to the other.

Vim isn't installed by default on most systems, but it's easy to add. If you find yourself wanting to go deeper into the vi family of editors, learning Vim rather than the original vi is the recommended path.

Alongside vi, there's another CUI editor that comes pre-installed on many UNIX-like systems: Emacs (pronounced "ee-macs"). Emacs has been around since the 1970s and is just as storied as vi. Among developers who have been in the field since the early days, there's often a strong preference for one or the other — "vi people" vs. "Emacs people."

So if you're drawn to Emacs instead of vi, that's a perfectly valid choice. Emacs is actually less quirky than vi, so you might find it more approachable without as much initial study.

As a bit of history: the first version of Emacs appeared in 1972, and development continues to this day. It holds the distinction of being the oldest actively developed open-source software. Vi's first version came out in 1976, so Emacs is the elder of the two.

Alright, in the next article we'll start actually using vi. See you there!

This article was written by Sakurama.

Author's beloved small mammal

桜舞 春人 Sakurama Haruto

A Tokyo-based programmer who has been creating various content since the ISDN era, with a bit of concern about his hair. A true long sleeper who generally feels unwell without at least 10 hours of sleep. His dream is to live a life where he can sleep as much as he wants. Loves games, sports, and music. Please share some hair with him.

If you find any errors or copyright issues, please .