Shougo / dein.vim

:zap: Dark powered Vim/Neovim plugin manager
MIT License
3.42k stars 197 forks source link

Equivalent of vim-plug do post-install step for fruzzy #374

Closed gotgenes closed 4 years ago

gotgenes commented 4 years ago

I'm trying to understand with dein how to do the equivalent of vim-plug's do for installing fruzzy with the native module. In the installation instructions, for vim-plug, the user should put the following

Plug 'raghur/fruzzy', {'do': { -> fruzzy#install()}}

I feel like there must be an equivalent using dein's hooks, but I haven't figured it out. I first tried

call dein#add('raghur/fruzzy', {'hook_post_update': fruzzy#install})

this led to the error

E121: Undefined variable: fruzzy#install                                                                                
E116: Invalid arguments for function dein#add  

I then tried

call dein#add('raghur/fruzzy', {'hook_post_update': 'fruzzy#install'})

but this resulted in the error

[dein] Error occurred while executing hook: fruzzy
[dein] Vim:E492: Not an editor command: fruzzy#install

I also tried

call dein#add('raghur/fruzzy', {'hook_post_update': 'fruzzy#install()'})

which resulted in the error

[dein] Error occurred while executing hook: fruzzy
[dein] Vim:E492: Not an editor command: fruzzy#install()

I then tried

call dein#add('raghur/fruzzy', {'hook_post_update': 'call fruzzy#install()'})

which led to the error

[dein] Error occurred while executing hook: fruzzy                                                                      
[dein] Vim(call):E117: Unknown function: fruzzy#install  

All of these were using a fresh cache — removing call dein#add('raghur/fruzzy', …) from the init.vim, quitting, starting Neovim, calling call dein#recache_runtimepath(), adding back the next attempt of call dein#add(…, quitting Neovim, and starting Neovim again.

Maybe I'm using the wrong hook, or maybe I'm using the hook incorrectly. I'm trying hard to understand dein better. I appreciate any help.

gotgenes commented 4 years ago

I found this comment in raghur/fruzzy#11, and a reply from @Shougo which indicates hook_post_update is the intended hook to be used, and the last form of

call dein#add('raghur/fruzzy', {'hook_post_update': 'call fruzzy#install()'})

is intended to work, but it does not, for a completely new cache.

Shougo commented 4 years ago

It works for me. And you don't understand that is intended to work, but it does not, for a completely new cache.

You need to explain it more clearly with reproduce instruction.

I will close it.

Note: To work hook_post_update, fruzzy must be installed or updated.

All of these were using a fresh cache — removing call dein#add('raghur/fruzzy', …) from the init.vim, quitting, starting Neovim, calling call dein#recache_runtimepath(), adding back the next attempt of call dein#add(…, quitting Neovim, and starting Neovim again.

I don't understand.

Shougo commented 4 years ago

Maybe I'm using the wrong hook, or maybe I'm using the hook incorrectly. I'm trying hard to understand dein better. I appreciate any help.

Yes. You seems dein's usage is wrong. But you don't upload the minimal vimrc. So I cannot help you. We have not ESP skills. Please read other issues.

Shougo commented 4 years ago

call dein#add('raghur/fruzzy', {'hook_post_update': 'call fruzzy#install()'})

It should work. If it does not work, it may be bug. But your description is not understand-able.

Shougo commented 4 years ago

Please compare the issue and your issue. https://github.com/Shougo/dein.vim/issues/373

Which issue is better to understand??

gotgenes commented 4 years ago

Now that I know this is a bug in dein, I have filed #375.

Thanks.