The Standard Editor has come to Rust!

What you have long waited for has finally occurred, a Rust native feature complete implementation of Ed is now available!

It has been released with two delivery methods.

  • The add-ed crate is a library with all the parsing and execution logic, to allow you to embed a feature complete Ed in any rust application.
  • The hired CLI text editor uses the add-ed library and provides it with a syntax highlighting print.

There are also some added features, such as:

  • Macros with arguments, to perform multiple commands with a single command. Come full circle by adding a grep macro for g/$1/p/!
  • Piping through a shell command. Previously you could pipe out or in, never both, but now you can |sort or |fmt your lines in a jiffy!
  • Expanded undo functionality. In this version of Ed you can undo more than one step backwards, and it tells you what command you just un-/re-did!
  • Default printing flags. Set lines to always print numbered, save yourself hundreds of 'n's over a day!
  • help and Help are valid commands which respectively print command summary and command documentation.

Alright, you probably weren't waiting for an editing convention that mostly died with the introduction of vi to make a comeback. But maybe you have some nostalgia for ed or edlin. And even if you don't, consider giving it a try, it is an interesting experience compared to modern editing.

9 Likes

I hope it has as informative and helpful error messages as the original!

6 Likes

Just like the original you can toggle if it prints the error or just '?', but unlike the original it defaults to printing them. You are free to submit an issue for this grave bug :wink:

2 Likes

I tried

cargo install hired

on windows and got a bunch of errors. Is it meant to be Linux-only?

Start of the errors:

Compiling crossterm v0.27.0
error: Compiling on Windows with "windows" feature disabled. Feature "windows" should only be disabled when project will never be compiled on Windows.
--> C:\Users\ano31.cargo\registry\src\index.crates.io-6f17d22bba15001f\crossterm-0.27.0\src/lib.rs:255:1
|
255 | compile_error!("Compiling on Windows with "windows" feature disabled. Feature "windows" should only be disabled when project will never be compiled on Windows....
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: use of undeclared crate or module winapi
--> C:\Users\ano31.cargo\registry\src\index.crates.io-6f17d22bba15001f\crossterm-0.27.0\src\cursor\sys\windows.rs:8:5
|
8 | use winapi::{
| ^^^^^^ use of undeclared crate or module winapi

That was news to me. I Thought crossterm was crossplatform by default, maybe they changed it in one of their recent releases. I'll enable that feature and make a release shortly.

(what actually happened: When they added bracketed paste as a default feature I disabled default features and missed adding windows as an explicit feature as it isn't documented outside their Cargo.toml.)

2 Likes

New release being published now, just the build taking some time with parsing the syntax definitions into a compressed format before it goes up. Should be up before you notice this message.

Note however that the editor is primarily built and tested on linux, so there may well be a few issues that I've never noticed. If you find such, do create an issue on github (or maybe even a PR with a fix).

It does now build on windows. When I ran it though, it seemed to behave a little strangely, although I haven't read the manual yet, so not sure exactly what it should do! Sorry, I may not get round to actually trying it out for real. Was just an exercise in nostalgia really, I think I was using Ed sometime around 1980, although it is hard to be sure.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.