diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-14 10:09:40 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-14 10:09:40 +1300 |
commit | d18c0c237c5fcd7c7d3484eb591cce0a4f8d104b (patch) | |
tree | dc5aaf180d8645b021ca18d22583d034b5aafd31 /vim/plugin/auto_swapdir.vim | |
parent | Merge branch 'release/v0.16.0' (diff) | |
parent | Bump version number to 0.17.0 (diff) | |
download | dotfiles-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_swapdir.vim')
-rw-r--r-- | vim/plugin/auto_swapdir.vim | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vim/plugin/auto_swapdir.vim b/vim/plugin/auto_swapdir.vim index b5f9ce3a..7d5940aa 100644 --- a/vim/plugin/auto_swapdir.vim +++ b/vim/plugin/auto_swapdir.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:swapdir + let s:swapdir \ = strpart(&runtimepath, 0, stridx(&runtimepath, ',')) \ . '/swap' endif @@ -32,12 +32,14 @@ if !isdirectory(expand(s:swapdir)) " 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:swapdir)) - elseif has('win32') || has('win64') - silent! execute '!mkdir ' - \ . shellescape(expand(s:swapdir)) + elseif has('*shellescape') + if has('unix') + silent! execute '!mkdir -m 0700 -p ' + \ . shellescape(expand(s:swapdir)) + elseif has('win32') || has('win64') + silent! execute '!mkdir ' + \ . shellescape(expand(s:swapdir)) + endif endif endif |