Does anyone use an unusual or unique text editor?
My regular TUI text editor is
ViM, but another text mode editor I semi-regularly use is
GNU Ed; which if you are using GNU/Linux, you might find it already be installed on your machine.
Context first, since it could be very-alien to many people here:
Ed is an ancient text editor, from the age when the smallest computer was as large as a closet, and the main way of using such computer interactively was sitting in front of a large electric "typewriter" (actually called teleprinter
(0)) that you type commands in and computer would type the output of those commands out; all on paper.
(1) There was no screen, just a large scroll-- literally.
So when you edit text with Ed, you see
nothing until you explicitly made it show the actual text (addressed by line number and its range)-- and even if you did so, you would not be editing that text you see directly, you edit by
typing individual instruction to edit that text.
For example, this is my Ed session to write Hello World shell script:
$ ed hello.sh
P
*H
Cannot open input file
*0a
#!/bin/sh
echo 'Hello World!'
.
*2c
printf 'Hello World!\n'
.
*,n
1 #!/bin/sh
2 printf 'Hello World!\n'
*w
34
*q
$ ls -l hello.sh
-rw-r--r-- 1 xwindows xwindows 34 Feb 8 18:21 hello.sh
$ sh hello.sh
Hello World!
$
The command "P" was to show an asterisk prompt (which distinguish command entry from entry of text into the file), and command "H" was to make it show actual error message of each action instead of just printing mere "?" to save ink.
I used command "0a" to append text after line 0 (i.e. file's very beginning) insert text; text insertion ended as soon as I typed a line with single dot. Then I changed my mind and wanted to use a "printf" command instead of "echo": I remembered that I entered "echo" stuff on the second line, so I set out use command "2c" to change (read: replace) the second line, entered replacement content there, then ended with a line with single dot.
Then for final assurance, I made it print out the entire range of lines currently in the buffer along with its line number (command ",n"), then finally saved the file (command "w", which shown number of bytes written), and exited (command "q").
And since we're no longer in a teleprinter era, today you are allowed to backspace through what you are typing in the current line (but not moving cursor to the beginning of the line to edit things there-- you still have to backspace all the way through). Otherwise, it's still the same text editing experience as 1970s minicomputers. Partially editing something in the line, or even adding actual line with single dot, requires typing in a regular expression-based command.
Ed is a text editor that relies heavily on user's imagination; if you're not imaginative, you can have a hard time using it.
I taught myself to use Ed so I could survive text editing in extreme environment (like Busybox-based router's telnet command line), as a preparation for myself in making software that explicitly support dumb terminals and teleprinters, and just... to avoid littering files around (ViM leaves history file by default) when I was editing system configuration file in PID-1 shell environment on my GNU/Linux system with `HOME` environment variable not properly set.
(0) It's sometimes called "teletype", but this one is actually a brand name of teleprinter (Teletype Corporation) now genericized.
(1) Of course, no real backspacing back then too, like when typing "This has a thpo" and you would like to correct it, pressing Backspace wouldn't erase the last letter typed from the paper, but would only remove that letter from the memory then output "^H" on the paper for you to see. Your correction of current input line would look like this on the teleprinter:
This has a thpo^H^H^Hypo.
If you wanna see what this feels like, you can demo this effect by running this command in your GNU/Linux terminal:
stty -crterase ; cat > /dev/null ; stty crterase
Then try typing anything into that, then try backspacing to see what happens. (Spoiler: nowadays, ANSI-compatible terminals use DEL character for backspace, so you'd see "^?" instead of "^H") Press Enter followed directly by Ctrl+D to end the demo. And if you would like to see the actual result of your typing, feel free to change `/dev/null` part to a filename you'd like to save your text to.