vim-projectionist
vim-projectionist copied to clipboard
Projectile detection doesn't include newly-started files
I have a projectile for vim plugins: 'plugin/*.vim|autoload/**/*.vim|addon-info.json'. I also created a template for addon-info.json. The projectile matches any directory that contains an addon-info.json file, but if I create a new directory and run vim newdir/addon-info.json, the projectile doesn't match and the template isn't used.
Projectiles should be triggered when first starting to edit a file that matches the projectile pattern, even if the file hasn't been saved yet.
"Should" is reaaaally presumptuous. You could maybe argue for this under a liberal interpretation of DWIM but I'm not sure I'm convinced.
Yeah, I was going to say "probably should"…
Are there particular cases where you see this going wrong? As it is, the logic for templates is "Use when starting the second and subsequent files in a project." Possibly safer, but it's been causing a lot of bother for me and it's not clear to me that there's any actual downside to changing it.
The proper event would be after writing the file, not after editing it, as that's when it actually becomes a valid project. But this event is tricky to tap into.