Last night I managed to write about 600 words in an hour using OpenBSD’s ed while joining my wife for dinner with some of her friends. Of course, I asked first. Contrary to some people’s opinions, I’m not utterly devoid of social graces.
It was easy. While we were waiting to order (and then for our food) and she was talking with her friends, I just fired up my laptop, logged in, and bashed out some commands.
demifiend@imaginos$ cd documents/starbreaker/novels/dissident-aggressor/witness/
demifiend@imaginos$ touch 01.scene
demifiend@imaginos$ ed -p 'ed ' 01.scene
Sure, I didn’t need to touch
the file before editing it, but it gives ed
one thing less to gripe about on startup.
ed a
A Witness for the Persecution - 1
It had been such a simple request that Morgan could not help but acknowledge it.
Had he known what manner of troubles he would bring upon himself by doing so, he might have ignored Naomi instead.
.
ed w
Writing one sentence per line and using blank lines as paragraph breaks, I was able to write at a decent pace despite being in a crowded public place. When I was done, I was able to view the finished (for now) work using commands like…
demifiend@imaginos$ cat -n 01.scene | less
Or…
demifiend@imaginos$ cat 01.scene | fmt | less
The former rendered the file as I typed it, but with line numbers. The latter re-flowed the text to put two spaces between full stops instead of newlines, making the text suitable for sharing with my wife.
And when I’m ready to revise the scene, I’ll put my changes in “01.scene.revisions”, a sed script. What makes it a sed script? Simple: it looks like this:
#!/bin/sed -f
s/<</«/g
s/>>/»/g
Of course, I had to startx
and type the guillemets in MATE, since I haven’t figured out how to make Caps Lock work like a compose key using wsconsctl(8) yet. (I use them in my fiction to distinguish texted dialogue from the spoken variety.)
Getting word counts is easy, too.
demifiend@imaginos$ cat 01.scene | wc -w
As you can see, OpenBSD’s base system has most of the tools a writer needs to start composing a work. The console is enough; a user looking to write prose need not bother with X11. The filesystem is likewise adequate for organizing one’s work if the user works out a reasonable naming convention for directories and files, and sticks with it.
The only tools the OS is “missing” out of the box for composition and revision are tools for version control other than rcs(1)
and cvs(1)
, dictionary & thesaurus searches, and spell check – and those are easily installed using the package tools.
While I could RTFM and learn to use cvs
, I’m already familiar with git
and having a remote master on BitBucket allows me to conveniently move work between machines. :)
(I’ll get this on my website eventually, but I didn’t want to wait until I had time to mess around with it.)
I don’t understand what I’m supposed to take away from this.
Don’t emacs and LaTeX work on *BSD? And even AbiWord and OpenOffice? Is it a joke? Is it making a point about using simple tools?
ed(1) is the standard text editor.
I’m confused. This is a sarcastic man page, right? Like, people don’t actually consider it the standard text editor - do they?
[Comment removed by author]
I understand that this might be serious, but it seriously reads like a parody of techie gear-obsession. GUIs (including vi) were invented for a reason, and though you don’t need to like them, when I read that “the file system is likewise adequate for organizing ones work if the user works out a reasonable naming convention” I can’t help but think of someone who exclusively uses a typewriter or someone else who uses only paper and fountain pen saying the exact same thing. And of course such people do exist, which makes the entire idea of claiming something extremely high up on the ladder of relative complexity is “adequate if the user is reasonable” rather silly.
Reading through the original message, I found myself wondering if this were real or not as well. It seems like it’s a different form of hipsterism, based in computers instead of something more analogue.
I guess it’s nice if he actually enjoys that flow, but I find it hard to believe it’s more productive than opening a modern text editor.
I mean, there have been other posts about how a lot of big authors still use WordStar. Maybe this was a parody of some kind? It kinda gets into Poe’s Law territory.
Neal Stephenson wrote ‘Cyphernomicon’ and the Baroque Cycle books with a fountain pen for the first drafts and then used Emacs for the revisions and polishing up.
Edit: Neil Gaiman uses fountain pens exclusively for his writing, and has said that using computers actually reduces his productivity.
My favorite quote by Patrick O’Brian was when he was asked what word processor he used:
That you know tools and processes that work for you is great. But it doesn’t sound like you have the best ideas about when to use them.
You say you got decent work done while your wife was talking with her friends at dinner. What they saw was someone tuning their presence out to do what they’d really wanted.
If you’re gonna be there, be there.
There are a few details to my story that I had left out because I didn’t think they were relevant. You just made them relevant.
Do you usually give out unsolicited etiquette advice online, or should I be flattered?
It’s advice, we don’t know the whole story.
I’m thankful when someone online is forward and seems genuinely interested in giving helpful etiquette advice. Unsolicited is the only solution if I don’t know I’m being rude.
Hah, I thought the same. It’s funny how most people will not put up with someone opening up their laptop in the restaurant but we don’t bat an eye when we start using smart phones.
I’m not going to defend smart phone usage and will call my friends out for using them at the table (in a friendly manner, of course), but the difference of degree between pulling out your phone and pulling out a laptop is so large it becomes a difference of kind.
I guess it only depends of the intent. If it’s just to write your thoughts quickly not to forget something, then a notebook is as intrusive in a dinner as a smartphone or a laptop.
Can someone send Donald Knuth an invite to lobste.rs? I will wait here to read his “I wrote my own typesetting system and my own font-drawing system while my wife, publisher and faculty colleagues all waited, and my 600 words took nearly three years” reply.
There’s RCS and CVS in the base system for that.
One thing that I find somewhat unfortunate is that OpenBSD has a lot of great text editing tools, yet it’s missing any kind of typesetter (troff, TeX) in the base system.
…editing because @xorhash had been kind enough to remind me of rcs(1) and cvs(1)…
OpenBSD’s base system doesn’t provide dictionary searches or spell check, either, but I’m fine with that. I’m grateful they provide X Window as part of the base system. Stuff like git, troff, aspell, diction, pandoc, and dictd I’m happy to install using the package mangler.
What I would love to know is why OpenBSD ports has the dict server but none of the dictionaries. If I want a dict daemon on my laptop so I can check definitions offline, I have to get the actual dictionary archives out of the FreeBSD port’s distfiles because ftp.dict.org is dead. While I can do that, I’d rather not have to. :)
I second xorhash’s mention of RCS. (Though, I’m no BSD user.)
I heard somewhere that RCS was designed with your sort of use case in mind! Maybe it was this post (2009)?
It’s certainly an easily understood, unixy tool. Maybe I’ll try using it one day. ;)
That’s an excellent introduction. Thanks.
However, RCS isn’t actually suited to my use case because I don’t use one file per novel. Instead, I write novels the way I code at my day job, with text distributed across various files in a directory tree. Yes, it’s probably overkill, but it beats paying a shitload of money for a Mac so I can use Scrivener or Ulysses.
My hierarchy currently looks somewhat like this:
When I’m ready to read what I’ve done as a whole, I’ll assemble the whole mess using
cat
andfmt
. Likewise when I’m done with all revisions and am ready to submit to a publisher. At that point I’ll put everything together into a file like “submission01”, mark it up with with Markdown or reStructuredText (depending on whether I was pretentious enough to include footnotes), run it through pandoc and convert it to Word format (unless the publisher is hip enough to accept an OpenDocument Text file, and then edit the output in LibreOffice to suit the publisher’s house style.You can’t manage something like this with RCS. CVS would be more appropriate, but as I mentioned in another comment I’m already familiar with git. I use it when tinkering with static site generators, build websies, and at my day job.
I don’t know much about the BSDs but I use Scrivener on Debian via WINE, flawlessly! Just a note.
Apparently there’s an AppImage of the unfinished Linux version for people who don’t want to use WINE.
Believe it or not, I’ve tried Scrivener. It’s not a bad app, but I don’t like that it stores everything in RTF files. When I’m drafting something, I’d rather work in plain text.
Also, as @qznc noted, a tool like ed(1) is great if you have a tendency to go back and edit unfinished work. I have this tendency in spades.
I don’t see why you can’t use RCS.
Compared to git, the only thing that’s missing is keeping track of contents that get moved from one file to another.
RCS is one repository per file. That’s not what I want. I want one repository for the entire project. And I want the master repository to live on BitBucket (or some other provider I trust because I’m too lazy to self-host on a VPS). This lets me sync between multiple machines.
This way, when I’m dead because somebody got upset about me typing in public and decided to beat me into the ground with my laptop, it’s possible that some other nerd who overdosed on JRPGs and Blue Öyster Cult albums as a kid might find it and take over. :)
In the true spirit of unix, you use one tool for one purpose only. Just use a separate tool for syncing. scp(1) works. rsync(1) works better. unison(1) beats everything.
You can’t really call RCS a ‘repository’. It is, after all, just one ‘,v’ file for the version history of a single file. You can setup rsync or unison to sync up ‘,v’ files exclusively, which essentially transforms rcs to a hand-rolled cvs.
Have you heard of
vi
? It’s a “visual” mode fored
. A truly amazing innovation. It lets you see the file while entering ed commands, and changes get reflected immediately.ex is not ed. i have often wished for ve instead of vi though
Isn’t that, mostly, sam?
vi, vi, vi - the editor of the beast
vi, vi, vi - the one for you and me
Just in case anybody is still unenlightened by Ed
I’ve got that book. It’s an excellent supplement to the manual page.
There is one aspect where Ed maybe has an actual advantage: It keeps you in write mode and discourages editing. I will consider using Ed for journalling where I currently use vim.
cat > $filename
will do that, too, but withed
I can switch back to command mode, save what I’ve done so far, and then continue by returning to append mode.Though I could probably do the same with
cat >> $filename
, but I’m afraid I’d forget that I need to type > twice to append and end up overwriting the file. :)This is why I prefer writing drafts in a chat with myself. Also because of the enforced pacing: the rhythm of hitting Enter when a line is done, and the leaving it as it is.
or use ex, similar enough to ed, has the vi : commands, and vi is one command away
I don’t quite think that this workflow is something that most writers are going to get excited about, although I’m happy it makes you happy.
Here’s what a professional writer with serious Linux and vim chops thinks about this: https://mobile.twitter.com/cstross/status/962051409335148546
I’m going to trust his opinion on something fully in his area of expertise. You can find more expanded arguments by him if you need them.
FYI here is a video from a writer describing his impressions using emacs.
I see a lot of push back against this. That surprises me. I liked the article.
Maybe it wasn’t said explicitly, but isn’t this about distraction free writing?
I wonder, have you heard of Word?
I know one author who swears by it. I know many who swear at it.
That’s fine, I guess. I’m not really sure why you’d want to use this when better tools have existed for years; even if you don’t subscribe to “WYSIWYG” graphical word processing, there’s still tools that are more usable and useful that subscribe to the Unix tautology.
While I could be sarcastic and say I tried ed because I like pain, Dark Souls is too easy, and going to a dominatrix would upset my wife, I actually have reasons for doing this.
Hand cranked cars that also required extensive manual lubrication weren’t that horrible either, but you would want to use them today? No, thanks ;-)
How is that possible? I though he had to write it in assembler, and only later on was it re-written in C with the help Ritchie?
But seriously, by that logic we shouldn’t have advanced beyond research unix v1, since if it could be used, why bother changing it? I understand this attitude if one looks at it like a game, but otherwise I’d rather prefer a more integrated experience, at the expense of having to focus by one’s own willpower.
It was originally written in assembly. They started turning B into C in a series of steps called “proto C’s.” They couldn’t do UNIX rewrite in them until the one with structs.
If arguing from Thompson’s actions, you’d write a modern, graphical OS in assembly (see MenuetOS). Then, you’d partner with someone who could build the best system language you could on top of the one you had available within your hardware constraints. Probably be more like Rust or Nim esp since they already exist. Could be better, like a leaner one. And then rewrite the assembly OS in that.
The result doing about the same things they did with modern tools would output something much better than UNIX and C. People trying to keep to what they did is like if they tried to keep doing what successful, number-crunching, batch-oriented computers did. Better to try to improve things.
what better tools?
vi as mentioned in thread
well vi encourages editing while you write and has a lot more commands, which can be distracting for some. i’d say vi is a different tool, not necessarily better.