App rules
An app rule makes a key do something different while a particular app is in front, without changing what it does everywhere else.
How rules are matched
Each mapping has a Default action and, optionally, a list of App rules. When you press the chord, Capslock checks the rules from top to bottom against the app in front. The first rule that names that app wins. If none does, the default action runs.
Apps are identified by their exact bundle ID, such as com.apple.Safari. A
rule keeps working if the app is moved or renamed, and it never matches a
different app with a similar name.
Add a rule
From a key:
- Click the key on the Keyboard page, then Edit….
- Under App rules, click Add App Rule.
- Under Applies in, click Add App and choose one or more apps.
- Choose the action to run in those apps, then save.
From the Apps page, click Add Rule…, choose an app, and the mapping editor opens with that app already filled in. To pick an app that is not installed yet, type its bundle ID instead of browsing.
Use the arrows next to a rule to change its order. Every rule must name at least one app.
The Apps page
The Apps page lists every app that has rules, marks the ones that are not installed, and shows each rule. From an app's menu you can add another rule for it or Remove All Rules. Removing all rules for an app is a single change: it is backed up first and can be undone.
In the configuration file
A rule is a bindings entry on the mapping. This one keeps ⇪ N deleting
the previous word with ⌥⌫ everywhere, but sends ⌃W in Terminal and iTerm,
where shells expect it:
Rules the editor cannot display are shown as "Advanced rule (edit in YAML)" and kept unchanged. See Configuration file.