Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Shougo
    @Shougo
    works.
    It is enabled by DimInactive... commands. But you cannot complete the command names.
    If you want to complete them, you need to specify the commands by on_cmd.
    Gontran Baerts
    @gbcreation
    Actually, I don't use DimInactive... commands. The plugin is enabled as soon as it is loaded.
    s:setup() is called at the end of the plugin script
    Shougo
    @Shougo
    I think you should use 'path': '.*'
    The plugin is loaded after you opened a file.
    Gontran Baerts
    @gbcreation
    This is not exactly what I would like to have. I don't need this plugin when I open a file, but only if I have more than one window.
    Shougo
    @Shougo
    Dein has not the loading feature.
    Gontran Baerts
    @gbcreation
    ok
    Shougo
    @Shougo
    It is really special case. So, you should use manual loading.
    dein#source(name)
    You can define the autocmd checks the winnr('$') and load it.
    Gontran Baerts
    @gbcreation
    ok, I will try that, thank you.
    I would like to lazy load the vim-signify plugin only if I open a file which is in VCS. Is it possible to detect for example a .git folder in the ancestor directories ?
    Shougo
    @Shougo
    Of course no.
    You should check it manually.
    :help finddir()
    Gontran Baerts
    @gbcreation
    Wouldn't it be interesting to add an event on_file_open to Dein which executes code returning true/false to indicate if the plugin should be loaded ?
    Shougo
    @Shougo
    Hm
    Gontran Baerts
    @gbcreation
    This event name is just an example, but you got the idea :)
    It would be helpful for the two last cases I talked about
    Gontran Baerts
    @gbcreation
    or maybe something more generic to eval some code returning true/false for given events like BufEnter, WinEnter, etc
    it would be like the existing on_idle but would allow to use other events
    Gontran Baerts
    @gbcreation
    for example:
    dein#add('blueyed/vim-diminactive', {
    \    'on_event': { 'WinEnter': 'winnr("$") > 1' }
    \ })
    Gontran Baerts
    @gbcreation
    What do you think about this feature ?
    Shougo
    @Shougo
    on_thinking
    Gontran Baerts
    @gbcreation
    Some other examples that could be useful (not sure they would work)
    # Load Projectionist if a .projections.json file is found in ancestor directories of the edited file
    dein#add('tpope/vim-projectionist', {
    \    'on_event': { 'VimEnter': 'findfile(".projections.json", ".;") != ""' }
    \ })
    # Load Signify if a .git directory is found in ancestor directories of the edited file
    dein#add('mhinz/vim-signify', {
    \    'on_event': { 'BufRead': 'finddir(".git", ".;") != ""' }
    \ })
    # Load DelimitMate when typing a matchpairs character
    dein#add('Raimondi/delimitMate', {
    \    'on_event': { 'InsertCharPre': 'index(split(&matchpairs, "[:,]"), v:char) != -1' }
    \ })
    Shougo
    @Shougo
    For delimitMate, you should use on_i instead.
    Wang Shidong
    @wsdjeg
    @gbcreation nice feature!
    Shougo
    @Shougo
    I will add the feature.
    Wang Shidong
    @wsdjeg
    thanks
    Gontran Baerts
    @gbcreation
    @wsdjeg Thank you
    @Shougo Good news :smile: Thank you very much
    Why do you recommend on_ifor DelimitMate ? For performance reasons ?
    Gontran Baerts
    @gbcreation
    @Shougo Just to know, do you plan to deprecate on_iand on_idleafter implementing on_event?
    Gontran Baerts
    @gbcreation
    hook_sourcedoes not work for non-lazy plugins ?
    Wang Shidong
    @wsdjeg
    yes,you need call manually
    it has beed wrote in doc
    Gontran Baerts
    @gbcreation
    Indeed, I just saw it
    but it is in the dein-options-hook_post_update section
    Wang Shidong
    @wsdjeg
    the doc updated? last time I read it is 15days ago
    Gontran Baerts
    @gbcreation
    yes
    Gontran Baerts
    @gbcreation
    I misanderstood. In fact, it is not clear that the three last paragraghs of the HOOKS section concern all kinds of hooks. I thought they were included in the dein-options-hook_post_update section because they have the same indent
    I think the Note about non lazy plugins' dein-options-hook_source would be better placed in the dein-options-hook_source section
    Same thing about the last Note: it should be moved to the dein-options-hook_post_source section.
    Gontran Baerts
    @gbcreation
    Is it possible to lazy load plugins that define text objects ?
    Which kind of event can be used ?
    Gontran Baerts
    @gbcreation
    Don't mind, just found I can use on_map
    Shougo
    @Shougo
    @Shougo Just to know, do you plan to deprecate on_iand on_idleafter implementing on_event?