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

35 active golfers, 88 entries

Leaderboard (lowest score wins):
39
#31 - 20speedvegan / @ashkevinm

04/12/2017 at 08:52PM

40
#32 - vg / @vg53210350

10/29/2018 at 03:57AM

41
#33 - Gurukandhamoorthi / @Gurukandhamoor1

07/13/2017 at 11:33AM

44
#34 - Reuben Narkwo / @reubwo

04/04/2017 at 08:41PM

57
#35 - Brian Hall / @_bruab_

05/02/2017 at 01:24PM