Yeah, hitting escape shouldn't exit the editor. What escape does is exit the current mode in which VI is currently in, for example, if I'm editing the file "example.txt", I should type "i" to start editing and to exit the editing mode I should hit escape, to quit vi I should type ":q!" (after exiting any mode) to quit without saving, ":x" to save and quit, or simply ":q" to quit the editor.
I will leave you this document: Basic vi Commands it talks about VI, its modes and commands.
Thanks. a great help