How to quit vi/vim

Rob

Administrator
Staff member
Joined
Oct 27, 2011
Messages
1,161
Reaction score
2,107
Credits
3,161
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 ;)
 


atanere

Well-Known Member
Joined
Apr 6, 2017
Messages
2,636
Reaction score
2,782
Credits
68
learn to use it and you'll get a promotion at work
I don't want a promotion! I want to ESCAPE! :D:D

Less than 8 weeks to go... but who's counting?

Cheers
 

Pawan Bahuguna

New Member
Joined
Jul 23, 2018
Messages
7
Reaction score
0
Credits
0
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!
 

Andy20190506

New Member
Joined
May 6, 2019
Messages
2
Reaction score
0
Credits
0
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?
 
OP
Rob

Rob

Administrator
Staff member
Joined
Oct 27, 2011
Messages
1,161
Reaction score
2,107
Credits
3,161
: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 :)
 

blackneos940

Active Member
Joined
May 16, 2017
Messages
335
Reaction score
197
Credits
222
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..... :( :( :(
 

rahul chauhan

New Member
Joined
May 14, 2019
Messages
2
Reaction score
2
Credits
0
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
 

heavydistortion

New Member
Joined
May 21, 2019
Messages
1
Reaction score
0
Credits
0
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!
 

Sai Kumar Dasari

New Member
Joined
Apr 22, 2019
Messages
1
Reaction score
0
Credits
0
You can quit it by pressing escape then ":"
Options after ":"
"w(Write)"
"q(quit)"
:wq(Save and Quit)
:q!(Force Quit)
 

NitroNilz

New Member
Joined
Jan 11, 2021
Messages
9
Reaction score
3
Credits
85
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:

blackneos940

Active Member
Joined
May 16, 2017
Messages
335
Reaction score
197
Credits
222
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? :(
 

NitroNilz

New Member
Joined
Jan 11, 2021
Messages
9
Reaction score
3
Credits
85
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
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Staff online

Members online


Latest posts

Top