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
StevieD
  • 1,492
  • 1
  • 16
  • 24
  • Did you run :call dein#install() after opening Vim with this vimrc? – filbranden Jun 13 '20 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 '20 at 17:33
  • See step 3 here: https://github.com/Shougo/dein.vim/blob/master/README.md#quick-start – filbranden Jun 13 '20 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 '20 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 '20 at 17:51
  • Yeah I saw your other posts on trying to load plug-ins conditionally... My first advice there is: don't worry about that! Most plug-ins use ftplugin or autoload which means their code only loads when actually used (so they won't delay your startup.) And if you do need to load some conditionally, vim-plug has 'for' and 'on' features to configure that correctly and load them only when needed... – filbranden Jun 13 '20 at 17:56
  • Well, I've got an insane amount of plugins. I recently started playing with rails/ruby and there was a full 1 or 2 second delay before the file loaded. Probably a bad config on my part. But I decided that I'm going to retool everything to try to steamline things as efficiently as I can. – StevieD Jun 13 '20 at 18:00
  • The problem is optimizing without knowing where the bottleneck really is... Then you're just doing random changes and hoping one of them works. See :help slow-start and :help profiling to help you understand where the problem really is. – filbranden Jun 13 '20 at 18:30

1 Answers1

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()
filbranden
  • 28,785
  • 3
  • 26
  • 71
  • OK, I think the documentation definitely needs some work, then. Because it clearly says the #add function will "install github plugins." – StevieD Jun 13 '20 at 17:43
  • The section of the README addresses how to install the dein plugin, not other plugins. – StevieD Jun 13 '20 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 '20 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 '20 at 17:53