前言
作为一个Golang程序员和一个伪Vim爱好者。有点烦输入冒号时要多按一个shift。
正文
直接讲教程,照着做就好了。
准备
需要两个工具:
- 搜狗输入法(其他输入法可能也行)
- Karabiner-Elements
步骤
- 搜狗输入法使用来设置使用仅使用
右shift来交换中英文输入(我的机器只有搜狗输入法,自带输入法被我干掉了,想干掉的话参考[原创] 完美删除自带中文输入法,只保留一个第三方输入法。) - 参照Karabiner-Elementsでcolonとsemicolonを入れ替える,看不懂没关系,把下面我贴出来的json,插入
~/.config/karabiner/karabiner.json->profiles->complex_modifications->rules的数组里面即可
{
"description": "Swap colon and semicolon",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "semicolon",
"modifiers": [
"left_shift"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "semicolon",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "semicolon"
}
]
}
]
}
后话
通过以上配置之后,就可以实现交换冒号和分号了。
需要输入分号时,注意额外按左shift,不能按右shift会出问题。