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

Reformat symbols in list

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

Start file
inputs = [ 1 2 3 4 5 ]
outputs
= [ 1 2 3 4 5 ]
End file
inputs = [ i1 i2 i3 i4 i5 ]
outputs
= [ (o1,i1) (o2,i2) (o3,i3) (o4,i4) (o5,i5) ]

View Diff

1,2c1,2
< inputs = [ 1 2 3 4 5 ]
< outputs = [ 1 2 3 4 5 ]
---
> inputs = [ i1 i2 i3 i4 i5 ]
> outputs = [ (o1,i1) (o2,i2) (o3,i3) (o4,i4) (o5,i5) ]

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 348 remaining solutions by signing in and submitting your own entry
#349 陈宏义 / @mason_chen_cn - Score: 202 - 09/12/22 @ 15:29
<Esc>:1,1s/[]<Left>0<BS>1-5<Right><Left><Left><Left><Left><Left>(<Right><Right><Right><Right><Right>)/i$1/g<CR>/<BS>:1s/([1-5]+)/i()<BS><BS>1<BS>$1.g<CR>/[]<Left>1-5<CR>nnnnnnnnn:s<BS>1,1s/[1-5]/i[]<Left>1-5<Right>/g<CR><Esc>u:s/<BS><BS>1s/[1-5]/$<Left><Left><Left><Left><Left><Left><Left>\(<Right><Right><Right><Right><Right>\)<Right><Right><BS>i\1/g<CR>s/<BS>i<Esc>:2s<BS>,<BS>s/\(1-5<Left><Left><Left>[<Right><Right><Right>]\)/\[<BS><BS>(o\1,i\1)/g<CR>`;<Esc><Esc>:w<CR>:q!<CR>

0 comments


Created by: @selfuryon

349 active golfers, 1625 entries

Leaderboard (lowest score wins):
25
#91 - 蛙爹 / @Joe53572723

02/16/2023 at 07:59AM

25
#92 - Sergio / @SergioVl12

03/18/2023 at 06:55PM

25
#93 - ­김수현 / 학생 / 건설환경공학부 / @gimsuhyeonhags1

03/22/2023 at 01:07AM

25
#94 - Francois Marais / @maraisf

04/04/2023 at 06:15PM

25
#95 - Jordan Woods / @JordanW09204552

06/10/2023 at 12:07AM

25
#96 - someperson150 / @someperson150

06/10/2023 at 05:54AM

25
#97 - someone / @IKvacenok

06/11/2023 at 05:21PM

25
#98 - tch1001 / @tch1001

07/18/2023 at 06:31PM

25
#99 - naka / @nak38223985244

08/05/2023 at 03:25AM

25
#100 - Selmir Aljic / @selmir_aljic

08/09/2023 at 12:10PM

25
#101 - Arūnas Smaliukas / @ArunasSmaliukas

08/29/2023 at 07:45AM

25
#102 - Luoyb / @Luoyb

10/19/2023 at 03:53AM

25
#103 - EtherFan / @ether_fan

02/25/2024 at 08:27AM

25
#104 - かみひろ / @km_hr

03/09/2024 at 11:31AM

25
#105 - Hector Bjernersjö / @HectorBjernersjo

07/09/2024 at 09:25PM

25
#106 - Marek Skrobacki / @skrobul

09/14/2024 at 11:16PM

25
#107 - Elliot Schemmel / @regulated

10/02/2024 at 09:50PM

26
#108 - 0xf00ff00f / @0xf00ff00f

10/17/2023 at 04:54PM

26
#109 - Maurice Schmicking / @m_schmicking

11/06/2023 at 05:08PM

26
#110 - Trewornan / @Trewornan

01/26/2024 at 01:45PM

26
#111 - Penbu / @penbuvt

02/16/2024 at 02:50AM

26
#112 - Seungho Lee / @llistnr

03/25/2024 at 01:56AM

26
#113 - constap / @constap

04/22/2024 at 10:34PM

26
#114 - Janusz Spatz / @janusz-anue

09/19/2024 at 02:39PM

27
#115 - "Smylers" / @Smylers2

07/15/2022 at 01:21PM

27
#116 - satetheus-vimgolf / @SVimgolf

07/17/2022 at 05:17AM

27
#117 - TimMcGuire / @mcguire

07/18/2022 at 10:52PM

27
#118 - cqjxx / @cqjxx1

07/20/2022 at 02:01PM

27
#119 - Aleksandre Khokhiashvili / @skkhokho

07/23/2022 at 10:28AM

27
#120 - Zachary Peterson / @zpeterson16

07/27/2022 at 11:40AM