From fff4a4c95e57f0e1742984caa66996255149e1cd Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sun, 10 Jul 2016 10:59:29 +0100 Subject: [PATCH] add ed.md (#944) * add ed.md inspired by this very nice introductory blog post: https://sanctum.geek.nz/arabesque/actually-using-ed/ * ed.md: fix linting --- pages/common/ed.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pages/common/ed.md diff --git a/pages/common/ed.md b/pages/common/ed.md new file mode 100644 index 000000000..88f613ba7 --- /dev/null +++ b/pages/common/ed.md @@ -0,0 +1,35 @@ +# ed + +> The original Unix text editor. + +- Start ed, editing an empty document (which can be saved as a new file in the current directory): + +`ed` + +- Start ed, editing an empty document, with `:` as a command prompt indicator: + +`ed -p :` + +- Start ed editing an existing file (this shows the byte count of the loaded file): + +`ed -p : {{path/to/file}}` + +- Toggle the printing of error explanations. (By default, explanations are not printed and only a `?` appears): + +`H` + +- Add text to the current document. Mark completion by entering a period by itself in a new line: + +`a{{text_to_insert}}.` + +- Print the entire document (`,` is a shortcut to the range `1,$` which covers the start to the end of the document): + +`,p` + +- Write the current document to a new file (the filename can be omitted if `ed` was called with an existing file): + +`w {{filename.txt}}` + +- Quit ed: + +`q`