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):
19
#61 - Dominik Stransky / @dominikstransk1

05/17/2016 at 10:33AM

19
#62 - Mihai / @mihaicristiant

01/30/2019 at 03:59PM

19
#63 - majo senf / @majo_senf

06/25/2019 at 12:02PM

20
#64 - Federico Galassi / @federicogalassi

01/11/2011 at 10:53PM

20
#65 - Toto l'haricot / @nico_le_terribl

01/12/2011 at 03:32PM

20
#66 - lemming / @darthlemming

01/18/2011 at 06:34PM

20
#67 - Edwin Merkled / @emacs_viper

01/25/2011 at 11:32AM

20
#68 - Artem Dudarev / @dudarev

01/30/2011 at 10:23AM

20
#69 - Mikael Gustavsson / @slvmnd

04/18/2011 at 04:38PM

20
#70 - Johan Sveholm / @rymdtjuren

06/23/2011 at 07:13AM

20
#71 - Sergey Panin / @dixPro

07/20/2011 at 09:14PM

20
#72 - Yann Moisan / @YannMoisan

01/26/2013 at 04:25PM

20
#73 - Steve Tjoa / @stevetjoa

07/30/2013 at 05:24PM

20
#74 - Marcin Sza / @coot_

10/21/2013 at 05:01PM

20
#75 - Quota / @Quotad

02/14/2014 at 10:10AM

20
#76 - jakeroberts / @jakeroberts

05/28/2017 at 02:51PM

21
#77 - Steve Morrow / @yawmark

01/12/2011 at 03:19AM

21
#78 - Gael / @darkael2

01/12/2011 at 12:13PM

21
#79 - Ash Searle / @hexmen

03/10/2011 at 08:25PM

21
#80 - Justin Cullen / @zenguine

02/27/2012 at 11:21PM

22
#81 - Benoît Ryder / @benoitryder

01/11/2011 at 09:28PM

22
#82 - Matthew Draper / @_matthewd

01/12/2011 at 05:04AM

22
#83 - Franco Lazzarino / @flazz

01/12/2011 at 07:06PM

22
#84 - Kurinniy Alexander / @kurinniy

01/21/2011 at 02:28PM

22
#85 - Vernon Thommeret / @synotic

01/30/2011 at 05:27PM

22
#86 - Terje Larsen / @terlars

04/08/2011 at 10:12AM

22
#87 - Chenut Ludovic / @7Brwa7

04/12/2016 at 12:38PM

22
#88 - Brandon Harrison / @llAboutB

09/25/2019 at 10:48PM

23
#89 - Francisco Dibar / @frandibar

01/12/2011 at 12:32AM

23
#90 - Matti Hänninen / @mjhanninen

01/29/2011 at 06:04AM