Added function check to MakeNewDir to avoid complaints when reloading

settings.vim, and played with key timeout settings to see if I can fix
a strange error where the arrow keys suddenly stop working.
This commit is contained in:
Kevin MacMartin 2014-07-24 00:51:58 -04:00
parent 855bede1d7
commit 5f64be2ad0

View file

@ -82,18 +82,21 @@
set whichwrap=b,s,<,>,[,] "scrolling left/right off current line wraps to the next/previous set whichwrap=b,s,<,>,[,] "scrolling left/right off current line wraps to the next/previous
set smarttab expandtab autoindent tabstop=4 shiftwidth=4 "configure tabs set smarttab expandtab autoindent tabstop=4 shiftwidth=4 "configure tabs
set hlsearch incsearch ignorecase smartcase "configure how search behaves set hlsearch incsearch ignorecase smartcase "configure how search behaves
set timeoutlen=500 ttimeoutlen=0 "shorten the timeout length of escapes set timeout timeoutlen=1000 "how long before timing out for mappings
set ttimeout ttimeoutlen=100 "how long before timing out for terminal key codes
"enable the auto-creation of missing folders in a save path "enable the auto-creation of missing folders in a save path
function s:MakeNewDir(fullpath, buf) if !exists('*s:MakeNewDir')
if empty(getbufvar(a:buf,'&buftype')) && a:fullpath!~#'\v^\w+\:\/' function s:MakeNewDir(fullpath, buf)
let dirpath=fnamemodify(a:fullpath,':h') if empty(getbufvar(a:buf,'&buftype')) && a:fullpath!~#'\v^\w+\:\/'
if !isdirectory(dirpath)|call mkdir(dirpath,'p')|endif let dirpath=fnamemodify(a:fullpath,':h')
endif if !isdirectory(dirpath)|call mkdir(dirpath,'p')|endif
endfunction endif
augroup WriteDir endfunction
autocmd! augroup WriteDir
autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>')) autocmd!
augroup END autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>'))
augroup END
endif
"}}} "}}}
"}}} "}}}