1. 23

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.)

  1.  

  2. 34

    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?

    1. 12

      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.

      1. 3

        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.

        1. 3

          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.

        2. 2

          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.

          1. 2

            My favorite quote by Patrick O’Brian was when he was asked what word processor he used:

            I use pen and paper, like a Christian.

        3. 27

          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.

          1. 12

            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.

            1. My wife and her friends know I’m a writer.
            2. They know that I sometimes come up with ideas at socially inconvenient times.
            3. I had told them that talking with them had sparked an idea, and asked them if they would mind if I wrote it down right away.
            4. Only one person objected.
            5. The one person who objected wasn’t my wife, so her opinion didn’t really matter.
            6. I didn’t have headphones plugged in, so I was able to put aside my work and engage when the conversation turned back toward me.
            7. When you’re the only man in a party of twelve, the conversation doesn’t turn to you that often.

            Do you usually give out unsolicited etiquette advice online, or should I be flattered?

            1. 5

              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.

            2. 1

              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.

              1. 7

                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.

                1. 2

                  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.

            3. 9

              “Morgan, can you close your laptop and talk with the guests?” 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, he might have complied, or at least used a visual editor.

              1. 5

                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.

                1. 5

                  “missing” out of the box for composition and revision are tools for version control

                  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.

                  1. 3

                    …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. :)

                    1. 3

                      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. ;)

                      1. 3

                        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:

                        $SERIES/
                          $TITLE/
                            title
                            dedication
                            disclaimer
                            acknowledgements
                            $SUBPLOT1/
                              01.scene
                              02.scene
                              01.revision01.sed
                            $SUBPLOT2/
                              01.scene
                        

                        When I’m ready to read what I’ve done as a whole, I’ll assemble the whole mess using cat and fmt. 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.

                        1. 4

                          I don’t know much about the BSDs but I use Scrivener on Debian via WINE, flawlessly! Just a note.

                          1. 3

                            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.

                          2. 2

                            I don’t see why you can’t use RCS.

                            % ed test
                            a
                            this is a test of using
                            RCS for version control.
                            .
                            w
                            49
                            !ci -l % 
                            ci -l test
                            test,v  <--  test
                            enter description, terminated with single '.' or end of file:
                            NOTE: This is NOT the log message!
                            >> test check in
                            >> .
                            initial revision: 1.1
                            done
                            !
                            ,n
                            1	this is a test of using
                            2	RCS for version control.
                            a
                            
                            Now we add a new paragraph.
                            .
                            w
                            78
                            !ci -l %
                            ci -l test
                            test,v  <--  test
                            new revision: 1.2; previous revision: 1.1
                            enter log message, terminated with single '.' or end of file:
                            >> new paragraph 
                            >> .
                            done
                            !
                            ,n
                            1	this is a test of using
                            2	RCS for version control.
                            3	
                            4	Now we add a new paragraph.
                            q
                            

                            Compared to git, the only thing that’s missing is keeping track of contents that get moved from one file to another.

                            1. 2

                              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. :)

                              1. 1

                                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.

                    2. 9

                      Have you heard of vi? It’s a “visual” mode for ed. A truly amazing innovation. It lets you see the file while entering ed commands, and changes get reflected immediately.

                      1. 2

                        ex is not ed. i have often wished for ve instead of vi though

                        1. 2

                          Isn’t that, mostly, sam?

                        2. 1

                          vi, vi, vi - the editor of the beast

                          vi, vi, vi - the one for you and me

                        3. 4

                          Just in case anybody is still unenlightened by Ed

                          1. 2

                            I’ve got that book. It’s an excellent supplement to the manual page.

                          2. 4

                            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.

                            1. 3

                              There is one aspect where Ed maybe has an actual advantage: It keeps you in write mode and discourages editing.

                              cat > $filename will do that, too, but with ed 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. :)

                              1. 2

                                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.

                                1. 1

                                  or use ex, similar enough to ed, has the vi : commands, and vi is one command away

                                2. 3

                                  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.

                                  1. 2

                                    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.

                                    1. 2

                                      FYI here is a video from a writer describing his impressions using emacs.

                                      1. 2

                                        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?

                                        1. 2

                                          I wonder, have you heard of Word?

                                          1. 7

                                            I know one author who swears by it. I know many who swear at it.

                                            1. 2

                                              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.

                                              1. 2

                                                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.

                                                1. I had bought an electronic copy of Michael W. Lucas’ Mastering Ed, and figured that since he bothered to write it and I bothered to not only spend five bucks on it but read it, I might as well try actually using ed.
                                                2. I wanted to cut through all of the memes and see if using ed was really as terrible an experience as people seem to think it is. I figured that if Ken Thompson could use it to write the first version of Unix on a PDP-7, it couldn’t be that horrible.
                                                3. I want to separate composition from revision because I have trouble actually finishing shit; I tend to go back and edit when I should be writing. A line editor like ed doesn’t prevent me from going back and making changes, but it does make doing so hard enough that it’s easier to say “fuck it” and keep going.
                                                1. 4

                                                  Hand cranked cars that also required extensive manual lubrication weren’t that horrible either, but you would want to use them today? No, thanks ;-)

                                                  1. 2

                                                    I figured that if Ken Thompson could use it to write the first version of Unix on a PDP-7, it couldn’t be that horrible.

                                                    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.

                                                    1. 2

                                                      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.

                                                  2. 1

                                                    what better tools?

                                                    1. 2

                                                      vi as mentioned in thread

                                                      1. 1

                                                        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.