Vim vs Gvim – What is the Difference?

gvimvim

Could someone please explain to me the differences between Gvim and Vim?

Best Answer

GVim is Vim with a built-in GUI, whereas plain Vim needs a terminal emulator (like GNOME Terminal, for example) to run.

The built-in GUI provides several extra features to GVim. Borrowing from a post in the Vi and Vim Stack Exchange:

Some features that will only work with gVim:

  • Supports a much wider range of colors (RGB), while the terminal only supports 256 colors (see this and this).
  • Some other more advanced graphical features, such as "wiggly lines" for spell checking, more flexible cursor shapes, etc. A terminal can only do "blocks of monospaced characters".
  • Enables mouse support, if otherwise left alone (including drag-and-drop for files). Terminal Vim can also handle the mouse quite well, but not drag-and-drop.
  • Offers a nice, customizable menu system, where each option has the corresponding Vim command listed.
  • gVim can offer you scrollbars which scroll the Vim buffer (and not the Terminal scrollback).
  • You can have popup "balloons" (aka. "tooltips").
  • Many terminals do not provide true italics like gVim does.
  • Has integrated font support.

Secondly, even if you prefer using Vim, installing a GUI version may offer more compile-time features than the version without, at least in some distros (such as clipboard and clientserver support on Debian-based system in vim-nox vs vim-gnome).

Things gVim doesn't do:

  • gVim isn't a (full) terminal emulator, so starting external programs that use a lot of terminal features won't work very well. For example try using :!vim, :!mutt, or :!irssi from gVim, or pressing K over a word (which, by default, opens the manpage for that word). Also see this.