I've read that WordStar had a "column mode" which could be useful for making it act as a programmer's editor. But I've not found a clear description (or screenshots) of exactly what this mode was and what it did?

Note - I'm not even sure if that is the real name of the feature, or just a description.

  • 5
    @Chenmunka this has nothing to do with page layout columns. Jan 30 '19 at 15:06
  • 1
    I'm not familiar with WordStar's 'column mode', but I imagine it is similar to nedit's, where you can select any arbitrary rectangular selection of text to copy and paste. I.e., if you start your selection say 10 characters in from the start of a line, then drag down how ever many rows you want, the selection would not include the first 10 chars of any of the lines.
    – Glen Yates
    Jan 30 '19 at 18:20
  • 1
    I read this as "WorldStar" and was like ummm...
    – user91988
    Jan 30 '19 at 18:38
  • 2
    You can do it in Notepad++ (at least, I'm pretty sure it's the same) by holding Alt while selecting text (either using the mouse or Shift+arrow keys)
    – 12Me21
    Jan 30 '19 at 18:47
  • 1
    Yes, Notepad++ can do it. Occasionally useful for things like converting a tab-separated file to a comma-separated file.
    – Alan B
    Jan 31 '19 at 15:02

Took me a while to write this and another answer showed up. But submitting it anyway because I am such a huge fan of WordStar and have the keystrokes in muscle memory.

There are a few different features of WordStar that made it work pretty well (for the time) as a programmer's editor. I used it (and NewWord) for many years, and then switched to vEdit. I have programmed vEdit with the WordStar control-codes and used it that way for so many years that it is somewhat of a blur which features were actually native in WordStar/NewWord and which ones were not. (Well, multi-gigabyte file editing is definitely vEdit and not WordStar...)

Non-document Mode

Non-document mode was a key feature of WordStar that most other word processors never had. In non-document mode, there were no formatting codes inserted or recognized (e.g., for bold, italics, etc.), did not wrap lines automatically, and did not set the 8th-bit of characters for internal use. A quick search finds WordStar's Document and Non-Document Modes Demystified which gives a complete explanation.

Column Blocks

I think this is the feature you are referring to. I still use it today in vEdit, which as a programmer's editor quite naturally has such a feature, but I still use the WordStar codes to get to it. WordStar historically used Ctrl-KB to start a block and Ctrl-KK to end a block. Those keys worked very much like clicking on the start of a block in a typical modern word processor and holding shift while clicking on the end - block highlighted and ready to copy/move/delete.

However, if you pressed Ctrl-KN first, then you entered column block mode. In this mode the block is a rectangle instead of a continuous character stream. This is ideal for programming as you can use it to indent/undent, move chunks of data or code around left & right, etc.

  • 4
    "have the keystrokes in muscle memory" Did you have the urge to press ctrl-K S while writing this answer? Jan 30 '19 at 19:43
  • I sometimes do things like that. Particularly, control-Q F to find in many programs - depending on the program it can do anything from nothing at all to Quit... I use control-K S all the time in vEdit - I have no idea what the default key binding is and it is plenty faster than going through the menus. Jan 30 '19 at 19:47
  • 1
    Off topic probably, but I've never heard of "undent". Was this terminology in use anywhere? "Outdent" I would recognise.
    – Mr Lister
    Jan 30 '19 at 20:04
  • 2
    I think I've heard "unindent"
    – 12Me21
    Jan 30 '19 at 20:37
  • 1
    @Mr Lister: that's why it's different. It's another operation that's the mirror of indent. While unindent, that we speak about here, is simply undoing the indent, so that it doesn't result in an outdent, just restores what it was before. (And, actually, we're digressing because column mode isn't about indents at all, it's about copying rectangular sections of text).
    – Gábor
    Jan 31 '19 at 8:50

WordStar does indeed have a column mode, whose effect is to allow blocks to have left and right boundaries. Usually when you mark a block (using CtrlKB and CtrlKK), the block spans whole lines, with at most the first and last lines being incomplete. In column mode (CtrlKN), the block starts at whatever line and column the cursor is in when you start it, and ends at whatever line and column the cursor is in when you end it. You can then manipulate the column as an object.

For example, this would allow you to select the “Year” column below

Year    Top salesman    Total sales
2013    Joe Bloggs      1000000
2014    Jane Doe        1500000

and move it to another position in the table.

When programming, this is useful for indenting or un-indenting code, or manipulating columnar data as would be common in some programming environments in the past.

Using WordStar has a decent description of this feature.

(For readers used to modern-day column handling in word processors, this has nothing to do with page layout columns. It’s a text-selection feature which you’ll find in many text editors; see for example editors with support for rectangular block selection in Wikipedia’s comparison of text editors.)

  • 1
    I also remember using these codes in a very early version of Turbo Pascal for DOS. Jan 30 '19 at 21:00
  • 1
    This sounds like Emacs's Rectangle commands.
    – Barmar
    Jan 31 '19 at 4:49
  • This feature can be activated in many modern editors (including MS Word) by pressing ALT while dragging the mouse (in Word, the useless “research this” feature can interfere with this, if you don’t move the mouse fast or cleanly enough). Jan 31 '19 at 14:20

Well, since I mentioned it, I'll illustrate it. I'm told that this is not unique to WordStar: Borland Sprint had it, and so do several modern text editors (I've been using Emacs with folds for the last 25 years).

Say you have some text like this:

           Production by year
       Foos   Bars  Blats  Spungs
1975      4      7     20      3
1976   1000      2     23      1
1977   3000      1   1537      0
1978   5000      4  20331      0
1979   4875    321  38145      0
1980   4900    450     37      0

This is not using a column formatting feature like a modern word processor. These are just characters on simple lines of text, in a text file. They are necessarily monospaced text, because CP/M, which WordStar was designed for, had no graphics.

Now, you want to change the order of the columns, in this text file. It's a fiddle. However, if you have column mode, you can select, say, the Bars column, which looks like this on the screen:

           Production by year
       Foos   *Bars*  Blats  Spungs
1975      4   *   7*     20      3
1976   1000   *   2*     23      1
1977   3000   *   1*   1537      0
1978   5000   *   4*  20331      0
1979   4875   * 321*  38145      0
1980   4900   * 450*     37      0

Then you put the cursor at the start of the Spungs column, and use the Block Move command (not separate cut and paste commands, they hadn't been invented yet), and you get this:

           Production by year
       Foos   Blats  Bars  Spungs
1975      4      20     7      3
1976   1000      23     2      1
1977   3000    1537     1      0
1978   5000   20331     4      0
1979   4875   38145   321      0
1980   4900      37   450      0

Yes, this is far more primitive than you might do with a modern text-processing tool, or with spreadsheet columns embedded in a word-processor document. Retrocomputing, remember?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.