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 by @mihaicristiant:

Unlock 6 remaining solutions by signing in and submitting your own entry
Created by: @YannMoisan

152 active golfers, 327 entries

Solutions by @mihaicristiant:
18
#75 - Mihai / @mihaicristiant

02/11/2019 at 04:14PM

19
#>130 - Mihai / @mihaicristiant

02/11/2019 at 04:07PM

23
#>146 - Mihai / @mihaicristiant

02/11/2019 at 04:06PM

26
#>149 - Mihai / @mihaicristiant

02/11/2019 at 04:02PM

27
#>150 - Mihai / @mihaicristiant

02/09/2019 at 09:43AM

60
#>152 - Mihai / @mihaicristiant

02/09/2019 at 09:40AM