diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-28 22:24:15 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-28 22:24:15 +0200 |
commit | 8c08b5b569e2a9e9f63dea514591ecfa2d3bb392 (patch) | |
tree | 4303829cd42d4910ee0d0dfc35687c7b313c5e14 /src/main.c | |
parent | eac784eced501c54d2c99e18a1af96cd996f3a6c (diff) | |
download | vim-git-8c08b5b569e2a9e9f63dea514591ecfa2d3bb392.tar.gz |
patch 7.4.2111v7.4.2111
Problem: Defaults are very conservative.
Solution: Move settings from vimrc_example.vim to defaults.vim. Load
defaults.vim if no .vimrc was found.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c index 926b8ab90..f24bda238 100644 --- a/src/main.c +++ b/src/main.c @@ -2997,11 +2997,14 @@ source_startup_scripts(mparm_T *parmp) DOSO_VIMRC) == FAIL #endif && process_env((char_u *)"EXINIT", FALSE) == FAIL - && do_source((char_u *)USR_EXRC_FILE, FALSE, DOSO_NONE) == FAIL) - { + && do_source((char_u *)USR_EXRC_FILE, FALSE, DOSO_NONE) == FAIL #ifdef USR_EXRC_FILE2 - (void)do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE); + && do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE) == FAIL #endif + ) + { + /* When no .vimrc file was found: source defaults.vim. */ + do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE); } } @@ -3009,7 +3012,7 @@ source_startup_scripts(mparm_T *parmp) * Read initialization commands from ".vimrc" or ".exrc" in current * directory. This is only done if the 'exrc' option is set. * Because of security reasons we disallow shell and write commands - * now, except for unix if the file is owned by the user or 'secure' + * now, except for Unix if the file is owned by the user or 'secure' * option has been reset in environment of global ".exrc" or ".vimrc". * Only do this if VIMRC_FILE is not the same as USR_VIMRC_FILE or * SYS_VIMRC_FILE. |