How to specify shell for vim?

Add or change the following line in ~/.vimrc:

set shell=/path/to/zsh

Not enough reputation for adding a comment, this is meant as a response to @BlackSheep comment in the accepted answer:

Despite the similar syntax, the set shell=/bin/bash does not apply to shell variables, but to variables that are internal to vi, so you can run a shell even if the system's shell for the active user is not a real one.

Also you can use :set shell=/bin/bash then :sh if you don't want to modify ~/.vimrc

Tags:

Vim

Shell

Macvim