How to make vim use the same environment as my login shell when running commands with “!”?
问题 I use !ls to execute bash command. But after i have configured something like source ~/.usr_profile in ~/.profile file, vim won't source this file as well. So when i want to execute a function declared in usr_profile , i have to run :!source ~/.usr_profile && my_command . When i using this once or twice, it's ok. But when use it frequently, the my vimrc becomes messy. Is there any better method to solve this problem.Thanks 回答1: Adding this line to your ~/.vimrc should solve your immediate