Create a #pragma Separator In Eclipse (Like in Xcode)

Create a pragma separator in eclipse, like in xcodeIf you've used Xcode for iOS or Mac development, you know how handy the #pragma line can be.  It makes it super-simple to group related functions or methods together in your outline.  Well, for those wondering how to do something similar in Eclipse-- this blog post is here to help!  It's a little hacky though.

 

For PHP Development

You can define either a dummy constant or a dummy function in-line, and it will show up in your outline.  See this screenshot:

Define a constant or function in eclipse to create separator in outline

I warned you it would be hacky ;).  Personally, I like to use dummy constants in all caps for this.  I always start with two or more underscores (__'s) to make it obvious.

 

For CSS Development

I use a similar trick in CSS.  This time, I define a style which doesn't go to anything; it's just for the outline in Eclipse.  I know this is a little wasteful, but for many projects the readability is more important to me, as it lets me group all my styles in one file, yet still skip to sections quickly.

creating separators in css in eclipse outline

 

Other Languages (Like Java, Javascript, Python, etc, etc) and Other IDEs (Netbeans, etc)

This trick works with pretty much any language or IDE, where either a dummy function or a dummy constant will show up in the outline.