Launch and Quit Vim

Michael Chan
InstructorMichael Chan
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 3 years ago

Quitting Vim is something that thousands of developers struggle with every day. Fortunately, for the astute, Vim tells us how to quit right on the launch screen.

Quitting Vim requires a mindset shift. Where most editors open in a persistent insert mode, Vim defaults default mode is different. It's known as normal mode and it allows you to type commands. Quit is one of those commands...

Michael Chan: [00:00] To launch Vim in a terminal, type Vim, the name of the program, and hit Enter. Opening Vim like this gives us a launch screen with important information on it -- how to get help, and how to quit.

[00:12] Unlike traditional editors, which only have an insert mode, Vim's default mode lets you issue commands. We quit by typing :q and hitting Enter.

[00:24] This shift can be very disorienting if you only used editors that default to insert mode, which would insert the text as you start typing. Vim does not default to insert mode.

[00:36] If you want to quit and don't have a handy-dandy launch screen, you can hit Ctrl-C, which is a commonly used command to halt terminal programs. This won't quit Vim, but it will prompt you with some details on how to quit. This message is getting truncated because I've zoomed in so far.

[00:53] I'll suggest that we use :qa, which will prompt us if we have any uncommitted changes, changes like my typing above here. If we don't care about those changes and don't mind discarding them, we can type :q! Or :qa! For all of the uncommitted files. That will force quit us out of them.

[01:13] That's it. That's how you launch and quit Vim.

egghead
egghead
~ 13 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today