aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-26 23:57:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-26 23:57:42 +1200
commit1a59433fa33f737264af73a7323ce669fa14a21a (patch)
tree1a7234a87b724ca35708536e0e3bb25e16252c73 /plugin
parentMerge branch 'release/v0.2.0' (diff)
parentBump VERSION (diff)
downloadvim-vimrc-reload-filetype-master.tar.gz
vim-vimrc-reload-filetype-master.zip
Merge branch 'release/v1.0.0'HEADv1.0.0master
* release/v1.0.0: Remove literal message documentation Adjust use of $MYVIMRC and expansion Move code out to autoload
Diffstat (limited to 'plugin')
-rw-r--r--plugin/vimrc_reload_filetype.vim15
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