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

Rearrange array to single level - 1298 entries

The goal is to flatten the array into a single list and remove any empty elements.

  • Best score: 14
  • Best player score: 19
  • Position: #52 / 205
  • Number of attempts: 13
Rearrange array to one line - 602 entries

Rearrange the array content on only one line, and remove trailing commas

  • Best score: 13
  • Best player score: 19
  • Position: #54 / 144
  • Number of attempts: 4
Copy punctuation - 487 entries

I want to copy the last line’s brackets, quotes, and commas to each line. How?

  • Best score: 19
  • Best player score: 53
  • Position: #99 / 121
  • Number of attempts: 1
hello-world-vimgolf - 2499 entries

Simple number generation

  • Best score: 10
  • Best player score: 14
  • Position: #514 / 708
  • Number of attempts: 1
Migrated to Postgres! - 331 entries

Celebration completion of this project. https://github.com/igrigorik/vimgolf/pull/322

  • Best score: 26
  • Best player score: 30
  • Position: #71 / 131
  • Number of attempts: 1
Increment number for every 10 lines - 230 entries

The file consists of 2 columns (code and percentage). We need to add 2 more columns with increasing number for 4th column (Xcols) and increment 3rd column (Ycols) only for every 10 lines with reset of 4th column

  • Best score: 25
  • Best player score: 26
  • Position: #9 / 64
  • Number of attempts: 1
simple replacements - 1753 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 19
  • Position: #3 / 380
  • Number of attempts: 3
Inverting Lines - 1900 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 10
  • Position: #28 / 511
  • Number of attempts: 8
CSV to MD format - 413 entries

To convert a CSV list to Markdown list

  • Best score: 36
  • Best player score: 36
  • Position: #5 / 94
  • Number of attempts: 8
Generate a very basic Python constructor - 316 entries

I actually needed to do this myself, so I look forward to learning how.

  • Best score: 38
  • Best player score: 52
  • Position: #48 / 98
  • Number of attempts: 1
Python dataclasses - 1136 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 19
  • Position: #15 / 284
  • Number of attempts: 4
Making 3 line function a one liner. - 328 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #21 / 205
  • Number of attempts: 1
Put a cross in the square - 225 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 23
  • Position: #53 / 89
  • Number of attempts: 2
Change double quotes to single quotes, but with a twist - 309 entries

Although this challenge is in the context of a Python function, you don't need to know Python to do this challenge. It is to add contexts and interesting constraints. The file contains a function that prints a multi-line string literal. I wrote the string literal with double quotes, but then I decided to use single quotes instead, and that's your challenge. However, interestingly enough, the string itself contains single and double quotes. This means, inside the string literal, the originally escaped double quotes no longer need to be escaped, but the single quotes now need to be escaped. Note that the triple double quotes in the docstring should be left alone.

  • Best score: 22
  • Best player score: 35
  • Position: #37 / 56
  • Number of attempts: 4
Simple, Practical, and Common - 33616 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: 22
  • Best player score: 23
  • Position: #2592 / 7420
  • Number of attempts: 6
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1173 / 3864
  • Number of attempts: 6
TAR archive pretty print - 31 entries

Will you use isk ?

  • Best score: 24
  • Best player score: 38
  • Position: #13 / 13
  • Number of attempts: 1
Number Sort - 314 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Position: #47 / 166
  • Number of attempts: 1
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1607 / 4197
  • Number of attempts: 4
Team names - 1836 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 18
  • Position: #331 / 588
  • Number of attempts: 1
Remember VimGolf Rules ! - 261 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #68 / 141
  • Number of attempts: 1
Back to the roots - 63 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

  • Best score: 20
  • Best player score: 23
  • Position: #13 / 38
  • Number of attempts: 2
Interactive git rebase changing commands - 172 entries

How to change the action of some commits in git rebase dialog.

  • Best score: 14
  • Best player score: 15
  • Position: #41 / 79
  • Number of attempts: 4
sort python functions and methods alphabetically - 28 entries

* sort functions in the python file alphabetically * sort functions within a Class alphabetically * sort Classes alphabetically

  • Best score: 20
  • Best player score: 25
  • Position: #13 / 15
  • Number of attempts: 1
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #649 / 4180
  • Number of attempts: 8
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2247 / 3683
  • Number of attempts: 3
quotes inside quotes - 3159 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: 14
  • Best player score: 17
  • Position: #671 / 1078
  • Number of attempts: 2
Top X - 212 entries

The End File is the Top 10 Vimgolf Leaderboard at June 29, 2013. This is a second version, with a great contribution of @udioica. X is ten in Roman,a numeric system in ancient Rome

  • Best score: 18
  • Best player score: 33
  • Position: #53 / 71
  • Number of attempts: 1
Number an outline - 280 entries

The indent and words are right, but the numbers are all wrong.

  • Best score: 25
  • Best player score: 36
  • Position: #23 / 78
  • Number of attempts: 3
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1199 / 3963
  • Number of attempts: 6
The Quick Brown Fox Jumps Over The Lazy Vim - 420 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 10
  • Position: #22 / 192
  • Number of attempts: 3
Convert pandoc unordered list to a numbered list - 166 entries

I know it's possible to use #. in pandoc to auto-generate numbered lists, but then it's not easy to tell how many items there are when reading it in Markdown. How fast can you make the switch?

  • Best score: 20
  • Best player score: 29
  • Position: #36 / 57
  • Number of attempts: 1
Alphabet soup - 429 entries

Create a column of all alphabet characters organized in a funky way

  • Best score: 25
  • Best player score: 28
  • Position: #60 / 108
  • Number of attempts: 4
Vertical Limit - 2538 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 29
  • Position: #609 / 754
  • Number of attempts: 1
Exchanging Quotes - 858 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 44
  • Position: #206 / 230
  • Number of attempts: 1
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 16
  • Position: #587 / 663
  • Number of attempts: 2
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #166 / 419
  • Number of attempts: 2
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Position: #129 / 199
  • Number of attempts: 2
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1068 / 1748
  • Number of attempts: 1
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 6
  • Position: #335 / 363
  • Number of attempts: 1
Calculate the table totals - 146 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

  • Best score: 33
  • Best player score: 137
  • Position: #42 / 45
  • Number of attempts: 1
remove dupes from array - 1358 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 24
  • Position: #223 / 336
  • Number of attempts: 1
Sort and add attributes - 1451 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 34
  • Position: #329 / 563
  • Number of attempts: 3
Whitespace, empty lines and tabs - 3665 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 17
  • Position: #66 / 787
  • Number of attempts: 7
Simple text editing with Vim - 12811 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #983 / 3694
  • Number of attempts: 3
Eric Söderström
Twitter:

entered into 45 challenges

contributed 0 challenges