Currently, there are a few triggers to choose when to load a plugin: Instant, Short Delay, Long Delay, Disabled. All of them are time-based.
You could implement more trigger types base on Obsidian provided events after which plugins may lazy-load, similarly to neovim's lazy package manager.
For example, a user could set a plugin to load when a specific file is opened, when any file is opened, when entering edit mode, etc.
Here are some examples of triggers that could be implemented :
AfterPlugin : Load the plugin after another plugin has loaded, useful if multiple plugins are used together or if they depend on another
FileOpened : When any file is opened, if the plugin isn't loaded then load it. Alternatives could include specifying a filetype, directory, tag, regex for the title etc.
FileCreated
FileDeleted
FileMoved
EditStarted : When editing a page
CustomAction : User could specify "groups" that they manually activate with a command. Eg, grouping all the plugins only useful when editing pages could be requested by the user when they need to.
AppReady : Instead of having a "short" delay, request the plugin to load once Obsidian has loaded the editor
etc.
Feature Description
Currently, there are a few triggers to choose when to load a plugin: Instant, Short Delay, Long Delay, Disabled. All of them are time-based.
You could implement more trigger types base on Obsidian provided events after which plugins may lazy-load, similarly to neovim's lazy package manager.
For example, a user could set a plugin to load when a specific file is opened, when any file is opened, when entering edit mode, etc.
Here are some examples of triggers that could be implemented :