php:自动缩进整个代码? [英] php: auto indent the whole code?
问题描述
没有任何软件/插件netbeans / eclipse自动缩进整个代码后,我插入它?
isnt there any software/plugin to netbeans/eclipse that auto indent the whole code after i've inserted it?
不只是缩进,当我按ENTER键为新
not just indent when i press ENTER for new function.
我想粘贴一个代码,例如没有缩进,它会自动缩进所有的一切,因为它可以识别使用什么语言。
i want to paste in a code for example without indents and it will auto indent everything automatically since it can recognize what language is used.
应该节省很多时间。
推荐答案
在Zend Studio中(我猜在Eclipse中使用PDT),您可以在编辑器视图中右键单击
您粘贴的文档,然后选择源
格式
。源格式规则在 Windows
首选项
PHP
代码样式
Formatter
。您可以默认选择代码约定,如PEAR或ZF,或者发明自己的。
In Zend Studio (and I guess in Eclipse with PDT as well), you can right click
your pasted document in the editor view and select Source
Format
. Rules for source formatting are edited in Windows
Preferences
PHP
Code Style
Formatter
. You can select Code Conventions like PEAR or ZF there by default or invent your own.
如果您只是想来回缩一些选定的代码行,请选择它,点击标签
(或 shift
选项卡
取消缩进)。这不会解决任何嵌套代码。使用 Ctrl
Shift
F
(感谢Paul Lammertsma指出这一点)。
If you just want to indent some selected lines of code back and forth you select it and hit tab
(or shift
tab
to unindent). This will not resolve any nested code though. Use Ctrl
Shift
F
for that (thanks to Paul Lammertsma for pointing that out).
这篇关于php:自动缩进整个代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!