To: vim_dev@googlegroups.com Subject: Patch 7.4.2111 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.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. Files: src/main.c, src/version.c, src/os_amiga.h, src/os_dos.h, src/os_mac.h, src/os_unix.h, src/feature.h, src/Makefile, runtime/vimrc_example.vim, runtime/defaults.vim, runtime/evim.vim, Filelist, runtime/doc/starting.txt *** ../vim-7.4.2110/src/main.c 2016-07-24 21:58:39.708057598 +0200 --- src/main.c 2016-07-28 21:07:56.144272774 +0200 *************** *** 2997,3007 **** DOSO_VIMRC) == FAIL #endif && process_env((char_u *)"EXINIT", FALSE) == 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); #endif } } --- 2997,3010 ---- DOSO_VIMRC) == FAIL #endif && process_env((char_u *)"EXINIT", FALSE) == FAIL ! && do_source((char_u *)USR_EXRC_FILE, FALSE, DOSO_NONE) == FAIL #ifdef USR_EXRC_FILE2 ! && 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,3015 **** * 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' * 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. --- 3012,3018 ---- * 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' * 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. *** ../vim-7.4.2110/src/version.c 2016-07-28 22:08:18.682287202 +0200 --- src/version.c 2016-07-28 22:17:04.565351251 +0200 *************** *** 5349,5354 **** --- 5351,5359 ---- version_msg("\"\n"); # endif #endif + version_msg(_(" defaults file: \"")); + version_msg(VIM_DEFAULTS_FILE); + version_msg("\"\n"); #ifdef FEAT_GUI # ifdef SYS_MENU_FILE version_msg(_(" system menu file: \"")); *** ../vim-7.4.2110/src/os_amiga.h 2016-01-30 21:48:44.329034406 +0100 --- src/os_amiga.h 2016-07-28 21:11:30.538260666 +0200 *************** *** 160,165 **** --- 160,168 ---- #ifndef USR_VIMRC_FILE4 # define USR_VIMRC_FILE4 "$VIM/.vimrc" #endif + #ifndef VIM_DEFAULTS_FILE + # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" + #endif #ifndef EVIM_FILE # define EVIM_FILE "$VIMRUNTIME/evim.vim" #endif *** ../vim-7.4.2110/src/os_dos.h 2013-12-07 14:32:04.000000000 +0100 --- src/os_dos.h 2016-07-28 21:12:03.717949346 +0200 *************** *** 25,30 **** --- 25,33 ---- #ifndef USR_VIMRC_FILE3 # define USR_VIMRC_FILE3 "$VIM\\_vimrc" #endif + #ifndef VIM_DEFAULTS_FILE + # define VIM_DEFAULTS_FILE "$VIMRUNTIME\\defaults.vim" + #endif #ifndef EVIM_FILE # define EVIM_FILE "$VIMRUNTIME\\evim.vim" #endif *** ../vim-7.4.2110/src/os_mac.h 2013-11-02 21:04:32.000000000 +0100 --- src/os_mac.h 2016-07-28 21:12:31.245691072 +0200 *************** *** 139,144 **** --- 139,147 ---- #ifndef SYS_OPTWIN_FILE # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" #endif + #ifndef VIM_DEFAULTS_FILE + # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" + #endif #ifndef EVIM_FILE # define EVIM_FILE "$VIMRUNTIME/evim.vim" #endif *** ../vim-7.4.2110/src/os_unix.h 2016-07-16 14:46:51.135240543 +0200 --- src/os_unix.h 2016-07-28 21:13:02.849394574 +0200 *************** *** 303,308 **** --- 303,312 ---- # endif #endif + #ifndef VIM_DEFAULTS_FILE + # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" + #endif + #ifndef EVIM_FILE # define EVIM_FILE "$VIMRUNTIME/evim.vim" #endif *** ../vim-7.4.2110/src/feature.h 2016-07-16 14:46:51.123240668 +0200 --- src/feature.h 2016-07-28 21:13:53.260921660 +0200 *************** *** 906,911 **** --- 906,916 ---- /* #define USR_VIMRC_FILE3 "$VIM/.vimrc" */ /* + * VIM_DEFAULTS_FILE Name of the defaults.vim script file + */ + /* #define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" */ + + /* * EVIM_FILE Name of the evim.vim script file */ /* #define EVIM_FILE "$VIMRUNTIME/evim.vim" */ *** ../vim-7.4.2110/src/Makefile 2016-07-24 17:32:41.881505040 +0200 --- src/Makefile 2016-07-28 21:16:08.131656647 +0200 *************** *** 1071,1077 **** ### the runtime directory is not below it. #VIMRUNTIMEDIR = $(VIMRTLOC) ! ### Name of the evim file target. EVIM_FILE = $(DESTDIR)$(SCRIPTLOC)/evim.vim MSWIN_FILE = $(DESTDIR)$(SCRIPTLOC)/mswin.vim --- 1071,1078 ---- ### the runtime directory is not below it. #VIMRUNTIMEDIR = $(VIMRTLOC) ! ### Name of the defaults/evim/mswin file target. ! VIM_DEFAULTS_FILE = $(DESTDIR)$(SCRIPTLOC)/defaults.vim EVIM_FILE = $(DESTDIR)$(SCRIPTLOC)/evim.vim MSWIN_FILE = $(DESTDIR)$(SCRIPTLOC)/mswin.vim *************** *** 2240,2250 **** chmod $(VIMSCRIPTMOD) $(SYS_SYNMENU_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/delmenu.vim $(SYS_DELMENU_FILE) chmod $(VIMSCRIPTMOD) $(SYS_DELMENU_FILE) ! # install the evim file ! $(INSTALL_DATA) $(SCRIPTSOURCE)/mswin.vim $(MSWIN_FILE) ! chmod $(VIMSCRIPTMOD) $(MSWIN_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/evim.vim $(EVIM_FILE) chmod $(VIMSCRIPTMOD) $(EVIM_FILE) # install the rgb.txt file $(INSTALL_DATA) $(SCRIPTSOURCE)/rgb.txt $(SYS_RGB_FILE) chmod $(VIMSCRIPTMOD) $(SYS_RGB_FILE) --- 2241,2253 ---- chmod $(VIMSCRIPTMOD) $(SYS_SYNMENU_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/delmenu.vim $(SYS_DELMENU_FILE) chmod $(VIMSCRIPTMOD) $(SYS_DELMENU_FILE) ! # install the defaults/evim/mswin file ! $(INSTALL_DATA) $(SCRIPTSOURCE)/defaults.vim $(VIM_DEFAULTS_FILE) ! chmod $(VIMSCRIPTMOD) $(VIM_DEFAULTS_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/evim.vim $(EVIM_FILE) chmod $(VIMSCRIPTMOD) $(EVIM_FILE) + $(INSTALL_DATA) $(SCRIPTSOURCE)/mswin.vim $(MSWIN_FILE) + chmod $(VIMSCRIPTMOD) $(MSWIN_FILE) # install the rgb.txt file $(INSTALL_DATA) $(SCRIPTSOURCE)/rgb.txt $(SYS_RGB_FILE) chmod $(VIMSCRIPTMOD) $(SYS_RGB_FILE) *************** *** 2612,2618 **** -rm -f $(DEST_HELP)/*.??x $(DEST_HELP)/tags-?? -rm -f $(SYS_RGB_FILE) -rm -f $(SYS_MENU_FILE) $(SYS_SYNMENU_FILE) $(SYS_DELMENU_FILE) ! -rm -f $(SYS_BUGR_FILE) $(EVIM_FILE) $(MSWIN_FILE) -rm -f $(DEST_SCRIPT)/gvimrc_example.vim $(DEST_SCRIPT)/vimrc_example.vim -rm -f $(SYS_FILETYPE_FILE) $(SYS_FTOFF_FILE) $(SYS_SCRIPTS_FILE) -rm -f $(SYS_INDOFF_FILE) $(SYS_INDENT_FILE) --- 2615,2621 ---- -rm -f $(DEST_HELP)/*.??x $(DEST_HELP)/tags-?? -rm -f $(SYS_RGB_FILE) -rm -f $(SYS_MENU_FILE) $(SYS_SYNMENU_FILE) $(SYS_DELMENU_FILE) ! -rm -f $(SYS_BUGR_FILE) $(VIM_DEFAULTS_FILE) $(EVIM_FILE) $(MSWIN_FILE) -rm -f $(DEST_SCRIPT)/gvimrc_example.vim $(DEST_SCRIPT)/vimrc_example.vim -rm -f $(SYS_FILETYPE_FILE) $(SYS_FTOFF_FILE) $(SYS_SCRIPTS_FILE) -rm -f $(SYS_INDOFF_FILE) $(SYS_INDENT_FILE) *** ../vim-7.4.2110/runtime/vimrc_example.vim 2016-04-05 22:06:25.223395130 +0200 --- runtime/vimrc_example.vim 2016-07-28 20:37:40.101226097 +0200 *************** *** 1,7 **** " An example for a vimrc file. " " Maintainer: Bram Moolenaar ! " Last change: 2016 Apr 05 " " To use it, copy it to " for Unix and OS/2: ~/.vimrc --- 1,7 ---- " An example for a vimrc file. " " Maintainer: Bram Moolenaar ! " Last change: 2016 Jul 28 " " To use it, copy it to " for Unix and OS/2: ~/.vimrc *************** *** 14,73 **** finish endif ! " Use Vim settings, rather than Vi settings (much better!). ! " This must be first, because it changes other options as a side effect. ! set nocompatible ! ! " allow backspacing over everything in insert mode ! set backspace=indent,eol,start if has("vms") set nobackup " do not keep a backup file, use versions instead else set backup " keep a backup file (restore to previous version) ! set undofile " keep an undo file (undo changes after closing) ! endif ! set history=50 " keep 50 lines of command line history ! set ruler " show the cursor position all the time ! set showcmd " display incomplete commands ! set incsearch " do incremental searching ! ! " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries ! " let &guioptions = substitute(&guioptions, "t", "", "g") ! ! " Don't use Ex mode, use Q for formatting ! map Q gq ! ! " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, ! " so that you can undo CTRL-U after inserting a line break. ! inoremap u ! ! " In many terminal emulators the mouse works just fine, thus enable it. ! if has('mouse') ! set mouse=a endif - " Switch syntax highlighting on when the terminal has colors or when using the - " GUI (which always has colors). if &t_Co > 2 || has("gui_running") ! syntax on ! ! " Also switch on highlighting the last used search pattern. set hlsearch - - " I like highlighting strings inside C comments. - let c_comment_strings=1 endif " Only do this part when compiled with support for autocommands. if has("autocmd") - " Enable file type detection. - " Use the default filetype settings, so that mail gets 'tw' set to 72, - " 'cindent' is on in C files, etc. - " Also load indent files, to automatically do language-dependent indenting. - filetype plugin indent on - " Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx au! --- 14,39 ---- finish endif ! " Get the defaults that most users want. ! source $VIMRUNTIME/defaults.vim if has("vms") set nobackup " do not keep a backup file, use versions instead else set backup " keep a backup file (restore to previous version) ! if has('persistent_undo') ! set undofile " keep an undo file (undo changes after closing) ! endif endif if &t_Co > 2 || has("gui_running") ! " Switch on highlighting the last used search pattern. set hlsearch endif " Only do this part when compiled with support for autocommands. if has("autocmd") " Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx au! *************** *** 75,88 **** " For all text files set 'textwidth' to 78 characters. autocmd FileType text setlocal textwidth=78 - " When editing a file, always jump to the last known cursor position. - " Don't do it when the position is invalid or when inside an event handler - " (happens when dropping a file on gvim). - autocmd BufReadPost * - \ if line("'\"") >= 1 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif - augroup END else --- 41,46 ---- *************** *** 91,114 **** endif " has("autocmd") - " Convenient command to see the difference between the current buffer and the - " file it was loaded from, thus the changes you made. - " Only define it when not defined already. - if !exists(":DiffOrig") - command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis - \ | wincmd p | diffthis - endif - - if has('langmap') && exists('+langnoremap') - " Prevent that the langmap option applies to characters that result from a - " mapping. If unset (default), this may break plugins (but it's backward - " compatible). - set langnoremap - endif - - " Add optional packages. " " The matchit plugin makes the % command work better, but it is not backwards " compatible. ! packadd matchit --- 49,58 ---- endif " has("autocmd") " Add optional packages. " " The matchit plugin makes the % command work better, but it is not backwards " compatible. ! if has('syntax') && has('eval') ! packadd matchit ! endif *** ../vim-7.4.2110/runtime/defaults.vim 2016-07-28 22:20:07.595651734 +0200 --- runtime/defaults.vim 2016-07-28 21:54:34.174032722 +0200 *************** *** 0 **** --- 1,109 ---- + " The default vimrc file. + " + " Maintainer: Bram Moolenaar + " Last change: 2016 Jul 28 + " + " This is loaded if no vimrc file was found. + " Except when Vim is run with "-u NONE" or "-C". + " Individual settings can be reverted with ":set option&". + " Other commands can be reverted as mentioned below. + + " When started as "evim", evim.vim will already have done these settings. + if v:progname =~? "evim" + finish + endif + + " Use Vim settings, rather than Vi settings (much better!). + " This must be first, because it changes other options as a side effect. + set nocompatible + + " Allow backspacing over everything in insert mode. + set backspace=indent,eol,start + + set history=200 " keep 200 lines of command line history + set ruler " show the cursor position all the time + set showcmd " display incomplete commands + set wildmenu " display completion matches in a status line + + " Do incremental searching when it's possible to timeout. + if has('reltime') + set incsearch + endif + + " Do not recognize octal numbers for Ctrl-A and Ctrl-X, most users find it + " confusing. + set nrformats-=octal + + " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries. + if has('win32') + set guioptions-=t + endif + + " Don't use Ex mode, use Q for formatting. + " Revert with ":unmap Q". + map Q gq + + " CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, + " so that you can undo CTRL-U after inserting a line break. + " Revert with ":iunmap ". + inoremap u + + " In many terminal emulators the mouse works just fine. By enabling it you + " can position the cursor, Visually select and scroll with the mouse. + if has('mouse') + set mouse=a + endif + + " Switch syntax highlighting on when the terminal has colors or when using the + " GUI (which always has colors). + if &t_Co > 2 || has("gui_running") + " Revert with ":syntax off". + syntax on + + " I like highlighting strings inside C comments. + " Revert with ":unlet c_comment_strings". + let c_comment_strings=1 + endif + + " Only do this part when compiled with support for autocommands. + if has("autocmd") + + " Enable file type detection. + " Use the default filetype settings, so that mail gets 'tw' set to 72, + " 'cindent' is on in C files, etc. + " Also load indent files, to automatically do language-dependent indenting. + " Revert with ":filetype off". + filetype plugin indent on + + " Put these in an autocmd group, so that you can revert them with: + " ":augroup vimStartup | au! | augroup END" + augroup vimStartup + au! + + " When editing a file, always jump to the last known cursor position. + " Don't do it when the position is invalid or when inside an event handler + " (happens when dropping a file on gvim). + autocmd BufReadPost * + \ if line("'\"") >= 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif + + augroup END + + endif " has("autocmd") + + " Convenient command to see the difference between the current buffer and the + " file it was loaded from, thus the changes you made. + " Only define it when not defined already. + " Revert with: ":delcommand DiffOrig". + if !exists(":DiffOrig") + command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis + \ | wincmd p | diffthis + endif + + if has('langmap') && exists('+langnoremap') + " Prevent that the langmap option applies to characters that result from a + " mapping. If unset (default), this may break plugins (but it's backward + " compatible). + set langnoremap + endif *** ../vim-7.4.2110/runtime/evim.vim 2010-05-25 19:34:49.000000000 +0200 --- runtime/evim.vim 2016-07-24 20:10:31.028052665 +0200 *************** *** 1,6 **** " Vim script for Evim key bindings " Maintainer: Bram Moolenaar ! " Last Change: 2006 Mar 29 " Don't use Vi-compatible mode. set nocompatible --- 1,6 ---- " Vim script for Evim key bindings " Maintainer: Bram Moolenaar ! " Last Change: 2016 Jul 24 " Don't use Vi-compatible mode. set nocompatible *************** *** 63,66 **** --- 63,74 ---- endif " has("autocmd") + " Add optional packages. + " + " The matchit plugin makes the % command work better, but it is not backwards + " compatible. + if has('syntax') && has('eval') + packadd matchit + endif + " vim: set sw=2 : *** ../vim-7.4.2110/Filelist 2016-07-19 16:38:45.507086996 +0200 --- Filelist 2016-07-28 21:16:31.367438739 +0200 *************** *** 526,533 **** runtime/macros/urm/examples \ runtime/macros/urm/urm \ runtime/macros/urm/urm.vim \ ! runtime/mswin.vim \ runtime/evim.vim \ runtime/optwin.vim \ runtime/ftplugin.vim \ runtime/ftplugof.vim \ --- 526,534 ---- runtime/macros/urm/examples \ runtime/macros/urm/urm \ runtime/macros/urm/urm.vim \ ! runtime/defaults.vim \ runtime/evim.vim \ + runtime/mswin.vim \ runtime/optwin.vim \ runtime/ftplugin.vim \ runtime/ftplugof.vim \ *** ../vim-7.4.2110/runtime/doc/starting.txt 2016-02-25 21:21:47.989840859 +0100 --- runtime/doc/starting.txt 2016-07-28 21:04:33.130177901 +0200 *************** *** 799,811 **** For the Macintosh the $VIMRUNTIME/macmap.vim is read. *VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc* *$MYVIMRC* ! c. Four places are searched for initializations. The first that exists is used, the others are ignored. The $MYVIMRC environment variable is set to the file that was first found, unless $MYVIMRC was already set and when using VIMINIT. ! - The environment variable VIMINIT (see also |compatible-default|) (*) ! The value of $VIMINIT is used as an Ex command line. ! - The user vimrc file(s): "$HOME/.vimrc" (for Unix and OS/2) (*) "$HOME/.vim/vimrc" (for Unix and OS/2) (*) "s:.vimrc" (for Amiga) (*) --- 806,818 ---- For the Macintosh the $VIMRUNTIME/macmap.vim is read. *VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc* *$MYVIMRC* ! c. Five places are searched for initializations. The first that exists is used, the others are ignored. The $MYVIMRC environment variable is set to the file that was first found, unless $MYVIMRC was already set and when using VIMINIT. ! I The environment variable VIMINIT (see also |compatible-default|) (*) ! The value of $VIMINIT is used as an Ex command line. ! II The user vimrc file(s): "$HOME/.vimrc" (for Unix and OS/2) (*) "$HOME/.vim/vimrc" (for Unix and OS/2) (*) "s:.vimrc" (for Amiga) (*) *************** *** 822,832 **** Note: For MS-DOS and Win32, "$HOME" is checked first. If no "_vimrc" or ".vimrc" is found there, "$VIM" is tried. See |$VIM| for when $VIM is not set. ! - The environment variable EXINIT. ! The value of $EXINIT is used as an Ex command line. ! - The user exrc file(s). Same as for the user vimrc file, but with ! "vimrc" replaced by "exrc". But only one of ".exrc" and "_exrc" is ! used, depending on the system. And without the (*)! d. If the 'exrc' option is on (which is not the default), the current directory is searched for three files. The first that exists is used, --- 829,842 ---- Note: For MS-DOS and Win32, "$HOME" is checked first. If no "_vimrc" or ".vimrc" is found there, "$VIM" is tried. See |$VIM| for when $VIM is not set. ! III The environment variable EXINIT. ! The value of $EXINIT is used as an Ex command line. ! IV The user exrc file(s). Same as for the user vimrc file, but with ! "vimrc" replaced by "exrc". But only one of ".exrc" and "_exrc" is ! used, depending on the system. And without the (*)! ! V The default vimrc file, $VIMRUNTIME/defaults.vim. This sets up ! options values and has "syntax on" and "filetype on" commands, ! which is what most new users will want. See |defaults.vim|. d. If the 'exrc' option is on (which is not the default), the current directory is searched for three files. The first that exists is used, *************** *** 857,862 **** --- 867,877 ---- commands from the command line have not been executed yet. You can use "--cmd 'set noloadplugins'" |--cmd|. + Packages are loaded. These are plugins, as above, but found in the + "start" directory of each entry in 'packpath'. Every plugin directory + found is added in 'runtimepath' and then the plugins are sourced. See + |packages|. + 5. Set 'shellpipe' and 'shellredir' The 'shellpipe' and 'shellredir' options are set according to the value of the 'shell' option, unless they have been set before. *************** *** 893,902 **** 12. Execute startup commands If a "-t" flag was given to Vim, the tag is jumped to. The commands given with the |-c| and |+cmd| arguments are executed. - The starting flag is reset, has("vim_starting") will now return zero. If the 'insertmode' option is set, Insert mode is entered. The |VimEnter| autocommands are executed. Some hints on using initializations: Standard setup: --- 908,921 ---- 12. Execute startup commands If a "-t" flag was given to Vim, the tag is jumped to. The commands given with the |-c| and |+cmd| arguments are executed. If the 'insertmode' option is set, Insert mode is entered. + The starting flag is reset, has("vim_starting") will now return zero. + The |v:vim_did_enter| variable is set to 1. The |VimEnter| autocommands are executed. + The $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc and/or + gvimrc file. + Some hints on using initializations: Standard setup: *************** *** 943,958 **** *compatible-default* When Vim starts, the 'compatible' option is on. This will be used when Vim ! starts its initializations. But as soon as a user vimrc file is found, or a ! vimrc file in the current directory, or the "VIMINIT" environment variable is ! set, it will be set to 'nocompatible'. This has the side effect of setting or ! resetting other options (see 'compatible'). But only the options that have ! not been set or reset will be changed. This has the same effect like the ! value of 'compatible' had this value when starting Vim. Note that this ! doesn't happen for the system-wide vimrc file nor when Vim was started with ! the |-u| command line argument. It does also happen for gvimrc files. The ! $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc and/or gvimrc ! file. But there is a side effect of setting or resetting 'compatible' at the moment a .vimrc file is found: Mappings are interpreted the moment they are --- 962,990 ---- *compatible-default* When Vim starts, the 'compatible' option is on. This will be used when Vim ! starts its initializations. But as soon as: ! - a user vimrc file is found, or ! - a vimrc file in the current directory, or ! - the "VIMINIT" environment variable is set, or ! - the "-N" command line argument is given, or ! even when no vimrc file exists. ! - the |defaults.vim| script is loaded, or ! - gvimrc file was found, ! then it will be set to 'nocompatible'. ! ! Note that this does NOT happen when a system-wide vimrc file was found. ! ! This has the side effect of setting or resetting other options (see ! 'compatible'). But only the options that have not been set or reset will be ! changed. This has the same effect like the value of 'compatible' had this ! value when starting Vim. ! ! 'compatible is NOT reset, and |defaults.vim| is not loaded: ! - when Vim was started with the |-u| command line argument, especially with ! "-u NONE", or ! - when started with the |-C| command line argument, or ! - when the name of the executable ends in "ex". (This has been done to make ! Vim behave like "ex", when it is started as "ex") But there is a side effect of setting or resetting 'compatible' at the moment a .vimrc file is found: Mappings are interpreted the moment they are *************** *** 960,975 **** mappings depend on a certain value of 'compatible', set or reset it before giving the mapping. ! The above behavior can be overridden in these ways: ! - If the "-N" command line argument is given, 'nocompatible' will be used, ! even when no vimrc file exists. ! - If the "-C" command line argument is given, 'compatible' will be used, even ! when a vimrc file exists. ! - If the "-u {vimrc}" argument is used, 'compatible' will be used. ! - When the name of the executable ends in "ex", then this works like the "-C" ! argument was given: 'compatible' will be used, even when a vimrc file ! exists. This has been done to make Vim behave like "ex", when it is started ! as "ex". Avoiding trojan horses: *trojan-horse* While reading the "vimrc" or the "exrc" file in the current directory, some --- 992,1015 ---- mappings depend on a certain value of 'compatible', set or reset it before giving the mapping. ! *defaults.vim* ! If Vim is started normally and no user vimrc file is found, the ! $VIMRUTIME/defaults.vim script is loaded. This will set 'compatible' off, ! switch on syntax highlighting and a few more things. See the script for ! details. NOTE: this is done since Vim 8.0, not in Vim 7.4. (it was added in ! patch 7.4.2111 to be exact). ! ! This should work well for new Vim users. If you create your own .vimrc, it is ! recommended to add this line somewhere near the top: > ! source $VIMRUNTIME/defaults.vim ! Then Vim works like before you had a .vimrc. Copying $VIMRUNTIME/vimrc_example ! is way to do this. Alternatively, you can copy defaults.vim to your .vimrc ! and modify it. ! ! If you don't like some of the defaults, you can still source defaults.vim and ! revert individual settings. See the defaults.vim file for hints on how to ! revert each item. ! Avoiding trojan horses: *trojan-horse* While reading the "vimrc" or the "exrc" file in the current directory, some *** ../vim-7.4.2110/src/version.c 2016-07-28 22:08:18.682287202 +0200 --- src/version.c 2016-07-28 22:17:04.565351251 +0200 *************** *** 760,761 **** --- 760,763 ---- { /* Add new patch number below this line */ + /**/ + 2111, /**/ -- Men may not be seen publicly in any kind of strapless gown. [real standing law in Florida, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///