redrose: (Default)
redrose ([personal profile] redrose) wrote2009-01-23 10:43 am
Entry tags:

Question of the Day: Vi or Emacs? Why?

I need to learn a stronger editor than pico, and I don't know which of these to choose.

I expect to be working in a unix/linux system for much of my career.

Vi allows regular expressions, which could be very useful.

Emacs is extensible, which could be very useful.

Any thoughts?

[identity profile] marydell.livejournal.com 2009-01-23 03:59 pm (UTC)(link)
Both? Vi is installed by default on every system under the sun - including when you're booting in single-user mode or with a partial OS - but if you're not sysadminning, that's not as important. Vi is deeply counterintuitive for most people, but if you're good at memorizing weird macro sequency things, it's extremely powerful.

Emacs is much more friendly--you can just fire it up and edit in a fairly normal way--and I believe it has embedded help info, so you can discover it as you go. I used to use emacs but once I got into heavy sysad type stuff I switched to vi.

There's a popular editor called joe that might be worth investigating. If you're confined to what happens to be on the system it won't be on most non-linux systems, but if you can customize a bit there are probably better editors than either of these.
ext_80683: (Default)

[identity profile] crwilley.livejournal.com 2009-01-23 04:40 pm (UTC)(link)
Odd that we have almost the opposite perspective. [livejournal.com profile] redrose3125, just so you know where I'm coming from: the first editor I ever learned to use on Unix was ed, the line editor that vi is based on, and I can probably count on one hand the number of times I've used pico. It's been quite a while since I've used Unix regularly, and my preference when I'm just trying to accomplish my task at hand is typically for a somewhat clunky old tool I'm familiar with over a shiny new one I'd have to learn.

[identity profile] marydell.livejournal.com 2009-01-24 01:24 am (UTC)(link)
:) vi is definitely the best editor for me, since I do troubleshooting and sysadmin stuff on a 30-system farm. But if I was, frex, writing programs, I would want something a little more helpful (vim, at least).

[identity profile] redrose3125.livejournal.com 2009-01-27 05:48 pm (UTC)(link)
I settled on vi, because of ubiquity, and the fact that emacs has an emulate attachment that makes it act like vi.

Your and crwilley's comments have been helpful! Thank you!

[identity profile] redrose3125.livejournal.com 2009-01-27 05:48 pm (UTC)(link)
I settled on vi, because of ubiquity, and the fact that emacs has an emulate attachment that makes it act like vi.

Your and MaryDell's comments have been helpful! Thank you!
ext_80683: (Default)

[identity profile] crwilley.livejournal.com 2009-01-23 04:30 pm (UTC)(link)
Does emacs not allow regular expressions? I'm astonished to hear that - if nothing else, if it doesn't natively, there's almost certainly an extension for it.

At any rate, if what you want to do with your text editor is edit text, vi is a pretty good balance between 'simple to use' and 'powerful' - a reasonably clueful user could probably master it in a couple days. In the Linux world, there's several different versions floating around, so you might be able to try a couple out and see what makes you happiest.

Emacs is kind of insane. It wouldn't surprise me to find out you could put a man on the moon and achieve world peace using only emacs with the right extensions loaded, but you'd have to memorize a thousand different keystroke combinations and maybe learn Lisp to get the job done. 20 years ago, I liked that you could tell it "I'm coding in C today" and it would automatically indent and highlight all your missing brackets for you, but I think one variant of vi will also do that, and I don't even know if that's relevant to you.

[identity profile] redrose3125.livejournal.com 2009-01-26 06:29 pm (UTC)(link)
Yeah, emacs probably does, but I'd have to figure out how.
ext_13461: Foxes Frolicing (Default)

[identity profile] al-zorra.livejournal.com 2009-01-23 05:51 pm (UTC)(link)
I wish I wasn't an idiot so I knew what you are saying!

Love, C.

[identity profile] redrose3125.livejournal.com 2009-01-26 05:36 pm (UTC)(link)
Don't think you're an idiot! This is fairly specialized knowledge!

There's this thing called the "editor wars" in the computer geek world - whether one edits one's code and files in a program called vi or a program called emacs. I have so far in my career used an third program entirely, called pico. I need something more powerful than pico, so I was comparing vi and emacs, and asking for other computer geek opinions.
ext_13461: Foxes Frolicing (Default)

[identity profile] al-zorra.livejournal.com 2009-01-26 05:37 pm (UTC)(link)
Thank you! Now I know an eensie bit more than I did before.

So cool though, that you are so skilled in code and editing. I wish I was.

Love, C.