Penguin
Note: You are viewing an old revision of this page. View the current version.

Vim is an evolution of vi(1).

vi(1) is a text editor that comes with the original Unix system as well as pretty much every other flavour, variation or clone of it known to mankind. They're all the same, except for when they're different (see below). vi(1) is rather unique among text editors because it explicitly operates in "modes", of which it knows three:

Normal:
You move the cursor and perform single-keystroke commands here
Insert:
You enter text in this mode, which you invoke using the [i] command in normal mode and leave using [Esc].
Ex:
ex(1) commands like search-and-replace commands can be entered into a CommandLine at the bottom of the screen in this mode

The default mode is normal. While this makes more sense than defaulting to insert mode, most people find it confusing that you can't just start hacking text into a file as soon as the editor loads, and thus get scared away from vi(1) after their first encounter. It has to be noted, however, that while it may not seem so on the surface, the concept of modes is inherent in every editor, if only implictly. In Emacs f.ex, you can think of pressing [Ctrl] as "entering normal mode": as long as you hold that key, you can enter command shortcuts. Once you let go (and optionally enter some command or whatever), you're "back in insert mode". GUI text editors work much the same way: once you activate a menu, keystrokes get interpreted as menu navigation - essentially command shortcuts -, and no longer as text input. You get back to "input mode" by leaving the menus.

So when you get down to it vi(1) doesn't work much different from any GUI editor except perhaps for the lack of displayed drop down menu. And unlike any GUI editor, it has a CommandLine with a vocabulary that leaves little to be desired once you've memorized a handful of the commands.

Another thing to remember is that as opposed to Emacs, even the bog standard vi(1) offers a huge pile of useful bindings out of the box. You don't need to synchronize DotFiles across machines or spend a lot of time setting things up to achive an environment close to what your very own configuration feels like, even if you may still want to in order to do an extended amount of work. You can immediately work productively on any random machine a vi(1) is installed on (which means everywhere).

Since vi(1) isn't free and limited in various annoying ways, Bram Moolenar created Vim, which adheres to the interface and usage philosophy of its ancestor but has many more features.

A notable addition in Vim is arrow key navigation (rather than having to use the [h] [j] [k] [l] keys as in original vi(1)) - even in insert mode, where you traditionally can't navigate at all (except using backspace, if you are inclined to call that "navigation"). Some other vi(1) clones that allow arrow key navigation stick closer to the original by interpreting arrow keys in insert mode as a request to change to normal mode or even to insert the control codes into the file you're editing.

There's support for a huge number of neat features, like on-the-fly gzip and bzip2 de/compression and SCP/FTP up/download.

Vim has been ported to almost every platform under the sun (no pun intended), so there's no excuse to still be using vi(1) (let alone other inferior editors ;^)).

See also:

The following authors of this page have not agreed to the WlugWikiLicense. As such copyright to all content on this page is retained by the original authors.
  • BartvanDeventer
The following authors of this page have agreed to the WlugWikiLicense.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()

lib/plugin/WlugLicense.php:99: Warning: Invalid argument supplied for foreach()

lib/plugin/WlugLicense.php:111: Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument