It seems like "do_source" function in "ex_cmds2.c" will read ".vimrc" file passed from "source_startup_scripts" in "main.c"
I found this out by inspecting the output of:
$ lid -S 'newline' ".vimrc"
Poking around "source_startup_scripts" I found EVIM_FILE constant,
running:
$ lid -S 'newline' "EVIM_FILE"
I navigated to "os_unix.h", since I run linux which lists a bunch of start up files.
In "source_startup_scripts", I found, variables whose values can be looked up in os_unix.h.
What are the various startup files Vim can/will read if they exist?
- EVIM_FILE
- SYS_VIMRC_FILE
- macvim.vim #if on a mac
- USR_VIMRC_FILE
- USR_VIMRC_FILE2
- USR_VIMRC_FILE3
- USR_EXRC_FILE
- USR_EXRC_FILE2
- VIMRC_FILE
- EXRC_FILE
Comments:
10 months ago
Good work!
Pop quiz: What happens unexpectedly when you run:
VIMINIT=':!date' vim
...and... why? :-)
1 month ago
will it print the current system date time in the terminal before the user type 'enter', then it goes in the editor window because on start up, VIMINIT variable is the first thing vim looks at (same quote with the previous answers). It runs the script in VIMINIT before it actually start?
Sign up or log in to comment