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 58e30bf5a570cf043d000002

Format java properties

Format java properties to a different format. The value which is the string following the first '=' cannot & should not change. All periods in the key get replaced with an underscore "_" and get a prefix of "b_".

Start file
# Set a.b
a.b=123
x.y.z=xyz.def
tini=00.x
# Change url to qa
url=http://aabb.com/cache=true
debug.java-options=-Xmx2g
a.b.c.d.e=twenty

End file
# Set a.b
b_a_b=123
b_x_y_z=xyz.def
b_tini=00.x
# Change url to qa
b_url=http://aabb.com/cache=true
b_debug_java-options=-Xmx2g
b_a_b_c_d_e=twenty

View Diff

2,4c2,4
< a.b=123
< x.y.z=xyz.def
< tini=00.x
---
> b_a_b=123
> b_x_y_z=xyz.def
> b_tini=00.x
6,8c6,8
< url=http://aabb.com/cache=true
< debug.java-options=-Xmx2g
< a.b.c.d.e=twenty
---
> b_url=http://aabb.com/cache=true
> b_debug_java-options=-Xmx2g
> b_a_b_c_d_e=twenty

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 16 remaining solutions by signing in and submitting your own entry
#17 James Houghton / jamesthoughton - Score: 37 - 05/16/17 @ 15:48
:%s/\.\([^\/]*=\)\@=/_/g<CR><C-V><Up><Up>Ib_<Esc>4k.ZZ

0 comments

#18 Dom Armstrong / dom_cycleface - Score: 38 - 04/05/17 @ 11:37
:%s/\./_/gc<CR>nyyynnnyyyyy<C-V><Up><Up>Ib_<Esc>4k.<Esc>:x<CR>

0 comments

#19 Kevin Ash / ashkevinm - Score: 39 - 04/12/17 @ 20:52
:g/^\l/norm Ib_<CR>qq/\.<CR>r_q3@q-@@5k03@qZZ

0 comments

#20 Reuben Narkwo / reubwo - Score: 44 - 04/04/17 @ 20:41
qqjib_<Esc>vt=:s/\%V\./_/g<CR>q@q3j.4G.7G@qkk.u@qZZ

0 comments

#21 Brian Hall / _bruab_ - Score: 57 - 05/02/17 @ 13:24
jib_<Esc>llr_:%s/\./_/gc<CR>nyynnnyyyyykkkkk^ib_<Esc>jh.jjh.jh.jh.ZZ

0 comments

Created by: anooplive

21 active golfers, 49 entries

Leaderboard (lowest score wins):
27
#1 - Saki Gw / Sakigw

04/04/2017 at 12:33PM

27
#2 - Smylers / Smylers2

04/04/2017 at 12:46PM

27
#3 - Paulo H Baumann / PauloBaumann

04/04/2017 at 05:07PM

27
#4 - John Braxler / braxler

04/04/2017 at 05:23PM

27
#5 - Urtica dioica / udioica

04/05/2017 at 02:37AM

27
#6 - Remus Dalrymple / bornintheflames

04/08/2017 at 12:36AM

27
#7 - 梧桐王子 / WutongYujie

04/26/2017 at 01:30AM

28
#8 - retro / tryphopp

04/06/2017 at 11:38AM

32
#9 - PL / petrlaitoch

05/16/2017 at 09:41AM

33
#10 - Миша Сорокин / rafmikovi4

04/09/2017 at 06:20AM

33
#11 - Daniel / Daniel00288663

04/27/2017 at 12:13PM

34
#12 - tPenguinLTG / tpenguinltg

04/04/2017 at 02:55PM

35
#13 - Reinaldo Astudillo / astudillor

04/04/2017 at 09:44AM

35
#14 - えるざっぷ / _elzup_

04/05/2017 at 09:51AM

35
#15 - Roland TheFreak / _TheFreak_

04/14/2017 at 09:36AM

36
#16 - Jerry Wu / AzureSpectra

05/16/2017 at 03:40PM

37
#17 - James Houghton / jamesthoughton

05/16/2017 at 03:48PM

38
#18 - Dom Armstrong / dom_cycleface

04/05/2017 at 11:37AM

39
#19 - Kevin Ash / ashkevinm

04/12/2017 at 08:52PM

44
#20 - Reuben Narkwo / reubwo

04/04/2017 at 08:41PM

57
#21 - Brian Hall / _bruab_

05/02/2017 at 01:24PM