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

Reformat Cura settings

Cura settings are weirdly encoded... After mere replacements, you'll have to enquote two strings (infill_pattern & speed_travel) and dont forget booleans in lowercase. #format #json

Start file
;SETTING3 "[data]\\n\\ninfill_pattern = gy
;SETTING3 roid\\ninfill_sparse_density = 1
;SETTING3 0\\njerk_print = 10\\nmaterial_p
;SETTING3 rint_temperature = 195\\nretract
;SETTING3 ion_amount = 6\\nretraction_hop_
;SETTING3 enabled = True\\nretraction_hop_
;SETTING3 only_when_collides = True\\nskir
;SETTING3 t_gap = 10\\nskirt_line_count = 
;SETTING3 2\\nspeed_print = 50\\nspeed_tra
;SETTING3 vel = =speed_print if magic_spir
;SETTING3 alize else 120\\n\\n"
End file
{ "infill_pattern": "gyroid", "infill_sparse_density": 10, "jerk_print": 10, "material_print_temperature": 195, "retraction_amount": 6, "retraction_hop_enabled": true, "retraction_hop_only_when_collides": true, "skirt_gap": 10, "skirt_line_count": 2, "speed_print": 50, "speed_travel": "=speed_print if magic_spiralize else 120" }

View Diff

1,11c1
< ;SETTING3 "[data]\\n\\ninfill_pattern = gy
< ;SETTING3 roid\\ninfill_sparse_density = 1
< ;SETTING3 0\\njerk_print = 10\\nmaterial_p
< ;SETTING3 rint_temperature = 195\\nretract
< ;SETTING3 ion_amount = 6\\nretraction_hop_
< ;SETTING3 enabled = True\\nretraction_hop_
< ;SETTING3 only_when_collides = True\\nskir
< ;SETTING3 t_gap = 10\\nskirt_line_count = 
< ;SETTING3 2\\nspeed_print = 50\\nspeed_tra
< ;SETTING3 vel = =speed_print if magic_spir
< ;SETTING3 alize else 120\\n\\n"
---
> { "infill_pattern": "gyroid", "infill_sparse_density": 10, "jerk_print": 10, "material_print_temperature": 195, "retraction_amount": 6, "retraction_hop_enabled": true, "retraction_hop_only_when_collides": true, "skirt_gap": 10, "skirt_line_count": 2, "speed_print": 50, "speed_travel": "=speed_print if magic_spiralize else 120" }

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 17 remaining solutions by signing in and submitting your own entry
#18 Dax / @zacoxi - Score: 109 - 08/30/19 @ 06:33
<C-V>Gf dgvgJ:s/\\\\n/<C-V><CR>/g<CR>dk2G.qqi"<C-O>f "<C-O>f <BS><BS>:<Esc>wi"<C-O>A",<Esc>qG@q/T<CR>~n.2Gqqi"<C-O>f ":<Right><Right><BS><BS><C-O>A,<Esc><CR>qV*<Esc>8:norm @q<CR>VHJI{ <Esc>A<BS> }<Esc>ZZ

0 comments


Created by: @mcr05

18 active golfers, 99 entries

Leaderboard (lowest score wins):
50
#1 - John Braxler / @braxler

08/20/2019 at 04:06PM

50
#2 - Saki Gw / @Sakigw

08/20/2019 at 09:33PM

50
#3 - james_bunch / @james_bunch

08/21/2019 at 10:42PM

50
#4 - Martin Delille / @martinodelilo

08/24/2019 at 04:56PM

50
#5 - Viktor Styrud / @ViktorStyrud

10/07/2019 at 07:09AM

51
#6 - Baine Wedlock / @BaineWedlock

09/12/2019 at 01:01PM

51
#7 - Mario Olofo / @mario_olofo

10/20/2019 at 12:44AM

55
#8 - Malcolm Sharpe / @blueblimpms

08/19/2019 at 07:23PM

55
#9 - Adam Hartz / @awareofnow

08/21/2019 at 01:08AM

61
#10 - Ron Holt / @ron_holt

08/19/2019 at 03:05AM

64
#11 - Matt / @mcr05

08/20/2019 at 09:40AM

66
#12 - Mr_Djez / @DjezMr

08/18/2019 at 07:22PM

75
#13 - Ivo Blöchliger / @aigledesalpes

08/20/2019 at 08:26PM

75
#14 - sooqua / @sooqua

08/29/2019 at 01:14AM

79
#15 - Timothée Gauthier / @zmf_tim

08/18/2019 at 10:08PM

79
#16 - Stefan Krist / @nerdyness_sk

08/20/2019 at 09:55AM

84
#17 - Jonathan Eidsness / @jonathaneidsnes

09/03/2019 at 10:50PM

109
#18 - Dax / @zacoxi

08/30/2019 at 06:33AM