PhpStorm 中的缩写

Abbreviations in PhpStorm

IntelliJ 带有 2 个我过去经常使用但在 PhpStorm 中找不到的缩写:

iter    Iterate (for each..in)
itar    Iterate elements of array (traditional loop)

因此,每当我键入 iter 并按下 Tab 键时,它都会生成一个增强的 for 循环。我怎样才能在 PhpStorm 中实现这一点?

PHPStormlive template 所以你可以用它来生成多种类型的代码片段。

Live templates can be used to insert frequently-used constructs into your source code, for example, loops, conditions, various declarations, print statements, tags, and so on. To expand a code snippet, type the corresponding template abbreviation and press Tab. Keep pressing Tab to jump from one variable in the template to the next. Press Shift+Tab to move to a previous variable

我觉得this link is useful and also suggest that you read this link

要创建新代码段,您可以转到 settings > Editor > Live Template