NOTES USING ED ed is a line-oriented text editor that's both simple and powerful. I find it very fun to write with, and I like how it integrates well within other unix tools. This place is where I write about things I learn to improve my text editing with ed. ============================================================ UNDERLINE DATES To add "---" after every line matching a date: g/^2...-..-../a\ ---------- ============================================================ ADD A SEPARATOR 1. have a script in your PATH that looks like that: printf "$1%.0s" $(seq 60) 2. if you want to insert the separator after the title (line 1): r1 !sep = ============================================================ HARD WRAP LINES e !fold -s -w60 % w To simplify things further, add a script to your PATH called f60 that does the following: fold -s -w60 $1 That way, simply run: e !f60 %. ============================================================ JOIN LINES s/$/ / j Then just s and j until all lines are joined. ============================================================ ERASE LINE If you start to write a line or a command, and you want to completely delete it, use <CONTROL> + u. ============================================================ SCRIPTING Invoke ed the following way: ed "!ls -r | grep '^[0-9]\{8\}'" < atom.ed where atom.ed is your list of instruction. The file doesn't need to end with .ed.