Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d4ab047795d626036000034

imports alignment (python)

Align as one import per line.

Start file
from random import randint, uniform, shuffle, sample
from math import ceil, pow
End file
from random import randint
from random import uniform
from random import shuffle
from random import sample
from math import ceil
from math import pow

View Diff

1,2c1,6
< from random import randint, uniform, shuffle, sample
< from math import ceil, pow
---
> from random import randint
> from random import uniform
> from random import shuffle
> from random import sample
> from math import ceil
> from math import pow

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 134 remaining solutions by signing in and submitting your own entry
#135 Xavier Nayrac / lkdjiin - Score: 31 - 01/08/12 @ 11:48
:%s/, /\r/g<CR>ggqay3wjP0q2@aj@aZZ

0 comments

#136 Ben Friedland / bfriedland174 - Score: 31 - 05/17/12 @ 08:23
:%s/, /\r/g<CR>ggqqy3wjP0q2@qj@qZZ

0 comments

#137 Petri Rosenström / wuzuuz - Score: 31 - 08/12/12 @ 14:23
:%s/, /\r/g<CR>kqq0y3WjPqgg3@q:wq<CR>

0 comments

#138 bing_twic / bing_twic - Score: 32 - 03/09/11 @ 19:59
:%s/, /\r/g<CR>ggqqy3wjP'[q2@qj@qZZ

0 comments

#139 Avinash Baliga / avinashbaliga - Score: 32 - 03/26/11 @ 05:55
y3wqqf,i<NL><Del><Del><Esc>Pq2@qj0y3wf,i<NL><Del><Del><Esc>PZZ

0 comments

#140 David Xia / davidxia_ - Score: 32 - 03/24/12 @ 01:24
y3wqqf,i<CR><Del><Del><Esc>Pq2@qj0y3wf,i<CR><Del><Del><Esc>PZZ

0 comments

#141 Oliver Christ / 0liverChrist - Score: 32 - 10/03/13 @ 21:04
:%s/,/\r/g<CR>ggy3ejP<Down><Home>P<Down><Home>P+y3ejPZZ

0 comments

#142 bestform / bestform - Score: 33 - 02/05/11 @ 21:11
:%s/, /\r/g<CR>kqay3wjPqgg@aj0Pj0PZZ

0 comments

#143 Vu Huan / huanvn - Score: 33 - 04/12/11 @ 10:04
:%s/, /\r/g<NL>kqay3wjPqgg@aj0Pj0PZZ

0 comments

#144 Nomen Nescio / vadtusan - Score: 33 - 04/14/11 @ 22:05
"ay3wqqf,s<CR><Esc>"aPq2@qj@q2bcwmath<Esc>ZZ

0 comments

#145 Tesnorth / Tesnorth - Score: 33 - 01/31/12 @ 00:14
Y3pf,daWj..j3.kE<C-V>kkDGYpf,daWkEDZZ

0 comments

#146 James / Dronak - Score: 33 - 09/12/13 @ 15:31
:%s/, /\r/g<CR>gg3dwP+.+.+.+3dwP+.ZZ

0 comments

#147 Mike Cooper / mythmon - Score: 35 - 02/14/11 @ 21:46
y3f f,r<CR>Pf,r<CR>Pf,r<CR>P<Tab>j0y3f f,r<CR>P:wq<CR>

0 comments

#148 tdirrenb / tdirrenb - Score: 35 - 05/14/11 @ 19:19
3yw:s/, /\="\r".getreg(0)/g<CR>j3yw&ZZ

0 comments

#149 Torben Rasmussen / rasmustorben - Score: 35 - 08/12/11 @ 23:42
3ywf,r<NL>f,r<NL>f,r<NL>Pk0Pk0PGf,r<NL>k3ywjPZZ

0 comments

#150 Jason Wolf / zephyr_wolf - Score: 35 - 11/08/12 @ 17:41
y3f :%s/, /\r/g<CR>kk<C-V>kkI<C-R>"<Esc>5Gy3f jPZZ

0 comments

#151 Martin Liberg / marreman - Score: 35 - 02/07/15 @ 18:43
:%s/, /\r/g<CR>ggy3wqqj0Pq2@qj0y3w@@ZZ

0 comments

#152 Pavlo Klets / p01nt - Score: 36 - 02/04/11 @ 10:43
3yw:%s/, /\r/g<CR>:2<CR>Pj^Pj^Pj^3ywjP:wq<CR>

0 comments

#153 rdt / rdtft - Score: 37 - 02/08/11 @ 12:04
3yw:%s/, /\r/g<CR>:2<CR>P:3<CR>P:4<CR>P:5<CR>3ywjPZZ

0 comments

#154 Tom Duijf / tomduijf - Score: 37 - 02/12/11 @ 15:32
:%s/, /\r/g<CR>ggv18<Right>y<Down>P<Down>^P<Down>^P<Down><Left><Left>v^y<Down>PZZ

0 comments

#155 Andrew / cobbal - Score: 37 - 08/22/11 @ 09:56
y3wf,lpf p;pj0y3wf,lp:%s/, /\r/g<CR>:wq<CR>

0 comments

#156 Burkhard Zimmermann / BurkZimm - Score: 37 - 12/26/11 @ 17:39
yy3p3jyyp3wdWkkw3dWk2.k.u1.:%s/,.*<CR>ZZ

0 comments

#157 R / 7vies - Score: 40 - 07/18/11 @ 00:52
3ye:s/m<BS>,/\r/g<CR>0Pk0Pk0P:5<CR>y33yw03ye&0PZZ

0 comments

#158 Alekseyka2 / Alekseyka2 - Score: 41 - 02/06/11 @ 17:53
y3e4ea<CR><Esc>pea<CR><Esc>pea<CR><Esc>p^x<Up>x<Up>x3jyyp3w6xkel5xZZ

0 comments

#159 Oliver Mader / dotb52 - Score: 44 - 07/17/12 @ 07:38
ypypyyppp3Wd3Wkd2Wkd1W5Gyyp3WdW:$<BS>%s/,.\+<CR>ZZ

0 comments

#160 Will Gray / graywh - Score: 45 - 03/14/11 @ 21:35
:%s/\(\(\w* \w* \w*\) \w*\),/\1\r\2/g<CR>g&g&:x<CR>

0 comments

#161 Johnny Tong / johnnytong - Score: 45 - 03/25/11 @ 06:15
3yw:%s/, /\r/g<CR>:2<CR><CR>Pj^P2<Esc>:2<CR>P5:<Esc><Esc>:5<CR>y3wjP:<BS>ZZ

0 comments

#162 Golf Sinteppadon / minigolf2000 - Score: 46 - 05/02/12 @ 20:48
yy3pkf,d$jb2dwwd$jb4dwwd$jb6dwjyyp3w2dwkwd$<Esc>ZZ

0 comments

#163 Nicolas Friedli / NicolasFriedli - Score: 46 - 10/28/12 @ 14:46
yy3p3wd2w<Down>d4w<Down>d6w<Up>wd$<Up><Right>.<Up><Right>.Gyyp4w<Left><Left><Left><Left>dw.<Up>wd$ZZ

0 comments

#164 Steve J at RF / rfsteve - Score: 47 - 04/25/11 @ 06:53
qq:%s/\v([^,]* )([^,]*), (.*)/\1\2\r\1\3<CR>q2@qZZ

0 comments

#165 Christian Oudard / ChristianOudard - Score: 54 - 04/15/11 @ 15:21
yyPPPfrwwwwDjnbdWwDjbdW.j...kd<Esc>elDjjyyp`<Esc>$bdBkdeuelDZZ

0 comments

#166 retired account / retired10072015 - Score: 67 - 08/21/12 @ 20:08
:s/,/<C-V><CR>from random import /g<CR><Down>:s/,/<C-V><CR>from math import<CR>:%s/  / /g<CR>ZZ

0 comments

#167 Matt Donahoe / mdonahoe - Score: 72 - 10/03/11 @ 06:38
:%s/,/\n/g<CR>u:%s/,/\r/g<CR>g0G0G00<C-G>00<C-G>g<CR>5kvweeyjpuPj0Pj0Pjj0P0wdwimath <Esc>:wq<CR>

0 comments

#168 Misha (Mike) Granin / Granin - Score: 91 - 04/28/11 @ 13:14
v3wy"+<CR>Mac OS X clipboard sharing<Up>uu<Esc>u<Left>vwww"*y:%s/, /\rfrom random import r<BS>/g<CR>wcwmath<Esc>:wq<CR>

0 comments

Created by: vimgolfer

168 active golfers, 532 entries

Leaderboard (lowest score wins):
17
#1 - Tim Chase / gumnos

02/03/2011 at 02:19PM

17
#2 - iCross / iCrossOfficial

02/03/2011 at 02:20PM

17
#3 - xhtmlforum / xhtmlforum

02/03/2011 at 02:34PM

17
#4 - h_east (トロッコ6個) / h_east

02/03/2011 at 03:22PM

17
#5 - Stephen Morrow / yawmark

02/03/2011 at 05:16PM

17
#6 - Pete Johns / johnsyweb

02/03/2011 at 09:06PM

17
#7 - Balkoth / _Balkoth_

02/03/2011 at 09:25PM

17
#8 - Federico Galassi / federicogalassi

02/03/2011 at 10:00PM

17
#9 - Antony Scriven / antonyscriven

02/04/2011 at 05:42AM

17
#10 - Oleg Roshupkin / jjjahson

02/04/2011 at 06:36AM

17
#11 - Wei Dai / clvv42

02/04/2011 at 07:27AM

17
#12 - Roy Marco Aruta / royaruta

02/20/2011 at 01:47PM

17
#13 - Dezső Zoltán / zakiazigazi

02/24/2011 at 02:41PM

17
#14 - xaizek / xaizek

02/26/2011 at 11:24AM

17
#15 - Paweu1kZ nbNeyIhH / yUQlwsFpRSzxJFh

03/20/2011 at 06:05AM

17
#16 - Dragan Cvetinovic / kawkafi

04/19/2011 at 05:27PM

17
#17 - Jean-Rene David / jeanrenedavid

05/12/2011 at 03:13AM

17
#18 - Emile Swarts / EmileSwarts

06/18/2011 at 03:45PM

17
#19 - not so punk :] / notsopunk

06/19/2011 at 08:23AM

17
#20 - Johan Sveholm / rymdtjuren

06/24/2011 at 09:41AM

17
#21 - Hu Junfeng / junfeng

08/02/2011 at 10:43AM

17
#22 - Theodore Finn Gast / tfgast

09/01/2011 at 06:50AM

17
#23 - Justin Love / wondible

09/07/2011 at 02:09PM

17
#24 - vimja / vimja666

10/30/2011 at 07:45PM

17
#25 - You-Siang Lin / yslinnctu

11/30/2011 at 05:13AM

17
#26 - Song Zheng / songz

01/20/2012 at 09:51PM

17
#27 - Renat Aksitov / Korvin79

02/08/2012 at 10:31PM

17
#28 - Rändöm Tester / mevcar

02/12/2012 at 03:31PM

17
#29 - Aaron Lake / aaronmlake

02/28/2012 at 07:08PM

17
#30 - Jomo / yoyoyojomo

03/14/2012 at 06:14PM

17
#31 - Chris Penkett / chrispenkett

04/03/2012 at 03:55PM

17
#32 - Urtica dioica / udioica

05/31/2012 at 07:49AM

17
#33 - Victor Ramirez / virako

10/16/2012 at 12:59AM

17
#34 - Marco Hinz / _mhinz_

05/22/2013 at 10:35PM

17
#35 - Petro Тrouq / zulolosi

08/30/2013 at 06:41PM

17
#36 - jgpaiva / jgpaiva

02/11/2014 at 11:10AM

17
#37 - John Braxler / braxler

05/01/2014 at 02:15PM

17
#38 - kimber gonzalez / kimberlycreates

02/05/2015 at 09:59PM

17
#39 - pftb12345 / pftb12345

04/13/2015 at 11:58AM

17
#40 - Jon Krause / jkrause314

01/28/2016 at 10:19PM

17
#41 - Foo Bar / foobar01123

06/02/2016 at 08:07PM

17
#42 - Zhihong Liu / pieapple03

03/25/2017 at 04:15AM

18
#43 - Ibrahim Tencer / ibrahimtencer

02/12/2012 at 06:59PM

18
#44 - William Dunand / wdunand

03/02/2012 at 08:42AM

19
#45 - aaaa3331 / aaaa3331

02/07/2011 at 09:46PM

19
#46 - Øystein Walle / oysteinwalle

07/07/2011 at 12:35PM

19
#47 - Pei-Lun Lee / ypcatw

01/19/2012 at 11:32AM

19
#48 - Kurt Gaastra / KGaastra

02/16/2012 at 04:40AM

19
#49 - Garry Shutler / gshutler

03/31/2012 at 01:24PM

19
#50 - Kerson Hsiao / KersonHsiao

07/03/2012 at 07:52AM

19
#51 - Yann Moisan / YannMoisan

01/25/2013 at 10:08PM

19
#52 - Trevor Powell / DoomedBunnies

03/20/2013 at 11:23PM

19
#53 - Leeren / Leeren

08/10/2014 at 11:16PM

19
#54 - Michael Comerford / MComerford1

09/26/2014 at 10:01AM

19
#55 - Andrii Maksai / AMaksai

05/09/2016 at 10:20PM

20
#56 - Joost / vlabakje

02/13/2011 at 03:51PM

20
#57 - Sergey Doroshenko / dorserg

03/04/2011 at 03:43PM

20
#58 - Rocky Meza / rockymeza

03/05/2011 at 07:17PM

20
#59 - Olof Hellquist / quistoh

03/05/2011 at 11:06PM

20
#60 - Thom Hughes / thom_hughes_1

03/26/2011 at 01:46AM

20
#61 - Jason Miller / Aidenn0

04/13/2011 at 03:59PM

20
#62 - wusher / wusher

05/31/2011 at 04:01AM

20
#63 - Sammasati / sammasati0

07/16/2011 at 04:46AM

20
#64 - Robert Robotter / robrob12

07/19/2011 at 12:28PM

20
#65 - Jesús Espino / jespinog

09/07/2011 at 09:51AM

20
#66 - Christopher Erin / MCNormalMode

09/27/2011 at 12:01AM

20
#67 - MaPo / de2zotjes

10/02/2011 at 08:22AM

20
#68 - Andrei Litvin / andy31416

11/17/2011 at 02:19AM

20
#69 - Maciej Suchecki / mcSuchecki

12/04/2011 at 07:44PM

20
#70 - sol / dichotomizer

12/19/2011 at 01:16PM

20
#71 - Vasil Sakarov / vsakarov

01/15/2012 at 02:31PM

20
#72 - Michał Wróbel / sparrovv_

03/14/2012 at 10:14PM

20
#73 - Marcin Sza / coot_

09/20/2012 at 03:01PM

20
#74 - Bradd Szonye / bszonye

07/15/2013 at 05:43AM

20
#75 - Steve Tjoa / stevetjoa

07/30/2013 at 06:21PM

20
#76 - NuM / NuM314

10/06/2013 at 12:20AM

20
#77 - jimauthors / jimauthors

02/18/2014 at 07:37AM

20
#78 - Joonas Pihlajamaa / jokkebk

02/20/2014 at 08:39AM

20
#79 - Quota / Quotad

04/04/2014 at 09:31AM

21
#80 - Artem Dudarev / dudarev

02/05/2011 at 09:27AM

21
#81 - strager / strager

12/12/2011 at 03:11AM

21
#82 - Walker Boh / walker_boh

11/06/2015 at 09:31AM

22
#83 - vg / vimgolfer

02/03/2011 at 01:41PM

22
#84 - Rich Cheng / sedm0784

02/10/2011 at 05:43PM

22
#85 -  Ikhsan Maulana / ixandidu

02/11/2011 at 02:29PM

22
#86 - Benjamin Sullivan / benjaminsull

12/06/2011 at 05:31PM

22
#87 - Matt Walker / _walkermatt

06/19/2012 at 12:31PM

22
#88 - Glen Huang / curvedmark

10/19/2014 at 06:39AM

23
#89 - Rob Ciaccio / RobertoCalavera

02/10/2011 at 02:44PM

23
#90 - Dmitry G. Kuksinsky / assert_false

04/27/2011 at 07:32PM

23
#91 - Dave / zzdave13

07/18/2011 at 09:06PM

23
#92 - Andrey Andreev / andro_a

07/29/2011 at 02:59PM

23
#93 - vansan / VinceVansan

08/27/2012 at 09:03PM

23
#94 - G. Ahtune / gahtune

11/04/2012 at 04:58AM

23
#95 - Runar / runarfu

01/12/2013 at 09:26AM

23
#96 - Asmund Liseth / Asmund_L

01/13/2013 at 10:55AM

23
#97 - Justin / justinjaffray

04/30/2013 at 08:22PM

23
#98 - Woojung Kim 김우중 / _kimwz

07/16/2013 at 04:26AM

24
#99 - Sven Eigenbrodt / rompetroll

02/07/2011 at 03:55PM

24
#100 - Jake / jmantyla

03/15/2011 at 08:48PM

24
#101 - Mikael Gustavsson / slvmnd

04/16/2011 at 04:54AM

24
#102 - Dmitry Teslenko / krab_mozga

05/03/2011 at 01:28PM

24
#103 - Felipe Talavera / flype

01/09/2012 at 01:19AM

24
#104 - Nolen Royalty / NolenRoyalty

04/20/2012 at 06:58PM

24
#105 - Bart of Denver / bartofdenver

08/13/2013 at 04:17AM

24
#106 - ZorgroZ / ZorgroZ

04/14/2014 at 09:37PM

24
#107 - luffy / raxcoi

06/12/2015 at 05:10PM

24
#108 - Will / w_labranche

09/17/2016 at 04:58PM

25
#109 - Jacob Vosmaer / jacobvosmaer

06/04/2012 at 08:12PM

25
#110 - Skúli Jóhannsson / skulibj

06/28/2015 at 08:56PM

26
#111 - Thomas Schönwälder / Masei1988

02/04/2011 at 07:34PM

26
#112 - Kevin Hamer / khamer

02/04/2011 at 09:11PM

26
#113 - Yannis Chatzimichos / feedward

07/06/2011 at 05:17PM

26
#114 - Daniel Lundin / danielundin

12/26/2011 at 11:34PM

27
#115 - Mark Smith-Guerrero / msmithgu

02/10/2011 at 10:22PM

27
#116 - Nicola Paolucci / durdn

02/25/2011 at 08:03PM

27
#117 - Eivind Jahren / HaskellElephant

03/23/2011 at 10:28PM

27
#118 - cj / cj01101

08/21/2013 at 03:58AM

27
#119 - brett / brettyukich

09/22/2013 at 09:21PM

27
#120 - Tyler / tylerbindon

10/23/2013 at 03:23AM

27
#121 - Assaf Lavie / AssafLavie

04/28/2015 at 06:21PM

28
#122 - Zak Johnson / zakj

04/21/2011 at 03:01AM

28
#123 - spriggo / spriggo

05/01/2011 at 05:32AM

28
#124 - 無ん垢の叫び / john_ababa

02/27/2012 at 08:21AM

29
#125 - Ash Searle / hexmen

03/13/2011 at 05:56PM

29
#126 - Martin Desrosiers / mdesrosiers

02/21/2012 at 06:57AM

29
#127 - David Goonja / davidgoonja

08/10/2013 at 05:42AM

30
#128 - Matthieu Honel / ocus

02/03/2011 at 10:06PM

30
#129 - Toto l'haricot / nico_le_terribl

02/05/2011 at 01:10PM

30
#130 - Alex Hammel / AlexJHammel

12/23/2012 at 02:58PM

30
#131 - かしゅーなっつ@修行中 / kashew_nuts

08/02/2014 at 07:53AM

30
#132 - Justin Knag / justinknag

09/16/2014 at 06:07AM

30
#133 - ltn614 / ltn614

09/24/2015 at 09:49AM

31
#134 - okay zed / okayzed

03/03/2011 at 01:54AM

31
#135 - Xavier Nayrac / lkdjiin

01/08/2012 at 11:48AM

31
#136 - Ben Friedland / bfriedland174

05/17/2012 at 08:23AM

31
#137 - Petri Rosenström / wuzuuz

08/12/2012 at 02:23PM

32
#138 - bing_twic / bing_twic

03/09/2011 at 07:59PM

32
#139 - Avinash Baliga / avinashbaliga

03/26/2011 at 05:55AM

32
#140 - David Xia / davidxia_

03/24/2012 at 01:24AM

32
#141 - Oliver Christ / 0liverChrist

10/03/2013 at 09:04PM

33
#142 - bestform / bestform

02/05/2011 at 09:11PM

33
#143 - Vu Huan / huanvn

04/12/2011 at 10:04AM

33
#144 - Nomen Nescio / vadtusan

04/14/2011 at 10:05PM

33
#145 - Tesnorth / Tesnorth

01/31/2012 at 12:14AM

33
#146 - James / Dronak

09/12/2013 at 03:31PM

35
#147 - Mike Cooper / mythmon

02/14/2011 at 09:46PM

35
#148 - tdirrenb / tdirrenb

05/14/2011 at 07:19PM

35
#149 - Torben Rasmussen / rasmustorben

08/12/2011 at 11:42PM

35
#150 - Jason Wolf / zephyr_wolf

11/08/2012 at 05:41PM

35
#151 - Martin Liberg / marreman

02/07/2015 at 06:43PM

36
#152 - Pavlo Klets / p01nt

02/04/2011 at 10:43AM

37
#153 - rdt / rdtft

02/08/2011 at 12:04PM

37
#154 - Tom Duijf / tomduijf

02/12/2011 at 03:32PM

37
#155 - Andrew / cobbal

08/22/2011 at 09:56AM

37
#156 - Burkhard Zimmermann / BurkZimm

12/26/2011 at 05:39PM

40
#157 - R / 7vies

07/18/2011 at 12:52AM

41
#158 - Alekseyka2 / Alekseyka2

02/06/2011 at 05:53PM

44
#159 - Oliver Mader / dotb52

07/17/2012 at 07:38AM

45
#160 - Will Gray / graywh

03/14/2011 at 09:35PM

45
#161 - Johnny Tong / johnnytong

03/25/2011 at 06:15AM

46
#162 - Golf Sinteppadon / minigolf2000

05/02/2012 at 08:48PM

46
#163 - Nicolas Friedli / NicolasFriedli

10/28/2012 at 02:46PM

47
#164 - Steve J at RF / rfsteve

04/25/2011 at 06:53AM

54
#165 - Christian Oudard / ChristianOudard

04/15/2011 at 03:21PM

67
#166 - retired account / retired10072015

08/21/2012 at 08:08PM

72
#167 - Matt Donahoe / mdonahoe

10/03/2011 at 06:38AM

91
#168 - Misha (Mike) Granin / Granin

04/28/2011 at 01:14PM