Skip to content
VimGolf - Prime Numbers episode artwork

EPISODE · Aug 10, 2012

VimGolf - Prime Numbers

from Vimcasts

For the VimGolf challenge “List the first 100 prime numbers”, there’s a solution that uses a regular expression to detect prime numbers. At 43 keystokes, it’s not the winning solution, but I think it’s the most interesting one. It uses a few clever Vim tricks, including macros, control-a to increment, the very magic pattern switch, and the :global command. There’s a lot to learn from those 43 keystrokes, so let’s study it!

Episode metadata supplied by the publisher feed · Published Aug 10, 2012

Embed this episode

Ready to play

VimGolf - Prime Numbers

0:00 0:00

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

When was this Vimcasts episode published?

This episode was published on August 10, 2012.

Can I download this Vimcasts episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!