aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-18 17:02:03 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-18 17:02:03 +1200
commitf7ea56ad907e8f74654268d00f3ba4685b4846fe (patch)
treee4bf2c6836b80fa8fdcfd4d031531943a80b16c6
parentMerge branch 'release/v6.26.0' into develop (diff)
downloaddotfiles-f7ea56ad907e8f74654268d00f3ba4685b4846fe.tar.gz
dotfiles-f7ea56ad907e8f74654268d00f3ba4685b4846fe.zip
Adjust ~/.vimrc 'compatible'/tiny/old Vim handling
-rw-r--r--vim/vimrc.stub.vim23
1 files changed, 12 insertions, 11 deletions
diff --git a/vim/vimrc.stub.vim b/vim/vimrc.stub.vim
index 25ca7cf8..a7136aec 100644
--- a/vim/vimrc.stub.vim
+++ b/vim/vimrc.stub.vim
@@ -1,17 +1,18 @@
-" If POSIXLY_CORRECT is defined in the environment, we'll start with
-" 'compatible' enabled if we're not already doing so
-if exists('$POSIXLY_CORRECT') && !&compatible
- set compatible
-endif
-
-" If we have non-tiny Vim version >=7, source real vimrc; this works because
-" tiny and/or ancient builds of Vim quietly ignore all code in :if blocks
-if v:version >= 700 && !&compatible
+" Check that we're not running in 'compatible' mode, nor that the environment
+" calls for the same, and that we're running Vim v7.0.0 or newer. If it's all
+" clear, we can load the main vimrc file from ~/.vim/vimrc, and then stop
+" sourcing the rest of this file.
+"
+if !&compatible && !exists('$POSIXLY_CORRECT') && v:version >= 700
runtime vimrc
finish
endif
-" Otherwise, prevent an old and/or tiny Vim from using any part of our
-" configuration, because parts of it will break
+" If we get this far, it means we're running a tiny, 'compatible', and/or
+" ancient version of Vim. Force 'compatible' on, remove our user runtime
+" directory, and start vi v3.7 from July 1985. Don't grizzle, just use it.
+" It's good for you, like raisin bran.
+"
+set compatible
set runtimepath-=~/.vim
set runtimepath-=~/.vim/after