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

137 active golfers, 278 entries

Leaderboard (lowest score wins):
18
#61 - Ralf Gueldemeister / @rgueldem

09/24/2015 at 11:50PM

18
#62 - Mikael Saltzman / @MikaelSaltzman

09/27/2015 at 11:20AM

18
#63 - Mike Adams / @davis_cromwell

10/02/2015 at 04:52PM

18
#64 - Jon Krause / @jkrause314

10/17/2015 at 02:34AM

18
#65 - Árpád Krejczinger / @krarpi

11/11/2015 at 02:15PM

18
#66 - Aleksey Zhidkov / @AlexeyZhidkov

02/24/2016 at 11:23AM

18
#67 - T. Sakuma / @taku39

05/05/2016 at 02:48PM

18
#68 - Jordan Wightman / @tuo2

08/13/2016 at 12:37PM

18
#69 - Daniel / @Daniel00288663

03/31/2017 at 07:17AM

18
#70 - Daniel Capo Sobral / @dcsobral

05/26/2017 at 11:18PM

18
#71 - Ben Hill / @KaizenSoze70

09/26/2017 at 01:18PM

18
#72 - Turkey Man / @lvturkeyman

11/25/2017 at 04:42AM

18
#73 - BarbaJol / @drpproteus

01/09/2018 at 05:21PM

18
#74 - Iury Adones / @Iury_Adones

05/08/2018 at 04:26PM

18
#75 - Daniël De Koker / @daniel_koker

07/17/2018 at 08:07AM

19
#76 - no hodls barred / @AssafLavie

04/25/2015 at 04:00PM

19
#77 - vgmct / @vgmct

04/25/2015 at 05:18PM

19
#78 - Michael Cramer / @mlcramer

04/25/2015 at 07:14PM

19
#79 - Jerome Korlowski / @nolifish

04/25/2015 at 07:29PM

19
#80 - E Both / @enboth

04/25/2015 at 08:38PM

19
#81 - chvzvhn / @chvzvhn

04/25/2015 at 10:20PM

19
#82 - Gammelin Guillaume / @ggammelin

04/26/2015 at 08:23AM

19
#83 - Chase Vasic / @ChaseVasic

04/26/2015 at 10:07AM

19
#84 - ushumpei / @ushumpei_

04/26/2015 at 01:16PM

19
#85 - Kevin Yokley / @kyokley19

04/26/2015 at 11:54PM

19
#86 - mnx / @mnxx

04/27/2015 at 09:41AM

19
#87 - kungfuchad / @kungfuchad

04/27/2015 at 11:07AM

19
#88 - Matthieu Crapet / @mcr05

04/27/2015 at 02:21PM

19
#89 - ipson_nek / @ipson_nek

04/27/2015 at 04:23PM

19
#90 - Aludirk Wong / @Aludirk

04/28/2015 at 02:56PM