Vim ack plugin with MacVim and MacPorts

The vim ack plugin doesn’t work if you use MacVim and MacPorts. The problem is the path (/opt/local/bin/ack). MacVim doesn’t get its path from your login shell (despite what the preferences page says) and /opt/local/bin isn’t a default path.

The way to fix it is to add a file to /etc/paths.d with one line it:

/opt/local/bin

You can call the file whatever you want. Restart MacVim and :Ack will work.

You should follow me on Twitter: @patrickxb