mirror of
https://github.com/prurigro/darkcloud-vimconfig.git
synced 2024-11-26 00:01:27 -05:00
Don't both checking for autocmd
This commit is contained in:
parent
5343c44763
commit
676378ca45
1 changed files with 17 additions and 19 deletions
|
@ -110,32 +110,30 @@
|
||||||
set directory=$HOME/.vim/swap,.,/var/tmp,/tmp
|
set directory=$HOME/.vim/swap,.,/var/tmp,/tmp
|
||||||
|
|
||||||
"FUNCTIONS: {{{
|
"FUNCTIONS: {{{
|
||||||
if has('autocmd')
|
"enable the auto-creation of missing folders in a save path
|
||||||
"enable the auto-creation of missing folders in a save path
|
if !exists('*s:MakeNewDir')
|
||||||
if !exists('*s:MakeNewDir')
|
function s:MakeNewDir(fullpath, buf)
|
||||||
function s:MakeNewDir(fullpath, buf)
|
if empty(getbufvar(a:buf,'&buftype')) && a:fullpath!~#'\v^\w+\:\/'
|
||||||
if empty(getbufvar(a:buf,'&buftype')) && a:fullpath!~#'\v^\w+\:\/'
|
let dirpath = fnamemodify(a:fullpath,':h')
|
||||||
let dirpath = fnamemodify(a:fullpath,':h')
|
|
||||||
|
|
||||||
if !isdirectory(dirpath)
|
if !isdirectory(dirpath)
|
||||||
call mkdir(dirpath,'p')
|
call mkdir(dirpath,'p')
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
augroup WriteDir
|
augroup WriteDir
|
||||||
autocmd!
|
|
||||||
autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>'))
|
|
||||||
augroup END
|
|
||||||
endif
|
|
||||||
|
|
||||||
"update the current filetype when a file is renamed
|
|
||||||
augroup RenameCheckFiletype
|
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufFilePost * filetype detect
|
autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>'))
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
"update the current filetype when a file is renamed
|
||||||
|
augroup RenameCheckFiletype
|
||||||
|
autocmd!
|
||||||
|
autocmd BufFilePost * filetype detect
|
||||||
|
augroup END
|
||||||
|
|
||||||
"functions to create a split using 33% and 66% of the height
|
"functions to create a split using 33% and 66% of the height
|
||||||
function s:SPResize33()
|
function s:SPResize33()
|
||||||
sp|wincmd =|q
|
sp|wincmd =|q
|
||||||
|
|
Loading…
Reference in a new issue