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

Create json from a .env file - 1518 entries

A simple everyday task.

  • Best score: 39
  • Best player score: 39
  • Position: #33 / 353
  • Number of attempts: 9
Reordering properties - 1136 entries

Arrange the CSS lines for the #topbar selector based on their complete line length, from shortest to longest.

  • Best score: 24
  • Best player score: 44
  • Position: #58 / 269
  • Number of attempts: 9
Sort and Tag - 676 entries

The goal is to sort these lines alphabetically, assign a unique identifier to each line in the format "[01]", "[02]", etc., and then restore the original order of the lines while preserving the assigned identifiers.

  • Best score: 36
  • Best player score: 87
  • Position: #74 / 140
  • Number of attempts: 2
Changing date formats - 687 entries

Change the date format to Y/M/D.

  • Best score: 37
  • Best player score: 45
  • Position: #28 / 188
  • Number of attempts: 4
YAML to dotenv - 1459 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 16
  • Position: #58 / 298
  • Number of attempts: 7
Reorganize Pokémon - 772 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 21
  • Position: #124 / 214
  • Number of attempts: 5
Rearrange array to single level - 1720 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #28 / 289
  • Number of attempts: 9
Rearrange array to one line - 807 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #31 / 190
  • Number of attempts: 5
New teacher - 1465 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 25
  • Position: #153 / 306
  • Number of attempts: 5
Generate a very basic Python constructor (fixed) - 1294 entries

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

  • Best score: 29
  • Best player score: 53
  • Position: #208 / 277
  • Number of attempts: 4
Plotting some variables in python - 1683 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 41
  • Position: #143 / 352
  • Number of attempts: 2
Inverting Lines - 1952 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #239 / 522
  • Number of attempts: 5
Swap values inside brackets - 2539 entries

Easy challenge.

  • Best score: 13
  • Best player score: 20
  • Position: #424 / 590
  • Number of attempts: 1
SCREAMING_SNAKE_CASE to Title Case - 1269 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

  • Best score: 19
  • Best player score: 27
  • Position: #150 / 264
  • Number of attempts: 3
Add semicolons - 10923 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #775 / 3087
  • Number of attempts: 2
Bad Copy Syntax - 2072 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 18
  • Position: #39 / 539
  • Number of attempts: 7
Com(m)a Trouble - 3968 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #188 / 901
  • Number of attempts: 7
Wrap the text of an email message to 79 characters - 852 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 6
  • Position: #391 / 441
  • Number of attempts: 1
Box it - 7987 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #457 / 1895
  • Number of attempts: 5
Search and Replace 0 - 5042 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #755 / 1643
  • Number of attempts: 3
Python Hello World! Reformatting - 1011 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 44
  • Position: #263 / 387
  • Number of attempts: 1
Line under headers - 2087 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 29
  • Position: #277 / 513
  • Number of attempts: 3
I forgot quotes - 16127 entries

Oops.

  • Best score: 10
  • Best player score: 13
  • Position: #1438 / 4208
  • Number of attempts: 2
Vertical Limit - 2610 entries

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

  • Best score: 21
  • Best player score: 21
  • Position: #110 / 771
  • Number of attempts: 7
replacing each line of a block selection - 3026 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #135 / 783
  • Number of attempts: 6
Switch function arguments - 2188 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #202 / 676
  • Number of attempts: 5
switch variable - 5101 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #676 / 1756
  • Number of attempts: 6
Make it more readable - 2015 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #116 / 654
  • Number of attempts: 4
remove dupes from array - 1361 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: 23
  • Position: #214 / 338
  • Number of attempts: 1
imports alignment (python) - 704 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 23
  • Position: #115 / 200
  • Number of attempts: 3
Ruby 1.9 hashes - 1277 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: #118 / 413
  • Number of attempts: 5
Assignment Alignment - 897 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 28
  • Position: #137 / 223
  • Number of attempts: 3
Shebangs for all - 2062 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: 11
  • Position: #80 / 525
  • Number of attempts: 3
A Simple One - 1070 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: #597 / 673
  • Number of attempts: 2
Increment, increment, increment.... - 703 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #77 / 414
  • Number of attempts: 2
The Cake is a Lie - 1389 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #294 / 538
  • Number of attempts: 3
Make Fancy Header - 1079 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #132 / 351
  • Number of attempts: 3
Reverse characters in a line - 806 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 12
  • Position: #28 / 271
  • Number of attempts: 9
Change the content of a string - 1750 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #535 / 639
  • Number of attempts: 2
Braces or Brackets? - 1140 entries

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

  • Best score: 34
  • Best player score: 47
  • Position: #203 / 349
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3949 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #360 / 841
  • Number of attempts: 2
Simple text editing with Vim - 13419 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #761 / 3846
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 7507 entries

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

  • Best score: 7
  • Best player score: 43
  • Position: #1118 / 1847
  • Number of attempts: 1
kloir-z
Github:

entered into 43 challenges

contributed 0 challenges