Press Esc to enter Command mode, and thentype :wq to write and quit the file. The other, quicker option is to use the keyboard shortcut ZZ to write and quit.Aug 20, 2019