How to quit vi/vim

Rob

Administrator
Staff member
Credits
469
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 ;)
 


Pawan Bahuguna

New Member
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!
 

blackneos940

Active Member
Credits
199
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
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
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!
 

NitroNilz

New Member
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
Credits
199
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? :(
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Latest posts

Top