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

Reorganize Pokémon - 602 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 23
  • Position: #116 / 164
  • Number of attempts: 2
Replace csv column if it's not empty - 193 entries

Replace the credit_score_percentile column with the value 0.0 but leave the empty ones untouched

  • Best score: 15
  • Best player score: 15
  • Position: #6 / 66
  • Number of attempts: 2
Fix timezone format - 294 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: 22
  • Position: #83 / 94
  • Number of attempts: 1
Search different SQL column with similar where clause - 265 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: 33
  • Position: #51 / 60
  • Number of attempts: 1
New teacher - 1364 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 31
  • Position: #231 / 285
  • Number of attempts: 1
months to html list items - 1088 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 38
  • Position: #265 / 295
  • Number of attempts: 1
Find fix point of cos - 1426 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: #250 / 422
  • Number of attempts: 3
Paste a column after a column - 2604 entries

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

  • Best score: 14
  • Best player score: 18
  • Position: #275 / 565
  • Number of attempts: 2
Tabbed Table to Python Array - 743 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 56
  • Position: #65 / 180
  • Number of attempts: 6
HS exam question - 1596 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 76
  • Position: #247 / 418
  • Number of attempts: 2
Reformat symbols in list - 1633 entries

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

  • Best score: 24
  • Best player score: 25
  • Position: #107 / 351
  • Number of attempts: 6
Many duplicates - 1459 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #319 / 476
  • Number of attempts: 2
delete swap - 1801 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #382 / 561
  • Number of attempts: 1
Generate a very basic Python constructor (fixed) - 1264 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 47
  • Position: #164 / 272
  • Number of attempts: 3
Fix the shell script! - 2605 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 57
  • Position: #534 / 606
  • Number of attempts: 1
simple replacements - 1814 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #141 / 392
  • Number of attempts: 4
Inverting Lines - 1923 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #355 / 516
  • Number of attempts: 2
Making 3 line function a one liner. - 340 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #179 / 209
  • Number of attempts: 1
Modernise code - 1410 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 35
  • Position: #100 / 326
  • Number of attempts: 2
Put a cross in the square - 235 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 21
  • Position: #20 / 92
  • Number of attempts: 4
swap number pairs - 2126 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 30
  • Position: #249 / 387
  • Number of attempts: 1
HS Final exam vimgolf - 912 entries

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

  • Best score: 21
  • Best player score: 21
  • Position: #39 / 240
  • Number of attempts: 3
Easy modification of ssh config - 382 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 25
  • Position: #43 / 115
  • Number of attempts: 3
Turn the x - 328 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 27
  • Position: #73 / 82
  • Number of attempts: 2
Format the CSS - 158 entries

You just copied some CSS color names from the web and need to add them to your python module. Create the COLORS variable and assign a dict() with the names as keys and hex-colors as values. BEWARE OF THE TABS!!

  • Best score: 41
  • Best player score: 46
  • Position: #31 / 49
  • Number of attempts: 5
Rural Post - 4567 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #485 / 1114
  • Number of attempts: 2
Satisfy the go linter - 2450 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: 20
  • Position: #167 / 485
  • Number of attempts: 4
Add quotes to ansible playbook - 1015 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #218 / 319
  • Number of attempts: 2
Multiline to Single Line - 737 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #258 / 313
  • Number of attempts: 1
xrandr outputs and dashes - 724 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 12
  • Position: #151 / 225
  • Number of attempts: 4
Capitalize the Names - 412 entries

I want to capitalize the names in quotes, but just the people's names, not the file names.

  • Best score: 21
  • Best player score: 31
  • Position: #69 / 98
  • Number of attempts: 1
Hogwarts Email Sorting - 930 entries

Given a list of emails, get the students full name and their associated house.

  • Best score: 20
  • Best player score: 22
  • Position: #175 / 263
  • Number of attempts: 2
prepend * to every non-blank line - 6358 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #762 / 1551
  • Number of attempts: 1
Quote modules - 1094 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 26
  • Position: #149 / 285
  • Number of attempts: 1
Search and Replace 0 - 5007 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 14
  • Position: #1086 / 1631
  • Number of attempts: 3
Exchanging Quotes - 859 entries

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

  • Best score: 30
  • Best player score: 37
  • Position: #138 / 231
  • Number of attempts: 4
replacing each line of a block selection - 3005 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 29
  • Position: #642 / 779
  • Number of attempts: 1
Append semicolon after expressions - 1057 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #265 / 420
  • Number of attempts: 3
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #1010 / 1750
  • Number of attempts: 3
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #327 / 363
  • Number of attempts: 1
Ugly spreadsheet copy/paste to CSV - 1009 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 37
  • Position: #121 / 193
  • Number of attempts: 2
Replacing some words - 428 entries

How fast could it be?

  • Best score: 17
  • Best player score: 20
  • Position: #66 / 151
  • Number of attempts: 3
Make it more readable - 2009 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #317 / 652
  • Number of attempts: 5
Line Zipper - 477 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #197 / 216
  • Number of attempts: 1
Ruby 1.9 hashes - 1260 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: 14
  • Position: #249 / 410
  • Number of attempts: 3
Shebangs for all - 2046 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 25
  • Position: #495 / 522
  • Number of attempts: 2
A Simple One - 1064 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #585 / 670
  • Number of attempts: 2
Reverse Simple Deletion - 857 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #377 / 461
  • Number of attempts: 2
Context insensitive completion 0 - 590 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 8
  • Position: #156 / 249
  • Number of attempts: 5
Compile C - 441 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 22
  • Position: #98 / 143
  • Number of attempts: 5
Make Fancy Header - 1070 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 30
  • Position: #336 / 348
  • Number of attempts: 1
Reformat most common surnames - 755 entries

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

  • Best score: 23
  • Best player score: 27
  • Position: #93 / 217
  • Number of attempts: 2
Change the content of a string - 1649 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #236 / 609
  • Number of attempts: 3
Sort and add attributes - 1501 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #290 / 582
  • Number of attempts: 2
Braces or Brackets? - 1073 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 39
  • Position: #87 / 331
  • Number of attempts: 4
Simple text editing with Vim - 13095 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #2035 / 3767
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 7230 entries

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

  • Best score: 10
  • Best player score: 42
  • Position: #1027 / 1779
  • Number of attempts: 1
Elliot Schemmel
Github:

entered into 57 challenges

contributed 0 challenges