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


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

138 active golfers, 873 entries

Leaderboard (lowest score wins):
38
#61 - garry quested / @GQuested

09/24/2021 at 11:40AM

39
#62 - Ferran / @dillunsos

07/29/2021 at 01:25PM

39
#63 - cheronder / @cheronder1

11/24/2021 at 07:46AM

39
#64 - Marco Meinardi / @Kee__no

12/29/2022 at 08:30PM

39
#65 - Divvy C. / @divvy_c

08/13/2023 at 11:39AM

40
#66 - mevmev / @mevmev8

07/23/2021 at 02:57PM

40
#67 - Yondonjamts Ganzorig / @yondonjamts_g

08/05/2021 at 05:31AM

40
#68 - Pierre-Olivier Proulx / @PierreO57066096

04/21/2022 at 01:49AM

42
#69 - Brogan / @Brogan79363502

07/18/2021 at 05:14PM

43
#70 - Shrutesh Patil / @patil_shrutesh

12/03/2021 at 10:15AM

44
#71 - webx007 / @webx_007

06/14/2021 at 02:30AM

44
#72 - shannon / @ShannonGu1031

06/27/2021 at 04:17PM

44
#73 - T. Arch / @TArch76864215

08/28/2021 at 06:51PM

44
#74 - hector / @w29975700

11/30/2021 at 05:03AM

45
#75 - Alex Lewin / @_AlexLewin

02/17/2023 at 04:58AM

46
#76 - Bruce Lee / @BruceLeeIII

07/23/2021 at 11:23PM

46
#77 - John Other / @john_other

10/25/2021 at 12:54AM

47
#78 - grsh / @girish_i_am

06/03/2021 at 08:25PM

47
#79 - Michael / @triorph

11/10/2021 at 06:50AM

48
#80 - BrandonChenZT / @BrandonChenZT

11/03/2024 at 03:49AM

50
#81 - David Díez / @deslogica

06/10/2021 at 01:28PM

51
#82 - czheo / @czheo

06/07/2021 at 03:41AM

52
#83 - Andey / @AndyonZ

12/28/2021 at 04:29AM

52
#84 - FirstModus / @Nolimimer

03/26/2023 at 01:07PM

53
#85 - sapir malka / @sapir5522

05/17/2022 at 01:01PM

55
#86 - Clmi / @c_decaf

08/06/2021 at 05:43AM

55
#87 - andre / @pintoquete

09/20/2023 at 01:04PM

56
#88 - Max Mossberg / @mxmossy

06/30/2021 at 06:52PM

57
#89 - Sergio / @SergioVl12

08/15/2021 at 07:13AM

57
#90 - 吴建明 / @pysnow5300

09/26/2021 at 12:57PM