Hacker News new | ask | show | jobs
by kevarh 2182 days ago
Vi (and ed) are the only text editors required to be included in the POSIX spec. A base Unix (and most Linux) installs will have some version of vi or vim installed by default.

If I'm working on someone else's box this pretty much guarantees I can edit files with my basic vi knowledge without having to install a different editor.

2 comments

That's why I learned vi initially years ago, because I was told it was the only editor that would always be available anywhere you went. I only ever use it in ssh sessions these days, but I still feel like learning how to use it has paid off many times.

I was playing with Haiku recently and was surprised that vi or vim wasn't included in its base install. Granted, Haiku (like BeOS before it) doesn't ever claim to be a Unix-like or POSIX-compliant system, but I found the CLI environment to be very Unix-like overall. I guess it's a testament to the ubiquity of vi that it never occurred to me that it wouldn't be there. (If anyone's curious, emacs is also absent but nano is there.)

Haiku does actually claim to be POSIX compliant generally, and is certainly UNIX-like. We don't include "vi" in the base install, though.
That also happened with NixOS. But then again, not really surprising for something that breaks FHS.
Vi is not strictly required; only if POSIX2_UPE and POSIX2_CHAR_TERM are defined.