1

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 1

1

-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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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