如何修改 IntelliJ 的 Emacs 键盘映射中的控制/选项/命令键映射?

发布于 2024-09-15 18:05:04 字数 619 浏览 8 评论 0原文

Mac OS X 上的 GNU Emacs 默认情况下使用 control 键作为 CTRL,使用 command 键作为 META >。这让我抓狂,因为我的 MacBook Pro 左侧只有一个 control 键,而我已经习惯了键盘两侧都有一个 control 键。

通过安装 GNU Emacs,我能够修改变量 mac-control-modifiermac-command-modifiermac-option-modifier code> 以便命令充当CTRL选项充当META

我如何在 IntelliJ IDEA 中完成同样的事情?选择“Emacs”作为键盘映射很容易,但我没有看到任何方法可以对CTRLMETA进行类似的重新映射。我知道我可以在操作系统中全局重新映射这些键,但我不想这样做。我也知道我可以进入每个操作并单独修改它们,但这似乎是一个糟糕的解决方案。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

韬韬不绝 2024-09-22 18:05:04

这可能不是最简单的解决方案,但您可以打开 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文