Map Cmd
+Opt
if pressed alone to /
with Karabiner Elements
Install Karabiner Elements
Install following custom complex modification:
{
"title": "Change Cmd_L and Option_L to Slash (/)",
"rules": [
{
"description": "Change Command_L + Option_L (Alt) to slash (/) if pressed at the same time and without any other key.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_option",
"modifiers": {
"mandatory": [
"left_command"
],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"key_code": "slash"
}
],
"to": [
{
"key_code": "left_option",
"modifiers": [
"left_command"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"any"
]
}
},
"to_if_alone": [
{
"key_code": "slash"
}
],
"to": [
{
"key_code": "left_command",
"modifiers": [
"left_option"
]
}
]
}
]
}
]
}
i) Copy json file to the correct location:
$ cp cmd-opt-alone-to-slash.json ~/.config/karabiner/assets/complex_modifications
ii) Import rules from Karabiner-Elements Preferences.
Karabiner-Elements Preferences > Complex Modifications > Rules > Add rule
:h macvim
. I guess Karabiner Elements could help here by mappingCmd
+Alt
if pressed alone to/
.