在 Karabiner 规则(https://pqrs.org/osx/karabiner/complex_modifications/)上,有规则Exchange paren and square bracket
但没有规则Exchange square bracket and curly braket
。
[Q]方括号和大括号如何通过Karabiner
或其他方式交换?
想换货:
[
=>{
和{
=>[
]
=>}
和}
=>]
在 Karabiner 规则(https://pqrs.org/osx/karabiner/complex_modifications/)上,有规则Exchange paren and square bracket
但没有规则Exchange square bracket and curly braket
。
[Q]方括号和大括号如何通过Karabiner
或其他方式交换?
想换货:
[
=>{
和{
=>[
]
=>}
和}
=>]
这段代码对我有用
{
"description": "Swap {} and []",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket"
},
"to": [
{
"modifiers": ["left_shift"],
"key_code": "open_bracket"
}
]
},
{
"type": "basic",
"from": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": ["left_shift"]
}
},
"to": [
{
"key_code": "open_bracket"
}
]
},
{
"type": "basic",
"from": {
"key_code": "close_bracket"
},
"to": [
{
"modifiers": ["left_shift"],
"key_code": "close_bracket"
}
]
},
{
"type": "basic",
"from": {
"key_code": "close_bracket",
"modifiers": {
"mandatory": ["left_shift"]
}
},
"to": [
{
"key_code": "close_bracket"
}
]
}
]
}
编辑:现在也在复杂的 mod 列表中https://pqrs.org/osx/karabiner/complex_modifications/#exchange_square_brackets_and_curly_brackets