AddThis Social Bookmark Button

Listen Print Discuss

What Is Vim (It's Easier than You Think)

by Matthew Russell
07/11/2006

Editor's note: If you've had a less-than-agreeable experience with Vim in the past and are willing to give it another shot, please ponder these points as you work through this article: 1) there's generally a learning curve involved with any powerful tool, 2) Vim is much more than just your run-of-the-mill text editor, and 3) the effort required to become a proficient Vimmer isn't as much as you'd think: it's comparable to that of learning to touch type.

Vim (Vi IMproved)
Vim is a modal text editor designed expressly for efficient text editing. Vim behaves much like the Unix text editor Vi but with many improvements, including graphical menus and mouse support, syntax coloring, undo/redo support, tabbed views, spell checking, and more. Vim is commonly known as a programmer's text editor because of its powerful features that are convenient for editing source code, but is suitable for any task that involves editing text. Vim is open source and highly portable, making it especially appealing to those who frequently work amongst multiple platforms.

In This Article:

  1. Download and Install
  2. Normal Mode Isn't so Normal (at First)
  3. More Keystrokes: Cut/Copy/Paste and Search
  4. The Vim Tutor
  5. Customizing Keystrokes in Vim

This article gets you up and running with Vim. Read on get the latest version installed, run though a quick overview of how its modal behavior can increase your efficiency, and then delve into some of the more advanced features that you can use to customize your Vim experience.

Download and Install

Vim.org is the undisputed source for all matters Vim. It houses a massive collection of incredibly useful Vim tips, scripts, and documentation, among other things. An interesting anomaly, however, is that you won't find the precompiled Vim 7 binaries for Mac there. To get those, you'll want to go to macvim.org. Go there, and look toward the bottom of the page to find precompiled binaries of Vim 7. Download the archive corresponding to the version of your OS, and unzip it. Inside, you'll find four files: gvim (a shell script), Vim.app (the GUI-enabled Vim application), gvim.app (the helper application that you'll want to use to launch Vim), and the standard README document.

Follow along with this much-expanded version of the README document to get all set up.

Brief aside: It's worth noting that Vim.app and gvim.app do not have the intuitive meanings that "vim" and "gvim" normally have. Traditionally, "vim" refers to the terminal-based version of Vim, while "gvim" normally refers to the version of Vim that runs as a GUI application with menus, mouse support, etc. The current situation for Mac users is that Vim.app is the single application that drives both the GUI-enabled version as well as the Terminal-based version of Vim. The disconnect, however, is that Vim.app is only capable of providing a single document window per application instance (at least for now). Until this issue is resolved, the gvim.app helper application works around the problem by launching separate instances of Vim.app behind the scenes for you. All that really means in the end is that if you want to invoke Vim from outside a Terminal setting (like from your dock), do it with gvim.app, not with Vim.app. Otherwise, you're stuck with a single document window. If you didn't understand a word of that, then just forget about it all except the previous sentence.

Pages: 1, 2, 3

Next Pagearrow