29

I'm learning Vim by watching screencasts. And I'm wondering, why do a lot of people use gVim or MacVim?

From what I can see, the GUI Vim version only have additional features that involves using mouse. But isn't this against the "Vim philosophy"?

Can anyone explain what additional features the GUI Vim version offer versus the terminal-based Vim?

1
  • Gui vim allows for more than 256 colors, as well as other text formatting, so that might be a draw. I personally can't see why people prefer gui vim though, as I find terminal vim more convenient. But that's my opinion. Commented Mar 9, 2015 at 23:47

6 Answers 6

37

Some features that will only work with gVim:

  • 24-bit color support out of the box (to get the same amount of colors in terminal vim, you have to try a little harder, see this and this). For true italics, the same holds true (see this and this). Note that you should be using a font that supports true italics.
  • 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").
  • Has integrated font support.
  • Some keybindings work out of the box with gVim like CTRL+Space, Meta+e... while they require more tweaking of the terminal in the other case.
  • Autoselect: If set, any visual selection is automatically yanked to primary/clipboard.

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).

Also, under Windows, a gVim window can be resized more easily than a console Vim window.

Things gVim doesn't do:

  • The :! ex command in gVim doesn't offer 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.
  • However, if you need such a feature, you can use the :terminal command to run a shell (or other external commands) from within vim. This needs at least a Vim version 8.1
6
  • 2
    Regular vim is also more convenient if you're going to be using SSH a lot, since it can be put under tmux or screen and doesn't require X11 support at either end.
    – Kevin
    Commented Mar 23, 2016 at 4:03
  • actually, gvim has an included terminal since one of the later 8.0 patches. So you can start a terminal and should be able to run interactive programs in it. Commented Feb 28, 2018 at 16:18
  • 2
    Menus are certainly nicer and more integrated in GUI vim, but they do exist and are usable in console vim. One must source menu.vim and then likely use set wildmenu and :emenu <Tab> to navigate in a way that resembles... well, menus.
    – brhfl
    Commented Feb 28, 2018 at 19:22
  • @brhfl I'd say "barely" usable instead.
    – muru
    Commented Mar 1, 2018 at 1:52
  • 2
    @muru finally done :) Commented Mar 18, 2021 at 7:29
6

Some of us are stuck in Windows land, so the terminal options are less convenient.

In Windows Explorer you can right-click a file and open it immediately with gVim. That's a lot easier and faster than opening a terminal (cygwin or whatever), navigating to the directory, and vimming the file.

(On my work PC, gVim and MinGW bash cover most of my editing needs)

3
  • It also work for Linux world. If you want to open a file in vim directly from nautilus, gvim is available while vim is not. Commented Mar 10, 2015 at 5:32
  • @kuldeep.kamboj This is simply a matter of configuring Nautilis; you can use xterm -e vim % or some such... Commented Mar 10, 2015 at 9:28
  • 1
    That's exactly why I have gVim installed. Windows terminal fonts make your eyes bleed.
    – Shahbaz
    Commented Mar 10, 2015 at 13:29
5

I just can talk about gVim. Besides basic differences, I found that using gVim help me a lot at the beginning to learn basic commands (for example one way of copying selected text to the clipboard with "+y) by reading each of the shortcuts displayed on the menu. It may sound silly, but you really should spend some time traversing the menu and not just click on an item, but to actually test the shortcut it shows. Personal opinion.

1

To add a trivial thing: When using gvim, the window list of my Desktop shows a nice Vim-symbol rather then an Xterm-symbol, which makes it easier to switch to the editor if a lot of xterms are open.

1
1

Changing the cursor shape depending on the mode (e.g. Normal vs Insert) works very well with gVim. This ought to work when using vim in a terminal program like Konsole, but I have never seen it work.

2
  • I don't tend to use particularly fancy terminal emulators on Linux, but I can confirm that it works very well in mintty/cygwin and iTerm2 on Mac.
    – brhfl
    Commented Feb 28, 2018 at 19:29
  • This is a nice addition. Definetly a changing cursor is not supported on XTerm.
    – Quasímodo
    Commented Aug 26, 2020 at 22:17
1

One crucial point for me that continues to make me use MacVim verses just the terminal+vi is speed. I have all kinds of vim plugins and language hints and syntax checkers that surprisingly bog the terminal vi way down, whilst the compiled bin of MacVim handles all that syntatic sugar just fine.

3
  • I think this is because Macvim uses neovim. If you used neovim on the CLI, it would also be very responsive. Commented Dec 5, 2022 at 13:26
  • @AngularNerd, yes agreed. In the summer of 2019, i switched over to Kitty.app and NeoVim. Been loving it ever since. Commented Dec 6, 2022 at 14:08
  • I was mistaken that MacVim uses neovim. It uses a current version of regular vim (9.x i believe). Regular vim 9.x also seems to perform well for me. Commented Dec 24, 2022 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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