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 133 remaining solutions by signing in and submitting your own entry
#134 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


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

135 active golfers, 847 entries

Leaderboard (lowest score wins):
24
#31 - Youssef Magdy / @youssef_magdy29

04/30/2022 at 01:39AM

24
#32 - Janzen / @__Coos

10/07/2022 at 08:33AM

24
#33 - vuems / @vuems2win

11/21/2022 at 10:49PM

24
#34 - John Huynh / @huynh_j93

03/30/2023 at 07:45PM

24
#35 - naka / @nak38223985244

07/08/2023 at 02:09AM

24
#36 - Luoyb / @Luoyb

10/23/2023 at 03:26AM

24
#37 - Seok Hwan Kim / @gworldkim

10/29/2023 at 03:09PM

24
#38 - bpking1 / @bpking1

11/20/2023 at 06:25AM

24
#39 - Remus Dalrymple / @bornintheflames

12/16/2023 at 09:43AM

24
#40 - jonas-grobe / @jonas-grobe

02/05/2024 at 04:33PM

24
#41 - Aly Thobani / @alythobani

04/07/2024 at 08:24PM

24
#42 - Peppa Pig / @PeppaPi95550250

04/22/2024 at 07:55AM

33
#43 - Georg Bökman / @BokmanGeorg

06/30/2021 at 10:33AM

33
#44 - Alice Bob / @AliceBo54291620

08/15/2021 at 10:19PM

33
#45 - Vim Golfer / @VimGolfer20

08/24/2021 at 07:02AM

33
#46 - Yeontaek Kim / @YeontaekK

08/25/2021 at 12:40PM

33
#47 - Jean George / @JeanGeo20504212

11/12/2021 at 06:06PM

33
#48 - Даня Ефимов / @Abberatus

02/19/2022 at 12:16PM

33
#49 - redbigyesnoGoThenWhy / @redbigyesno

06/03/2022 at 10:46AM

33
#50 - ndaval / @ndaval

01/13/2024 at 10:51PM

34
#51 - quiet_doi / @quiet_doi

06/11/2021 at 02:58AM

34
#52 - Blake Tereau / @BlakeTereau

06/19/2021 at 04:10PM

34
#53 - りん / @mizuwumi

07/30/2021 at 03:00PM

34
#54 - satetheus-vimgolf / @SVimgolf

07/17/2022 at 10:24PM

34
#55 - MonkieeBoi / @MonkieeBoi

11/22/2023 at 09:53AM

35
#56 - Tuure / @tuure_p

06/04/2021 at 02:49AM

35
#57 - sdfghjk / @sdfghjk88424595

04/28/2022 at 12:46AM

37
#58 - quemeraisc / @quemeraisc

05/18/2022 at 12:32PM

37
#59 - Dank City / @ddankcity

12/06/2022 at 04:43PM

38
#60 - garry quested / @GQuested

09/24/2021 at 11:40AM