Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Wang Shidong
    @wsdjeg
    @gbcreation yes,I know,so it has been fixed,nice to hear
    Gontran Baerts
    @gbcreation
    Or does the script finish at line 3 ?
    Shougo
    @Shougo
    OK.
    I get it.
    You must specify the .vimrc file in dein#begin() 2nd argument.
    call dein#begin(s:plugins_dir, [s:pluginList]) just detect plugin list changes.
    Please read it.
    Gontran Baerts
    @gbcreation
    ok, i anderstand
    Shougo
    @Shougo
    call dein#begin(s:path, [expand('<sfile>')]
          \ + split(glob('~/.vim/rc/*.toml'), '\n'))
    This is my config. You should use expand('<sfile>')
    Gontran Baerts
    @gbcreation
    Yes, I see
    Thank you very much :)
    So I have to call dein#clear_state() manually after doing this change ?
    Shougo
    @Shougo
    You need call this one time.
    Gontran Baerts
    @gbcreation
    I use the blueyed/vim-diminactive plugin. I would like to lazy load it only the first time I split the window. What kind of event should I use ?
    Shougo
    @Shougo
    It seems enabled by DimInactive commands
    call dein#add('blueyed/vim-diminactive', {'lazy': 1})
    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