Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Alexander Jeurissen
    @alexanderjeurissen
      call dein#add('chriskempson/base16-vim', {
            \ 'hook_source': "
            \   colorscheme base16-solarized\n
            \   set background=dark\n
            \"})
    I expect that the colorscheme is applied, but sometimes when i run neovim the default colorscheme is applied.
    If I clear the cache of dein manually using call dein#clear_state() then the next time neovim is run the hook above works as expected, however when I exit that neovim instance and rerun neovim (then I presume dein loads the state because it was previously saved) the hook above isn't executed.
    Alexander Jeurissen
    @alexanderjeurissen
    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 ?
    Shougo
    @Shougo
    @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
    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
    You can call it manually after dein#end().
    Alexander Jeurissen
    @alexanderjeurissen
    but then what is the benefit of hook_source compared to hook_add ?
    Shougo
    @Shougo
    call dein#call_hook('source')
    Alexander Jeurissen
    @alexanderjeurissen
    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
    You should use hook_source for it.
    hook_add is executed when it is added.
    Alexander Jeurissen
    @alexanderjeurissen
    ok that's what I assumed was the case, so then when should I use hook_add ? in what circumstances ?
    Shougo
    @Shougo
    It is for the mapping configurations for lazy loaded plugins.
    Alexander Jeurissen
    @alexanderjeurissen
    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
    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
    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
    yeah thats thing I'm seeing
    Wang Shidong
    @wsdjeg
    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."
    Mike Hartington
    @mhartington
    Wang Shidong
    @wsdjeg
    thanks
    Alexander Jeurissen
    @alexanderjeurissen

    in the documentation the following is stated:

    *dein-options-depends*
            depends        (List or String)
            Specify a list of plugins a plugin depends on.
            List items are '{plugin-name}'.
            Those specified in the list are NOT installed automatically.
            Note: The loading order is not guaranteed in non lazy plugins.

    If depends doesn't install the mentioned plugin handles automatically then what is the use of the depends option ? Just to make sure those plugins are sourced before the plugin with the depends option ?

    Shougo
    @Shougo
    If depends doesn't install the mentioned plugin handles automatically then what is the use of the depends option ?
    If they are not installed, dein will print the error.
    Just to make sure those plugins are sourced before the plugin with the depends option ?
    Yes
    It is the different behavior with neobundle.
    Alexander Jeurissen
    @alexanderjeurissen
    ah ok thanks for clarifying ! I really like dein so far :thumbsup: it's really fast.
    Alexander Jeurissen
    @alexanderjeurissen
    I came across the following problem though when cloning my new dotfiles to another machine of mine (also running osx).
    I get an error with the following dein#add call:
      call dein#add('szw/vim-maximizer', {
            \ 'lazy': 1,
            \ 'on_cmd': 'MaximizerToggle',
            \ 'hook_add': 'nnoremap <silent><leader>wz :MaximizerToggle<CR>'
            \})
    Screen Shot 2016-04-26 at 23.59.01.png
    Shougo
    @Shougo
    You don't have to add lazy.
    Alexander Jeurissen
    @alexanderjeurissen
    Yeah I'm aware of that refactoring that is on my todolist ;)
    do you think that's causing the error ?
    Shougo
    @Shougo
    Please create new issue.