Installing Vim

When you craft computer programs, you need to create simple text files, not something you build with Microsoft Word!. Programmers like to use “editors” that understand they are writing program code. A good “Programmer’s Editor” is very useful, and not just for creating programs.

I have used a tool called Vim for many years. It is very popular in the world of programming, and I install it on all of my computers!

On some systems, Vim comes pre-installed, but you might find upgrading to a GUI version helpful. Here are some notes on installing this editor:

Windows

On Windows, you should install gVim. The installer is a simple executable that you download and run. It integrates with Windows Explorer giving you a new Context Menu option called Edit with vim.

Here is a link to the current installer:

Run this file by either double-clicking on the file name in Windows Explorer, or from the command prompt by doing this:

$ gvim74

During installation, you may be asked if you want to install command line tools. Say “yes” to this question so you can use the editor in any situation.

Once the installation completes, you will be able to edit files from the command prompt:

$ vim <filename>
$ gvim <filename>

(That last command launched the GUI version of the editor). You can also edit a file visible in the Windows Explorer tool by right-clicking on the file name and choosing Edit with vim.

Mac OS-X

On Macs, things are a bit more complicated. If you use a Mac extensively for working on software projects, I highly recommend that you install Homebrew, a tool that makes installing many open-source packages very easy. Notes on installing HomeBrew can be found here:

The version of vim for the Mac is, oddly enough, MacVim. It can be installed easily as follows:

$ brew update
$ brew install macvim

Once this step has been completed, you should be able to launch vim from the command line:

$ vim <filename>
$ mvim <filename>

The last command will launch the GUI version of the program.

Linux

Vim is usually installed on a Linux system, since so many administrators use it to manage the system. You can install a graphical version that is more like the GUI versions on other platforms. Here is how I install it on my Ubuntu system:

$ sudo apt-get install -y vim-gtk

The command needed to install Vim on other versions of Linux are different. A bit of searching on the Internet should turn up the needed command.