Sublime Forum

How to make keybindings available only in certain projects?

#1

Just wondering how this could be done.

The only thought I have would be to make the command that the keybinding calls check for some effective flag in the project settings (using, eg, view.window().project_data()) and use that as a gate for whether anything happens or not. This seems potentially problematic and clunky to me. Not being familiar with all that’s possible with contexts, projects and other window tricks potentially, I’m wondering if anyone has any better ideas?

0 Likes

#2

I answered something similar a while back

1 Like

#3

Thank you! Very helpful post you’ve got there … I should have dug around more looking for it. Odat’s content on YouTube addresses this in someway too IIRC.

I was aware of that method (used the custom context before) and was hoping there might be a better way. I’ll probably be copying your code examples now though! Thanks again!

0 Likes