Wednesday, March 4, 2009

[vi/vim] Save on Exit

I see a lot of people using 'wq' a lot but never a form 'x'.
In vi and vim, if you want to save and exit with a simple key stroke simply use:
:x


Bookmark and Share

6 comments:

Anonymous said...

Thanks for this. I'm definitely one of those people that uses :wq all the time. It doesn't even feel like an extra keystroke anymore!

AnjanBacchuDev said...

thank you.

I think that I forgot this command for about 15 years.

BR,
~A

Jimmy said...

Why use :x when ZZ is easier?

Scott said...

Thanks. I didn't even know how to save a file in vi. I always just use :q! to get out and use pico, but ESX has no pico :(

Thanks.

Unknown said...

You can also use ZZ, which is even shorter then :x

nprasanna said...

you can use :xa to save and close multiple files

Total Pageviews

Reading List - 05-Mar-23

Talking to #AI may be the most important job skill of this century ( JohnGoodPasture ) Role of account management over the years. It’s a ro...