如何将文本对齐到phpstorm或webstorm中的特定字符? [英] how to align text to specific character in phpstorm or webstorm?

查看:58
本文介绍了如何将文本对齐到phpstorm或webstorm中的特定字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这句话

$test1 = 'testing1';
$test1test1 = 'testing1';
$test1test1test1 = 'testing1';
$test1 = 'testing1';

,我想使用标签将其对齐,

and I would like to align it like this, using tabs,

$test1           = 'testing1';
$test1test1      = 'testing1';
$test1test1test1 = 'testing1';
$test1           = 'testing1';

有没有办法在phpstorm或webstorm中做到这一点?

is there a way of doing this in phpstorm or webstorm ?

推荐答案

Cmd + Alt + L(在Mac中)或Ctrl + Alt + L(Win),PHP Storm将根据设置"中的代码样式来格式化代码.要设置此代码样式,请执行以下操作: 文件->设置->代码样式-> PHP(在此处选择您的语言)->其他->对齐键值对-标记为选中.然后按重新格式化代码(Ctrl + Alt + L)并按voila.您将获得上面编写的样式相同的代码.

Cmd+Alt+L (in Mac) or Ctrl+Alt+L (Win) and PHP Storm will format code depends of your Code style in Settings. TO set this code style go: File -> Settings -> Code style -> PHP(choose here your language) -> Other -> Align key-value pair - mark as checked. And then press Reformat code (Ctrl+Alt+L) and voila. You will get code, styled you write above.

这篇关于如何将文本对齐到phpstorm或webstorm中的特定字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆