Geekdosage
  • Home
  • Computer hardware
    • GPU
      • AMD
      • Nvidia
    • Processor
  • Linux
    • CentOS
    • Ubuntu
  • Docker
  • Computer Software
    • Operating System
      • Windows
      • MacOS
      • Android
  • Gaming
  • Computer Science
    • Network Engineering
    • Comparisons

Geekdosage

  • Home
  • Computer hardware
    • GPU
      • AMD
      • Nvidia
    • Processor
  • Linux
    • CentOS
    • Ubuntu
  • Docker
  • Computer Software
    • Operating System
      • Windows
      • MacOS
      • Android
  • Gaming
  • Computer Science
    • Network Engineering
    • Comparisons
CentOSHow toLinuxUbuntu

How to Exit Vim

by GeekDosage March 11, 2021
written by GeekDosage March 11, 2021
How to exit from Vim

How to exit from Vim/Vi is a common question asked by most of the new users who don’t have much experience with the Vim/Vi editor. Vi is a Linux command line editor and Vim is the enhanced version of Vi.

In this tutorial we are going to explain few different methods on how to exit Vim.

Exit Vim

  • Press the Esc key to enter “Normal mode” in the vim editor.
  • Type :wq to save the new changes to the file and exit.
  • Type :q to exit. You can’t just quit like this if there are any changes.
  • Type :q! to exit without saving the changes you have made.

These three methods are the basics you can use to exit from the Vim/Vi editors. It’s very simple. You can edit the file by switching into insert mode by pressing i key and return back to normal mode by pressing esc key.

Switch between vim modes
Switch between the modes of Vim editor

You can see the command type in the normal mode at the bottom left corner of the terminal.

commands execution in normal mode of Vim editor

More Options to exit from Vim/Vi editor

There are more options available to play around with the Vim editor other than the above-mentioned methods. You can practice all the methods and apply as you prefer in practical usage of vim editor.

  • Type :x in normal mode to write and exit
  • Type:exit in normal mode to write and exit (same as :x)
  • Type ZZ in normal mode to save and exit (same as :x)
  • Type ZQ in normal mode just to exit (same as :q!)
  • Type :qa in normal mode to quit all

Conclusion

In this short tutorial, we explained how to use different methods to exit from vim. This is one of the most googled questions by developers. Hope you can understand the simply explained tutorial and please comment on all your doubts and suggestions.

Read More:

How to Copy, Paste and Delete in Vim / Vi
GeekDosage
exit vimhow to exit from vimvim
0 comment
0
FacebookTwitterPinterest
previous post
SCP Linux – Securely Copy Files in Linux Using SCP with examples
next post
Best 10 Docker Hosting Services

Related Posts

How to fix “dial unix /var/run/docker.sock: connect: permission...

August 10, 2021

How to connect to your VirtualBox VM from...

August 8, 2021

How To Install Cloudflare Origin SSL Certificate with...

July 20, 2021

How to Stop all Docker Containers

June 8, 2021

Cloudflare Origin SSL vs. Let’s encrypt SSL

May 9, 2021

Best 10 Docker Hosting Services

April 7, 2021

SCP Linux – Securely Copy Files in Linux...

February 22, 2021

How to Copy, Paste and Delete in Vim...

February 7, 2021

How to Copy Files Between Linux Servers Using...

February 4, 2021

passwd: Module is unknown issue in Ubuntu

January 26, 2021

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

In This Article

  • 1 Exit Vim
  • 2 More Options to exit from Vim/Vi editor
  • 3 Conclusion
  • 4 Read More:

Keep in touch

Facebook Twitter Google + Instagram Pinterest Email

Popular Posts

  • How to change the forgotten root password in CentOS 8

  • How to remove/delete user in Linux

  • How to Create a Private Docker Registry in Ubuntu 20.04

  • How to Build a Docker Image from Dockerfile

About Geekdosage

Geekdosage is a technology based website which mainly focuses on network engineering, computer science, automation, computer hardware and software and internet technologies. Our purpose is to create a platform where anyone can access the subject areas without barriers.

Recent Posts

  • How to fix “dial unix /var/run/docker.sock: connect: permission denied” error

    August 10, 2021
  • How to connect to your VirtualBox VM from your Host OS using SSH

    August 8, 2021

Find us

Facebook Twitter Instagram Pinterest Email
  • About Us
  • Contact Us
  • Disclaimer
  • Terms and Conditions
  • Cookie Privacy policy
  • Privacy Policy
  • DCMA

@2021 - All Right Reserved | Designed and Developed by GeekDosage