3


If I open multiple files in vi using vi *.py then how do I exit the whole vi session instead of editing each and every file? Seems like a simple enough issue but can't find anything on google.

  • Are you sure you are using vi and not vim? You can do :qall in vim, but not vi. Lots of systems use vi as a link to vim – DJMcMayhem Nov 22 '16 at 21:32

1 Answers1

7

You can quit from all open files (buffers) by :qa or :qa! In vim. The exclamation mark means to force quit the edited unsaved file.

Also there's ZQ and ZZ shortcuts to quit and save quit respectively, though I'm not sure if they would quit all files as unfortunately have never came to check.