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

前端 未结 3 1206
-上瘾入骨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 04:00

    You can use autohotkey (http://www.autohotkey.com/) to create new keystrokes and replace PHP Object Operator for period or anything else.

    For example, with a script like this:

    ^.::
    Send ->
    return
    

    Will replace (ctrl + .) with (->), in anywhere in Windows.

    Or

    #IfWinActive ahk_class SunAwtFrame
    .::
    Send ->
    return
    

    Will replace . (period) with (->) only in PhpStorm Window (Or others with ahk_class SunAwtFrame). Use Window Spy to see the ahk_class class of any Windows Window.

    You can use CTRL + . as . (period)

    #IfWinActive ahk_class SunAwtFrame
    ^.::
    Send .
    return
    

提交回复
热议问题