diff options
Diffstat (limited to 'vim/autoload/reload.vim')
-rw-r--r-- | vim/autoload/reload.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vim/autoload/reload.vim b/vim/autoload/reload.vim new file mode 100644 index 00000000..322c44d2 --- /dev/null +++ b/vim/autoload/reload.vim @@ -0,0 +1,16 @@ +" Re-run filetype detection, if it's run before +function! reload#FileType() abort + if exists('g:did_load_filetypes') + doautocmd filetypedetect BufRead + endif +endfunction + +" Re-read .vimrc file, reloading filetypes afterwards to avoid masking +" filetype plugin settings +" +function! reload#Vimrc() abort + noautocmd source $MYVIMRC + call reload#FileType() + redraw + echomsg fnamemodify($MYVIMRC, ':p:~').' reloaded' +endfunction |