Any netbeans features that will make my day?

I recently really liked netbeans for my php job because of XDebug integration. It made me forget about textmate (which imho still beats the non-poor for little things)

What do you think is the awesome netbeans feature I should be aware of, and more importantly, why and how to use it?

I ask this to optimize my IDE skills and build on the idea that what works well for others can just work for me (and hopefully others).

+44
php netbeans
May 29 '09 at 18:31
source share
21 answers

Integrating Subversion directly into the IDE and Local History are my must-have, favorite features.

+26
May 29 '09 at 18:34
source share

I found another great genius who I wanted to share:

you can make your own folded code (not related to php, just netbeans)

just put this in your code file:

// <editor-fold defaultstate="collapsed" desc="getters and setters"> some boring code you don't need to see every time here // </editor-fold> 

It will be like #region in visual studio or pragma mark in xcode. but unlike region s, this will not ruin your code, it is really just a comment!

+42
02 Oct '09 at 19:36
source share

I find the single most useful feature in Netbeans for working with PHP is that it understands PHPDoc (just like it understands Javadoc) and uses it for a hint of type.

Type /** before defining the function, press return and create a PHPDoc template.

 /** <-- I typed this one line * @param <type> $otherObj <-- Netbeans added these 3 lines * @return <type> <-- */ <-- public function exampleFunction($otherObj) { $myObj = new MyClass($otherObj); return $myObj; } 

Replace <type> tag labels with the appropriate types:

 /** * @param OtherClass $otherObj * @return MyClass */ public function exampleFunction($otherObj) { $myObj = new MyClass($otherObj); return $myObj; } 

And warrior, you get type completion (and pop-up documentation) with Ctrl-space.

+19
Jul 04 '09 at 19:17
source share

Awesome Vi bindings via jVi plugin .

+17
May 29 '09 at 19:14
source share
 if ($x instanceof SomeClass) { $x->.... // now it has code completion with SomeClass' methods. } 
+13
Mar 21 '10 at 16:51
source share

Macros and Advanced Entry Code Templates !

Templates with parameterized code (try entering fnc in netbeans and then immediately pressing Tab, and then continuing to press Tab to find out what happens, how it cycles through the function name and function parameters - look inside the code code to see how it done). (Options> Editor> Code Templates)

Some simple examples (I made some of them, some of them have netbeans):

  • [forek] expands to: [foreach ($ array as $ key => $ value) {}] (This code comes with netbeans, the rest I did)
  • [arr] + Tab expands to: [array ();]
  • [kv] + Tab expands to: ['key' => "val",] (the key and val are parameters that I can cycle through and edit using the tab. The code template looks like this: ['$ {key}' => "$ {val}",] where [$ {something}] is a template parameter, it prints [something]. If you want tio print [$ something], I think you need to use three] $ ] characters: [$$$ {key}])

EDIT: You can create a code template for an arrow with a single letter (for example, "m" for ex), but when you enter the code, you must put a space before the letter, otherwise it will not recognize it. Example: $ obj m [press Tab], expanding to [$ obj β†’]. The space between them works fine and is not a syntax error. / EDIT

Every time I want, there is a template for something, I actually insert the template, and then use it right away and continue with the rest of the php programming.

Macros with shortcuts as mini code templates ! (Netbeans> Menu> Edit> Start / Stop Macro)

The Best Macros I made for php actually code templates (because "+ Tab does not work as a code template for some reason, only if the template starts with the letter in which it works) ([shortcuts] inserts [text]):

  • the shortcut [Ctrl +;] inserts [->] (no more than a keyboard gymnastics, no more than a point sintax envy in other languages ​​:))
  • shortcut [Ctrl + Shift +;] inserts [=>]
+11
Jul 23 2018-10-23T00:
source share

This link contains many keyboard shortcuts that will come in handy. I have a copy printed and attached to the wall next to my computer. Unfortunately, I do not see any special PHP shortcuts.

UPDATE: http://netbeans.org/project_downloads/usersguide/shortcuts60.pdf UPDATE2: http://netbeans.org/project_downloads/www/shortcuts.pdf (for 7.0)

+9
Jun 04 '09 at 12:31
source share

I would add task integration. Do not have time to do something? Add a simple task that NetBeans will track for you. You can configure what is tracked in Tasks in Options -> Miscellaneous -> Tasks , but I found the format below the most useful, as it is in good agreement with the PHPDoc comments (see Comment):

 /** * @todo Create public setters and __toString() for this class. */ 
+8
Mar 21 '10 at 23:00
source share

Ctrl + Space is my favorite and most used function when programming in java, I think that it is also included for PHP. But if you like net beans, you will probably find out about it if you don't try to find out what it does.

Also, going to the corresponding source code using Ctrl + Clicking on any of the variables, method calls, class links are a good function.

In addition, the pop-up menus that appear when you right-click in the source code contain many useful tools for everything from refactoring to code generation.

+6
May 29 '09 at 19:09
source share

This will sound ridiculously trivial, but one thing I do on Netbeans is formatting the code. Its code formatting is formed (source-> format).

SVN integration is also great, but this has already been mentioned.

+6
Jan 18 '10 at 21:36
source share

Ability to create quick macros on the fly.

For example, here is one of them that will put a semicolon at the end of the current line and put your cursor where it was before the macro started.

";" delete-previous caret-end-line ";" jump-list-last-edit jump-list-last-edit (I know that by default it is present in other implementations of the language, but by default it does not work in PHP Netbeans.)

As a person who adheres to the IDE for a long time, I like to tune things in to make me more efficient.

+5
May 29 '09 at 18:50
source share

If you consider Netbeans 6.7, it has a synchronization feature similar to Dreamweaver

In the method of adding custom ftp, import it into the project, and when you save files locally, they will also be uploaded to the server so that you have a semi-automatic backup system.

(trust me this is better than working directly with the ftp tree and realizing that the transfer somehow happened between the current tmp file and the server file, and you lost your job because you closed the file window :))

+5
Jun 03 '09 at 10:42
source share

NetBeans also allows you to completely undock individual windows .

How:
Right-click on the toolbar of the window you want to move and select Undock window . The selected window becomes floating, which allows you to move it outside the main NetBeans window.

Main characteristics:

  • you can attach floating windows to border screens or to different floating windows (only from NetBeans)
  • floating windows can make themselves translucent if you leave them (configured using the basic settings in the "Miscellaneous / Appearance" section).
  • If you move another application on top of any floating windows, they return to first place after reusing NetBeans
  • your workspace layout is remembered, so all floating windows retain their respective positions between separate encoding sessions (restarting NetBeans)

This is useful, especially if you have a second monitor, since it allows you to maximize the use of space for the source code by moving any additional windows (file browser, unit test results, etc.) away from the main screen. Best of all, NetBeans works with most of the annoyances that are usually present in multi-window applications (for example, various applications that span individual toolbars in GIMP).




Note: perhaps this is a well-known function, but I managed to open it only today. It was not yet on the list, so I added it, although some time ago I already answered with another function.

+4
Apr 08 2018-11-11T00:
source share

Squiglies under unused private class members.

+3
Apr 28 2018-11-21T00:
source share

maybe a search box to find something in the source code?

+2
Jun 04 '09 at 12:28
source share

Some features certainly deserve attention, including those mentioned above:

  • Version Control Integration, including local history
  • Wide search field IDE
  • Integration with Tomcat / Apache, GlassFish can be useful when you want to work with PHP and other server-side technologies like JSP
  • Very good integration with MySQL - necessary for developing wAMP / LAMP.
+2
Jun 04 '09 at 12:33
source share

TextMate is a great little small editor that I use all the time on my Mac, but not the IDE. I did not use Netbeans on a Mac, very much not being native, but on Windows or Linux I prefer it over Eclipse.

  • The designer of the Swing GUI with Java was huge in quickly completing projects.
  • Other people talk about it, but the built-in Subversion is awesome. If I work with a project from a terminal on Linux, it turns out that SVN is checked in this directory and handles it perfectly.
  • I like code formatting (right-click in the editor), especially when team members write poorly spaced / indented code using nano, xemacs or something like that.
+2
Jun 08 '09 at 15:31
source share

its amazing that no one was talking about this cool plugin.

http://code.google.com/p/zen-coding/

I found it very useful for html. PHP developers need this. He adds a lot of patterns like this.

download zen coding for netbeans and import the zip file into tools> options> code templates> import.

+2
May 7 '11 at 14:10
source share

I like the most: phpunit + code coverage

+2
Oct 31 '11 at 14:59
source share

I personally used Eclipse a couple of years ago to develop Java, and since I knew Netbeans in version 3.5, it has done a great job integrating server technologies like TomCat for deploying J2EE applications, disruptive activities, uml and many plugins for different technologies , not just java now.

  • Database integration (MySQL, Jdb, SQL editor).
  • Continuous progress in PHP integration and features.
  • Integration with Subversion ... it helps LOT!
  • Indentation code, custom color highlighting.
  • If you are a PHP developer, Ruby on Rails integration can also help if you want to expand your experience in web applications.
+1
Jun 08 '09 at 20:57
source share

Netbeans is always known for providing support for experimental (not yet released) technologies such as Java 6 EE preview, JDK7 support, ...

And support for subversion out of the box. This is a big difference with Eclipse, where you should use plugins. With Eclipse, I had problems only under Linux (JavaHL problems, blabla ...). I don’t remember who said it or where it was written, but "external support is much more important for the user than the ability to use some plugins."

+1
Oct 22 '09 at 14:52
source share



All Articles