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 140 remaining solutions by signing in and submitting your own entry
#141 okay zed / okayzed - Score: 31 - 03/03/11 @ 01:54
qq"a3ywqqwf,xi<CR><C-R>a<Esc>q2@w$w@q@w<C-Z>ZZ

0 comments


#142 Xavier Nayrac / lkdjiin - Score: 31 - 01/08/12 @ 11:48
:%s/, /\r/g<CR>ggqay3wjP0q2@aj@aZZ

0 comments


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

0 comments


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

0 comments


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

0 comments


#146 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


#147 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


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


#154 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


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

0 comments


#156 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


#157 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


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

0 comments


#159 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


#160 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


#161 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


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

0 comments


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

0 comments


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

0 comments


#165 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


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

0 comments


#167 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


#168 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


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

0 comments


#170 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


#171 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


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

0 comments


#173 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


#174 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


#175 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

175 active golfers, 566 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