OpenVi: Portable OpenBSD vi for UNIX systems
Uma tradução em português está disponível.
OpenVi — Portable OpenBSD vi / ex
OpenVi is an enhanced and portable implementation of the Berkeley
vi / ex text editor, originally developed by Bill Joy.
OpenVi is a fork of the vi / ex editor included with
OpenBSD, which is derived from version 1.79 of the nvi editor originally
distributed as part of the Fourth Berkeley Software Distribution (4BSD).
The nvi editor was developed by Keith Bostic of the Computer Systems
Research Group (CSRG) at the University of California, Berkeley, Sven
Verdoolaege, and other contributors. Nvi itself was derived from Steve
Kirkendall's Elvis editor.
Why would you want to use OpenVi instead of AnotherVi?
strlcpy, snprintf, mkstemp, pledge)bserase, cwerase, expandtab, imctrl,
visibletab, globbrace, globdot, etc.So, why might you not want to use OpenVi, then?
Some of these points might be desirable features, depending on your point of view.
ex-mode interfaces availablesh) and utilities,
Awk (mawk, nawk), etc.xlc, suncc, clang, gcc, etc.)ncurses, NetBSD curses V8+, PDCurses V2.8+,
PDCursesMod, etc.)csh, tcsh, etc.)nroff, groff, etc.OpenVi is easily portable to most platforms with UNIX-like operating systems that are mostly conforming to the programming interface described by IEEE Std 1003.1-2008 and user environment described by IEEE Std 1003.2-2008, also known as POSIX.1-2008 and POSIX.2-2008, respectively.
The following operating systems are fully supported and regularly tested using ix86/AMD64, ARM/AArch64, m68k, MIPS, POWER, and RISC-V processors:
The following compilers are fully supported and regularly tested:
Newer or older operating system and compiler releases, within reason, should work. The versions listed above are those regularly tested and known working.
User contributions to enhance platform support are welcomed.
gmake or make)
from the top-level directory of a source release or git checkout.-j N flag may be used to parallelize the compilation, where N
is a positive integer representing the number of parallel jobs requested.CC - C compiler to useCC=gcc)OPTLEVEL - Optimization flagsOPTLEVEL=-O2)CFLAGS - Flags to pass to the C compilerCFLAGS="-Wall -pipe")LIBS - Libraries (overriding defaults) to pass to the linkerLIBS="-lpdcurses -lflock")LDFLAGS - Flags to pass to the linkerLDFLAGS="-L/lib/path -static")V - Set to enable verbose compilation outputV=1)DEBUG - Set to compile a debugging buildDEBUG=1)LGC - Set to enable link-time garbage collectionLGC=1)LTO - Set to enable link-time optimizationLTO=1)EXTRA_LIBS - Extra libraries for linkingEXTRA_LIBS=-lmtmalloc)PREFIX - Directory prefix for use with install and uninstall targetsPREFIX=/opt/OpenVi)all, strip, superstrip, clean, distclean,
install, install-strip, uninstall, upx, etc.) are available; review
the GNUmakefile to see all the available targets and options.For example, to compile an aggressively size-optimized build, enabling link-time optimization and link-time garbage collection, explicitly using GCC:
env CC=gcc OPTLEVEL=-Os LGC=1 LTO=1 gmake sstrip
or, to verbosely compile a debugging build, explicitly using Clang:
env CC=clang DEBUG=1 V=1 gmake
For systems with GNU Make as make (e.g. GNU/Linux), basic compilation
should succeed without any options or additional configuration needed:
make
With the appropriate privileges to manipulate files within the chosen PREFIX
(using doas, sudo, su, etc.), the compiled executable may be installed —
as-is or stripped — using an invocation such as:
doas gmake install-strip
or
sudo env PREFIX=/usr/local make install
The following sections document only platform specific differences, and are not intended to be a general or exhaustive reference. For installation of prerequisite software packages or other system configuration, consult the vendor's documentation.
Before building OpenVi on AIX, install the ncurses libraries and
headers. IBM provides the necessary packages, ncurses and
ncurses-devel, in RPM format as part of the AIX Toolbox for Linux and
Open Source Software. With the appropriate permissions (e.g. root), these
packages are installable on most systems using the dnf or yum utilities,
for example:
dnf install ncurses ncurses-devel
or
yum install ncurses ncurses-devel
The IBM AIX base system (and PASE for i, an integrated runtime
environment for AIX applications on the IBM i operating system)
provides libxcurses, an XPG4/XSI Extended Curses implementation
derived from AT&T System V, which is not yet supported for use with
OpenVi.
Compilation is supported using IBM XL C/C++ V16.1+ (gxlc or
xlclang), IBM Open XL C/C++ V17.1+ (ibm-clang), or GNU
GCC (usually gcc, gcc-8, gcc-9, gcc-10, gcc-11):
LTO=1) requires Open XL C/C++ V17.1+.
The IBM (AIX Toolbox) and Bull/Atos (Bull Freeware) GCC
packages, and IBM XL C/C++ versions earlier than V17.1 are
not LTO-enabled.LGC=1)No open issues yet, or sync has not completed.