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:

Bookmark and Share


Andrew Lombardi 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.


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 :(


Svend Tofte said...

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

ShortCuts make our work smarter said...

you can use :xa to save and close multiple files


Popular Posts (Last 30 days)

This is a personal blog and I do not speak for my employer.