Today, I decided to try Vi instead of Vim, I wanted to see how different it is. I didn't notice much differences at all, the biggest thing I noticed was how Vi didn't say -- INSERT -- when I went into insertion mode, and there were some minor interface differences.

This made me wonder, what are the biggest differences between Vi and Vim?

  • You obviously aren't using many advanced features of vim. block select, search for word under cursor, increment number under cursor, syntax highlighting etc. – Jim Nov 19 '15 at 3:55
up vote 23 down vote accepted

There actually is a help command in vim to tell you about the differences: :help vi_diff

From Vim's site, the biggest are:

unlimited undo

You can do xxxx and undo each of the four deletes. When was the last time you typed "jjjj" and then found out the caps lock key was on? You accidentally joined five lines together, and Vi can undo only the last command. In Vim you can undo all four "J" commands and get your original text back.

portability

Vi is only available on Unix. Vim works on MS-Windows, Macintosh, Amiga, OS/2, VMS, QNX and other systems. And also on every Unix system.

syntax highlighting

Vim can be programmed to highlight portions of the buffer in different colors or styles, based on the type of file being edited. There are hundreds of syntax highlighting rulesets bundled with Vim.

GUI

Vim works well at a console, but it can run natively in many GUIs, including X Windows, Mac OS, and Microsoft Windows. It uses native GUI widgets for scrolling, dividing buffers, and menuing. It can also talk to the clipboard.

  • 3
    Some more differences are mentioned in the faq – Christian Brabandt Nov 18 '15 at 13:12
  • According to the readme, some of those OSes are no longer supported. – Rolf Jul 5 '16 at 8:48

Vim has many features that Vi does not, even features that are not obviously "advanced" features.

In practice, this means that if you are used to Vi, you will likely encounter very few differences if you start using Vim (or some other Vi clone), but if you are used to Vim and if your "reflexes" include features such as visual mode highlighting, any key action that starts with "g" or "z", any text action with "i" or "a" [e.g. "daw" to delete a word under the cursor], navigating with arrow keys in insert mode, etc, you will find that those don't work in Vi.

There's also the question of what exactly you were using when you say you "tried Vi". On many systems, "vi" actually runs Vim, in a mode where some of these differences apply (default showmode as you observed, arrow keys don't work in insert mode) and others do not (visual mode and g/z keys work), and some features depend on a compile-time option that is sometimes disabled in the "tiny Vim" that is used for this (text objects, such as "aw" a word, are one of these). You won't get these if you run the real Vi, or if "vi" is some other clone with fewer or different features than Vim, such as nvi or VILE.

And, on the obscure side, while "tiny Vim in Vi mode" obviously doesn't have any features that a full Vim does not, there are a few features of the genuine original Vi that vim lacks. These are documented in :help vi-differences.

  • 2
    I'd bet heavily that OP actually has a "tiny vim" vi. – Kevin Nov 18 '15 at 22:15

Most comparisons give more functionality to vim than to vi, but there is one exception. There was "open" mode in vi, and vim doesn't really have this mode.

Open mode is a single-line mode that was used back in the day with terminals that didn't have electronic displays, i.e teletypes, letterprinters, and the like, and also with displays where the cursor remains only at the bottom.

I know there is documentation out there that says vim simulates open mode, but my experience is that it doesn't, for I have seen it used with vi with my own eyes, and I have never seen vim do it. It seems that vim just uses the open command simply to open and edit a file in visual mode. I do believe that vim's official documentation states that it does not support open mode.

  • I have ex-vi.sourceforge.net installed, which is a port of the original Vi. How do I start this open mode? The manpage mentiones it when talking about ^R, but gives no other help. :open some/file returns open: No such command from open/visual. – muru Apr 4 '16 at 15:46
  • @muru Q to enter ex mode, then open. z to show the context of the current line once you're in open mode. To back out, Q then vi. – Antony Jun 21 '16 at 3:00

I think it is very hard to make the comparison, because of the changes in vi that have happened over time.

When I was in college, I used plain-vanilla vi on a dumb terminal (and also on a terminal emulator on a Mac) that connected to mainframes using System V. You can't even find that any more.

But I'm not even sure that was true vi. About that time there were lots of clones and ports made because vi wasn't open-source at the time. And when vendors made clones, they added features that weren't in vi. The history is kind of convoluted. You can read it on Wikipedia and elsewhere.

So if you weren't using certain vendors/hardware, you weren't using vi, but something like vi.

But I do recall vi (or the clone I was using) being very minimalist in its interface (no colors, no INSERT labels, no mulitple undos, etc.) yet powerful in what it could actually accomplish. Very practical.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.