How to make .bashrc aliases available within a vim shell command? (:!…)

Bash doesn’t load your .bashrc unless it’s interactive.

Run :set shellcmdflag=-ic to set it to interactive for the current session.

To make the setting permanent, add set set shellcmdflag=-ic to the end of your .vimrc file.

Use a bang (!) before sending a command to shell. For example: :! cd folder/.

Leave a Comment