Friday, November 21, 2008

e-texteditor

Being an old Linux user from way back, my default choice of text editor has always been vi. When editing shell scripts, vi; when coding, vi; taking notes vi.

When I started my first development job and moved over to Windows I brought vi with me.

Sure there was Eclipse and TextPad but every now and again I'd encounter something where I need to do a column editing function, or a search and replace via regular expression, or just a very large file that I needed to load up which didn't cause the entire OS to hang.

Being a developer involves working in a team, and one time or another, they'll be a developer at my computer debugging a problem who would encounter vi for the first time. Unable to comprehend the reason they need to go into insert mode to type something, they would give up exasperated, stating that I should use a real editor, like EditPlus.

I've given nearly every single Windows editor a try and haven't found anything that would easily replace the functionality that vi provided.

Simple things like "find as you type", and highlighted search results would be basic criteria for me (note, both these features have made it into browsers like Firefox and Chrome, which only goes to show where all the innovation currently is).

Enter e-texteditor. Recommended by an old co-worker of mine, and branded as a TextMate clone for Windows the editor it is very sparse. I did my usual barrage of tests, first thing being "find as you type" and to my surprise what do I see:



Not only was there "find as you type" but as if almost like I was in vi again, highlighted search results!

And to replace the highlighted results, no need to open up another search window but instead, place the cursor in the "replace" text box and hit the "all" button. Everything highlighted is now changed, and is an easy way to see (just by sliding around the document and looking for highlighted text) what is going to get changed with a find/replace before actually performing a find/replace.

A bit more digging around and I find it has a built in indent guide, which draws vertical lines at where the indents are.



The indent is a bit smarter than usual too. Not only can you specify how many spaces a tab is, but you can specify soft tabs (i.e. an indent is equivalent to 4 spaces). This means every time you hit tab 4 spaces will be used but also (when using the cursor keys) if you move back over those 4 spaces it doesn't traverse one space at a time but 4 spaces at time.

Another nice touch is that to display non printing characters, i.e. spaces, tabs, carriage returns, instead of sifting through a menu option, all you have to do is highlight the area and all the non printing characters are displayed



My second test is usually column editing. Most text editors usually need to be put in a column edit mode, but e-texteditor all that is required is that instead of using shift and the cursor keys to highlight the text, you use alt instead and can highlight a column straight away. Then ctrl-c to copy, or just straight away type over the selected columns.



This hooks in with another nice feature they have where if you wanted to modify a couple of words in a document, you just highlight each word individually and just start typing. When select these terms, you have essentially put the cursor in those highlighted positions and when you type you literally see yourself type in half a dozen places at a time.

This fits in nicely with the column editing paradigm. As when you select a column, you are essentially just selecting that word. When you copy, push delete, or just type, you are typing over that word.

There is a video of this on the home page of the e-texteditor homepage which explains this better than I can explain it.

Finally regex, which works a charm. It's a little finicky to get to (I can't seem to find a keyboard shortcut for it) and you have to click the little magnifying glass icon next to the search to enable it, but the regexes themselves I haven't found anything fundamentally wrong with it so far. But that could be the fact that I've only been doing rather primitive regexes so far.

One more feature I'd like to highlight is that it is compatible with TextMate bundles (syntax highlighting definitions) so nearly any language you can think of is supported.



There is also a keyboard binding to switch between different bundles in the document, which comes in handy when editing a marked up file which contains a soup of HTML, CSS, JavaScript, scriptlets, etc and you want to highlight the different parts of the document as it isn't available in a single bundle.

This was about 2 months ago and since then I've gotten a lot more use out of this. Strangely also reducing my reliance on vi, and have even gone as far as purchasing a license!

I haven't really got any niggles with this except it crashes a lot more than I would like it to (not that often but a text editor shouldn't crash at all) and it also has trouble loading large files (i.e. files larger than 100megs) which vi just eats for breakfast.

I think vi will still be around a bit but I think I've managed to find an editor which I can use on a day to day basis where people won't freak out using when jumping on my machine.  

1 comment:

Anonymous said...

nice review jklp - AK

About Me

My photo
Melbourne, VIC, Australia
Jerrold is a recently migrated Melbourne based software engineer with roughly 5 years experience developing in Java and the web technology stack (HTML, CSS, DOM, JavaScript, etc). More recently, he's started developing in Python (well, Jython, but close enough) and is unsure if it's flaws outweigh its advantages of having a more sugary syntax. He is currently working at a small South Melbourne based company which specialises in sales incentive management / reporting software, and is being schooled in the finer points of small company operations.