You say you can exit vim, have you ever tried exiting `ed` instead?
summary
Ed is the canonical line editor found on every POSIX machine and it explains many modal ex commands in modern editors. Live demo shows it runs in a plain terminal, uses a prompt set with Ctrl-P, edits by appending with a ... . and stopping with . , prints with p or %p, deletes with 4d, joins lines with 3,4j, searches with / and global with g/p, and writes files with w — it actually works.
AI-written summary · about
