aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/reload.vim
blob: 322c44d226a3db64dde0f4f58abe1914d0260d19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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