Skip to content

Instantly share code, notes, and snippets.

@kana
Created November 7, 2012 09:57
Show Gist options
  • Save kana/4030531 to your computer and use it in GitHub Desktop.
Save kana/4030531 to your computer and use it in GitHub Desktop.
Listing 100 primes by Vim
S 1qa>>Ypq540@aQg/\v^( +)\1+\d/d
%s/ //g
wq
S 1qa>>Ypq540@aQg/\v^( +)\1+\d/d
%s/ *
wq
S 1qa>>Ypq540@aQg/\v^( +)\1+\d/d
%s/ *
x
S 1qa>>Ypq540@aQg/\v^( +)\1+</d
%s/ *
x
See also: http://vimgolf.com/challenges/4d1c27940e3d7832db000010
Older solusions: https://gist.github.com/3986088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment