如何修改 IntelliJ 的 Emacs 键盘映射中的控制/选项/命令键映射?
Mac OS X 上的 GNU Emacs 默认情况下使用 control 键作为 CTRL,使用 command 键作为 META >。这让我抓狂,因为我的 MacBook Pro 左侧只有一个 control 键,而我已经习惯了键盘两侧都有一个 control 键。
通过安装 GNU Emacs,我能够修改变量 mac-control-modifier
、mac-command-modifier
和 mac-option-modifier
code> 以便命令充当CTRL,选项充当META。
我如何在 IntelliJ IDEA 中完成同样的事情?选择“Emacs”作为键盘映射很容易,但我没有看到任何方法可以对CTRL和META进行类似的重新映射。我知道我可以在操作系统中全局重新映射这些键,但我不想这样做。我也知道我可以进入每个操作并单独修改它们,但这似乎是一个糟糕的解决方案。
GNU Emacs on Mac OS X, by default, uses the control key as CTRL, and the command key as META. This drives me crazy, because my MacBook Pro contains only a single control key on the left, while I'm used to having a control key on both sides of the keyboard.
With my GNU Emacs installation, I was able to modify the variables mac-control-modifier
, mac-command-modifier
, and mac-option-modifier
so that command acts as CTRL and option acts as META.
How can I accomplish the same thing in IntelliJ IDEA? It's easy to select "Emacs" as the keymap, but I don't see any way make a similar remapping of CTRL and META. I know I could remap these keys globally in the OS, but I don't want to do that. I also know I could go in to each and every action and individually modify them, but that seems like a poor solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能不是最简单的解决方案,但您可以打开 resources.jar (MacOS 上的 /Applications/IntelliJIdea.app/lib/resources.jar )文件,找到 Keymap_Emacs.xml (在 idea 目录中)副本并修改它。
然后您可以在 IntelliJ 中创建一个新的键盘映射,以使用新内容更新它(MacOS 上的 ~/Library/Preferences/IntelliJIdea90/keymaps)。
这样您就可以更改所有键盘映射,而无需单独更改每个操作。
It's may be not the easiest solution but you can open the resources.jar (/Applications/IntelliJIdea.app/lib/resources.jar on MacOS) file, locate the Keymap_Emacs.xml (in idea directory) copy and modify it.
And then you can create a new keymap in IntelliJ for updating it with the new content (~/Library/Preferences/IntelliJIdea90/keymaps on MacOS).
That way you can change all your keymap without changing each action individually.