Followup to my MacVim review last year
Software
Vim (left) compared to MacVim (right)
I try my best to include as much information from personal experience as I can when I do my reviews of software here, but sometimes I forget something critical which later involves me hitting my head on a table or similarly raised flat surface.
In August of last year I wrote up a review of the MacVim text editor which, as you’ve probably already figured out, is a native Cocoa port of the venerable Vim text editor. Back then I admitted I didn’t see the point of using MacVim when Vim was already available in Mac OS X and could easily be accessed from the Terminal [Wikipedia], but I stated I’d started using MacVim anyway.
I thought I’d clear up some ambiguity now that several months have passed: MacVim is the ultimate Mac text editor and I use it exclusively now for everything! It has become such a critical part of my life now that I can’t possibly imagine going back to TextMate or TextEdit [Wikipedia]. It’s an excellent application that works just as regular Vim does, but with all the benefits of being a native Cocoa application such as native file open and save windows, a broader range of colours for syntax highlighting… plus gosh darn it, it just looks nice!
Since my initial review I’ve also learned more regarding execution from the Terminal. I’ve broken the post up into three sections, to pretend I’m organised.
1. The mvim script
Paulo posted a question on my original review and answered it before I even could! If you’re reading this Paulo, do you have a website you want me to link to?
Thanks for sharing this! One question thou: I’ve used ports install MacVim and I can’t find the mvim script that is supposed to be shipped with it. Am I missing something?
[…]
Figured that you need to get the version from the project’s web site at http://code.google.com/p/macvim/
2. Using an ampersand to stay in the shell
This is something I already knew given I use FreeBSD so heavily now, but I realised others might not. If you want to execute MacVim in a directory from the Terminal but you still want to work in that directory, you can append an ampersand to the command:
% mvim [filename] &
This is really useful if you want to edit source code in MacVim and compile it in the Terminal.
3. Command aliases for the absent minded
Another tip from Unix is adding aliases to your profile shell script so if you’re like me and you absent mindedly type
vim
or vi
when you meant mvim
you’ll execute the right thing! First check which shell you’re running:
% echo $SHELL
Then append these lines to your appropriate file. Leopard uses bash by default but given I’m a FreeBSD guy I still prefer tcsh.
For bash,
~/.profile
,~/.bash_profile
or~/.bashrc
:
alias vim="mvim"
alias vi="mvim"
For tcsh,
~/.tcshrc
or~/.cshrc
:
alias vim "mvim"
alias vi "mvim"