vi doesn't depend on X working. So if everything is fubar, you can still vi.
And for very simple occasional use of vi, the command set is VERY small:
ESC : get out of input mode
i: insert (do into input mode)
":" : get into command mode
dd: delete a line
ARROW KEYS: move about
dl: delete a character. you'll learn which one it's deleting
w: write the file
q: quit the file
q!: REALLY quit the file, even if vi thinks it unwise
No "Open is under FILE" or "Edit->Abandon changes to undo all changes and exit".
A very minimal set of vi commands gets work done. And works ANYWHERE with a command line on linux.