Is there a command comparison cheat sheet between nvi and vim?

35 views
Skip to first unread message

Ottavio Caruso

unread,
Nov 15, 2019, 6:34:26 AM11/15/19
to v...@vim.org
Hi all,

apart from the excellent "vi_diff" in the docs, is anybody aware of a
basic cheat sheet of commands comparison between vim and *BSD nvi?

Thanks

--
Ottavio Caruso

Tim Chase

unread,
Nov 15, 2019, 11:17:21 AM11/15/19
to vim...@googlegroups.com
On 2019-11-15 11:33, 'Ottavio Caruso' via vim_use wrote:
> apart from the excellent "vi_diff" in the docs, is anybody aware of
> a basic cheat sheet of commands comparison between vim and *BSD nvi?

While I'm not aware of any succinct cheat-sheet, I've picked up on a
few notable differences:

For the most part, neovim is a superset of vim which is a superset of
vi.

However, (excluding neovim/vim diffs for this discussion) here are a
few hiccups I've encountered:

^A: in vim, increments the number under the cursor; in nvi, searches
for the word under the cursor (similar to "*" in vim, except it
starts at the cursor, not searching for the whole word, so if your
cursor is on the "h" of "the" it will search for the next instance of
"he" not "the")

To increment/decrement by {count} in nvi, use the #+ and #- commands

^X in vim's insert mode enters a sub-mode for completion while in nvi
it adds the character whose hex-value you specify (akin to `:help
i_CTRL-V_digit` in vim)

In nvi, ^D/0^D/^T do the same thing in insert-mode, but only at the
beginning of the line; in vim they operate anywhere within the line

Undo in nvi is traditional vi undo with only one level of undo(*)
whereas using "u" in vim keeps undoing. (*)Nvi does have multiple
undo levels, but you undo once with "u", then use the "." repeat
operator to continue undoing. Otherwise, a second "u" undoes the undo.

Windows work differently, nvi opens them with ":N fileswitches between
them with ^W where vim uses ^W as a prefix for other window-related
commands; nvi uses ":bg" and ":fg" to push screens/windows to the
background or pull them to the foreground; and uses ":resize
[+|-]size" to resize them.

While nvi can playback macros stored in registers, you have to
populate those registers manually/explicitly since there's no
record-macro functionality. I.e., write your macro into a file and
then yank/delete into a register that you can then play back.

Hope this gives you some starting points to work with.

-tim









Reply all
Reply to author
Forward
0 new messages