:q[uit] | Quit VimThis fails when changes have been made. |
:q[uit]! | Quit without writing |
:qa | Quit all buffers / tabs |
:cq[uit] | Quit always, without writing |
:wq | Write the current file and exit |
:wqa | Quit and write all buffers / tabs |
:wq! | Write the current file and exit always |
:wq {file} | Write to {file}. Exit if not editing the last |
:wq! {file} | Write to {file} and exit always |
:[range]wq[!] | Write the lines in [range] and exit always |
ZZ | Write current file, if modified, and exit |
ZQ | Quit current file and exitSame as :q!. |