Closed dmhenry closed 5 years ago
This looks remarkably like #140. Can you try the updated installation instructions (see the Readme, vim doc, or website) and let us know if that works for you?
Closing as dupe in the meantime. Please re-open if the new instructions don’t solve your problem.
@benknoble Proposed solution 1 from https://github.com/dracula/vim/issues/140#issuecomment-496707448 has no effect:
packadd! dracula
colorscheme dracula
Proposed solution 2 from https://github.com/dracula/vim/issues/140#issuecomment-496707448 does apply the theme, but the very verbose errors are still outputted upon starting Neovim:
au VimEnter * colorscheme dracula
Manually sourcing the autoload file works:
source $HOME/.config/nvim/pack/minpac/start/vim-dracula/autoload/dracula.vim
colorscheme dracula
Alternatively, users of minpac can check out the prior commit alluded to in https://github.com/dracula/vim/issues/140 by adding the following to your init.vim or .vimrc:
call minpac#add('dracula/vim', {'name': 'vim-dracula', 'rev': 'bfbc3cadbd142e74d3b92e63f1de8711261015a4', 'frozen': 1})
The 'rev' entry chooses the commit and the 'frozen' entry will prevent minpac from automatically updating the plugin upon calling minpac#update()
Obviously this isn't a great long-term solution, but it's the solution I have chosen for now.
I copied my previous comment to https://github.com/dracula/vim/issues/140 because I agree this is a duplicate.
Aha! Like vim-plug, you want 'name': 'dracula'
—the autoload discovery mechanism is sensitive to path names.
If that works I'd be surprised. Autoload is sensitive to path names only after the first level of the autoload
directory. So, technically, you should be able to have the plugin in this shape...
├── any-name-i-want
│ ├── autoload
│ │ ├── airline
│ │ │ └── themes
│ │ │ └── dracula.vim
│ │ └── dracula.vim
Because when calling an autoloaded function or variable (say, for example dracula#pallete
), it doesn't care where the autoload is located, only that it is located somewhere in an autoload
directory in your runtimepath
in a file named dracula.vim
.
So some shenanigans are going on with minpac I think.
I reinstalled the plugin with 'name': 'dracula'
using the master branch and the errors persist:
call minpac#add('dracula/vim', {'name': 'dracula'})
Hm never mind then... I seemed to recall something about that from vim-plug issues but I am clearly wrong.
It was worth a shot.
I'm surprised packadd! dracula
doesn't work: you've made sure it's after the minpac
code? Can you check the value of runtimepath
and packpath
before/after the packadd!
call?
Okay, so in process of checking the runtimepath
I stumbled onto another solution. The combination of call minpac#add('dracula/vim', {'name': 'dracula'})
and packadd! dracula
works. When I tried earlier I hadn't manually supplied a name for the plugin, so it defaulted to vim
. Playing around I noticed that any name works so long as the minpac 'name'
matches the packadd!
argument. I think this was what you were suggesting previously, but we hadn't discussed the naming issue at that point.
Continuing the discussion here (no need to clutter 140).
@dmhenry
any name works so long as the minpac
'name'
matches thepackadd!
argument
Doy! This is what I was suggesting, but I didn't realize it. I may have to go check those installation instructions again... glad you found a solution.
@benknoble Well, the packadd
shouldn’t really be necessary, according to minpac’s instructions, unless you install a package as optional, which I did not. In any case, I opted to simply packloadall
after the minpac initialization. I do see from Dracula’s installation instructions that, under vim-plug you suggest installing ’as’: ‘dracula’
, which translates under minpac to ’name’: ‘dracula’
, but I took it to be only cosmetic, i.e., a preference in the directory naming. I didn’t realize the importance because, in my personal experience, the name never mattered with either minpac or vim-plug up to this point. Live and learn. Anyway, thanks for your help.
to make this work i had to do the following
call minpac#add('dracula/vim',{'name': 'dracula'})
packadd! dracula
colorscheme dracula
@rfletchr overall, there is a runtimepath issue (dracula needs to be fully on the rtp prior to colorscheme dracula
). It turns out this is a non-issue for packages users if you put colorscheme dracula
in a plugin/
file :)
@benknoble I don't really have an opinion on this, I just wanted anyone who found this thread to find a clearly stated work around :)
I recently switched from vim-plug to minpac as my plugin manager because minpac is purportedly using the Vim8/Neovim standard directories to manage packages. I get the errors below upon loading
$HOME/.config/nvim/init.vim
(I'm using Neovim 0.3.7). If I directly source${DRACULA_ROOT}/autoload/dracula.vim
everything works fine. Based on the errors below, I tried swapping the locations ofautoload/dracula.vim
withcolors/dracula.vim
and everything works perfectly upon loading Neovim. It seemscolors/dracula.vim
is referring to variables that have yet to be defined because of the source ordering. The errors also happen when I manually install the plugin. I realize it's possible that this is a bug in Neovim if the directories are getting sourced out of order. Assuming that's not the case (I have not tried under Vim 8) then perhaps the plugin doesn't conform to Vim 8's built-in package management? I'm a Vim script newbie, so please forgive the error if I've misdiagnosed the issue.