Vim – How to Quit vi Editor

editorskeyboard shortcutsvim

I'm new to vi. I started vi on my Ubuntu machine and I can't quit. I see the editor and I can write text, at the bottom line there is a label "recording".

How do I quit the vi editor?

Best Answer

vim is a modal editor. Hit the ESC key to get into Normal (command) mode then type :q and press Enter.

To quit without saving any changes, type :q! and press Enter.

See also Getting out in Vim documentation.

Related Question