· 3 min read

Vi Hard: Escape from insert mode

First off, yes, this article takes place at Christmas, which technically makes it a Christmas article.

First off, yes, this article takes place at Christmas, which technically makes it a Christmas article.

Vi Hard: Escape from insert mode

First, yes, this article takes place at Christmas, which technically makes it a Christmas article.

  1. Opening a File: To get started, fire up your terminal and type vi filename. Don’t worry about intuitive commands or a helpful interface – go with the flow!

  2. Modes in Vi: Vi boasts not one but TWO “fantastic” modes! The Command Mode, where you can’t directly edit text, and the Insert Mode, where you can type away to your heart’s content.

  3. Command Mode Basics: The “command-tastic” mode comes with an array of confusing single-letter commands. Move over user-friendly arrow keys; embrace the cognitive dissonance of navigating with h, j, k, and l.

  4. Navigating the File: Get ready for some finger gymnastics with G, gg, $, and 0. It’s like playing a text editing version of Twister. Why make things simple when you can make them “intriguing”?

  5. Searching: The thrill of the hunt! Use / to begin your “treasure hunt” for text. Who needs a simple search box when you can have a forward slash?

  6. Replacing Text: Ready to feel the power of “find and replace”? Use the cryptic :s/old_text/new_text/ command and become a “text-editing wizard”!

  7. Cut, Copy, and Paste: Embrace the “cutting-edge” editing techniques with dd, yy, and p. Who needs a simple Ctrl + X when you can memorize quirky commands?

  8. Exiting Vi Editor: Exiting vi is a true test of your endurance! Type :wq to save and quit or :q! to bail out without saving. It’s like trying to solve a complex puzzle every time you want to leave.

  9. The Art of VIM: Oh, did you think we were done? Introducing VIM, the “upgraded” version of vi. Because who needs simplicity when you can have more commands and features to remember?

  10. The Final Challenge - Configuration: Want to make vi even more exciting? Dive into configuration files and customize everything! Be prepared to face a plethora of cryptic options and commands, which, let’s be honest, you won’t remember anyway.

There’s a saying in Hollywood, show, don’t tell. What better way to show people you’re text editor challenged than buying a vi t-shirt? Here are a few to choose from;

  • “Vi is my favourite text editor. I’ve been using it for years…I can’t figure out how to exit.”. Hilarious.

  • ”The joy of Vi” - Want strangers to know that you know the original code for vi was written by Bill Joy in 1976. Bingo.

Time for me to save this article and upload it q!:qq!Q::qw:quit!!!qdd

Thanks to Unsplash for the blog cover image - https://unsplash.com/photos/time-lapse-photograph-of-mountain-ranges-oGsUW_zfCwI

Share:
Back to Blog