Is there a shortcut for inserting PHP's object operator upon code completion in PhpStorm?

前端 未结 3 1210
-上瘾入骨i
-上瘾入骨i 2020-12-14 03:29

Let\'s say I want to type the following in PhpStorm:

$longObjectName->propertyName = \'some value\';

Seems innocent enough, no? If I sta

3条回答
  •  我在风中等你
    2020-12-14 03:58

    Well, I solved this problem by recording a Macro and then binding it with a keyboard shortcut:

    1. Go to Edit | Macros | Start Macro Recording
    2. Type '->'
    3. Stop Macro Recording using the button in the lower right corner, then name it whatever you want.
    4. Assign Shortcut to it:
      • Go to File | Settings | Keymap | Macros |
      • Right click and choose 'Add Keyboard Shortcut'

    I chose Ctrl+. as the shortcut and now I am more than happy. :)

提交回复
热议问题