How to quit vi/vim

Rob

Administrator
Staff member
Joined
Oct 27, 2011
Messages
1,210
Reaction score
2,240
Credits
3,485
This has been a long term joke, but as an avid vim user, it's simple.

Once you open your file and edit it, to quit vi/vim, you simply:

Quit without saving:
ESC, then :q

If you ctrl-c, you'll create a swap file..

Quit with saving:
ESC, then :ZZ

Vim is really the ultimate editor.. learn to use it and you'll get a promotion at work ;)
 


This has been a long term joke, but as an avid vim user, it's simple.

Once you open your file and edit it, to quit vi/vim, you simply:

Quit without saving:
ESC, then :q

If you ctrl-c, you'll create a swap file..

Quit with saving:
ESC, then :ZZ

Vim is really the ultimate editor.. learn to use it and you'll get a promotion at work ;)


I am in the habit of using ESC :wq!
 
Quit with saving:
ESC, then :ZZ
My understanding of Save and Quit is: ESC; :wq
I have not see :ZZ usage.
Kindly, could you please tell me if this is a newly added feature?
How is :ZZ different from :wq?
 
:ZZ has been around for a while.. I'm thinking at least 20yrs that I've been using it - My understanding is that its identical to :wq.

It's quicker for me to type and I'm just used to it :)
 
OpenBSD kinda forced me to learn Vim, since the default install doesn't include Nano..... :) So, another way, if someone didn't post it, is this: when at the last character on a line, press the Right Arrow on your Keyboard..... :3 Now, you're in interactive mode..... :) I don't know much beyond this: type ; Scratch that..... Vim on Linux is different..... :( :( :(
 
VI commands for day to day working:
Note: **Press ESC key to come out of VI

:q -> to quit
:w -> to write
:qw -> to write and quite
:qw! -> to write and quite forcefully

h -> to move cursor left
j -> to move cursor down
k -> to move cursor up
L -> to move cursor down

x -> to delete a character
dw -> to delete a word
dd -> delete a line
 
This has been a long term joke, but as an avid vim user, it's simple.

Once you open your file and edit it, to quit vi/vim, you simply:

Quit without saving:
ESC, then :q

If you ctrl-c, you'll create a swap file..

Quit with saving:
ESC, then :ZZ

Vim is really the ultimate editor.. learn to use it and you'll get a promotion at work ;)

Yeah, I've been using it for a long time and when the joke starting popping up everywhere, I was confused. I thought there was a new bug in vim, or may be it's not about something else altogether!
 
You can quit it by pressing escape then ":"
Options after ":"
"w(Write)"
"q(quit)"
:wq(Save and Quit)
:q!(Force Quit)
 
OpenBSD kinda forced me to learn Vim, since the default install doesn't include Nano.....[…] Vim on Linux is different..... :( :( :(

Yo!
OpenBSD does not include NANO in base of course, but it certainly does not include VIM either! However at least ED and VI is included, and maybe you tried VI?

VIM means Vi IMproved and is a younger fork of VI which was made in Berkeley University — famous for it's distribution of UNIX® called Berkeley Software Distribution (BSD) which in -92 was finally free from a legal battle so it could release it's code freely.

(If this would have happened one or two years earlier there would have been no need for Linus to make Linux!)

So VI is a smaller VIM, and when you type VI on most Linuxen you get linked to VIM which can cause some confusion.

Personally I prefer the standard UNIX editor ED (so Saint iGNUcious can't damn me for using VI VI VI - the editor of the beast! Saint iGNUcious (youtube)
 
Last edited:
Yo!
OpenBSD does not include NANO in base of course, but it certainly does not include VIM either! However at least ED and VI is included, and maybe you tried VI?

VIM means Vi IMproved and is a younger fork of VI which was made in Berkeley University — famous for it's distribution of UNIX® called Berkeley Software Distribution (BSD) which in -92 was finally free from a legal battle so it could release it's code freely.

(If this would have happened one or two years earlier there would have been no need for Linus to make Linux!)

So VI is a smaller VIM, and when you type VI on most Linuxen you get linked to VIM which can cause some confusion.

Personally I prefer the standard UNIX editor ED (so Saint iGNUcious can't damn me for using VI VI VI - the editor of the beast! Saint iGNUcious (youtube)
Thanks for clearing that up! :D No WONDER it behaved differently than on Linux! :) I was 1 year old in '92, so I almost certainly didn't know about *BSD or Linux, let alone any OTHER OS.... Besides, we lived in a haunted house around then, my family and I, and a Computer would probably have gotten busted up or something, had we owned one.... Ever have a ghost running up the stairs at you? :(
 
Glad to see my hobby interest in Unix can enlight others :)
I've never had a ghost coming at me so far, but I do run both OpenBSD and GhostBSD these days :eek:

GhostBSD.org
 

Staff online

Members online


Top