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

199 active golfers, 703 entries

Leaderboard (lowest score wins):
23
#91 - Graham O' Malley / @GrahamOMalley

11/07/2012 at 06:05PM

23
#92 - Caek / @Caek_

07/14/2014 at 05:23AM

23
#93 - PLS / @jaegd

08/04/2014 at 12:25AM

23
#94 - Andrii Maksai / @AMaksai

05/09/2016 at 09:27PM

24
#95 -  Ikhsan Maulana / @ixandidu

01/14/2011 at 05:21PM

24
#96 - drio / @drio

03/23/2011 at 09:48PM

24
#97 - Raeez / @raeez

04/12/2011 at 06:26PM

24
#98 - KMNK / @kmnk

06/11/2011 at 08:03PM

24
#99 - Amy / @imightbeAmy

02/17/2013 at 05:30PM

25
#100 - Jordan Lewis / @JordanALewis

01/11/2011 at 08:51PM

25
#101 - Daniel Harrington / @rubiii

12/10/2011 at 09:22PM

25
#102 - Kurt Gaastra / @KGaastra

02/16/2012 at 08:14PM

25
#103 - David Sanders / @SandersCD

02/27/2012 at 02:32AM

25
#104 - brett / @brettyukich

09/22/2013 at 08:38PM

25
#105 - Remus Dalrymple / @bornintheflames

05/08/2017 at 07:00AM

25
#106 - Andreas Nordahl / @andreasnordahl

11/18/2018 at 10:24AM

26
#107 - Christoph Stock / @christophstock

01/11/2011 at 08:36PM

26
#108 - Tesnorth / @Tesnorth

01/31/2012 at 08:19PM

26
#109 - Woojung Kim 김우중 / @_kimwz

07/16/2013 at 02:23AM

26
#110 - Daniel Pham / @dany_pham

02/05/2016 at 05:49PM

27
#111 - Clive Evans / @swish_bob

01/13/2011 at 08:46PM

27
#112 - Jomo / @yoyoyojomo

03/14/2012 at 06:24AM

27
#113 - cj / @cj01101

08/20/2013 at 09:59PM

28
#114 - Bryan Kam / @bryankam

01/11/2011 at 08:21PM

28
#115 - ananth / @ananth

06/17/2011 at 03:33PM

28
#116 - Scott Schlesier / @sschlesier

02/24/2012 at 06:14AM

28
#117 - Tyler / @tylerbindon

04/07/2013 at 04:59AM

28
#118 - Ram Tamtam / @ramtamtamtam

06/30/2014 at 03:48PM

29
#119 - h_east (トロッコ6個) / @h_east

01/11/2011 at 07:54PM

29
#120 - Matt Tarbit / @mtarbit

01/11/2011 at 09:18PM