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 513b1dcd2d1ae10002000010

Sort the VimGolf challenges by popularity

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

Start file
replacing each line of a block selection - 809 entries

replace each line's ../assets/js with /javascripts
switch variable - 1197 entries

how fast can you switch two variable ?
Numbering a List - 914 entries

Pretty simple, number the list.
Context Insensitive completion 1 - 304 entries

Finish writing this simple Python HTTP server.
Search and Replace 0 - 1442 entries

Replace every instance of 'aaa' with 'xaaax'.
Wrap the text of an email message to 79 characters - 351 entries

You're replying to an email with silly long lines. Clean them up.
Sort and add attributes - 754 entries

Sort the states and add the attribute country to each record.
Whitespace, empty lines and tabs - 1470 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.
Simple text editing with Vim - 3405 entries

Make the pairs of lines match up by making each second line same as first
Reformat/Refactor a Golfer Class - 2803 entries

A simple case of removing unneeded code and fixing broken indentation.
End file
Simple text editing with Vim - 3405 entries
Reformat/Refactor a Golfer Class - 2803 entries
Whitespace, empty lines and tabs - 1470 entries
Search and Replace 0 - 1442 entries
switch variable - 1197 entries
Numbering a List - 914 entries
replacing each line of a block selection - 809 entries
Sort and add attributes - 754 entries
Wrap the text of an email message to 79 characters - 351 entries
Context Insensitive completion 1 - 304 entries

View Diff

1,3c1,4
< replacing each line of a block selection - 809 entries
< 
< replace each line's ../assets/js with /javascripts
---
> Simple text editing with Vim - 3405 entries
> Reformat/Refactor a Golfer Class - 2803 entries
> Whitespace, empty lines and tabs - 1470 entries
> Search and Replace 0 - 1442 entries
5,9d5
< 
< how fast can you switch two variable ?
< Make it more readable - 741 entries
< 
< Insert blank lines to make it more organized and readable
11,18c7
< 
< Pretty simple, number the list.
< Search and Replace 0 - 1442 entries
< 
< Replace every instance of 'aaa' with 'xaaax'.
< Reconstruct the Sentence - 713 entries
< 
< Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.
---
> replacing each line of a block selection - 809 entries
20,30c9,10
< 
< Sort the states and add the attribute country to each record.
< Whitespace, empty lines and tabs - 1470 entries
< 
< Convert tabs to spaces, strip empty lines and trailing whitespace.
< Simple text editing with Vim - 3405 entries
< 
< Make the pairs of lines match up by making each second line same as first
< Reformat/Refactor a Golfer Class - 2803 entries
< 
< A simple case of removing unneeded code and fixing broken indentation.
---
> Make it more readable - 741 entries
> Reconstruct the Sentence - 713 entries

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 64 remaining solutions by signing in and submitting your own entry
#65 Bart of Denver / bartofdenver - Score: 19 - 08/12/13 @ 22:21
:v/-/d<CR>:sor!n/-/<CR>ZZ

0 comments

#66 ltn614 / ltn614 - Score: 19 - 09/30/15 @ 10:42
:v/-/d<CR>:sor!n/-/<CR>ZZ

0 comments

#67 Vincent Desprez / vincentdesprez - Score: 20 - 03/29/13 @ 17:11
:v/\d/d<CR>:sor!n/-/<CR>ZZ

0 comments

#68 Chris Webb / chriswebb_42 - Score: 20 - 04/07/13 @ 22:05
:v/\d/d<CR>:sor!n/-/<CR>ZZ

0 comments

#69 Norm Fasey / DeathRay1977 - Score: 20 - 06/04/13 @ 22:27
:v/\d/d<CR>:sor!n/-/<CR>ZZ

0 comments

#70 James / Dronak - Score: 20 - 08/29/13 @ 17:52
:v/\d/d<CR>:sor!n/-/<CR>ZZ

0 comments

#71 CHIP CASTLE / chipcastle - Score: 20 - 12/28/13 @ 15:55
:v/\d/d<CR>:sor!n/-/<CR>ZZ

0 comments

#72 Pradeep Kumar / pradeep6kumar - Score: 21 - 03/09/13 @ 15:38
:sor!n<CR>:11,$d<CR>:.m3<CR>ZZ

0 comments

#73 foo / foo88832727 - Score: 21 - 10/18/13 @ 21:29
:sor! n /-/|%v/-/d<CR>ZZ

0 comments

#74 Trevor Powell / DoomedBunnies - Score: 22 - 03/10/13 @ 22:29
:v/\d/d<CR>:sor! n /-/<CR>ZZ

0 comments

#75 Stefan Leszkiewicz / stefanlz - Score: 24 - 06/16/13 @ 07:27
:v/\d/d<CR>:sor! n /-/<CR>:wq<CR>

0 comments

#76 Andrew Burgess / andrew8088 - Score: 26 - 03/09/13 @ 14:50
:v/-/d<CR>:sor! n /.* -/<CR>:wq<CR>

0 comments

#77 Runar / runarfu - Score: 27 - 03/10/13 @ 11:43
:sor n /.*-/<CR>20dd:g/^/m0<CR>ZZ

0 comments

#78 Stefan Antoni / Suchkultur - Score: 29 - 06/13/13 @ 13:17
:sor!n<CR>:22<CR>dd:10<CR>dG:3<CR>"2p:wq<CR>

0 comments

#79 Leo Shemesh / Leoncelot - Score: 42 - 05/06/13 @ 14:16
:<Up><Up><Up><Up><Up><Up><Down><Up>sort!nr/\d+<BS>\+ entries/<CR>:11<CR>dG:x<CR>

0 comments

#80 modestas / modstan - Score: 47 - 05/15/13 @ 20:16
:ta<BS><BS>g!/enti<BS>ries$/d<CR>:se<BS>or!-n/-/<CR>:<Up><Left><Left><Left><Left><BS><CR><Esc>:wq<CR>

0 comments

#81 Christopher Gioia / gioia_gioi - Score: 73 - 05/30/13 @ 04:12
:25y<CR>p:29y<CR>p:24y<CR>p:16y<CR>p:8y<CR>p:12y<CR>p:1d<CR>:6<CR>p:25y<CR>p:23y<CR>p:18y<CR>p:11,39d<CR>:x!<CR>

0 comments

Created by: udioica

81 active golfers, 226 entries

Leaderboard (lowest score wins):
15
#1 - Urtica dioica / udioica

03/09/2013 at 09:10PM

15
#2 - Petro Тrouq / zulolosi

03/09/2013 at 10:19PM

15
#3 - Korbinian Stoemmer / PaulSmecker

03/10/2013 at 08:47AM

15
#4 - Adam Bell / adamgbell

03/16/2013 at 07:27PM

15
#5 - jDeveloper / jDevEE

03/31/2013 at 03:49PM

15
#6 - Justin / justinjaffray

04/29/2013 at 11:24PM

15
#7 - Kate / Arohanui

05/04/2013 at 03:47AM

15
#8 - Lonny Jepson / Jiskiras

05/07/2013 at 02:03AM

15
#9 - Jordan Eldredge / captbaritone

05/08/2013 at 06:57PM

15
#10 - Marco Hinz / _mhinz_

05/31/2013 at 11:36PM

15
#11 - Michael / mjs2600

06/06/2013 at 12:16AM

15
#12 - Bradd Szonye / bszonye

07/13/2013 at 08:41AM

15
#13 - Steve Tjoa / stevetjoa

07/18/2013 at 02:38AM

15
#14 - Ingo / ist3fani

07/30/2013 at 02:05PM

15
#15 - Stephen Drodge / sjdrodge

10/08/2013 at 02:57AM

15
#16 - Casey Dwyer / caseydwyer

11/04/2013 at 09:10PM

15
#17 - Yann Moisan / YannMoisan

01/05/2014 at 10:12PM

15
#18 - Joonas Pihlajamaa / jokkebk

02/23/2014 at 11:56AM

15
#19 - John Braxler / braxler

04/29/2014 at 11:39AM

15
#20 - Philipp Aeschbach / ihbmifqerg

10/10/2014 at 04:18PM

15
#21 - pftb12345 / pftb12345

04/23/2015 at 02:14PM

15
#22 - esquifit / henroboke

10/07/2015 at 03:04PM

15
#23 - Jon Krause / jkrause314

02/03/2016 at 06:38PM

15
#24 - Márton Németh / nemarci42

04/06/2017 at 11:30AM

15
#25 - markschwarz / markschwarz

05/28/2017 at 02:54AM

16
#26 - Tim Chase / gumnos

03/09/2013 at 02:09PM

16
#27 - Joel Elkins / dice_tea

03/11/2013 at 02:25PM

16
#28 - Mikael Gustavsson / slvmnd

03/13/2013 at 03:23PM

16
#29 - Vito / GodFather

03/15/2013 at 03:17AM

16
#30 - Kerson Hsiao / KersonHsiao

03/24/2013 at 07:38AM

16
#31 - Tyler / tylerbindon

03/28/2013 at 05:27AM

16
#32 - Marcin Radomski / _dextero

04/15/2013 at 04:40PM

16
#33 - Satoshi Kawasaki / hobbes3k

04/18/2013 at 01:25AM

16
#34 - Ronie Uliana / ronie

04/22/2013 at 02:47AM

16
#35 - László Bácsi / icanscale

05/08/2013 at 09:07AM

16
#36 - curist / curist

07/09/2013 at 04:42AM

16
#37 - Quota / Quotad

02/11/2014 at 03:56PM

16
#38 - oliver mueller / marcontwit

02/25/2014 at 09:58PM

16
#39 - ZorgroZ / ZorgroZ

04/11/2014 at 09:32PM

16
#40 - Théophile Wallez / twallez

07/02/2014 at 10:24AM

16
#41 - Caek / Caek_

08/18/2014 at 02:07AM

16
#42 - Jose Gutierrez / Jogusa

10/11/2014 at 02:16PM

16
#43 - Score_Under / Score_Under

11/29/2015 at 03:08AM

17
#44 - Kai Yuan / kentyuan

03/09/2013 at 10:17PM

17
#45 - Martin Lundberg / marlun

03/12/2013 at 05:21PM

17
#46 - KeuZ / Fl4t

05/28/2013 at 08:47PM

17
#47 - Hachez Floran / FloranHachez

09/05/2013 at 10:31AM

17
#48 - Ram Tamtam / ramtamtamtam

07/01/2014 at 11:49AM

17
#49 - AC / quadface

08/23/2014 at 06:11PM

17
#50 - Matt Robbins / mcrmfc

11/27/2014 at 08:58AM

17
#51 - Carlos A Henríquez Q / lagunex

01/19/2015 at 10:01AM

17
#52 - Charles Reynolds / reynoldscem

01/07/2016 at 04:49PM

17
#53 - Daniel / Daniel00288663

04/06/2017 at 02:07PM

18
#54 - betty Workspace / nabodix

03/09/2013 at 05:00PM

18
#55 - Nick Andryshak / nandryshak

04/01/2013 at 06:59PM

18
#56 - David Hoeffer / dhoeffer

04/23/2013 at 11:10PM

18
#57 - Gruetzwurst / nomagic2

04/28/2013 at 10:30PM

18
#58 - cj / cj01101

08/08/2013 at 08:00PM

18
#59 - Some(coder) / hauleth

08/16/2013 at 06:48AM

18
#60 - brett / brettyukich

09/22/2013 at 01:40AM

18
#61 - Oliver Christ / 0liverChrist

10/14/2013 at 04:18PM

18
#62 - Walker Boh / walker_boh

12/14/2015 at 09:23AM

19
#63 - Marcin Katulski / marcink79

03/24/2013 at 06:26PM

19
#64 - A / Tower_1980

08/02/2013 at 11:52AM

19
#65 - Bart of Denver / bartofdenver

08/12/2013 at 10:21PM

19
#66 - ltn614 / ltn614

09/30/2015 at 10:42AM

20
#67 - Vincent Desprez / vincentdesprez

03/29/2013 at 05:11PM

20
#68 - Chris Webb / chriswebb_42

04/07/2013 at 10:05PM

20
#69 - Norm Fasey / DeathRay1977

06/04/2013 at 10:27PM

20
#70 - James / Dronak

08/29/2013 at 05:52PM

20
#71 - CHIP CASTLE / chipcastle

12/28/2013 at 03:55PM

21
#72 - Pradeep Kumar / pradeep6kumar

03/09/2013 at 03:38PM

21
#73 - foo / foo88832727

10/18/2013 at 09:29PM

22
#74 - Trevor Powell / DoomedBunnies

03/10/2013 at 10:29PM

24
#75 - Stefan Leszkiewicz / stefanlz

06/16/2013 at 07:27AM

26
#76 - Andrew Burgess / andrew8088

03/09/2013 at 02:50PM

27
#77 - Runar / runarfu

03/10/2013 at 11:43AM

29
#78 - Stefan Antoni / Suchkultur

06/13/2013 at 01:17PM

42
#79 - Leo Shemesh / Leoncelot

05/06/2013 at 02:16PM

47
#80 - modestas / modstan

05/15/2013 at 08:16PM

73
#81 - Christopher Gioia / gioia_gioi

05/30/2013 at 04:12AM