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):
38
#181 - Dmitry Teslenko / @krab_mozga

01/19/2011 at 01:48PM

39
#182 - Przemysław Pawełczyk / @przemoc86

01/15/2011 at 07:32PM

41
#183 - Eric Andres / @eric_m_andres

12/05/2012 at 05:42PM

43
#184 - Stefan Schmidt / @stafue

12/06/2013 at 04:16PM

44
#185 - Ivo Dancet / @caifara

12/03/2011 at 10:04PM

46
#186 - ksauzz / @ksauzz

04/24/2011 at 07:59AM

47
#187 - niquola / @niquola

01/28/2011 at 11:56PM

47
#188 - Matt Donahoe / @mdonahoe

11/26/2011 at 09:41PM

51
#189 - Philipp Bayer / @PhilippBayer

01/30/2011 at 11:58PM

52
#190 - fdsfasdf / @fdsfasdf1

12/14/2011 at 08:03PM

54
#191 - Jurica / @Jurica34581259

12/05/2018 at 03:22AM

54
#192 - BZ_VG / @BZ_VG

02/27/2019 at 08:10AM

57
#193 - Tomasz Zurkowski / @doriath88

04/18/2011 at 10:45AM

57
#194 - Dean / @thecamelwalk

10/18/2011 at 06:16AM

58
#195 - Takuya Nishigori / @nishigo_ri

04/24/2011 at 07:50AM

61
#196 - 軽給 / @kei_q

04/24/2011 at 07:55AM

65
#197 - Stephen Paul Weber / @singpolyma

01/12/2011 at 09:27PM

363
#198 - personlink / @personlink

04/07/2011 at 08:56AM