Peter's Blog

Redefining the Impossible

Items filed under e


I think I was aware of the existance of something called Netbeans in the Java world but for some reason I had always assumed it was some kind of object packaging thing, like Java Beans.

I had been using E Texteditor for about three months and a few things were niggling at me about it:

  • My project has many files and I have many files open at once. The files all open in tabs and soon I have too many tabs to be shown in a horizontal bar. With E I end up having to horizontal scroll all the time to get to the tab for the file that I have selected: it doesn't automatically scroll to that tab. As I say, it's a niggle but I've done it too many times.
  • It comes with lots of textmate bundles and more can be downloaded but first you need spend time working out what they are supposed to do and how you are supposed to use them, then you have to determine just how broken the script is after its port from an OS X environment and whether you can be bothered to fix it.
  • Unlike every other editor on the windows platform the INS button doesn't toggle into overwrite mode.
  • I became familiar with it and started to get bored. It lacked depth apart from writing my own textmate-like stuff which I don't have time to do.

The one thing that kept me using E was the ruby bundle that dumped unit test output into a window with stack traces so I could easily click on a line where an error occured and open it in the editor.

Still I started researching what else was available. I use linux at home all the time now and I wanted a cross platform editor/ide.

First I tried Jedit which is another editor written in Java. While it has many features it had a number of it's own niggles:

  • the way it displays text is just ugly. It has trouble rendering fonts in anything like a crisp and clear way. There are settings for subpixel antialiasing or whatever it is but I couldn't get it working nicely under Windows. It was better under Ubuntu.
  • (silly niggle) instead of a single tree the file manager has two selection controls, a tree for directory and another for the files in the directory. This means mucho switching between the two controls and just reminds me of Windows 3.1 file open dialogs. The project manager is better and has the traditional single file selection tree holding both files and directories.
  • the mechanism for running a command and capturing the errors wasn't set up for ruby and I didn't feel inclined to develop a regular expression to parse them. Laziness on my part.

The font thing put me off Jedit the most, it's just awful.

Then I found Netbeans and discovered that despite the misleading name it's an editor/IDE. It comes from the java world and is written in java but it has plenty of modules available to support C/C++ and Ruby/Rails. And the Rails support actually works. I'll emphasise that again, it works. Unlike the fragile stuff in Eclipse and the half-hearted E texteditor bundle ports, the rails features work and are usable: this is an environment that I can use without having to keep a command line open in the background.

The rails support gives me:

  • can run and debug a rails environment from the IDE. If I'm editing a file for a rails view, for example, I can press CTRL-R (not the default) and it will start a rails server and open firefox and the URL that relates to that view! The way it runs the server from the IDE is robust and I can even hibernate my laptop, resume and continue running it. That's robust.
  • When I say debug I mean the debugger works. It's not an interactive debugger in that I haven't found a way to evaluate expressions from a breakpoint but just being able to breakpoint, single step and watch variables is something.
  • run a rails console from the IDE. This is nice except the up/down keys don't work for command history which is a major downer.
  • run migrations
  • The project tree for a rails application displays the project directories in a slightly flatter way which makes navigating the project much easier. For example, the app directory is suppressed. It's still in the file system but the project doesn't bother to display it.
  • Pressing ctrl-shift-a in a view will take you to the controller for that view.
  • Pressing ctrl-shift-t in a controller will take you to the tests for that controller.
  • There is a built-in database client that lets me browse the mysql databases and run SQL statements.
  • There's a built-in gem administrator that shows me what gems I have installed and, interestingly, lists what more are available. This works better under windows than linux as under the latter it is unable to run sudo and install new gems.
  • Administer the rails plugins in a project.

General Features:

  • Very nice project-search facility, best I've used.
  • Refactoring that works! Want to change the name of something, run the refactoring, get a preview of what changes it will make, then apply the changes. I've never dared to try refactoring before but I could use this.
  • Runs just as nice on windows and ubuntu.

Netbeans annoyances:

  • Initially Netbeans wouldn't run, it would just lock up on opening. I tried installing a development version, googling etc but no joy. I was determined to get it going and ultimately I downloaded the Process Monitor to see what it was trying to do. It turned out that it was trying to use the cygwin version of subversion for something or other (who knows what) and this was locking up. I resolved the situation by simply renaming the cygwin svn.exe to svnhidden.exe and netbeans could start. Once it was sentient enough to open a settings window I installed a windows command line version of subversion for it to use. I'm going to add some keywords here to help other googlers find this fix: netbeans hang lockup freeze dammit ffs.
  • Double-clicking in the project tree doesn't always open a file. Often have to right click and click on open.
  • Can't seem to use save-as to copy a file. Have to go through irritating 'new file' wizard and copy/paste.
  • No apparent python support, not that I care much these days.
  • Not sure how well it would support a mixed ruby/c development project.

Conclusion: Netbeans is the nicest rails environment I have found so far.

UPDATE: don't just take my word for it.


Filed under: e editor netbeans

2 Comments

The more I use E the more I am liking it. I've researched for other editors with snippet support but things like jedit plugins come up. I tried it out but it just isn't the same, E has a bloat-free quality that is very alluring.

It has it's quirks though, mainly in the porting of Textmate bundles to Windows.

I wanted to be able to run makefiles and pipe the output through an error parser. There was already a command in there to do this so the process to run it would be:

  • open the makefile
  • make sure E knows it is a makefile
  • press CTRL-R

This just gives the error 'target not found'.

Start editing the script in the bundle editor. The script appears to be a bash script so the learning curve is not too bad (e.g. no need to learn java).

Add 'pwd' to the script and it seems to be launching in C\Windows\System32 and there ain't no makefiles in there.

Add 'cd $TM_DIRECTORY' to the script to get it to cd to the directory where the makefile is and WAYHAY it runs and errors from the c compiler are listed in the results window. Click on and error and we are there at the source file/line.

This is how it should be.

I can believe that OSX is intelligent enough to not launch anything in the OSX equivalent of \Windows\System32.

And this will now work for ANY makefile, no dicking about creating new build configurations for each one, thank you Eclipse.


Filed under: e editor

1 Comment

Eclipse annoyances:

  • cannot just edit a file. Have to have a workspace set up, a project in the workspace and the workspace has to be associated with a perspective.
  • project manager is too dopey to see files change on disk and you have to manually refresh.
  • project manager file tree has annoying auto-horizontal scrolling behaviour that makes it scroll whenever I don't want it to and we have a tug of war over it.
  • build/make configurations seem to last about 20 minutes before they vapourise.
  • most menu's have about thirty entries in and I am continually having to search for them.
  • as an editor it doesn't seem to offer much more than notepad with syntax highlighting and tabs.
  • I get the feeling I need to read a book to be able to use it properly but don't have the time/inclination and also haven't found such a tome.

I searched through the gui text editor state-of-the-art (VIM is great from the command line but doesn't cut it through a gui, especially if the netrw plugin keeps playing up under vista). THE editor of the moment is textmate which has one major limitation: it is only available for Mac OS. Sorry but I'm not buying a Mac just to use Textmate, to me it's not that killer an app (although it's close).

I found two windows Textmate clones:

E-TextEditor: uses wxWidgets (scintilla I suspect) and cygwin in an attempt to make it's 'bundles' (aka sets of macros) compatible with textmate. There is a version available for sale for $35.

Intype: doesn't go for total textmate compatablity, more of an 'inspired by' approach. This seems to be in an earlier stage of development than E and they appear to be coding it from scratch. You can download a free version but it doesn't yet have any project management features to select files to edit. What there is seems very solid but I really need the project manager (without it I would stick with vim).

So I am running the 30 day trial version of E.

If textmate is better than E then it must be fantastic. E itself is very good and I am included to stick with it. Features:

  • solid editor (scintilla)
  • project manager is more a simple file system viewer except you are able to kind of lock it to only show directories in a chosen subdirectory. This is great for me, all I need from project support. The viewer is somehow magically linked to windows explorer so right clicking an element in the tree gives you the same options you get in explorer which in my case gives me tortoise svn: excellent. Ctrl-shift-T gives you a quick way to find a file within your project by typing the first few letters of its name.
  • bundles, the big Textmate innovation. The idea seems to be that instead of having an ugly, quirky built in scripting language (*cough* lisp, *cough* vim macros) there is a finely tuned mechanism for shelling out to unixy command line programs to do the chores. The unixy command line programs can be bash scripts, ruby scripts, whatever, which gives you infinite flexibility without having to build the languages into the editor (hey: these unix guys were onto something all those years ago). This also explains why E needs cygwin to give the unix environment that textmate itself lives in.
  • another aspect of the bundle thing is the snippet. You can set snippets up so you type the first couple of letters of a trigger word, then tab and the snippet fills in a load of typing for you. I found a nice use for this in a load of typing I was doing. I had to type a load of switch cases like this:
    case 9600:
       nBaud = B9600;
       break;
    
    so I created a snippet like this:
    case $1:
       nBaud = B$1;
       break;
    $0
    
    now, to fill in each entry I had to type:
    ca<tab><number><tab>
    
    and that was it! Brilliant. It replaced both instances of $1 at the same time, as I typed.

I particularly like the way it runs ruby scripts. The output from the script is captured and displayed in an html control. If the script dies and generates a stack trace then each point in the trace is displayed as a hyperlink that will open the file/line up in the editor. Brilliant. And the hooks are in there for your own scripts to generate html output...

E has a few quirks:

  • under vista the cygwin setup can start moaning about needing to be upgraded. I think this is because the cygwin files are stored under /program files/e which Vista shadows to the /user directories. If you run cygwin as a mortal, all the changes are written to /user somewhere but the old version in /program files/e triggers the nagging next time. This is just a theory. Anyway, run e as administrator, let cygwin do it's thing and the nags go away. Some say the fix is temporary and I don't know, it may be due to cygwin versions changing.
  • under XP at home the application title bar disappears when I open a file. It's not a problem unless I want to move the window in which case I have to click about a bit to make it redraw. It's probably a windowblinds/nvidia problem UPDATE: confirmed, if I disable WindowBlinds Skinning for E then problem goes away. So why is it fussy about being skinned...?
  • under the very minor annoyance category (will it grow?) when I double click on a file in the project manager and it opens inthe editor, I have to click on the edit screen before it will vertically scroll with the mouse wheel.
  • the command to run a ruby script (ctrl-R) has a silly bug where for some reasons it overwrites your file in a way that causes E to prompt you to reload it. This behaviour may be inherited from the textmate bundles. It is possible to comment out a line in 'scriptmate.rb' to stop it.
  • of the other included bundle stuff (and there is a lot), some has been ported to windows, others have not, you have to try them all out. The source is all there in the bundle editor. I had to manually install 'rxvt' in cygwin to get some working.
  • this may be a scintilla problem but if the syntax highlighting creates bold text followed by normal text in certain fonts the spacing between the characters is screwed and the gap between is either too small or they characters actually overlap. It's ok with the basic microsoft fonts (courier new) but I prefer serif. I've turned off all the bold elements in the syntax highlighting.

It's a long list of quirks but E has such potential that I think I can live with them.

Features that may be missing, maybe hidden in the plethora of bundles:

  • tagging: ctags and the ilk.
  • no toolbar! Interesting when microsoft is going away from menu's to purely toolbars. Personally I don't miss the toolbars, there are keyboard shortcuts for everything and no toolbar means more screen space.

Conclusion: I'm liking it.


Filed under: e editors

3 Comments