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 9v0060b82e38000000000208

Transpose a python matrix

Rotate the matrix in 90 degrees.

Start file
((1, 2, 3, 4),
 (5, 6, 7, 8),
 (9, 10, 11, 12),
 (13, 14, 15, 16))
End file
((1, 5, 9, 13),
 (2, 6, 10, 14),
 (3, 7, 11, 15),
 (4, 8, 12, 16))

View Diff

1,4c1,4
< ((1, 2, 3, 4),
<  (5, 6, 7, 8),
<  (9, 10, 11, 12),
<  (13, 14, 15, 16))
---
> ((1, 5, 9, 13),
>  (2, 6, 10, 14),
>  (3, 7, 11, 15),
>  (4, 8, 12, 16))

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 110 remaining solutions by signing in and submitting your own entry
#111 Lucas Hourquin / @LHourquin - Score: 316 - 06/24/21 @ 01:29
kvll<Esc><Esc>hvllllllllllll<Esc>i<Left><Left><Down><Left><Left><Left><Left><Left><Left><Left><Left><BS>2<Down><BS>3<Down><Right><BS><BS>4<CR>(5<Up>,<Up><Up><Up><Right><BS><Right><BS> 6<Down><BS>7<Down><Right><BS><BS>8<Down><Right><Right>9<Left> <Down><Right><Right><BS>0<Up>,<Up><Up><Up><Right><Right><BS>11<Down><Left><BS>12<Down><BS>3<Down> 14<Down><Left><BS><Right><Right><Up>,<Up><Up><Up><Right><Right><BS>16<Left><Down><BS>17<Down><BS><BS>18<Down>19<Down><Right><BS><BS>3<BS>20<Right><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS> 5, 9, 14),<CR>(<Left> <Right>1<BS>2, 6, 10, 14<Up><Left><BS>3<Down><Right>),<CR>(3<CR>'<BS>(4<Up><Up><Up><Down><Down>, 7<Down>n<BS>, 8,<Up>, 11<Down> 21<BS><BS>12,<Up>, 13<Down><Up><BS>5),<CR><BS><BS><Down> 16))<Esc>:w<CR>:wq<CR>

0 comments


#112 Adam Ma / @6i9Bz4gMtVSByjj - Score: 316 - 08/08/21 @ 11:50
/sg<BS><BS><BS>:s<BS>%s//d<BS><BS>\d+<BS>[]<Left>1,2<BS><BS><BS><BS><Right><BS>{}<Left>1,2<BS><BS><BS><BS><Right><BS>+<BS>*<BS>/1/g<CR>/<BS>:%s/\d\1<BS><BS>/1/g<Left><Left><Left><Left><Left><Left>(<BS>[<Right><Right>]+<Left><Left><Left><Left><BS>(<Right><Right><Right><BS>)<Left><Left><Left><Left>\<Right><Right><Right>\<Right><BS><BS><Left><Left><BS><BS><Right><Right><Right><BS>*<BS>+<CR><Up>:s<BS>%s/\d+/1/g<Left><Left><Left><Left><Left>\<CR>jjkkkjlkjqaa<Esc><C-A>q@ajkkjr1jkkqaj<C-A>q2@ajjk<C-A>j<C-A><C-A>kkk:let i=1<CR>:g/^/ s//\i=.<BS> . ' '/ |let i = i<BS><BS><BS><BS>=i+1<CR>ukjljkkkllllr5lllr9lllr1a3<Esc>ji4<Esc>ji5<Esc>ji6hh<BS><BS>``<BS><BS><Esc>hhhha2<Esc>jki1j<BS>`<BS><Esc>ki0<Esc>hhhhr6jr7jr8<Esc>:wq<CR>

0 comments


Created by: @Kyle98675198

112 active golfers, 629 entries

Leaderboard (lowest score wins):
23
#1 - John Braxler / @braxler

06/04/2021 at 07:59PM

23
#2 - Miłosz Łakomy / @foobar01123

06/06/2021 at 05:16PM

23
#3 - roudens / @roudens2

06/12/2021 at 05:57AM

23
#4 - Smylers / @Smylers2

06/12/2021 at 10:31PM

23
#5 - sap / @sap38838304

06/27/2021 at 08:12PM

23
#6 - LittleMO / @LittleMotwo

07/11/2021 at 07:07AM

23
#7 - A A A / @37fatos

07/13/2021 at 01:29AM

23
#8 - ippachi / @ippachi1018

08/05/2021 at 12:44AM

23
#9 - Bspammer / @Bspammer

08/14/2021 at 02:14AM

23
#10 - Trần Chí Thiện / @tecix

08/17/2021 at 08:33PM

23
#11 - Roman Privalov / @RomanPrivalov

08/24/2021 at 05:03AM

23
#12 - migoo / @migoo00668679

10/15/2021 at 11:57AM

23
#13 - russellzhaomao / @russellzhaomao

05/21/2022 at 10:50AM

23
#14 - Irakli Chigvaria / @tchigvaria

06/01/2022 at 02:57PM

23
#15 - ShookerAndBeta / @Shooker2012

06/03/2022 at 07:44PM

23
#16 - Topvimgolf Score / @topvimgolfscore

10/15/2022 at 01:18PM

24
#17 - Jon Krause / @jkrause314

06/04/2021 at 02:35PM

24
#18 - loupiot.veloce / @LoupiotVeloce

06/10/2021 at 09:18PM

24
#19 - Andreas Siegrist / @andreaszwei

06/11/2021 at 07:22PM

24
#20 - iBhagwan / @iiBhagwan

07/01/2021 at 07:54PM

24
#21 - Nate Slager / @NateSlagr

07/12/2021 at 04:42AM

24
#22 - spock900 / @spock9002

08/07/2021 at 11:30AM

24
#23 - 深窓の令嬢@ドクター / @arbino1031

12/12/2021 at 07:30AM

24
#24 - POSIX / @po6ix

01/07/2022 at 10:59AM

24
#25 - Sammit / @somemeatjain

01/25/2022 at 03:07PM

24
#26 - $HA-|| / @s_k0731

02/23/2022 at 04:23PM

24
#27 - John Xu / @xzzhiao

04/06/2022 at 05:47PM

24
#28 - Youssef Magdy / @youssef_magdy29

04/30/2022 at 01:39AM

24
#29 - Janzen / @__Coos

10/07/2022 at 08:33AM

24
#30 - vuems / @vuems2win

11/21/2022 at 10:49PM