The ex editor first appeared in 1BSD. The nex/nvi replacements for the
ex/vi editor first appeared in 4.4BSD.
Some background, from memory, so I hope got the details correct:
In the beginning, UNIX was free. Everyone could request a copy from Ken, and he
would send you a tape with the source (allegedly with the text "love, Ken" on
them). The terms "free software" or "open source" didn't exist yet, but for all
intents and purposes it was "open source".
The reason for this was because UNIX was developed at Bell labs. Bell labs
is part of AT&T which, at the time, had an effective monopoly on telephony. As
part of an agreement with the U.S. government, it was agreed that AT&T was not
allowed to enter other fields of businesses (such as computers).
Somewhere along the way this changed, and UNIX became proprietary software. As a
result, BSD (which stems from UNIX) also became proprietary software.
written as part of BSD, so it also became proprietary.
This is why in the late '80s to early '90s some "vi clones" appeared, such as
stevie (later the basis for
In the early '90s, people wanted a free BSD system, so
nvi was created for
4.4BSD-lite (lite meaning, not encumbered by AT&T code), so
nvi was created as
a "bug-for-bug compatible" replacement for the encumbered
vi. It has all of the
vi features, but not the more advanced features you might find in
FreeBSD & NetBSD both descend from 4.4BSD-Lite (and OpenBSD & DragonflyBSD
descend from NetBSD and FreeBSD, respectively), which is why they ship with
nvi installed by default.
Unlike Linux, BSD systems have a single "base" system of which
nvi is part
of, so there are really 4+ versions of
nvi. But in reality the changes are
small to non-existent, the BSD projects exchange code, so most bugfixes and
enhancements are shared (but perhaps not all?). I believe FreeBSD added multibyte support a few years ago, for example.
vim story is more boring: Bram was running on Amiga, wanted to run
vi, but couldn't find a
vi for Amiga. So he took the
stevie code, ported it to Amiga, and continued to improved it further. This is why you can still find many Amiga-related notes in the docs even today.
In the meanwhile, UNIX is "free" once more, and you can run