Why does anyone use Vi?

“vi” is the middle of evil.

(I use emacs, even on my pc)

That sounds similar to EVE, a nice text editor that I used on a VAX running VMS in the 80s. The editor was based on the original EDT.

At the time I remember wondering why those poor Unix people were saddled with vi while VMS people had such a nice full screen editor with such a low learning curve.

I knew Vi she was a smart lady who know Vi. It did get confusing sometimes when someone said Vi because you didn’t know if it was if they were talking about Vi or Vi. People resorted to calling her by her full name to end the confusion.

Do people pronounce the text editor “vee”? I’ve always heard it “vee eye”, that is, the two letters pronounced sepretely.

I don’t think gedit has a terminal mode (and is only on Gnome systems). So if your trying to edit files without a GUI, or remotely editing text files and the connection is to slow to tunnel a GUI using X, you need something like vi.

Granted there are plenty of people who don’t do those things, so I’m sure gedit is fine. But as to the OPs question, I think the inclusion of a terminal mode is one reason why vi is still in use amongst the techy crowd.

Muscle memory, mostly.

And the same reason we used EDLIN on DOS machines back in the late 80’s.

I was using a Perkin-Elmer 3200 series at the time. EVE doesn’t ring a bell. My strongest memories were creating documents for the laser printer using troff. The documents looked nice, but it huge pain to make look nice, especially the tables. We had a Spinwriter, but no one wanted to use it after we got a laser printer. This was before HP brought the price down to $5,000.

If all you want to do is edit some plain text in a simple way, then yes, it doesn’t much matter what you use. On my own Mac, I keep TextWrangler and similar desktop apps around for exactly that purpose. MS Windows has plenty of choices too.

However, there are very few editors that give you Emacs’s power for manipulating text. If you write a lot of text or software for a living, you might appreciate the huge variety of functions Emacs provides, along with the ability to write your own functions, and then bind them to any key or mouse click.

It’s roughly analogous to Microsoft’s VBA language that accompanies their office applications. Office apps without a programming language underlying them are still useful enough, but they become so much more powerful when you can program their behavior yourself, in ways that the original authors couldn’t give you out of the box.

If you only work on one machine then you can install whatever editor you like. But many people who work in big shops connect to many, many machines that are installed and managed by different groups. There’s no guarantee that any 3rd party package will be there.

I decided to use vi exclusively because I kept having to connect to random test and customer machines and vi was always there. There are better editors, but vi works pretty well for my needs.

I tend to use IDEs for code editing these days, but when I want to do something fast from a command line, then definitely vi. I’ve heard that when it comes to emacs and vi, you love whichever one you learned first and hate the other. That’s a good theory, but I prefer mine: emacs was created by Satan to make humans suffer.

I do write software for a living. Still never saw the appeal of emacs or vi over a nice gui-based editor, most of which also allow you to write functions and macros.

In my experience (and I haven’t used emacs in years), emacs was created by Humans to make Satan suffer – and we’re still trying to get there.

I am just starting to use Unix at my new job, and vi is all I have been taught to use. It’s pretty easy, user friendly, and it serves the purpose that we need to use it for.

It’s certainly possible you’ve never needed or wanted a feature that Emacs provides and that your favorite editor doesn’t. Some things I like about Emacs, which often don’t exist in more ordinary text editors:
[ul]
[li]Neatly re-format block comments, while automatically rearranging the comment markers in between lines.[/li][li]Download syntax-coloring libraries for pretty much every programming language in existence, as well as file formats like XML, JSON, Makefiles, X Windows resource files, etc.[/li][li]Customizable indentation rules for most languages.[/li][li]Add your own colorized syntax if desired. For example TRUE and FALSE are not special words in C normally, but you can make them show up in color (and therefore their misspellings won’t).[/li][li]Limit customization rules to specific individual files, or to all files in a directory tree.[/li][li]Run Unix shell commands and capture their output in a buffer, all within Emacs. No need to copy and paste from a terminal window.[/li][li]Cut, copy, and paste rectangles of text, not just ranges of lines or characters.[/li][li]Save or print just a portion of text within a file — for example a single function.[/li][/ul]

Saint IGNUcius of the Church of Emacs blesses your computer.

http://stallman.org/saint.html

Edit is still available on PC’s from the command prompt. I use it frequently.

This is what always got me. People always say “Oh, you don’t need to learn any complicated commands in vi, unless you’re trying to do something really advanced”. But what they leave off is that for vi, “something really advanced” includes “editing text”. pico, unlike vi, really does get out of your way, and is in my experience just as universally available. The only commands you ever need to learn in pico are ^o to save, and ^x to quit, and those (along with a half-dozen other often-useful commands) are summarized right on the bottom of the screen.

If you open up pico and don’t know what you’re doing, you’ll be told as much as you need to know to do what you need to do. If you open up vi and don’t know what you’re doing, your only recourse is to close the terminal window. That’s not my idea of “no learning curve”.

I can understand the arguments for and against emacs (and most of them are the same arguments). But pico vs. vi is no contest.

I wouldn’t mind if pico were universally available, though it is a bit constraining.

For a simple editor to do a quick tweak, it is much better than either emacs or vi.

And some environments (think BusyBox-style builds of Linux on embedded devices) provide only pico. I think the latest BusyBox has some emaciated form of vi though, but if you are traveling super light, pico is the ticket.

I think some minimal form of vi is required by the POSIX standard, but I could be wrong.

A side “benefit” to vi’s inscrutability is that if you make it hard for the “Oh, I can fix that!” crowd that really can’t (or shouldn’t!) fix it, it’s less likely that they’ll be able to do anything dangerous like edit config files.

Hopefully, anyone that knows how to invoke vi and use it will be less likely than the average user to bork something.