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

196 active golfers, 695 entries

Leaderboard (lowest score wins):
30
#151 - BJ Terry / @ThatBJTerry

05/21/2014 at 06:02AM

30
#152 - r. / @rmarvie

12/20/2014 at 09:10PM

31
#153 - Eivind Jahren / @HaskellElephant

01/15/2011 at 12:45AM

31
#154 - paul_carey / @paul_carey

01/21/2011 at 11:31AM

31
#155 - Steven Occhipinti / @steveocchipinti

02/03/2011 at 03:04AM

31
#156 - dschobel / @dschobel

02/16/2011 at 02:14PM

31
#157 - Neal Lindsay / @neall

03/18/2011 at 01:01PM

31
#158 - Masashi Iizuka / @uochan

04/24/2011 at 07:52AM

31
#159 - arminas / @arminas

06/22/2011 at 09:09AM

31
#160 - Jakub Arnold / @darthdeus

12/19/2011 at 04:27PM

31
#161 - Burkhard Zimmermann / @BurkZimm

12/31/2011 at 07:22PM

31
#162 - Ben Wagaman / @jamin4jc

01/13/2012 at 05:49AM

31
#163 - Nathan Manousos / @trafnar

04/06/2012 at 06:27AM

31
#164 - Jim Kalafut / @jimkalafut

09/24/2013 at 04:09AM

31
#165 - Oliver Christ / @0liverChrist

11/11/2013 at 10:27PM

31
#166 - CHIP CASTLE / @chipcastle

12/28/2013 at 05:40PM

31
#167 - Felipe Jaramillo F / @mrfelipe

04/17/2014 at 01:00PM

31
#168 - Gerald Tilma / @GeraldTilma

11/11/2015 at 02:13AM

31
#169 - Liam Chimes / @ChimesLiam

05/02/2018 at 12:57PM

32
#170 - Kevin Hamer / @khamer

01/19/2011 at 10:23PM

33
#171 - Alex David / @alexd_me

05/04/2012 at 03:17AM

34
#172 - pablo flouret / @quuxbaz

01/13/2011 at 11:23PM

34
#173 - NuM / @NuM314

10/06/2013 at 12:12AM

35
#174 - szetobo / @szetobo

01/12/2011 at 06:12AM

35
#175 - snaky / @snaky

01/19/2011 at 12:40PM

36
#176 - Dan Dorman / @dandorman

01/18/2011 at 06:24PM

36
#177 - Miha Filej / @mfilej

11/26/2011 at 04:40PM

36
#178 - Jyun-Fan Tsai / @fakecolor

02/11/2012 at 03:49AM

38
#179 - Dmitry Teslenko / @krab_mozga

01/19/2011 at 01:48PM

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

01/15/2011 at 07:32PM