Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's no reason to learn vi if you know Emacs. If you claim that Emacs isn't installed everywhere, guess what: Neither is vi.

If you want an "installed everywhere" editor, learn ed. If you're willing to take an editor with you (or otherwise make sure a specific editor is everywhere you are), there's no reason it has to be vi.



I can't remember ever encountered a unix-like system without "vi" installed. I've used (and set up) machines running FreeBSD, DragonflyBSD, OSX, Ubuntu, Debian, RHEL, ...

Plenty of those didn't have emacs, especially on first boot, when you're most likely to need to modify network configuration files in order to get online to install new packages in the first place...

Edit: By "vi" I mean that somewhere in the path there is a program called vi. Of course, usually this is nvi, vim, evil, etc; I don't mean the original UNIX vi binary.


I can't remember ever encountered a unix-like system without "vi" installed.

It's often/always part of a full install, but it isn't always there when you end up in rescue mode and/or situations where /usr won't mount.


Not on OpenBSD on rescue mode, or when booting from bsd.rd. Pretty sure the same applies to several others.

However, ed is available, and vi is closer to ed than emacs is. And emacs won't be available either.


> I can't remember ever encountered a unix-like system without "vi" installed.

Default Ubuntu install.


Ubuntu 14.04, the default Ubuntu on EC2, definitely comes with vi.


Yeah, I'm guessing cbd1984 is confusing it with 'vim'.


Of course not.


It's actually vim symlinked as vi. Which had it's quirks back when I was used to vi instead of vim.


Wow, seriously? I stand corrected -- still much more likely to find than emacs.


Ubuntu (and Debian) comes with vi (not vim) by default. It's just not the default editor.


vim.tiny is installed by default, though I don't believe the vi symlink is installed by default.


vi is a posix requirement, emacs is not. If the system you're working on has ed, it'll have some version of vi or vim as well.


and not having to know ed is an excellent reason to learn vi :)

obCompulsoryEdJoke: https://www.gnu.org/fun/jokes/ed-msg.html


a

I learned ed for a joke and found myself actually liking some features so much that I started porting them to emacs.

.

w


I've used ed(1) to do complex(ish) programmatic edits to files that I think would have been extremely painful otherwise. An interesting editor worth spending at least a small amount of brainpower on.


That was pretty damm amusing.


I don't think this is true. I've certainly been in a bunch of hairy situations over the years where I had nothing fancier than ed available to me because I was in some sort of recovery mode. The single user mode that FreeBSD comes with is lacking vi if, for example, you don't have / mounted yet. Thankfully ed is in the ramdisk.


V7/x86 [1] has both vi and ed, but ed is easier to get to.

"Of course, we are not absolutely compelled to use ed, since V7/x86 comes with the full-screen editor vi (as well as the related line editor ex), but getting access to vi in this context would involve mounting the /usr filesystem and changing various environment variables and settings to allow editing in full-screen mode. Some basic ed skills are particularly useful in the V7 world, and most of all when one is involved on system administration tasks." [2]

[1] http://www.nordier.com/v7x86/

[2] http://www.nordier.com/v7x86/doc/v7x86intro.pdf


Not in Ubuntu.


I much prefer emacs and at least emacs shortcuts are by default in most shell (and everywhere in osx!) but no, every servers I install (debian, ubuntu, osx...) comes with vi but not emacs.


Anyone considering using vi should be warned away by this practice of "disagreement by downvoting". If they do it here, imagine what they would do to a bug report!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: