Basics, Opening, Closing & Saving

Vim Text Editor Quick Reference

1 min read

Published Jul 6 2025


11
0
0
0

LinuxText Editor

Opening files

From the terminal:

vim filename

From within Vim:

KeyDescription
:edit

:edit filename will open the file

:e

or alternatively you can use the short form of :e filename

:split

To open another file while in Vim to a split window, you can use :split otherfilename

:sp

or use the short form sp: otherfilename to also open in a split window

:vs

To open another file in a vertical split window use :vs otherfilename


Saving & exiting

KeyDescription
:w

Save the current file, you can specify a new filename by adding :w newfilename

:q

Close the current file

:wq

Save and quit

:x

Save and quit alternative

ZZ

Save and quit alternative

:wqa

Save and quit all open files

:q!

Force quit with no save

ZQ

Force quit alternative

:qa

Close all files

:qa!

Force quit all files

© 2025 SimpleSteps.guide
AboutFAQPoliciesContact