aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-09-04 13:28:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2012-09-04 13:28:39 +1200
commit93b6bdf9090cf777c8c8e1d4114851f0856cdd3e (patch)
tree15050f91bc274a15a2e2f9300257e3106cfe8b61 /vim
parentCompatibility checks (diff)
downloaddotfiles-93b6bdf9090cf777c8c8e1d4114851f0856cdd3e.tar.gz
dotfiles-93b6bdf9090cf777c8c8e1d4114851f0856cdd3e.zip
More compatibility updates
Looks like a buffer overflow problem for very old Vim with long backupext strings
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc8
1 files changed, 4 insertions, 4 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 910ce0c2..a463fda0 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -36,14 +36,14 @@ if has("autocmd")
endif
" Backups
-if !strlen($SUDO_USER)
+if !strlen($SUDO_USER) && has("unix")
set backup
set backupext=.bak
set backupdir^=~/.vim/backup//
if !isdirectory($HOME . "/.vim/backup") && exists("*mkdir")
call mkdir($HOME . "/.vim/backup", "p", 0700)
endif
- if has("autocmd")
+ if has("autocmd") && v:version > 700
autocmd BufWritePre * let &backupext = '.' . strftime("%Y-%m-%d_%H:%M:%S") . '.bak'
endif
else
@@ -173,7 +173,7 @@ if has("spell")
endif
" Swaps
-if !strlen($SUDO_USER)
+if !strlen($SUDO_USER) && has("unix")
set swapfile
set directory^=~/.vim/swap//
if !isdirectory($HOME . "/.vim/swap") && exists("*mkdir")
@@ -204,7 +204,7 @@ endif
" Undo
set undolevels=1000
-if !strlen($SUDO_USER) && has("persistent_undo")
+if !strlen($SUDO_USER) && has("unix") && has("persistent_undo")
set undofile
set undodir^=~/.vim/undo//
if !isdirectory($HOME . "/.vim/undo") && exists("*mkdir")