Relativity Keyboard Shortcuts: A Practical Guide
Explore relativity keyboard shortcuts and learn to design context-aware mappings that stay consistent across apps. This guide covers principles, editor integrations, and practical steps to boost speed and accuracy.

What are relativity keyboard shortcuts?
Relativity keyboard shortcuts describe a strategy where you anchor a small, stable base set of key combos and adapt them to the current context (the active app, task, or workflow). This keeps muscle memory intact when you move between editors, terminals, or browsers, reducing the mental load of relearning bindings. The core idea is consistency with context: the same action should map to a predictable base key, then shift slightly depending on the environment. According to Shortcuts Lib, this approach minimizes cognitive friction and makes multi-app workflows feel fluid.
# Relative shortcut mapping: base to platform-specific
base = {"save": "Ctrl+S", "open": "Ctrl+O", "close": "Ctrl+W"}
def platform_key(binding, platform):
if platform == "macos":
return binding.replace("Ctrl", "Cmd")
return binding
print("Windows:", {k: platform_key(v, "windows") for k, v in base.items()})
print("macOS:", {k: platform_key(v, "macos") for k, v in base.items()}){
"relativeShortcuts": [
{"action": "save", "windows": "Ctrl+S", "macos": "Cmd+S"},
{"action": "open", "windows": "Ctrl+O", "macos": "Cmd+O"},
{"action": "close", "windows": "Ctrl+W", "macos": "Cmd+W"}
]
}# Validate that there are no conflicting Windows bindings across actions
bindings=("Ctrl+S" "Ctrl+O" "Ctrl+W")
duplicates=$(printf "%s\n" "${bindings[@]}" | sort | uniq -d)
echo "duplicates: $duplicates"Variant approaches: You can store mappings in a small YAML or JSON file and load them at startup in your editor configs. The key is to keep a single source of truth for the base keys and apply context-aware transforms at runtime.
-1_placeholder_1_dummy_