Reputation: 313
Currently I define shortcuts for build variants in my global config. Is there a way to do the same, but using <my-project>.sublime-project
config file?
I tried to define them inside "settings" field - didn't work:
"settings": [
{ "keys": ["ctrl+shift+a"], "command": "build", "args": {"variant": "my_variant"} }
]
Upvotes: 8
Views: 925
Reputation: 102922
I don't think there is a way to define keymaps outside of .sublime-keymap
files, which AFAIK need to be stored under the Packages
hierarchy - for example, in Packages/User/Default (<your OS>).sublime-keymap
, as Sublime ignores keymap files with other names.
However, for what you're trying to do, there is a workaround. The .sublime-project
file supports a "build_systems"
setting:
"build_systems":
[
{
"name": "List",
"cmd": ["ls"]
}
]
By appropriately modifying this on a per-project basis you can enable the Automatic
build system and have your specified one run when you hit CtrlB. More information on build systems is available here.
Upvotes: 3