Last week I wrote a post that offered an introduction to the text editor Vim, as well as a brief guide to learning the oddity and power of Vim. Today I follow up with part two of my series of posts on Vim: customizing Vim. This is the introductory part. If you just want to see my .vimrc, look at part 3 in this series.
Vim is a bit of a throwback computer program. If you are a computer programmer (or if you are very comfortable using the command line for some other reason), you might not notice this. But it is. In some ways, using Vim is like going back in time. The most obvious difference between Vim and any ‘modern’ text editor in this regard is that all your configurations and preferences for Vim are set using a text file. Even for your graphical MacVim and gVim.
With Vim there are two ways to make changes, one that makes the changes permanent (until you change them), one that makes the changes just for the current session.
Temporary changes in Vim configuration
When I am writing a first draft, I don’t like for spell check to be set. I prefer to write without the distraction of correcting my mistakes. But I want spell check to be on at some points in the writing process. Since I want spell check more often than I don’t want it, I leave it on by default. And when I am drafting, I turn it off.
To turn off spell checking, in normal mode (where you can’t type letters) just type :set nospell. The colon just tells Vim that you are about to enter a command in normal mode. Once you type it, you’ll see the colon appear in the last line of your Vim window. The command :set spell turns spell checking on; the command :set nospell turns it off.
By default, Vim does not wrap long lines (where a line is anything between hard or carriage returns). Each of your paragraphs is probably a single line. Unless you write really short paragraphs, by default this means you will not see most of your paragraph, as it will carry off the window to the right. To turn on line wrapping, you type :set wrap in normal mode. To turn it off again, type :set nowrap. Though there may be some exceptions to this rule, if you want to use a setting for the current window for the current session, just type a colon, then ‘set’, then the setting you want to turn on or off. It will be set temporarily and you can try it out.
Note: in MacVim (I don’t know about gVim), if you click Edit in the menu bar, you’ll see options to change your Global Settings, File Settings, and Color Scheme. These should make the same kinds of temporary changes that :set command make.
Long term changes to your Vim configuration
You don’t want to have to turn on every configuration option every time. Instead, you’ll want to set some options up to be turned on by default, whenever you open Vim. To do that, you need to edit a text file.
The file in question is in your home directory. When you open up the Finder on your Mac, you will likely be in your home directory. If you open up a terminal window and type cd ~, you’ll go to your home directory (you’ll probably start in that directory when you open up your terminal window). Your home directory is the most basic directory on your computer. There are more basic directories on the computer, but any changes you make to those would apply to any user account on the computer. At work, you likely can’t access anything more basic than your home directory. The tilde (~) is standardly used to refer to your home directory. Strictly, this is shorthand for /Users/username, where ‘username’ is your user name.
All your Vim configuration details will go in your ~/.vimrc file. That is, they will go in a file called .vimrc in your home directory. The dot there is important. And it is important that this file not have an extension (like .tex or .txt). You likely won’t have such a file to begin with. To see if you do, open a terminal window, make sure you are in ~, and type ls -a. That will list all the files in that directory, including the ones that start with a dot. On a Mac, those dot files are hidden in the Finder. But even on Linux boxes I think they don’t show up in a standard ls command. If there is a file, you’ll want to open it. If there isn’t one, you’ll want to create one. A vim .vimrc command from your home directory will open or create the file, as needed.
If you want to turn spell checking on by default, just write set spell all by itself on a line in this file. If you want to set line wrapping by default, write set wrap on a line all by itself. Save the file, and next time you open up Vim, misspelled words will be highlighted and long lines will be wrapped.
Vim will check this file every time it start up. But it only checks the file at startup. So if you want to change something now, you’ll need to set it via the first method above.
Note: if you are using MacVim or gVim, you can access your .vimrc file without opening up a terminal (or typing :e ~/.vimrc, which will always open that file for editing). In the menu bar, click Edit -> Startup Settings and your .vimrc will open. Make changes to that and save it, and the changes will take effect next time you start Vim.
More
I’m going to share the relevant parts of my .vimrc. But since this post is getting kind of long, I’m going to do it in a separate post.

I switched spell check off at all and use free online spell check if it necessary: http://www.spellchecker.net/spellcheck/ It also has grammar check and thesaurus.