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

Fix timezone format - 345 entries

Add the missing T and Z in the datetime field. There should be a T instead of the space, and a Z at the end of the datetime. `2024-08-31 18:32:00;` -> `2024-08-31T18:32:00Z;`

  • Best score: 15
  • Best player score: 19
  • Position: #65 / 114
  • Number of attempts: 1
Search different SQL column with similar where clause - 360 entries

Replace a column in the where clause and convert all numbers from text to numeric, by replacing the leading 0 with the code 359.

  • Best score: 22
  • Best player score: 25
  • Position: #39 / 85
  • Number of attempts: 1
Remove adjacent duplicates - 718 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 22
  • Position: #72 / 179
  • Number of attempts: 3
New teacher - 1502 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 23
  • Position: #86 / 315
  • Number of attempts: 1
months to html list items - 1136 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 22
  • Position: #27 / 308
  • Number of attempts: 5
Find fix point of cos - 1483 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 15
  • Position: #231 / 433
  • Number of attempts: 2
Paste a column after a column - 2666 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 17
  • Position: #242 / 577
  • Number of attempts: 3
Poorly indented Python comments - 1348 entries

Fix the alignment of some Python comments as quickly as possible.

  • Best score: 15
  • Best player score: 33
  • Position: #127 / 224
  • Number of attempts: 2
Many duplicates - 1481 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #59 / 481
  • Number of attempts: 1
2 quick changes and a numbered list - 660 entries

The ascii will not be lost, but rather numbered in 4 digit blocks with leading zeros.

  • Best score: 37
  • Best player score: 54
  • Position: #98 / 156
  • Number of attempts: 1
delete swap - 1880 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #3 / 575
  • Number of attempts: 1
Fix the shell script! - 2676 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 45
  • Position: #472 / 622
  • Number of attempts: 1
Visual block training - 1116 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 25
  • Position: #79 / 208
  • Number of attempts: 2
Put a newline after every 10 lines in vim - 1685 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 20
  • Position: #527 / 566
  • Number of attempts: 2
hello-world-vimgolf - 2532 entries

Simple number generation

  • Best score: 10
  • Best player score: 11
  • Position: #400 / 725
  • Number of attempts: 4
Contribute to keyboard mashing - 905 entries

Speak in tongues

  • Best score: 17
  • Best player score: 19
  • Position: #145 / 275
  • Number of attempts: 4
Inverting Lines - 1956 entries

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

  • Best score: 10
  • Best player score: 12
  • Position: #302 / 524
  • Number of attempts: 4
Making 3 line function a one liner. - 346 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #89 / 213
  • Number of attempts: 1
Put a cross in the square - 243 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 23
  • Position: #59 / 93
  • Number of attempts: 5
HS Final exam vimgolf - 933 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 27
  • Position: #133 / 244
  • Number of attempts: 2
Turn the x - 339 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 27
  • Position: #74 / 84
  • Number of attempts: 2
Rural Post - 4595 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 13
  • Position: #671 / 1121
  • Number of attempts: 2
Satisfy the go linter - 2482 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 28
  • Position: #361 / 494
  • Number of attempts: 1
Add quotes to ansible playbook - 1039 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 10
  • Position: #251 / 329
  • Number of attempts: 1
Yo To Hello - 1154 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #367 / 535
  • Number of attempts: 1
Swap values - 4703 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #793 / 1291
  • Number of attempts: 3
prepend * to every non-blank line - 6388 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 10
  • Position: #422 / 1559
  • Number of attempts: 7
Quote modules - 1101 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 25
  • Position: #136 / 289
  • Number of attempts: 2
V to the i - 4860 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Position: #1495 / 1910
  • Number of attempts: 1
Applying same text modification in several lines - 2927 entries

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

  • Best score: 12
  • Best player score: 15
  • Position: #554 / 865
  • Number of attempts: 2
Add string initializers to an enum - 901 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 31
  • Position: #245 / 265
  • Number of attempts: 1
Swap the operands under comparison - 318 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 23
  • Position: #61 / 106
  • Number of attempts: 1
remove lines containing the word "reader" - 3645 entries

easy stuff

  • Best score: 9
  • Best player score: 15
  • Position: #1108 / 1182
  • Number of attempts: 1
Com(m)a Trouble - 3988 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 15
  • Position: #466 / 908
  • Number of attempts: 4
Every other line - 2945 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #527 / 710
  • Number of attempts: 1
Array propagate - 346 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 27
  • Position: #65 / 123
  • Number of attempts: 2
That hyphen - 2624 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Position: #379 / 708
  • Number of attempts: 6
Learn some german verbs - 547 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 22
  • Position: #65 / 135
  • Number of attempts: 3
Interweave two blocks of text - 661 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 29
  • Position: #207 / 215
  • Number of attempts: 2
Basic renumbering - 5731 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #259 / 1277
  • Number of attempts: 1
Adam's challenge - 1018 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 21
  • Position: #169 / 278
  • Number of attempts: 3
Create a table - 342 entries

Convert the given input into a formatted table

  • Best score: 16
  • Best player score: 17
  • Position: #58 / 107
  • Number of attempts: 7
Fiddle percentages into real numbers - 884 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 13
  • Position: #152 / 296
  • Number of attempts: 1
Paragraph sort - 456 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 17
  • Position: #77 / 126
  • Number of attempts: 5
Order and join - 1022 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #140 / 264
  • Number of attempts: 6
One to Ten - 2248 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 14
  • Position: #519 / 686
  • Number of attempts: 2
Change part of a function name in multiple occurrences - 680 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
  • Position: #126 / 212
  • Number of attempts: 3
Separating firstname & lastname - 181 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 23
  • Position: #30 / 61
  • Number of attempts: 3
convert yml into java pojo field - 873 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

  • Best score: 29
  • Best player score: 30
  • Position: #131 / 231
  • Number of attempts: 1
Swap assigned value - 681 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Position: #236 / 262
  • Number of attempts: 1
Change your calendar - 421 entries

Happy New Year!

  • Best score: 18
  • Best player score: 30
  • Position: #42 / 89
  • Number of attempts: 1
Collect List - 4332 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 14
  • Position: #674 / 1196
  • Number of attempts: 2
VimGolfNight - 581 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #278 / 353
  • Number of attempts: 1
Logging with key - 342 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 35
  • Position: #69 / 89
  • Number of attempts: 3
Space out the alphabet - 1690 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Position: #139 / 454
  • Number of attempts: 9
ASCII box - 365 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 28
  • Position: #84 / 110
  • Number of attempts: 2
Condensed Cases - 820 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 20
  • Position: #225 / 251
  • Number of attempts: 2
I forgot quotes - 16179 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2399 / 4218
  • Number of attempts: 2
learn vim in short time - 245 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #123 / 165
  • Number of attempts: 1
-a-b-c- - 3233 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #878 / 1143
  • Number of attempts: 3
Count both ways - 1035 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #132 / 358
  • Number of attempts: 3
NBCU Weekly Challenge - Test - 261 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #60 / 118
  • Number of attempts: 3
Gray area - 754 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #126 / 273
  • Number of attempts: 4
Do you demand a shrubbery? - 1185 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 31
  • Position: #222 / 306
  • Number of attempts: 2
Don't know what this is - 2044 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 14
  • Position: #381 / 591
  • Number of attempts: 2
Vim tetris - 384 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 29
  • Position: #79 / 105
  • Number of attempts: 1
quotes inside quotes - 3200 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: 16
  • Position: #669 / 1091
  • Number of attempts: 2
Words in parens - 13032 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1177 / 3986
  • Number of attempts: 3
Pairs of numbers - 387 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 32
  • Position: #52 / 138
  • Number of attempts: 2
Delete unwanted lines - 441 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #182 / 235
  • Number of attempts: 1
Block Fun 1 - 225 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 17
  • Position: #24 / 77
  • Number of attempts: 5
Prefixes and suffixes - 664 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 30
  • Position: #160 / 206
  • Number of attempts: 1
Dehamlizing - 193 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 42
  • Position: #45 / 73
  • Number of attempts: 1
NATO phonetic alphabet - 547 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Position: #111 / 199
  • Number of attempts: 2
The name of the game - 682 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #266 / 366
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1641 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 13
  • Position: #316 / 456
  • Number of attempts: 1
Stairs Indenting - 483 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #136 / 200
  • Number of attempts: 4
Let's play some Ivmgolf - 1151 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #129 / 456
  • Number of attempts: 2
Vertical Limit - 2629 entries

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

  • Best score: 21
  • Best player score: 26
  • Position: #511 / 775
  • Number of attempts: 3
Append semicolon after expressions - 1068 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #359 / 424
  • Number of attempts: 1
Remove noise from HTTP log - 741 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 19
  • Position: #250 / 279
  • Number of attempts: 2
switch variable - 5114 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #651 / 1759
  • Number of attempts: 2
The meaning - 580 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #301 / 365
  • Number of attempts: 1
Sort the cardinal numbers - 315 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 16
  • Position: #136 / 149
  • Number of attempts: 1
Numbering a List - 1942 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #70 / 658
  • Number of attempts: 1
Ruby 1.9 hashes - 1288 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 12
  • Position: #104 / 416
  • Number of attempts: 2
Reverse Simple Deletion - 865 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #364 / 464
  • Number of attempts: 1
Compile C - 445 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Position: #79 / 145
  • Number of attempts: 4
Context Insensitive completion 1 - 514 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #150 / 249
  • Number of attempts: 1
Make Fancy Header - 1080 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 17
  • Position: #215 / 352
  • Number of attempts: 1
Reformat most common surnames - 813 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 32
  • Position: #145 / 235
  • Number of attempts: 1
Change the content of a string - 1766 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #341 / 648
  • Number of attempts: 4
Sort and add attributes - 1572 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #497 / 610
  • Number of attempts: 1
Simple text editing with Vim - 13526 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1962 / 3879
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 7612 entries

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

  • Best score: 7
  • Best player score: 42
  • Position: #1055 / 1875
  • Number of attempts: 1
x03n046
Twitter:

entered into 95 challenges

contributed 0 challenges