Zhihao Yuan edited this page Feb 13, 2016 · 3 revisions
Clone this wiki locally

Porting Instructions


Nvi2 is POSIX-compatible Vi implementation written for the modern BSDs, including FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and other OSs based on them. The main goal of the project is to replace the old nvi-1.79 or nvi-1.81.6 in their base systems. Since Mac OS X already choose vim-lite as its vi implementation, some parts in this article may not apply to that platform.


  • CMake >= 2.6;
  • POSIX.1-2008-compatible libc;
  • libiconv (for USE_ICONV);
  • libncursesw (for USE_WIDECHAR);
  • libutil;
  • uudecode(1) with -m option (Base64);
  • Anything required by a minimal nvi-1.79, notably:
    • Berkeley DB1 in libc;
    • /var/tmp/vi.recover/ with mode 41777.


cd to the build/ directory under the source tree, run cmake -i and confirm all of the options, include paths, libraries. Upon success, run make to build the nvi binary.
cd to the catalog/ directory under the source tree, run make.


Install build/nvi to /usr/bin/, and point the symbol links, nex nview vi ex and view to it.
Install man/vi.1 to /usr/share/man/man1, and point the symbol links nvi.1 nex.1 nview.1 ex.1 and view.1 to it.
Install the files, dutch english french german polish ru_RU.KOI8-R spanish swedish uk_UA.KOI8-U zh_CN.GB2312, under the catalog/ directory to /usr/share/vi/catalog/, and create sufficient symbol links with the POSIX locale(1) names and point them to the corresponding catalog files. For example, en_US.ISO8859-1 -> english, zh_CN.GBK -> zh_CN.GB2312.
Recovery script
build/recover shows the basic logic of sending the recovery notification emails to the users. A system-wide rc.d script, /etc/rc.d/virecover, for example, need be prepared. Note that the recovery files start to use the new X-vi-data: header, in the form of X-vi-data: <file|path>;<MIME folding base64 sequence>, since nvi-2.1.0, so the logic in the old rc.d scripts need to be changed.


Ask me if you have any questions. I'm a BSD guy.

Author: Zhihao Yuan
Email: lichray@gmail.com