by running grep -R '~/\.vimrc' . I was able to locate a starting point of main.c.
The main() function in main.c executes source_startup_scripts() in main.c. source_startup_scripts() will try to execute a startup file in this order (once a file is found, the rest are ignored):
- environment variable VIMINIT
- user vimrc file (s:.vimrc for Amiga, ~/.vimrc otherwise)
- second user vimrc file ($VIM/.vimrc for Dos)
- environment variable EXINIT
- user exrc file (s:.exrc for Amiga, ~/.exrc otherwise)
- second user exrc file ($VIM/.exrc for Dos)