Slash commands plugin feature request

Please add a configuration option for slash commands module to trigger only at the beginning of a line.

It seems to me that this would be a simple change to the plugin looking for the start of line regex “^/“ as the trigger for slash commands. This would have the benefit of not triggering a slash pulldown menu in the middle of a sentence.

Thanks!

2 Likes

+1. I think it’s Logseq that offers an option in the settings to require two consecutive slashes to trigger the command menu - this worked well for me and could be another way to go here.

1 Like

It really bothers me too. I don’t know how to hack the core plugin, so I’m trying to make a simple plugin to do this: obsidian-slash-commander

I’m still working on it. For now, you can

  • trigger slash commands only at the beginning of a line or after any whitespace
  • add commands to the slash command list

Nice work!

Another (potentially fragile?) approach to address this feature request via a plugin would be to patch app.internalPlugins.plugins['slash-command'].instance.suggest.constructor.prototype.onTrigger using a tool like monkey-around.

But your plugin seems to have much more nice features, not limited to fixing this problem!