These are chat archives for Shougo/dein.vim

21st
Apr 2016
Gontran Baerts
@gbcreation
Apr 21 2016 07:48
Thank you. I'm going to test it.
Gontran Baerts
@gbcreation
Apr 21 2016 08:09

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
Apr 21 2016 08:15
Maybe the second argument of findfile()is not correct.
Gontran Baerts
@gbcreation
Apr 21 2016 08:21
Indeed, echo findfile(".projections.json", ".;") displays nothing, but echo findfile(".projections.json", ";")finds the file.

However

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

does not work anyway.

on_ifis only associated to the BufReadevent ?

My mistake, this:

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

does not work if I open a single file and then do :sp.

Wang Shidong
@wsdjeg
Apr 21 2016 12:16
@gbcreation I think on if is slow,for this plugin you should use on_cmd
call dein#add('RomainEndelin/vim-projectionist', {
\ 'on_cmd': 'A',
\ })
you can use a list of commands of vim-projectionist,the plugin is loaded on the first time you run this command
even if you has projections.json in root,but if you do not use this command,I think no need load this plugin
Gontran Baerts
@gbcreation
Apr 21 2016 12:58
@wsdjeg Hi! I don't think on_if is so slow. When I use it to lazy load vim-dimactive, it has no impact on my workflow.
I could indeed use a list of commands to lazy load vim-projectionist, but depending on the project I work on, those commands could be different. For example, I could have :Econtroller for a project, and :Ecomponent for another one. I would not be useful to have to modify my lazy loading setup every time I work on a new project with new projections. Looking for the .projections.json file is a one time setup for all my projects.
Wang Shidong
@wsdjeg
Apr 21 2016 13:25
@gbcreation I know
Shougo
@Shougo
Apr 21 2016 22:27
on_ifis only associated to the BufReadevent ?
Please read the documentation.