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

91 active golfers, 268 entries

Leaderboard (lowest score wins):
16
#31 - Tim Chase / @gumnos

03/09/2013 at 02:09PM

16
#32 - Joel Elkins / @dice_tea

03/11/2013 at 02:25PM

16
#33 - Mikael Gustavsson / @slvmnd

03/13/2013 at 03:23PM

16
#34 - Vito / @GodFather

03/15/2013 at 03:17AM

16
#35 - Kerson Hsiao / @KersonHsiao

03/24/2013 at 07:38AM

16
#36 - Tyler / @tylerbindon

03/28/2013 at 05:27AM

16
#37 - Marcin Radomski / @_dextero

04/15/2013 at 04:40PM

16
#38 - Satoshi Kawasaki / @hobbes3k

04/18/2013 at 01:25AM

16
#39 - Ronie Uliana / @ronie

04/22/2013 at 02:47AM

16
#40 - László Bácsi / @icanscale

05/08/2013 at 09:07AM

16
#41 - curist / @curist

07/09/2013 at 04:42AM

16
#42 - Quota / @Quotad

02/11/2014 at 03:56PM

16
#43 - oliver mueller / @marcontwit

02/25/2014 at 09:58PM

16
#44 - ZorgroZ / @ZorgroZ

04/11/2014 at 09:32PM

16
#45 - Théophile Wallez / @twallez

07/02/2014 at 10:24AM

16
#46 - Caek / @Caek_

08/18/2014 at 02:07AM

16
#47 - Jose Gutierrez / @Jogusa

10/11/2014 at 02:16PM

16
#48 - Score_Under / @Score_Under

11/29/2015 at 03:08AM

16
#49 - Mihai / @mihaicristiant

03/31/2019 at 07:47AM

17
#50 - Kai Yuan / @kentyuan

03/09/2013 at 10:17PM

17
#51 - Martin Lundberg / @marlun

03/12/2013 at 05:21PM

17
#52 - Fl4t / @Fl4t

05/28/2013 at 08:47PM

17
#53 - Hachez Floran / @FloranHachez

09/05/2013 at 10:31AM

17
#54 - Ram Tamtam / @ramtamtamtam

07/01/2014 at 11:49AM

17
#55 - AC / @quadface

08/23/2014 at 06:11PM

17
#56 - Matt Robbins / @mcrmfc

11/27/2014 at 08:58AM

17
#57 - Carlos A Henríquez Q / @lagunex

01/19/2015 at 10:01AM

17
#58 - Charles Reynolds / @reynoldscem

01/07/2016 at 04:49PM

17
#59 - Daniel / @Daniel00288663

04/06/2017 at 02:07PM

18
#60 - betty Workspace / @nabodix

03/09/2013 at 05:00PM