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 4d2c9d06eda6262e4e00007a

Assignment Alignment

line up the operators. Use spaces, not tabs.

Start file
# Align these assignments

x = 1
y = true
z = 'you'
foo = 'bar'
long_name = "long variable value"
$p3cial = ch4rs
last = line

# Much better!
End file
# Align these assignments

x         = 1
y         = true
z         = 'you'
foo       = 'bar'
long_name = "long variable value"
$p3cial   = ch4rs
last      = line

# Much better!

View Diff

3,6c3,6
< x = 1
< y = true
< z = 'you'
< foo = 'bar'
---
> x         = 1
> y         = true
> z         = 'you'
> foo       = 'bar'
8,9c8,9
< $p3cial = ch4rs
< last = line
---
> $p3cial   = ch4rs
> last      = line

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 197 remaining solutions by signing in and submitting your own entry
#198 personlink / @personlink - Score: 363 - 04/07/11 @ 08:56
Vjjjjjjjjjjjjjjjjyppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp<Esc>dddxxxxxxxxxxxxxxixxxxxx<Esc>GGVggdi# Align these assignments<CR><CR>x         = 1<CR>y         = true<CR>z         = 'you'<CR>foo       = 'bar'<CR>long_name = "long variable value"<CR>$p3cial   = ch4rs<CR>last      = line<CR><CR># Much better!<Esc>:wq<CR>

0 comments


Created by: @khamer

198 active golfers, 700 entries

Leaderboard (lowest score wins):
29
#121 - Thomas Schönwälder / @Masei1988

01/12/2011 at 06:41PM

29
#122 - Soliman Sylvain / @sylvain_soliman

01/14/2011 at 10:27AM

29
#123 - Bradly Feeley / @bradly

01/16/2011 at 05:17AM

29
#124 - Rob Ciaccio / @RobertoCalavera

01/17/2011 at 09:02PM

29
#125 - peter.xiao / @yoco315

01/18/2011 at 07:07PM

29
#126 - Tom Duijf / @tomduijf

02/12/2011 at 04:18PM

29
#127 - Loc Nguyen / @Loc_Sic

03/30/2011 at 03:15PM

29
#128 - Ilya Strukov / @i1ey

05/02/2011 at 08:39AM

29
#129 - mightyfoo / @mightyfoo

05/26/2011 at 10:38PM

29
#130 - Dave / @zzdave13

07/16/2011 at 05:02PM

29
#131 - p0ckets / @p0ckets

10/07/2011 at 09:33AM

29
#132 - Peter Esselius / @esselius

12/06/2011 at 08:10PM

29
#133 - Ben Somers / @somanyrobots

12/24/2011 at 11:34PM

29
#134 - Chun Yang / @cccyang

07/27/2012 at 09:38AM

29
#135 - James / @Dronak

09/17/2013 at 02:57AM

29
#136 - Walker Boh / @walker_boh

11/04/2015 at 12:57PM

30
#137 - Paul King / @nrocy

01/11/2011 at 06:43PM

30
#138 - Mattiassich Ákos / @mattiassicha

01/11/2011 at 08:18PM

30
#139 - Magnus Hörberg / @magnush_

01/18/2011 at 06:59PM

30
#140 - Thom Hughes / @thom_hughes_1

04/06/2011 at 11:17PM

30
#141 - Derrick Camerino / @robustdj

04/23/2011 at 05:25AM

30
#142 - wusher / @wusher

05/31/2011 at 03:01PM

30
#143 - Øystein Walle / @oysteinwalle

07/04/2011 at 12:14AM

30
#144 - Josh Hawthorne / @JoshHawthorne

07/05/2011 at 11:11PM

30
#145 - Panino Matic / @paninomatik

10/27/2011 at 09:17PM

30
#146 - Xavier Nayrac / @lkdjiin

01/08/2012 at 09:41AM

30
#147 - bmamax / @bmamax

01/17/2012 at 05:13PM

30
#148 - 無ん垢の叫び / @john_ababa

02/21/2012 at 11:17AM

30
#149 - Reed Riley / @ReedRile

08/12/2012 at 10:35PM

30
#150 - Rob Grijs / @robgrijs

10/14/2012 at 09:51AM