k-takata/minpac

[E116} Error running PackUpdate

Th3Whit3Wolf opened this issue · 2 comments

I get an error when running :PackUpdate

Error detected while processing function PackInit:
line   38:                                                            
E116: Invalid arguments for function minpac#add
Press ENTER or type command to continue
if &runtimepath !~# '/minipac.vim'
	let s:minipac_dir = expand('$VARPATH/pack').'/minpac/opt/minpac'
	if ! isdirectory(s:minipac_dir)
		execute '!git clone https://github.com/k-takata/minpac' s:minipac_dir
        execute 'curl -fLo ~/.vim/autoload/plugpac.vim --create-dirs https://raw.githubusercontent.com/bennyyip/plugpac.vim/master/plugpac.vim'
    endif

	execute 'set runtimepath+='.substitute(
		\ fnamemodify(s:minipac_dir, ':p') , '/$', '', '')
    
endif
set packpath^=~/.cache/vim/

function! PackInit() abort
	packadd minpac
	call minpac#init()
	call minpac#add('k-takata/minpac', {'type': 'opt'})
	call minpac#add('liuchengxu/space-vim-dark')
	call minpac#add('lambdalisue/gina.vim')
	call minpac#add('taigacute/spaceline.vim')
	call minpac#add('ryanoasis/vim-devicons')
	call minpac#add('tyru/open-browser.vim')
	call minpac#add('neoclide/coc.nvim', {'branch': 'release'})
	call minpac#add('neoclide/coc-git')
	call minpac#add('neoclide/coc-pairs')
	call minpac#add('neoclide/coc-snippets')
	call minpac#add('neoclide/coc-yank')
	call minpac#add('honza/vim-snippets')
	call minpac#add('SirVer/ultisnips')
	call minpac#add('w0rp/ale')
	call minpac#add('sheerun/vim-polyglot')
	call minpac#add('junegunn/goyo.vim')
	call minpac#add('junegunn/limelight.vim')
	call minpac#add('ludovicchabant/vim-gutentags')

	"Loaded only for specific filetypes on demand. Requires autocommands below.
	" call minpac#add('oknozor/illumination', { 'dir': '~/.illumination', 'do': './install.sh' })
	call minpac#add('neoclide/coc-tsserver', {'type': 'opt'})
	call minpac#add('neoclide/coc-html', {'type': 'opt'})
	call minpac#add('neoclide/coc-json', {'type': 'opt'})
	call minpac#add('neoclide/coc-css', {'type': 'opt'})
	call minpac#add('neoclide/coc-vetur', {'type': 'opt'})
	call minpac#add('fannheyward/coc-rust-analyzer', {'type': 'opt'})
	call minpac#add('neoclide/coc-yaml', {'type': 'opt'})
	call minpac#add('neoclide/coc-python', {'type': 'opt'})
	call minpac#add('neoclide/coc-highlight', {'type': 'opt'})
	call minpac#add('neoclide/coc-emmet', {'type': 'opt'})
	call minpac#add('fannheyward/coc-markdownlint', {'type': 'opt'})
	call minpac#add('iamcco/coc-flutter', {'type': 'opt'})
	call minpac#add('fannheyward/coc-texlab', {'type': 'opt'})
	call minpac#add('neoclide/coc-r-lsp', {'type': 'opt'})
	call minpac#add('neoclide/coc-solargraph', 'type': 'opt' })
	call minpac#add('marlonfan/coc-phpls', 'type': 'opt' })
	call minpac#add('fatih/vim-go', { 'do': ':GoInstallBinaries', 'type': 'opt' })
	call minpac#add('xuhdev/vim-latex-live-preview', 'type': 'opt' })
	call minpac#add('pgdouyon/vim-accio', 'type': 'opt' })
	call minpac#add('vmchale/ion-vim', 'type': 'opt' })
endfunction
function! PackList(...)
  call PackInit()
  return join(sort(keys(minpac#getpluglist())), "\n")
endfunction

command! -nargs=1 -complete=custom,PackList
      \ PackOpenUrl call PackInit() | call openbrowser#open(
      \    minpac#getpluginfo(<q-args>).url)

command! -nargs=1 -complete=custom,PackList
      \ PackOpenDir call PackInit() | call term_start(&shell,
      \    {'cwd': minpac#getpluginfo(<q-args>).dir,
      \     'term_finish': 'close'})

" Define user commands for updating/cleaning the plugins.
" Each of them loads minpac, reloads .vimrc to register the
" information of plugins, then performs the task.
command! PackUpdate call PackInit() | call minpac#update('', {'do': 'call minpac#status()'})
command! PackClean  call PackInit() | call minpac#clean()
command! PackStatus call PackInit() | call minpac#status()

"Load plugins only for specific filetype
augroup packager_filetype
  autocmd!
  autocmd FileType go 			packadd vim-go
  autocmd FileType rs 			packadd coc-rust-analyzer
  autocmd FileType python 		packadd coc-python
  autocmd FileType css			packadd coc-css
  autocmd FileType sass,scss 	packadd coc-css
  autocmd FileType less			packadd vim-less, coc-css
  autocmd FileType latex		packadd vim-latex-live-preview,coc-texlab
  autocmd FileType php			packadd coc-phpls
  autocmd FileType ion 			packadd ion-vim
  autocmd FileType ruby			packadd coc-solargraph
  autocmd FileType r			packadd coc-r-lsp
  autocmd FileType c, cpp, java, sh, python		packadd vim-accio
augroup END

As far as I cant tell everything has been set up correctly

When I remove all of the plugins that have 'type': 'opt' the error goes away.

As the error message says, line 38 in PackInit() has an error:

	call minpac#add('neoclide/coc-solargraph', 'type': 'opt' })
	                                          ^ '{' is missing 

Also the following lines have the same mistakes:

	call minpac#add('marlonfan/coc-phpls', 'type': 'opt' })

	call minpac#add('xuhdev/vim-latex-live-preview', 'type': 'opt' })
	call minpac#add('pgdouyon/vim-accio', 'type': 'opt' })
	call minpac#add('vmchale/ion-vim', 'type': 'opt' })