These are chat archives for Shougo/dein.vim

24th
Apr 2016
Shougo
@Shougo
Apr 24 2016 01:13
@Shougo on_i is deprecated.but when it will be delete?
Not in the plan. The feature is converted to on_event.
I just replaced hook_source with hook_add and that seems to solve the problem, but I'm not sure why.. Is it because hook_source is cached and not evaluated in load_state ?
        Note: non lazy plugins' |dein-options-hook_source| cannot be
        called.  You must call it by |dein#call_hook()| if needed.
Alexander Jeurissen
@alexanderjeurissen
Apr 24 2016 01:18
Hmm so my previous understanding was that hook_source got called when a plugin is sourced, and hook_add when a dein#add statement is called as in when the plugin is added to the runtime.
how come non lazy plugins their hook_source is not called, is it because it's impossible for denite to determine when they are sourced ?
Shougo
@Shougo
Apr 24 2016 01:19
You can call it manually after dein#end().
Alexander Jeurissen
@alexanderjeurissen
Apr 24 2016 01:20
but then what is the benefit of hook_source compared to hook_add ?
Shougo
@Shougo
Apr 24 2016 01:20
call dein#call_hook('source')
Alexander Jeurissen
@alexanderjeurissen
Apr 24 2016 01:20
should I only use hook_source for actions that require the plugin to be fully loaded and use hook_add for all other cases ?
or are there other benefits of the hook_source ?
Shougo
@Shougo
Apr 24 2016 01:21
You should use hook_source for it.
hook_add is executed when it is added.
Alexander Jeurissen
@alexanderjeurissen
Apr 24 2016 01:22
ok that's what I assumed was the case, so then when should I use hook_add ? in what circumstances ?
Shougo
@Shougo
Apr 24 2016 01:22
It is for the mapping configurations for lazy loaded plugins.
Alexander Jeurissen
@alexanderjeurissen
Apr 24 2016 01:24
but wouldn't the configuration options of lazy loaded plugins benefit more from being loaded when the plugin is sourced ? i.e. hook_source ?
Shougo
@Shougo
Apr 24 2016 01:51
hook_add is the configuration to load it.
My example:
[[plugins]]
repo = 'Shougo/vimfiler.vim'
depends = 'unite.vim
on_map = [['n', '<Plug>']]
on_if = "isdirectory(bufname('%'))"
hook_add = 'nnoremap <silent>   [Space]v   :<C-u>VimFiler -invisible<CR>'
hook_source = 'source ~/.vim/rc/plugins/vimfiler.rc.vim'
The mapping must be defined in hook_add.
Mike Hartington
@mhartington
Apr 24 2016 13:47
anyone getting errors when installing a new plugin? It seems that dein and airline aren't playing nice together
Error detected while processing function airline#check_mode[45]..airline#highlighter#highlight:
line   14:
E716: Key not present in Dictionary: accents, accent)
only seems to happen when you install a new plugin with this
  if dein#check_install()
    call dein#install()
  endif
see line 73
I also use dein with airline together,but if I add new plugin,and restart nvim,the plugin will auto install,after installing ,the nvim will be open ,but I can not see color in statusline,
I need restart neovim
Mike Hartington
@mhartington
Apr 24 2016 14:39
yeah thats thing I'm seeing
Wang Shidong
@wsdjeg
Apr 24 2016 23:37
I have test in vim ,no issue,only happened in neovim
@mhartington I think an issue maybe should be open. "airline lost color after dein check install plugin when neovim startup."