1. 23
  1.  

  2. 7

    an older, but really good article.

    1. 1

      I’ve subscribed to this method for a long while but I tend to substitute ed for vim and add tmux for splits. If only there was a newer line editor that had line editing capabilities with vim keybindings…

      1. 4

        I still love ed as an editor; I’m still not comfortable doing actual coding work in it; but I reach out to ed more and more for small config edits after reading “Actually using ed” (http://blog.sanctum.geek.nz/actually-using-ed/).

        Anyone here actually using ed … for real development tasks?

        1. 5

          I actually use it for about 90% of my daily work. I realized after years of Vim usage that I was mostly just using ex commands anyway. I’ve become fairly productive with ed aside from one issue: changing a line. That’s where the ‘line editor with line editing’ thing came from. Instead of just replacing the line, I’d love to just populate the line with the content and use a line editor to actually edit it.

          I have directories filled with stalled attempts at this; there’s half-completed Go-implementation with a fork of golang.org/x/crypto/ssh/terminal, a rewrite of plan9 ed in c99 for modern *nix with linenoise, and an attempt to add linenoise with modifications to the heirloom version of ed.

          More modern regex support would probably be convenient as well. On the whole I find that ed integrates well with my workflow and presents only minor annoyances. I would love to see a resurgence and remixing of the traditional line editor, however.

          1. 3

            Have you checked out sam from plan9/p9p? Probably, as you mention working with plan9’s ed. Heck, it might be the same editor.

            I’d be interested in your thoughts on it.

            1. 4

              You know, I used it for a bit but mostly kept getting sam commands confused with ed commands. Something like 157,189n just falls out of my fingers and I wound up just reverting back to Plan 9’s ed (which is still the version I use). The structural regular expressions are great though and I’d love to see them implemented in other editors. I should try using sam again. The few differences in commands is worth it for the structural regexs alone.

              I’ve also been meaning to track down the sources for qed for archaeological purposes.

              1. 2

                Wow, it’s neat to see that mentioned. I’ve never used it, but I read about it extensively many years ago when I was more interested in text editors. It’s always a surprise when someone else remembers!

              2. 1

                Care sharing one of said directories somewhere?

            2. 2

              vi + open mode?

              1. 1

                I didn’t even know open mode was a thing but I remember reading about open mode in ed from an interview with Bill Joy:

                But while we were doing that, we were sort of hacking around on ed just to add things. Chuck came in late one night and put in open mode - where you can move the cursor on the bottom line of the CRT.

                The real question is how do you enable open mode in vi/vim without having a hardcopy terminal?

                1. 2

                  vim/nvi doesn’t have it. Use ex from ex-vi, then, e.g.:

                  % TERM=dumb /usr/bin/vi /etc/passwd 
                  [Using open mode]
                  "/etc/passwd" [Read only] 24 lines, 1520 characters 
                  root:x:0:0:root:/root:/bin/bash                     
                  ...
                  
                  1. 1

                    Installed. It’s very interesting. It’ll take a little getting used the ex commands.

                    ex

                    "/tmp/ed" [New file]
                    :i
                    No lines in the buffer
                    :a
                    the quick
                    brown fox
                    jumped
                    .
                    :.
                    jumped
                    :,
                    jumped
                    :q
                    No write since last change (:quit! overrides)
                    :q
                    No write since last change (:quit! overrides)
                    

                    ed (plan 9)

                    ?/tmp/ed2
                    i
                    the quick
                    brown fox
                    jumped
                    .
                    ,
                    the quick
                    brown fox
                    jumped
                    q
                    ?
                    q
                    

                    One big thing I like about ed is the ability to look through the scrollback and see changes as they were made, even after closing a file or while editing another file. The use of a full screen interface removes this ability. I’ll definitely play with this a bit more though. Thank you for the recommendation.

                    :i  
                    this
                    is a t^A^E^[^[
                    
            3. 1

              Acme does this wonderfully. I wish I could get structural regexps in my vim.