My New Mac Travails Part I

So at my new job, the main development machines are Macs. Previously, I knew a ton of people doing Windows development on Macs though most of the work was done in Parallels, Fusion or Bootcamp. I haven’t been on a Mac since probably sixth grade when I wrote a program I didn’t find on the internet to output Alfred E. Neuman’s face to the terminal. Suffice it to say, I’m out of touch. So I spent 2 hours yesterday just trying to get MacVim installed and bent to my will. This series (where series may be anywhere from 1 to N posts) will throw little tidbits of knowledge out into the interwebs regarding my trials and tribulations with becoming a Mac convert. This will be old hat for anyone with any Linux or Mac background but for someone coming from a purely Windows environment with only a tiny bit of self-taught Linux history, maybe it will help other total beginners.

Lesson 1 involves getting MacVim to correctly recognize Python files with pretty indenting and whatnot. I downloaded MacVim and so far have just left it in the Downloads folder which I’m sure is ridiculous but at least I know where it is. Once that was done, I spent a ton of time getting a .vimrc file set up, mostly because files starting with . on a Mac are system files and hidden by default. This page helped a lot in that regard.

Once that was done, I set about getting MacVim to deal with Python files with pretty indenting and whatnot. One thing to understand right off the bat with MacVim is that “filetype”, “plugin” and “indent” are disabled by default on installation. Before you go creating your own plugin files and indent files, it’s helpful to add “filetype plugin indent on” to your settings file and see what happens. You may not go to the trouble I did overwriting all the defaults. But that’s just how I roll.

I found this helpful post dealing with Python syntax and indenting. The key is figuring out where to put those files. When you install MacVim (or lots of other apps on the Mac), you get a folder typically named .app. You can drag this into your Applications folder and have access to it there instead of leaving things in Downloads. With MacVim, you are going to put your indent and ftplugin files in MacView.app/Contents/Resources/vim/runtime/indent or ftplugin. Once I figured that out, I dropped the files from the link above in the correct folder and of course, everything worked like a champ.

Now if I could just remember that on a Mac keyboard, you copy and paste using the Command key instead of the control key, I’d be set up.