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 [challenge ID]

Played Challenges

Reformat/Refactor a Golfer Class - 5391 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 47
  • Number of attempts: 1
Execute immediate SQL - 72 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 82
  • Number of attempts: 2
Draw the Go board - 109 entries

which is a 19×19 lines board. Here we use ascii characters only for simplicity. See diff file to get a sense. (See also http://en.wikipedia.org/wiki/Go_(game))

  • Best score: 50
  • Best player score: 76
  • Number of attempts: 2
Put the months in order - 271 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

  • Best score: 23
  • Best player score: 42
  • Number of attempts: 3
Simple, Practical, and Common - 22752 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 2
  • Best player score: 22
  • Number of attempts: 6
Change part of a function name in multiple occurrences - 309 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 5
remove lines containing the word "reader" - 953 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
VimGolfNight - 451 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
abcd > a b c d - 239 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 1
Words in parens - 10644 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 4
Word frequency alignment - 195 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 2
One number per line - 11399 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 9
Saving the hashes(#) - 1688 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 32
  • Number of attempts: 1
Applying same text modification in several lines - 1256 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 4
  • Best player score: 22
  • Number of attempts: 3
Sort the VimGolf challenges by popularity - 250 entries

"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!

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 2
quotes inside quotes - 2684 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 2
  • Best player score: 17
  • Number of attempts: 1
Fl4t
Twitter:

GNU/Linux, starcraft2 master rank, ViM user, Git user, devOps.

entered into 16 challenges

contributed 0 challenges