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

Rural Post

Simple challenge to remove all but the post code on each line

Start file
RD 5 Gore 9775
RD 6 Gore 9776
RD 7 Gore 9777
RD 1 Great Barrier Island 0991
RD 1 Greta Valley 7387
RD 1 Greytown 5794
RD 1 Hamilton 3281
RD 2 Hamilton 3282
End file
9775
9776
9777
0991
7387
5794
3281
3282

View Diff

1,8c1,8
< RD 5 Gore 9775
< RD 6 Gore 9776
< RD 7 Gore 9777
< RD 1 Great Barrier Island 0991
< RD 1 Greta Valley 7387
< RD 1 Greytown 5794
< RD 1 Hamilton 3281
< RD 2 Hamilton 3282
---
> 9775
> 9776
> 9777
> 0991
> 7387
> 5794
> 3281
> 3282

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 365 remaining solutions by signing in and submitting your own entry
#366 Pierre Bréchet / @brechetp - Score: 258 - 08/10/20 @ 14:10
:%s/^.<BS>\.*<BS><BS><BS>.*\d\d<BS><BS><BS><BS>\d\d\d<BS><BS><BS><BS><BS><BS><BS>?<BS>*\d\d<BS><BS><BS><BS><BS>\?\d\d<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>:%s<BS>s<BS><BS><BS>:%s/^.*<BS><BS>*<BS>\d\d<BS><BS><BS><BS>\d<BS><BS>.<BS>\w(<BS>*\d<BS><BS><BS><BS>W*<BS><BS><BS>\a*<BS><BS><BS>.*<BS><BS>[&<BS><BS>.*\d\d<BS><BS><BS><BS><BS>?<BS>??\d\d<BS><BS><BS><BS><BS><BS>**<BS><BS>\P<BS>{0<BS>-|<BS>?<BS>|<BS>}\d\d<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>\(<Right><Right><Right><Right><Right><Right>\)<Right><Right><Right><Right><Right>/\1/g<CR>u:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><BS><Left><Left><Left><Left><Left><Left><BS><BS><Right><Right><Right><Right><Right><Right>\(<Right><Right><Right><Right>.*\)<Right><Right><Right><Right><Right><CR>:w<CR>:x<CR>

0 comments


Created by: @ctmusicnz

366 active golfers, 1388 entries

Leaderboard (lowest score wins):
10
#1 - Coded / @coded_nz

07/27/2020 at 02:24AM

10
#2 - Daniel Steinberg / @dstein64

07/27/2020 at 02:36AM

10
#3 - Jon Krause / @jkrause314

07/27/2020 at 03:23AM

10
#4 - Smylers / @Smylers2

07/27/2020 at 05:50AM

10
#5 - Saki Gw / @Sakigw

07/27/2020 at 06:57AM

10
#6 - Jeff Cui / @jeffacce

07/27/2020 at 08:50AM

10
#7 - TimMcGuire / @mcguire

07/27/2020 at 01:47PM

10
#8 - Jan Sturm / @JanSturm77

07/27/2020 at 02:25PM

10
#9 - analogpixel / @analogp1xel

07/27/2020 at 04:42PM

10
#10 - Ángel Durán / @AngeeelD

07/28/2020 at 03:57AM

10
#11 - Petro Тrouq / @zulolosi

07/28/2020 at 11:30AM

10
#12 - Till Straube / @tillstr

07/28/2020 at 01:15PM

10
#13 - Xaver Fleer / @XaverFleer

07/28/2020 at 02:24PM

10
#14 - Gergely Risko / @errge

07/28/2020 at 07:35PM

10
#15 - せいほう / @FICSQF

07/28/2020 at 09:06PM

10
#16 - RockerZZY / @rocker_zzy

07/29/2020 at 04:38AM

10
#17 - dotvimrc / @dotvimrc1

07/29/2020 at 06:56AM

10
#18 - Patrick Sanan / @patricksanan

07/29/2020 at 07:26AM

10
#19 - MathijsHoogland / @MathijsHoogland

07/29/2020 at 07:34AM

10
#20 - Leandro Lourenci / @lourenci

07/29/2020 at 10:30PM

10
#21 - たかを / @mzntaka0

07/30/2020 at 10:42AM

10
#22 - Sina Siadat / @sinasiadat

07/30/2020 at 11:56AM

10
#23 - Yuhei Nakayama(ごん) / @times_gon

07/30/2020 at 11:58AM

10
#24 - Olle Wiklund / @Kabix

07/30/2020 at 01:18PM

10
#25 - John Braxler / @braxler

07/30/2020 at 04:02PM

10
#26 - Edgar Domingues / @edgar_domingues

07/30/2020 at 06:07PM

10
#27 - merphant / @merphant

07/31/2020 at 08:06AM

10
#28 - leodamsky / @leodamskyi

07/31/2020 at 04:50PM

10
#29 - Matthias / @Matthia78044730

07/31/2020 at 07:48PM

10
#30 - speisz / @speiszc

07/31/2020 at 09:47PM