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

152 active golfers, 327 entries

Leaderboard (lowest score wins):
28
#151 - Ivan Kasatenko / @sky31338

05/09/2015 at 04:26PM

53
#152 - Personal Life Trackr / @PersLifeTrackr

05/24/2015 at 09:25PM