3

I'm very confused by the documentation in dein. It says:

dein#add({repo}[, {options}])
        Initialize a plugin.
        {repo} is the repository URI or local repository directory
        path.  If {repo} starts with github user name (ex:
        "Shougo/dein.vim"), dein will install github plugins.
        See |dein-options| for what to set in {options}.
        Note: You must call it in |dein#begin()| block.

So it sounds to me like I can just drop in call dein#add('dense-analysis/ale') and the plugin will be installed.

But the dense-analysis/ale plugin I want to use never gets installed and downloaded. I have the following in my .vimrc:

if dein#load_state('~/git_repos/dein')
  call dein#begin('~/git_repos/dein')

  " load plugins
    call dein#add('~/git_repos/dein/repos/github.com/Shougo/dein.vim')
    call dein#add('dense-analysis/ale')
    if !has('nvim')
      call dein#add('roxma/nvim-yarp')
      call dein#add('roxma/vim-hug-neovim-rpc')
    endif

  call dein#end()
  call dein#save_state()
endif
8
  • Did you run :call dein#install() after opening Vim with this vimrc?
    – filbranden
    Jun 13, 2020 at 17:31
  • No, but the documentation doesn't say anything about doing that. That's what I'm trying to get clarification on. The documentation says dein#add is all you need to do. So I don't know if I have something misconfigured or what.
    – StevieD
    Jun 13, 2020 at 17:33
  • See step 3 here: github.com/Shougo/dein.vim/blob/master/README.md#quick-start
    – filbranden
    Jun 13, 2020 at 17:38
  • 1
    BTW, I'd recommend using vim-plug as a plug-in manager. It has same performance features of dein, but it has commands and an "UI" which makes it easier and more obvious to use. You're also more likely to find instructions on how to install specific plug-ins on vim-plug (rarely I see instructions for dein). And if instructions are available for Vundle only, it's trivial to adapt them for vim-plug (just use Plug instead of the Vundle command.)
    – filbranden
    Jun 13, 2020 at 17:44
  • Yeah, I have used Plug in the past before I really knew what I was doing. Then I went to pathogen. Then I tried the new vim8 plugin manager. Now I'm trying dein. I may go back to Plug now as I know what lazy loading is. Thanks. The vim ecosystem is insane.
    – StevieD
    Jun 13, 2020 at 17:51

1 Answer 1

3

You need to call the "install" function after you open Vim with the vimrc including the dein configuration:

:call dein#install()

See step 3 in the "Quick Start" part of dein's README:

  1. Open vim and install dein
:call dein#install()
4
  • OK, I think the documentation definitely needs some work, then. Because it clearly says the #add function will "install github plugins."
    – StevieD
    Jun 13, 2020 at 17:43
  • The section of the README addresses how to install the dein plugin, not other plugins.
    – StevieD
    Jun 13, 2020 at 17:44
  • @StevieD See above... My recommendation is to use vim-plug instead. It's fully featured yet easy to use.
    – filbranden
    Jun 13, 2020 at 17:45
  • @StevieD Yeah even that part is ambiguous, looking at the source code it's clear that dein#install() will install the plug-ins too. In fact, you can pass it an optional argument with a list of plug-ins to install (in case you want to install a subset only.)
    – filbranden
    Jun 13, 2020 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.