diff options
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/vimrc_reload_filetype.vim | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/plugin/vimrc_reload_filetype.vim b/plugin/vimrc_reload_filetype.vim index 34ff8d7..de23a8b 100644 --- a/plugin/vimrc_reload_filetype.vim +++ b/plugin/vimrc_reload_filetype.vim @@ -9,23 +9,14 @@ if exists('loaded_vimrc_reload_filetype') || &compatible finish endif -if !has('autocmd') || !exists('##SourceCmd') +if !exists('##SourceCmd') finish endif let loaded_vimrc_reload_filetype = 1 -" Wrapper function reloads .vimrc and filetypes -function! s:Reload() abort - source <afile> - if exists('#filetypedetect#BufRead') - doautocmd filetypedetect BufRead - endif - redraw - echomsg 'Reloaded vimrc: '.expand('<afile>') -endfunction - " This SourceCmd intercepts :source for .vimrc augroup vimrc_reload_filetype autocmd! - autocmd SourceCmd $MYVIMRC call s:Reload() + autocmd SourceCmd $MYVIMRC + \ call vimrc_reload_filetype#Reload() augroup END |