gitmyhub

how-to-exit-vim

★ 7.2k updated 3mo ago

Below are some simple methods for exiting vim.

A community joke repository collecting deliberately absurd and overcomplicated methods for quitting the Vim text editor, from rebooting the computer to reimplementing Vim in Rust.

setup: easycomplexity 1/5

how-to-exit-vim is a joke repository that lists deliberately overcomplicated and absurd methods for quitting the Vim text editor. Vim is a command-line text editor that has been around since the 1990s and is famous for confusing new users with its unusual interface: to do almost anything, including saving and quitting, you type specific keyboard commands rather than using menus or buttons.

The actual correct way to exit Vim is to press Escape, type ":q!", and hit Enter. This repository ignores that entirely and instead collects contributions from the developer community offering increasingly ridiculous alternatives.

Methods in the list include: killing the Vim process from within Vim itself using shell commands, rebooting the computer, pulling out the power cable, reimplementing Vim in the Rust programming language and then exiting that version instead, using AppleScript to automate keystrokes on a Mac, opening the Mac Activity Monitor to force-quit the process, and simply walking away. One method sets a random timer that kills Vim at an unpredictable future moment. Another suggests aliasing the vim command to /bin/true so that Vim never actually opens in the first place.

There are also methods in Python, Perl, Ruby, C, and PowerShell, each routing around the normal quit command to achieve the same end result through a more convoluted path.

The repository has over 7,000 stars, reflecting how widely recognized the "how do I exit Vim" frustration is in the developer community. It is a community running joke, not a practical guide. The README contains no license information.

Where it fits