Vim's UserGettingBored Autocmd

Hacker News Top News

Summary

Vim has a joke autocmd called UserGettingBored that doesn't do anything, first added in 2000 as a humorous documentation entry. An unofficial plugin inspired by it now displays an image when the same key is pressed 42 times.

No content available
Original Article
View Cached Full Text

Cached at: 08/29/26, 06:37 PM

# Vim's UserGettingBored autocmd Source: [https://evanhahn.com/usergettingbored-vim/](https://evanhahn.com/usergettingbored-vim/) *In short: Vim has a jokeautocmdcalled`UserGettingBored`that doesn’t do anything\.* Vim’sautomatic commandsfeature, usually shortened to “autocmd”, lets you run code when various events occur\. For example, you could implement an auto\-save feature by binding the`TextChanged`event to the`:w`command\. Vim has over 100 events, from “buffer was created” to “file was saved”\. But one of them sticks out to me:`UserGettingBored`\. Here’s the documentation: > `UserGettingBored`: When the user presses the same key 42 times\. Just kidding\! :\-\) When I saw this, I was busy doing something else and it completely derailed me\. “I must know more,” I thought\. Here’s what I found: - Unfortunately, it doesn’t do anything\. It only exists in the documentation \(and some tests\)\. If you try to use it with somethig like`autocmd UserGettingBored \.\.\.`, you’ll get a “no such group or event” error\. - It’s present in[Vim](https://vimdoc.sourceforge.net/htmldoc/autocmd.html#UserGettingBored),[Neovim](https://neovim.io/doc/user/autocmd/#UserGettingBored), and[Vim Classic](https://vim-classic.org/doc/autocmd.html#UserGettingBored)\. - It was first added by Bram Moolenaar in[July 2000](https://github.com/vim/vim-history/commit/c3cba9278b34e6ff131e99d5ef39e346176957de#diff-7fc4babd126f0b22993940da3ae8260a3b82ec20aa3dca54425bc4d27e6d8600R379-R380), over a year before Vim 6\.0 was released\. The original description was, “When the user hits CTRL\-C\. Just kidding\!” And it didn’t do anything back then, so I don’t think it’s*ever*been real\. - In August 2001, he[added the smiley face to the documentation](https://github.com/vim/vim-history/commit/a9b9a230b2431d7877eb4ce685eb6ec766b86045#diff-7fc4babd126f0b22993940da3ae8260a3b82ec20aa3dca54425bc4d27e6d8600R483)\. It then read, “When the user hits CTRL\-C\. Just kidding\! :\-\)” - Twelve years later, in 2013,[the description changed](https://github.com/vim/vim/commit/bf88493c0979d88279930b5330f667d0bd6b651e#diff-7fc4babd126f0b22993940da3ae8260a3b82ec20aa3dca54425bc4d27e6d8600R854-R855)to its current iteration: “When the user presses the same key 42 times\. Just kidding\! :\-\)” In 2022, developer Mike Smith[created an unofficial plugin](https://codeberg.org/mikesmith/ugbi)inspired by this jokeautocmd\. If you press the same key 42 times in Insert mode, a picture of Samuel L\. Jackson appears\. 22 years later, it’s finally real\.

Similar Articles

Learn Vim motions with an ice-cream van

Hacker News Top

Vim Scoops is a free interactive web game that teaches Vim motions by having you drive an ice-cream van through a town, using keyboard commands to reach customers. It provides a fun, hands-on way to learn Vim's movement keys and editing commands.

Vim Users Deserved Better, So I Built This

Lobsters Hottest

Zenotes is an open-source note-taking app with full Vim keybinding support, featuring built-in keyboard navigation, live Markdown preview, templates, remote repositories, and more—designed for users who never want to leave the keyboard.