THIS IS DRAFT
Follow me on Twitter for updates.
On major BSD systems (OpenBSD, FreeBSD, and NetBSD) vi(1) is actually nvi (new vi). It was written by Keith Bostic and currently seems to be frozen at version 1.79.
For few Vim features I couldn't find any workarounds yet and really miss them:
Insert-mode completion, text objects, viminfo (save command history, marks, registers between Vim sessions), searching for words under cursor.
For some features I've managed to find workarounds.
For example, for rare cases when I need Unicode, I use nvi2:
# pkg_add nvi
Instead of syntax highlighting I use cleaner formatting and linters, but
I understand this can be a deal breaker for
hipsters modern software
For many other features there are POSIX utilities and shell scripts:
|Vim feature||nvi 1.79|
|text formatting (
|extended search patterns||
|scripts and expressions||
Finally, there are Vim features I didn't use, so I haven't check for alternatives:
folding, printing, mouse support, editing binary files, netrw, virtualedit.
Undo and redo: Press
u to undo previous edit, then press
to undo further, to redo press
Increment a number: place cursor at the first digit and press
To redraw the screen press
If you miss Visual mode, try marks. They are useful. For example, mark
the line by pressing
mm, then move to the line you need, then delete
from the current line to the marked one with
Break lines at column 72 in Insert and Append modes.
Format a paragraph with goal line length 72, allow indented paragraphs.
:?^$?,//!fmt -pw 72
Sort lines in a paragraph (in Command mode):
To remove trailing spaces:
To edit command-history:
To read help:
Tested on OpenBSD 6.3