Last Updated: February 25, 2016
·
3.271K
· sao

zsh: command not found while executing shell commands in vim

This is a solution to an issue I was having when trying to use vundle and running the :BundleInstall command inside Vim. I kept seeing the following in the logs of the failed installs:

zsh: command not found: git

When I had 'git' installed. I then attempted to run other shell commands inside Vim using ! and it gave me that message with any command I threw at it.

This was being caused by not having a .zprofile file. By default Mac OS X's system version of zsh uses .zshenv as the .zprofile config.

Incase someone else has this issue, this is the solution.

Written by Silas Sao

Recommend
Say Thanks
Update Notifications Off
Respond

1 Response
Add your response

EDIT: I found what is really going on. Regarding the manual:

Commands  are  first  read from /etc/zshenv; this cannot be overridden.

[...]

Commands are then read from $ZDOTDIR/.zshenv. If the shell is a
login shell, commands are read from /etc/zprofile and then 
$ZDOTDIR/.zprofile. Then, if the shell is interactive, 
commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc. Finally,
if the shell is a login shell, /etc/zlogin and $ZDOTDIR/.zlogin are
read.

So setting ZSH in interactive mode works great.

set shell=zsh\ -i

I don't know. I think I have the same issue you describe but what should I put in ~/.zprofile? I linked it to ~/.zshenv, it didn't work. Then I linked it to ~/.zshrc, it didn't work.

I was happy to find your tip which was the first element of response after a pretty long research :)

Any hint?

over 1 year ago ·