I change my shell to zsh now.But when I call shell in vim by :! xxx will call the bash.So, how can I call zsh in vim ?

  • 3
    How did you change the default shell? Vim picks $SHELL for running :! commands. See :h 'shell' – muru Oct 19 '18 at 3:54
  • Did you log out and in again after changing your shell? – Kusalananda Oct 19 '18 at 7:12
  • I change by 'chsh',and it works for terminal. – Shylock Hg Oct 21 '18 at 2:02

Inside vim, you can check your current shell by running

:set shell?

You can change the shell used in vim for the running session via command:

:set shell=/usr/bin/zsh

...And to make this change permanent, just put the set command in your vim RC file.

  • Yes, it works.But the completion of parameters by zsh don't works.Do you know this? – Shylock Hg Oct 21 '18 at 2:04
  • And some alias such as 'l' also don't works. – Shylock Hg Oct 21 '18 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.