X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vimrc;h=04d26cab126f38003c941f6075b028d1ea73397a;hb=a52718a67ac0a600575b992c06804ef6ce76bae5;hp=5c80473dc265cddb6483d8ebe890ff0367ae1fcf;hpb=c2e3de29b62b1208678b7b7cac2aa0474988de02;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 5c80473..04d26ca 100644 --- a/vimrc +++ b/vimrc @@ -4,9 +4,12 @@ " EDITOR SETTINGS " Save 'runtimepath' in case it was changed by the system's configuration -" files. +" files. Also save 'diff' as set all& resets it; but somehow later (after +" sourcing the vimrc - for example in a VimEnter autocmd) it gets +" automagically restored to the correct value. if has('eval') let s:save_runtimepath = &runtimepath + let s:save_diff = &diff endif " Reset all options (except 'term', 'lines' and 'columns'). This makes sure a " system wide configuration file doesn't change default values. @@ -14,7 +17,9 @@ set all& " And restore it after all other options were reset. if has('eval') let &runtimepath = s:save_runtimepath + let &diff = s:save_diff unlet s:save_runtimepath + unlet s:save_diff endif " Make sure Vim (and not Vi) settings are used. @@ -111,10 +116,12 @@ endif set ignorecase set smartcase -" Activate spell checking, use English as default. Don't use spell checking -" when diffing. -if exists('+spell') && has('syntax') && !&diff - set spell +" Activate spell checking, use English as default. +if exists('+spell') && has('syntax') + " But not when diffing as spell checking is distracting in this case. + if !&diff + set spell + endif set spelllang=en_us endif