A Mind Lost

Anything and everything.

A New Editor

I’ve been looking for a new text editor for Windows lately.  For years now I have been using ConTEXT, and it has been a faithful friend.  Unfortunately, my editing needs have outgrown the features that ConTEXT provides.  While ConTEXT is now open source, progress on it seems to have stalled.  Written in Delphi, it is beyond my means to contribute to as my knowledge of Pascal is over 15 years behind me.  I considered trying to port it to an open compiler (Free Pascal), but being as unfamiliar with it as I am with Pascal/Delphi, I didn’t consider it for very long.

I’ve alternately (and infrequently) tried dabbling with both Vim and Emacs.  They’re pretty ubiquitous these days, running on just about everything under the sun.  As a Windows and Linux user, having a cross-platform editor that I can use on both operating systems would be a great boon.

Unfortunately, they’re both complicated as hell!

The first editors I remember using, aside from MS-DOS’s Edit, were the built-in editor in Borland Turbo C++ and later (when I’d all but ditched the IDE and switched to using Makefiles) Semware’s Qedit.

There were no arcane command sequences to remember, no modes or anything fancy.  Text windows were easily navigable by hotkeys, menus were plain and also easily accessed via Alt and a hotkey (like a “standard” Windows application menu).  I grew used to this type of interface by virtue of it being pretty much the only interface in DOS and Windows, at least for the software I used.

Moving to Windows, I continued to use Qedit in a DOS box, later switching to the Programmer’s File Editor (good ol’ PFE).

Eventually, time caught up with me and I had to ditch these old friends for something newer and shinier (and more compatible).

These days I use a mix of the aforementioned ConTEXT for normal editing, and the Folding Text Editor (FTE) , in a Windows console (actually, from a TCC/LE console).  On Linux, I use Kate when I want a GUI program, and alternately Joe’s Own Editor (joe) and FTE on the console.  FTE’s Linux console support feels somewhat crufty (it’s 6 years old, afterall) and doesn’t always do what I want it to.  I’ve been meaning to dig in to the code and see if there’s any way I could modernize it somewhat, but just never seem to get around to it.

My biggest problem, thus far, has been finding an editor that does things the way I want it done.  I don’t like editors that go out of their way to move lines of text around on me based on how it thinks it should be formatted.  I am also picky about indentation when it comes to programming.  I have, for long and long, conformed to a slightly modified form of the Whitesmiths indentation style, an example follows:

#include <stdio.h>
#include <stdlib.h>

#define DEFAULT_VALUE      12

int function(int argument)
  int result;
  // operate on data

int main(int argc, char **argv)
  int i;
  i = function(DEFAULT_VALUE);
  if(i == 69)
    printf("Oh you naughty boy!\n");

Opening and closing tokens should align with their twin, and every new block (beginning at the opening brace) is indented 2 spaces.  I don’t use hard tabs because of their effect in different editors.  I’ve been using this style for almost 20 years now; every other indentation style just looks horrible and foreign.

So the trick is finding an editor that works with me with a minimum of fuss and configuration (and frustration).  Most editors have some sort of a configuration method that allows one to explicitly specify an indentation mode for source files.  Some are easier than others to coerce in to behaving, and some are just infuriating.

For the nonce, I’m giving Vim another try (GVim, specifically) for a few reasons.  One is that it, as mentioned, runs on both Linux and Windows.  I also know it can eventually be configured to work the way I want.  Also, my favourite syntax highlighting scheme “Zenburn” was created with Vim in mind.

To get indentation to work the way I wanted, I have (in my .vimrc) the following, which I found on what appears to be a blog in Korean (?):

"Not this part, the next...
set gfn=Envy_Code_R:h11:cANSI
set lines=50
set columns=100
set number
set virtualedit=all
color zenburn

"whitesmiths Indent
set cindent
set expandtab
set shiftwidth=2
set softtabstop=2
set noet
set cino=1fs{1s=1s:1s(1s

Hopefully I’ll have the patience to finally stick to Vim and learn how it works before I get too frustrated and ditch it (again). The whole modal system is awkward to me, and will take some getting used to.  Wrapping my head around the idea that just because the cursor is where I want to add text, blinking away at me, doesn’t mean that when I type it’s what will actually happy is difficult to say the least.  Also, Vim’s documentation appears to be quite convoluted and not easily navigated.  And what good is building the documentation into the editor when I don’t know how to work it in the first place!  Hah.

I’m not yet foolish enough to try installing the Emacs OS.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: