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 553b97364ba96c319d0296eb

readability

Make the code readable by adding some spaces

Start file
J=J-y(i)*log(h)-(1-y(i))*log(1-h)+(lambda/2)*sumtheta2;
End file
J = J - y(i) * log(h) - (1 - y(i)) * log(1 - h) + (lambda / 2) * sumtheta2;

View Diff

diff --git a/vimgolf2-in b/vimgolf2-out
index 3babd97..ddbb1af 100644
--- a/vimgolf2-in
+++ b/vimgolf2-out
@@ -1 +1 @@
-J=J-y(i)*log(h)-(1-y(i))*log(1-h)+(lambda/2)*sumtheta2;
+J = J - y(i) * log(h) - (1 - y(i)) * log(1 - h) + (lambda / 2) * sumtheta2;

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 137 remaining solutions by signing in and submitting your own entry
#138 Personal Life Trackr / @PersLifeTrackr - Score: 53 - 05/24/15 @ 21:25
a <Esc>w.w.w.f).w.f).w.f1.w.5l.w.5l.w.2l.w.fafa.w.2l.w.ZZ

0 comments


Created by: @YannMoisan

138 active golfers, 279 entries

Leaderboard (lowest score wins):
18
#1 - Tim Chase / @gumnos

04/25/2015 at 02:20PM

18
#2 - pftb12345 / @pftb12345

04/25/2015 at 02:31PM

18
#3 - matthieu le grix / @mlegrix

04/25/2015 at 03:35PM

18
#4 - Urtica dioica / @udioica

04/25/2015 at 03:56PM

18
#5 - Thameera Senanayaka / @thameera

04/25/2015 at 04:17PM

18
#6 - Petro Тrouq / @zulolosi

04/25/2015 at 05:00PM

18
#7 - Louis Caruana / @louiecaruana

04/25/2015 at 05:34PM

18
#8 - Andreas Carben / @meiner_eins

04/25/2015 at 08:05PM

18
#9 - Phil Runninger / @PhilRunninger

04/26/2015 at 12:54AM

18
#10 - Johannes Elferich / @jojoelfe

04/26/2015 at 01:01AM

18
#11 - Rathrio / @Rathrio

04/26/2015 at 09:48AM

18
#12 - Oleg Parashchenko / @olparko

04/26/2015 at 09:58PM

18
#13 - Bruce Park / @bpark0

04/27/2015 at 12:42AM

18
#14 - Roman Zolotarev / @romanzolotarev

04/27/2015 at 02:42AM

18
#15 - Antony Scriven / @antonyscriven

04/27/2015 at 04:44AM

18
#16 - Kai Yuan / @kentyuan

04/27/2015 at 08:13AM

18
#17 - Sam Cristall / @sbcristall

04/27/2015 at 03:03PM

18
#18 - Wandering ponderer / @0proxycon

04/27/2015 at 03:57PM

18
#19 - John Braxler / @braxler

04/27/2015 at 05:29PM

18
#20 - J. Lurch-artz / @JKirchartz

04/27/2015 at 06:34PM

18
#21 - Pratik / @prathik_t

04/28/2015 at 12:34PM

18
#22 - skrobul / @skrobul

04/28/2015 at 12:42PM

18
#23 - Jason Walton / @jay_ay_y

04/28/2015 at 07:27PM

18
#24 - Olivier Debon / @OlivierSwift

04/30/2015 at 09:58AM

18
#25 - wlads / @wlads

04/30/2015 at 02:45PM

18
#26 - B Wilson / @ncatwill

04/30/2015 at 11:16PM

18
#27 - Corentin Lapeyre / @c_lapeyre

05/01/2015 at 05:15PM

18
#28 - Rui Mendes / @rcm_dium

05/01/2015 at 05:50PM

18
#29 - Charles Joachim / @cacplate

05/02/2015 at 12:41AM

18
#30 - Fan Zhang / @2bDeactivat3d

05/02/2015 at 12:41AM