1

While experimenting with the ex text editor, I executed the :$i command (which inserts text before the final line) and found myself unable to proceed.

I assumed that I could return to normal mode by pressing esc, similar to vi(m), but it didn't have any effect.

Now I'm struggling to find a way to save, exit, or perform any action other than typing more characters into the file.

How can I resolve this situation?

Z0OM
  • 3,149

2 Answers2

2

I couldn't find any information in the man page or through a web search, so I resorted to trying various key combinations until I found a solution.

It turns out that to return to command mode (or whatever it's called), you need to press . (period) followed by the Enter key.

Z0OM
  • 3,149
0

To exit the insert mode in ex, you can press Ctrl + C to interrupt the current command and return to the ex command prompt.

To exit with . an than press enter, you must always be on a new line and the first character must be the . (period). There should be no character before or after it.

From there, you can proceed with other actions such as saving, or performing additional edits or exiting the programm with :q!

Z0OM
  • 3,149