Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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?
    No.
    Why do you recommend on_ifor DelimitMate ? For performance reasons ?
    It is the implementation reason.
    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.
    Shougo
    @Shougo
    I will fix it.
    Gontran Baerts
    @gbcreation

    We can't use VimL variables in TOML files, can we ?
    I mean, can we do that:

    let s:currentScriptDir=fnamemodify(expand('<sfile>'), ':h')
    call dein#add('vim-airline/vim-airline', {
    \    'hook_add': 'source '.s:currentScriptDir.'/plugins/vim-airline.vim'
    \ })

    with TOML file:

    [[plugins]]
    repo = 'vim-airline/vim-airline'
    hook_add = 'source '.s:currentScriptDir.'/plugins/vim-airline.vim'

    ?

    Wang Shidong
    @wsdjeg
    @gbcreation have you read Shougo's dotfiles?
    also you can have a look at mine
    Gontran Baerts
    @gbcreation
    yes I did. You are not using TOML files, are you? Shougo does, but I have not seen usage of external Vim variables in his TOML files. I guess it is not possible. Do you think it could be interesting to have this feature?
    Wang Shidong
    @wsdjeg
    sorry I do not use toml,I use *.vim file,I do not see any advantage of toml
    Shougo
    @Shougo
    @gbcreation
    hook_add = "execute 'source '.s:currentScriptDir.'/plugins/vim-airline.vim'"
    is correct.
    TOML cannot use s:currentScriptDir, so it should be global variable.
    hook_add = "execute 'source '.g:currentScriptDir.'/plugins/vim-airline.vim'"
    Gontran Baerts
    @gbcreation
    @Shougo Thank you for the tip. I think it should be added to the help file of dein.
    Gontran Baerts
    @gbcreation
    Very nice the dein source for Unite :smile:
    Shougo
    @Shougo
    I have added on_if feature.
    Gontran Baerts
    @gbcreation
    Thank you. I'm going to test it.
    Gontran Baerts
    @gbcreation

    So, it works perfectly for this:

    call dein#add( 'blueyed/vim-diminactive', {
    \   'on_if': 'winnr("$") > 1'
    \ })

    The plugin is loaded as soon as I have two windows.

    It also works for this:

    call dein#add('mhinz/vim-signify', {
    \    'on_if': 'finddir(".hg", ".;") != ""'
    \ })

    The plugin is loaded when I open a file controlled by Mercurial

    But it does not work for this:

    call dein#add('RomainEndelin/vim-projectionist', {
    \    'on_if': 'findfile(".projections.json", ".;") != ""',
    \ })

    when I only launch Nvim without a filename on the command line.

    I would like to just launch Nvim without opening a file, then execute :Econtroller loginto open the file containing the Login controller class, for example.
    Gontran Baerts
    @gbcreation
    Maybe the second argument of findfile()is not correct.