gpt4 book ai didi

intellij-idea - 如何将多个操作绑定(bind)到快捷方式

转载 作者:行者123 更新时间:2023-12-04 02:52:06 27 4
gpt4 key购买 nike

每次我完成一个 Java 类的编辑后,我都想:组织导入、重新格式化代码和重新排列代码。我必须按 3 个键盘快捷键。

有没有办法将一系列 Action 分配给单个快捷方式?

我正在使用 IntelliJ 14.1.5。

最佳答案

您可以录制包含要执行的操作的宏,并为该宏分配快捷方式。

该过程描述here .为了完整起见,以下是这些在线指南中的步骤(归功于 Jetbrains):

To record a macro

  • On the main menu, choose Edit | Macros | Start Macro Recording. From that moment on, all your recordable actions are recorded.
  • When you are done with the procedure, choose Edit | Macros | Stop Macro Recording.
  • In the Enter Macro Name dialog, specify the name of the new macro, and click OK. If the macro is intended for temporary use only, you can leave the name blank.

To bind a macro with a keyboard shortcut

  • Open the Settings dialog and click Keymap.
  • Create a new keymap Run/Debug Configuration: PHP Script or select an editable keymap from the list of keymaps.
  • Expand the Macros node and select the macro for which a keyboard shortcut should be created.
  • Right-click on the macro and choose Add Keyboard Shortcut in the context menu.
  • In the Enter Keyboard Shortcut dialog, press the keys to be used as a shortcut. The keystrokes are immediately reflected in the First Stroke field. Optionally, select the Second stroke check box and specify the second stroke. As you press the keys, the Preview field displays the keystrokes you pressed, and the Conflicts field displays warnings, if the keystrokes are already in use.
  • Click OK using the mouse pointer to create a shortcut and bind it with the macro.
  • Click Apply to save the settings.

关于intellij-idea - 如何将多个操作绑定(bind)到快捷方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32948061/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com