Basics, Opening, Closing & Saving
Vim Text Editor Quick Reference
1 min read
This section is 1 min read, full guide is 16 min read
Published Jul 6 2025
11
Show sections list
0
Log in to enable the "Like" button
0
Guide comments
0
Log in to enable the "Save" button
Respond to this guide
Guide Sections
Guide Comments
LinuxText Editor
Opening files
From the terminal:
vim filename
Copy to Clipboard
From within Vim:
Key | Description |
---|---|
: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
Key | Description |
---|---|
: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 |