* Front Page * Table of Contents * Return to Town

ed quickstart

ED IS THE STANDARD EDITOR

About

ed is a bit of a meme and also a beloved tool and utility here at tilde.town. It is a perfectly reasonable choice of editor, and you may find that you enjoy using it for writing and composing. In fact, the first version of this page was written and edited entirely in ed.

ed!

Getting Started

ed is a line editor that you can use interactively and also in scripts. It is not a visual editor. You may find this takes a little bit of time to get used to.

To edit a new file with ed, type ed myfile.txt at the command line prompt. This will drop you into an astonishingly barebones editor. To insert text, type i and press enter. This will drop you into Insert mode. Type away. When you are done, enter . on a new line by itself and press enter. This will exit Insert mode and put you back into regular mode.

In regular mode, if you want to see what you have entered so far, type ,p + enter. Or if you want to see line numbers (which is helpful because this is a line editor) type ,n + enter. To save your file and exit, type wq + enter.

To make changes and edits to your text you can change a whole line with nc + enter where n = the line number. e.g. 18c + enter will drop you into Insert mode and you can retype all of line 18. You can also use the s command which you will be familiar with if you have used vim or sed. Its syntax is s/find/replace/. In ed, you can prefix it with a line number. e.g. 18s/ramalama/dingdong/ + enter to change just a portion of a line and not the whole thing.

Next Steps

There's a lot more ed can do! You can move lines around and read and write to shell commands. Check out info ed for more info.

Best Practices

ed is actually pretty great for composing text because its lack of distractions and most of all its design allow you to focus on the act of writing and save editing and revising for later.

To make future edits easier it is best to adopt the use of Semantic Linebreaks, which is to say it is best to keep your lines very short, each line comprising a small semantic unit of each sentence. If you linebreak after each fragment or thought, and after each comma and pause, then you'll have an easier time revising those lines later.

See more:

https://sembr.org/


last compiled: 2024-10-15 11:00:58.792855