简体   繁体   English

默认情况下,在WebStorm中的PhpStorm中自动缩进

[英]Auto indentation in PhpStorm like in WebStorm by default

Using WebStorm with the default configuration, when I press delete in a blank line with some spaces, the whole line is always deleted. 使用具有默认配置的WebStorm,当我在带有一些空格的空行中按delete时,整行总是被删除。 Also, if I close a bracket for a function, the code inside is auto-indented. 此外,如果我关闭函数的括号,则内部代码将自动缩进。

I've tried to configure PhpStorm (7.1) with such functionalities ( Settings -> Code Style -> General and Settings -> Code Style -> PHP ). 我试图配置具有这些功能的PhpStorm(7.1)( Settings -> Code Style -> GeneralSettings -> Code Style -> PHP )。 I thought that I had found it out when I saw Tabs and Indents -> Smart Tabs , but selecting those options nothing seems to change. 当我看到Tabs and Indents -> Smart Tabs ,我以为我找到了它,但选择这些选项似乎没有任何改变。

PhpStorm标签和缩进

How could I get the above behaviour in PhpStorm? 我怎样才能在PhpStorm中获得上述行为?

Edit: 编辑:

As @lena has suggested, I looked inside Editor -> General -> Smart keys , but doesn't exist any Reformat block on typing '}' option and the other stuff is enabled: 正如@lena建议的那样,我查看了Editor -> General -> Smart keys ,但Reformat block on typing '}'选项时没有任何Reformat block on typing '}'其他内容已启用:

在此输入图像描述

Please make sure you have Reformat block on typing '}' enabled in Settings | Editor | General | Smart keys Settings | Editor | General | Smart keys Reformat block on typing '}'Reformat block on typing '}'请确保您有Reformat block on typing '}' Settings | Editor | General | Smart keys Settings | Editor | General | Smart keys . Settings | Editor | General | Smart keys Also, please try playing with 'Backspace | Unindent 另外,请尝试使用'Backspace | Unindent播放 'Backspace | Unindent ' in Settings | Editor | General | Smart keys 'Backspace | Unindent '在Settings | Editor | General | Smart keys Settings | Editor | General | Smart keys Settings | Editor | General | Smart keys : Settings | Editor | General | Smart keys

  • "Disabled' - smart backspace is turned off; “已禁用” - 智能退格已关闭;
  • 'To nearest indent position' - deletes white spaces to nearest indent position, does not jump to the line above; '到最近的缩进位置' - 删除最近的缩进位置的空格,不跳到上面的行;
  • 'To proper indent position' - jumps to the line above. '到适当的缩进位置' - 跳到上面的行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM