1

Why are the commands on my .bash_profile not recognized? I tried using both set shell=/bin/bash\ and set shell=/bin/bash\ -i - none worked.

2

The shell which executes your command isn't a login shell, so it doesn't load .bash_profile. One hack for getting it to work (even though most people I've seen recommend against it) is: :set shellcmdflag=-i in your .vimrc.

I don't recall why it was recommended against, but when I've done it, Vim tends to randomly get put in the background like CTRL+z was pressed.

Here's a previous StackOverflow answer to the same question: https://stackoverflow.com/questions/4642822/commands-executed-from-vim-are-not-recognizing-bash-command-aliases

|improve this answer|||||
  • Why'd they recommend against it? – MaiaVictor Oct 22 '15 at 21:19
  • I'll see if I can find it... – Cody Poll Oct 22 '15 at 21:20

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.