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


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

103 active golfers, 523 entries

Leaderboard (lowest score wins):
58
#61 - Qlio / @mrunagaldai

08/05/2021 at 06:16AM

59
#62 - Peter Pandorum / @PeterPandorum

08/07/2021 at 07:22PM

59
#63 - MrRubiksSC / @RubiksSc

08/14/2021 at 02:13PM

59
#64 - José Rodrigues / @jyrodrigues

08/18/2021 at 09:50PM

60
#65 - Ramtin Martin / @martin_ramtin

03/31/2022 at 11:19PM

61
#66 - Quentin Leroy / @qnleroy

08/20/2021 at 03:16PM

62
#67 - Patrick Martin / @PatrickDMartin

06/29/2021 at 08:16AM

62
#68 - Spencer Lanman / @LordZaffeine

08/17/2021 at 02:20AM

62
#69 - Justin Haaheim / @justinhaaheim

02/26/2022 at 10:37PM

66
#70 - hiramayo / @hiramayo2

06/25/2021 at 04:07AM

66
#71 - Hourann Lin / @HourannLin

08/05/2021 at 10:19AM

66
#72 - e1mnos / @e1mnos

08/10/2021 at 11:28AM

66
#73 - 0xdrowsy / @0xdrowsy

02/08/2022 at 07:57AM

67
#74 - Andreas Näsman / @andreas_nasman

06/15/2021 at 01:19PM

67
#75 - Roni Kettunen / @Ronsteri1

11/28/2021 at 10:27AM

69
#76 - AAbraxas / @AAbraxas1

07/13/2021 at 08:49PM

69
#77 - Connor / @ronnocthered

08/15/2021 at 05:40AM

70
#78 - Andrew Savino / @AndrewSavino5

03/24/2022 at 09:43PM

71
#79 - TimMcGuire / @mcguire

11/23/2021 at 02:18AM

72
#80 - HotSixRedBull / @AlanSerpente

07/18/2021 at 04:29AM

72
#81 - John Wohlfert / @jlwohlfert

11/29/2021 at 06:34PM

73
#82 - Cameron Cordes / @cameron_cordes

07/13/2021 at 11:57PM

73
#83 - 모정건 / @treebird82

01/29/2022 at 10:33AM

74
#84 - Alaris Morissette / @Alaris_Villain

08/05/2021 at 06:18AM

74
#85 - Scott Berger / @scottberger

09/28/2021 at 08:45PM

74
#86 - Humbaba / @humbabu

12/31/2021 at 11:51PM

76
#87 - caseyhadden / @caseyhadden

03/24/2022 at 09:24PM

78
#88 - Ben Shephard / @_shepharddd_

08/17/2021 at 11:34AM

79
#89 - Ethan Rietz / @EthanRietz

07/23/2021 at 06:04PM

79
#90 - Ali Aslan / @AliAsla95742367

10/17/2021 at 12:42AM