vim: use mkdir() function to create tmp dir

master
Guillaume DOTT 2012-11-30 15:38:49 +01:00
parent 39abdf5af5
commit 6588977c34
1 changed files with 9 additions and 21 deletions

View File

@ -82,25 +82,17 @@ set undolevels=150
set undofile set undofile
if filewritable(expand("~/.vim/tmp/undo")) == 2 if !filewritable(expand("~/.vim/tmp/undo"))
set undodir=$HOME/.vim/tmp/undo call mkdir(expand("~/.vim/tmp/undo"), "p")
else
if has("unix") || has("win32unix")
call system("mkdir $HOME/.vim/tmp/undo -p")
set undodir=$HOME/.vim/tmp/undo
endif
endif endif
set undodir=~/.vim/tmp/undo
set backup set backup
if filewritable(expand("~/.vim/tmp/backup")) == 2 if !filewritable(expand("~/.vim/tmp/backup"))
set backupdir=$HOME/.vim/tmp/backup call mkdir(expand("~/.vim/tmp/backup"), "p")
else
if has("unix") || has("win32unix")
call system("mkdir $HOME/.vim/tmp/backup -p")
set backupdir=$HOME/.vim/tmp/backup
endif
endif endif
set backupdir=~/.vim/tmp/backup
let mapleader = "," let mapleader = ","
@ -140,13 +132,9 @@ map <F12> ggVGg?
let g:session_autoload = 'no' let g:session_autoload = 'no'
let g:session_autosave = 'no' let g:session_autosave = 'no'
if filewritable(expand("~/.vim/tmp/sessions")) == 2 let g:session_directory=$HOME."/.vim/tmp/sessions"
let g:session_directory=$HOME."/.vim/tmp/sessions" if !filewritable(expand(g:session_directory))
else call mkdir(expand(g:session_directory), "p")
if has("unix") || has("win32unix")
call system("mkdir $HOME/.vim/tmp/sessions -p")
let g:session_directory=$HOME."/.vim/tmp/sessions"
endif
endif endif