I'm running external command inside vim by :!command
.
Noticed vim will source .cshrc before run the command, because I've added some echo in the .cshrc.
Is there a way to force vim don't source the .cshrc?
1 Answer
-f
tells csh
not to source its startup scripts, so you need to tell Vim to give that flag to the shell.
:!
and !
use the shell specified in the shell
option, with flag(s) from the shellcmdflag
option. By default, that is -c
, which has to come immediately before the command to run. If you want additional options, you'll need to insert them before that:
set shellcmdflag=-f\ -c