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 5ec18a61827ca60009087755

Replace pattern with 1, 2, 3, ... on each line

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

Start file
I can't see the $ for all the $,
But there $ not $ $ tomorrow.
$ she can do $ and 4,
$ the $ in the $ and $ the $.
End file
I can't see the 1 for all the 2,
But there 1 not 2 3 tomorrow.
1 she can do 2 and 4,
1 the 2 in the 3 and 4 the 5.

View Diff

1,4c1,4
< I can't see the $ for all the $,
< But there $ not $ $ tomorrow.
< $ she can do $ and 4,
< $ the $ in the $ and $ the $.
\ No newline at end of file
---
> I can'
t see the 1 for all the 2,
> But there 1 not 2 3 tomorrow.
> 1 she can do 2 and 4,
> 1 the 2 in the 3 and 4 the 5.
\ No newline at end of file

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 231 remaining solutions by signing in and submitting your own entry
#232 shahanavaz m / @shahanavazm - Score: 134 - 03/28/24 @ 23:54
:let c=0|exe "function! C() \n let c+=1 \n return<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>g:<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right> g:c \n endfunction"<CR>:g/\$/s//\=C)H<C-H><C-H>()/g|let g<BS>c=0<CR>ZZ

0 comments


Created by: @kaddkaka

232 active golfers, 1150 entries

Leaderboard (lowest score wins):
38
#181 - Scott Atkins / @scottrick49

06/02/2021 at 07:00PM

39
#182 - Kurtis D. Miller / @phdkurt

07/26/2020 at 07:02PM

39
#183 - Ibrahim Abou Elenein / @abou_eleyes

05/27/2021 at 10:23AM

39
#184 - alfyn / @xacosh

06/11/2021 at 04:17AM

40
#185 - pady. 🇪🇺 @hundertzwoelf@sueden.social / @hundertzwoelf_

05/20/2020 at 04:21PM

40
#186 - Amit Kumar / @amit_locham

06/01/2020 at 03:59PM

40
#187 - majo senf / @majo_senf

06/16/2020 at 09:31AM

40
#188 - Edgar Domingues / @edgar_domingues

07/09/2020 at 08:54AM

40
#189 - knub / @LauraToric

08/01/2020 at 09:43AM

40
#190 - Franz Kirchhoff / @kirchhoff_f

10/11/2020 at 05:14PM

40
#191 - Michael / @Michael62785035

05/30/2021 at 03:12PM

40
#192 - Sarthak Gupta / @saarthxk

08/04/2021 at 06:17PM

40
#193 - panakin skywalker / @_j3ffrey

08/31/2021 at 05:34PM

40
#194 - yxke / @_yxke

12/17/2021 at 02:09PM

40
#195 - naomi (forgetful functor) / @fixedpointfae

03/29/2022 at 01:19AM

40
#196 - James / @Dronak

12/02/2022 at 04:44PM

40
#197 - Marius Ropotica / @cipmar

03/30/2024 at 06:36PM

41
#198 - yanisdebusschere@gmail.com / @db_yanis

05/26/2020 at 06:47PM

41
#199 - Yannick / @Yannick88147038

06/01/2020 at 09:06AM

41
#200 - gardalion / @gardalion

06/03/2020 at 10:51PM

41
#201 - Martin Landsem / @landsematwork

06/15/2020 at 10:21AM

41
#202 - Azeddine Hamdaoui / @Azeddine_Hmd

09/05/2020 at 08:48PM

41
#203 - Christ / @Christ46234422

09/05/2020 at 11:54PM

41
#204 - Muradil / @MuradilUdun

10/21/2020 at 08:56PM

41
#205 - Ihor / @Ihor96382508

11/30/2020 at 11:09AM

41
#206 - Neverlandrunner / @neverlandrunner

12/06/2020 at 07:13AM

41
#207 - POSIX / @po6ix

01/07/2022 at 02:26AM

42
#208 - Vallaa123 / @vallaa123

05/25/2020 at 06:59AM

42
#209 - Sebastian W. / @Sebasti91439242

09/01/2020 at 07:33PM

43
#210 - David Cherednik / @david_cherednik

05/22/2020 at 06:49PM