Pinned post
Pinned post

Felt like dressing up as something scary for Halloween:

$ alias ed=emacs

Parents, please check your kids' candy this Hallowe'en. I just found a Lisp interpreter pretending to be a text-editor inside one of their chocolates.

For you who like to theme your $EDITOR for spooky season, ed(1) has you covered:

$ed -p '🧛‍♂️ ' stoker-dracula.txt

$ ed -p '🫀 ' poe-telltale-heart.txt

$ ed -p '🕷️ ' creepy-crawlies.txt

$ ed -p '🧟🪦 ' tales-of-the-undead.txt

$ ed -p '👻🏚️ ' ghost-stories.txt

You know what doesn’t have a high probability of getting compromised via some shady plugin because it doesn’t somehow execute random js code from somewhere on the internet? A normal text editor.

Ed, man! !man ed

(Alright, alright, I’ll also accept vi(1).)

@netbsd *angry goose meme* what is the _standard_ editor? What's the standard editor, NetBSD?

You know, ed(1) is not a perfect editor. It stutters on globally editing a 47MB file (replacing a couple thousand entities through regex.) But #Emacs and #VSCode can’t even edit a single char without hanging for seconds. ed(1) is the best imperfect option out there.

@ed1conf

@nantucketlit @hyde @thorstenzoeller @amin @eclecticpassions @birming @gumnos @ed1conf

It's a lot more usable than you'd think, particularly nvi.

#ed as a main editor does take a bit of mental prep, but it's mostly quite usable. ;)

I don't even miss #vim's column select mode. It's quite easy to implement with basic substitutions. ;)

Why add encryption to ed? That's what crypt(1) is for.

In case you happen to find yourself editing a shell-script inside ed(1) and want to run it from within ed, you can use

!%

or if it takes arguments

!% -zf

@cks

Huge Font/Small Screen Challenge:

Open a terminal with a ridiculous font-size that results in a tiny number of columns/rows, ideally 40x25 or less, e.g.

$ xterm -fa 'xft:JetBrains Mono' -fs 42

(maximize the window)

$ echo $COLUMNS $LINES
40 10

and attempt to use your preferred $EDITOR/$VISUAL.

How readily can you edit text?

@dougmerritt I went the other direction: learned sed first and only later discovered there was an interactive version of sed (that is, ed). @ed1conf

Advanced Programming in the #UNIX Environment

Week 5: ed(1) is the standard text editor

What? You thought we could skip ed(1)? No way! It's the standard text editor. ed man! !man ed

But understanding ed(1) also helps us understand other tools like vi(1), sed(1), and ultimately even things like diff(1) and patch(1) better.

youtu.be/mRZsV7aMK0I

Show thread

Reading over @mwichary's excellent blog post about differences between Windows and Mac keyboards makes me appreciate ed(1) all the more. No need to worry whether you have Control or Alt or Windows/Logo/Mod4 or Meta or Fn modifiers or how they're named. No worries about arrow-keys or Home/End or Pgup/Pgdn or F1–F12 keys.

Just you, your text, and some 7-bit printable-ASCII commands supported by just about every computer¹

⸻

¹ okay, some like the Apple II had uppercase-only and were non-ASCII

Gonna see how far I can get using #ed to write toots sometimes.

@sirjofri
Line editors are also super handy when you're using a device that isn't so great at refreshing the whole screen, like a slow serial line
@ed1conf
Sometimes it feels like unironically using ed as an editor is something people just can't believe.

Don't get me wrong, I don't use it for huge editing tasks. It is my preferred editor for git commits and smaller things, like three-line shell scripts and changing a line in a config file and stuff like that.

#unix #ed #editor @ed1conf

So somebody created a notebook that lets you run Markdown code-blocks

If you want to run a backtick-delimited block of Markdown in ed(1) that your cursor is on:

?`?+,//-w ! command

And if it's a block of four-space-indent surrounded by empty lines, you can do similarly with

?^$?+,//-w ! sed 's/^ //' | command

(you can skip the sed invocation if the program happily ignores leading whitespace)

If you want to run one of those blocks on a remote server, you can use ssh for that:

?^$?+,//-w ! sed 's/^ //' | ssh me@remote "command"

Show older
BSD Network

bsd.network is a *BSD-adjacent Mastodon Instance. We have a code of conduct.