vi Archives

How to exit VI with or without saving

Although many alternatives exist, I like using vi for all my command line editing needs. To save changes, I usually use SHIFT + Z + Z, exiting vi under most circumstances. But sometimes, this trick doesn’t work because of write permission problems. In such cases, vi doesn’t close with the above command. Instead, we must … Read more

How to quit vi without saving your changes

It just occurred to me that even though I know my way around vi fairly well, I never had to quit it without saving my changes. Usually I just go back in and overwrite my mistakes. Today I did something though that wasn’t as easy to eliminate: instead of pasting an IP address, I accidentally … Read more