mirror of
https://github.com/prurigro/darkcloud-vimconfig.git
synced 2024-11-22 14:44:11 -05:00
Redetect filetype after saving as new name + wrap autocmd with check
This commit is contained in:
parent
479494f636
commit
38819aedae
1 changed files with 18 additions and 10 deletions
|
@ -84,6 +84,7 @@
|
||||||
set timeout timeoutlen=500 "how long before timing out for mappings
|
set timeout timeoutlen=500 "how long before timing out for mappings
|
||||||
set ttimeout ttimeoutlen=100 "how long before timing out for terminal key codes
|
set ttimeout ttimeoutlen=100 "how long before timing out for terminal key codes
|
||||||
|
|
||||||
|
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)
|
||||||
|
@ -97,5 +98,12 @@
|
||||||
autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>'))
|
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
|
||||||
|
endif
|
||||||
"}}}
|
"}}}
|
||||||
"}}}
|
"}}}
|
||||||
|
|
Loading…
Reference in a new issue