Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Reload plugins.vim when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth committed Oct 16, 2017
1 parent 21ec4b1 commit 3c3c90a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions nvim/autoload/plugins.vim
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
" vi: foldmethod=marker
let s:current_file = expand("<sfile>")

func! plugins#load() abort
" This intentionally call non existing function
silent! call plugins#reload()
if !exists("*plugins#reload")
func! plugins#reload() abort
exec 'source ' . s:current_file

call plugins#spec()
endfunc
call plugins#spec()
endfunc
endif

func! plugins#spec() abort
packadd minpac
Expand Down Expand Up @@ -64,13 +66,11 @@ func! plugins#spec() abort
call minpac#add('romainl/vim-qf')
call minpac#add('romainl/vim-qlist')
" }}}
" Linting {{{
call minpac#add('w0rp/ale')
" }}}
" Utils {{{
call minpac#add('wellle/targets.vim')
call minpac#add('tpope/vim-repeat')
call minpac#add('tpope/vim-unimpaired')
call minpac#add('wakatime/vim-wakatime')
" }}}
endfunc

Expand Down
4 changes: 2 additions & 2 deletions nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let g:loaded_vimballPlugin = 1
" }}}

" Plugins {{{
command! -bar PackUpdate call plugins#load() | call minpac#update()
command! -bar PackClean call plugins#load() | call minpac#clean()
command! -bar PackUpdate call plugins#reload() | call minpac#update()
command! -bar PackClean call plugins#reload() | call minpac#clean()

set packpath^=~/.local/share/nvim
" }}}
Expand Down

0 comments on commit 3c3c90a

Please sign in to comment.