Is there a keyboard shortcut for “Do Refactor” (Refactor Preview Pane) in IntelliJ IDE?

后端 未结 3 1736
无人共我
无人共我 2021-01-08 01:23

How to press \"Do refractor\" button when you are trying to refractor some method in (PHP, Java..) code.

Steps:

  • Press ctrl+r to rename method
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-08 01:53

    IntelliJ tries to solve as many problems as possible using only your keyboard.

    In your case, a panel showing a refactoring preview is really useful. You can use your arrow keys to navigate through this panel and exclude unwanted refactorings by pressing Del. To confirm the refactoring, just press Alt + D. The Do Refactor button has a shortcut underline on the D, that's why you don't even need to memorize this.

    Regarding your second question (camel case navigating): you need to check the following setting:

    Settings > Editor > General > Smart Keys > Use "CamelHumps" words

    Now you can navigate within Strings using Ctrl + R/LArrow.

    Btw: you can return to your editor anytime by pressing Esc.

    And finally - you can execute almost any command by pressing Ctrl + Shift + A. Simply type the name of your command (like Rename) to execute it. So even without a shortcut, you don't need to use your mouse.

提交回复
热议问题