Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Commands»How to Save and Quit from Vim

    How to Save and Quit from Vim

    RahulBy RahulOctober 3, 20142 Mins ReadUpdated:June 7, 2022

    VIM is an enhanced version of VI text editor. It is a highly configurable text editor to edit files very efficiently. Many Linux beginners face issues with exit form vi/vim editor. This tutorial will help you to exit the Vim text editor on the Linux command line.

    How to Exit Vim?

    As we have already seen in advanced Vim tips, there are multiple ways to quit Vim. Let me list them one by one along with the procedure.

    You have several ways to exit from the Vim text editor. But you need to choose the right command to exit from Vim editor based on your decision. Remember that the exit command always runs from Vim command mode. So you need to press ESC to go to command mode. Now type a colon : to before writing exit command.

    • ESC + :w – Save changes and continue editing.
    • ESC + :q – Quite (exit) from vim editor, only if no changes made.
    • ESC + :wq – Write changes and quite from Vim editor.
    • ESC + :q! – Quit Vim editor without saving any changes (discard all changes made after last saved).
    • ESC + :wq! – Forecefully save changes and quick from editor.

    Save and Quite from Vim Editor

    Quit Vim using Keyboard Shortcuts

    You can also use keyboard shortcuts to exit from the vim editor. No need to type anything. Press ESC to make sure you are in command mode.

    • Shift + z + z – save changes and exit
    • Shift + z + q – exit without saving changes

    Reference:
    http://vimdoc.sourceforge.net/

    vi vi editor vim
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleBoosting Your Business With Trade Show Exposure
    Next Article How To Install phpPgAdmin on Ubuntu 16.04 and 14.04 LTS

    Related Posts

    How to Search Recently Modified Files in Linux

    2 Mins Read

    Bash Printf Command

    Updated:December 23, 20212 Mins Read

    Tee Command in Linux with Examples

    4 Mins Read

    How to Scan Open Ports with Nmap

    5 Mins Read

    Handling filenames with spaces in Linux

    3 Mins Read

    How To Compare Two Files in Linux

    Updated:August 23, 20215 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    • How to Install Angular CLI on Ubuntu 22.04
    • How to Install Composer on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.