Cody Ma
Cody Ma

Reputation: 347

Can't open vim in zsh?

I recently decided to switch from zsh to bash. However, for some reason that escapes me, I cannot open vim within zsh after I change my default shell to zsh (chsh -s /bin/zsh). Currently, my default shell is bash. If I just use zsh to enter a zsh shell, I have no problems with vim. The problems arise when I try to change my default shell, then open a new terminal window. Any insight would be great as I'd love to be able to play around with zsh.

Upvotes: 1

Views: 2217

Answers (1)

chepner
chepner

Reputation: 532268

vim probably lives in a directory that is added to your PATH environment variable in one of your bash start up files. When you start zsh manually, that PATH is inherited by zsh. When you make zsh your default shell, it inherits a PATH which is not modified to include the directory for vim. In bash, type

which vim

to find out which directory vim lives in. Let's say it /usr/other/bin/. Then you would add the following to your .zshenv file (creating it if necessary):

path+=/usr/other/bin

New zsh sessions should now be able to run vim.

Upvotes: 1

Related Questions