aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/auto_backupdir.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-14 10:09:40 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-14 10:09:40 +1300
commitd18c0c237c5fcd7c7d3484eb591cce0a4f8d104b (patch)
treedc5aaf180d8645b021ca18d22583d034b5aafd31 /vim/plugin/auto_backupdir.vim
parentMerge branch 'release/v0.16.0' (diff)
parentBump version number to 0.17.0 (diff)
downloaddotfiles-0.17.0.tar.gz (sig)
dotfiles-0.17.0.zip
Merge branch 'release/v0.17.0'v0.17.0
* release/v0.17.0: Bump version number to 0.17.0 Move mapleader settings before .vimrc conf source Strip trailing whitespace Check for shellescape() function before using it Force muttrc filetype from ftdetect rules
Diffstat (limited to 'vim/plugin/auto_backupdir.vim')
-rw-r--r--vim/plugin/auto_backupdir.vim16
1 files changed, 9 insertions, 7 deletions
diff --git a/vim/plugin/auto_backupdir.vim b/vim/plugin/auto_backupdir.vim
index d15c3150..17a1a646 100644
--- a/vim/plugin/auto_backupdir.vim
+++ b/vim/plugin/auto_backupdir.vim
@@ -18,7 +18,7 @@ else
" This is imperfect in that it will break if you have a backslashed comma in
" the first component of your &runtimepath, but if you're doing that, you
" probably already have way bigger problems
- let s:backupdir
+ let s:backupdir
\ = strpart(&runtimepath, 0, stridx(&runtimepath, ','))
\ . '/backup'
endif
@@ -32,12 +32,14 @@ if !isdirectory(expand(s:backupdir))
" Failing that, use an OS-dependent command
" (Fortunately, Unix and Windows are the only OS types in the world)
- elseif has('unix')
- silent! execute '!mkdir -m 0700 -p '
- \ . shellescape(expand(s:backupdir))
- elseif has('win32') || has('win64')
- silent! execute '!mkdir '
- \ . shellescape(expand(s:backupdir))
+ elseif has('*shellescape')
+ if has('unix')
+ silent! execute '!mkdir -m 0700 -p '
+ \ . shellescape(expand(s:backupdir))
+ elseif has('win32') || has('win64')
+ silent! execute '!mkdir '
+ \ . shellescape(expand(s:backupdir))
+ endif
endif
endif