isnt there any software/plugin to netbeans/eclipse that auto indent the whole code after i've inserted it?
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.
should save a lot of time.
Spacing and indentation should be consistent throughout your code. Many developers choose to use 4-space or 2-space indentation. In PHP, each nested statement (e.g., a statement following a "{" brace) should be indented exactly once more than the previous line's indentation.
PHP is whitespace insensitive PHP whitespace insensitive means that it almost never matters how many whitespace characters you have in a row. one whitespace character is the same as many such characters.
Automatic indenting occurs when you insert new lines. • None No special indenting occurs. Source Insight will return the insertion point to the very beginning of the next line when you insert a new line or word wrap.
Auto Indent Luckily, Atom has you covered. Select the code and head to Edit > Lines > Auto Indent. This should copy the current indentation on the file to correct your code. To speed this up, I created a custom keyboard shortcut, enabling me to use Ctrl + Cmd + ] at any point.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With