You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为Emacs.app与Emacsclient.app禁用Karabiner-Elements

针对Emacs.app和Emacsclient.app禁用Karabiner-Elements的方法

可以通过修改Karabiner-Elements的配置文件,让所有按键规则仅在非Emacs类应用中生效,以此实现针对这两个应用禁用Karabiner的效果,具体步骤如下:

  • 打开Karabiner的主配置文件,路径为 ~/.config/karabiner/karabiner.json
  • 找到配置中所有的"rules"条目,给每个规则添加conditions条件(如果规则本身已有conditions,就把以下内容合并进去):
"conditions": [
  {
    "type": "frontmost_application_not",
    "bundle_identifiers": [
      "^org\\.gnu\\.Emacs$",
      "^org\\.gnu\\.Emacsclient$"
    ]
  }
]

这个条件的作用是:只有当前前台应用不是Emacs.app或Emacsclient.app时,对应的Karabiner规则才会执行。当这两个应用处于前台时,所有带该条件的规则都会失效,等同于在这两个应用中完全禁用Karabiner。

  • 验证应用的Bundle ID是否正确(避免匹配错误),可以在终端执行以下命令:

    • 查看Emacs.app的Bundle ID:osascript -e 'id of app "Emacs"'
    • 查看Emacsclient.app的Bundle ID:osascript -e 'id of app "Emacsclient"'
      如果输出和配置中的bundle_identifiers不一致,替换成实际输出的ID即可。
  • 保存配置文件后,Karabiner会自动加载新设置,此时打开Emacs.app或Emacsclient.app,就能正常使用等核心快捷键了。

内容的提问来源于stack exchange,提问作者alper

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 01:07:06