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 - 575 entries

A simple everyday task.

  • Best score: 39
  • Best player score: 39
  • Position: #3 / 135
  • Number of attempts: 11
Reordering properties - 735 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: 52
  • Position: #49 / 182
  • Number of attempts: 4
Sort and Tag - 374 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: 102
  • Position: #56 / 84
  • Number of attempts: 3
Changing date formats - 412 entries

Change the date format to Y/M/D.

  • Best score: 37
  • Best player score: 85
  • Position: #76 / 129
  • Number of attempts: 2
YAML to dotenv - 877 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 16
  • Position: #33 / 196
  • Number of attempts: 13
Change to ascending order - 338 entries

Change each line of numbers consistently from descending to ascending order.

  • Best score: 17
  • Best player score: 17
  • Position: #14 / 88
  • Number of attempts: 6
Generate an entry for each month - 229 entries

The input file contains a URI with a month in it. Generate the URIs for all the other months up to a couple of years

  • Best score: 27
  • Best player score: 32
  • Position: #10 / 64
  • Number of attempts: 8
Fix the git merge conflicts - 207 entries

Solve the merge conflicts in the Python file

  • Best score: 36
  • Best player score: 70
  • Position: #49 / 59
  • Number of attempts: 2
Nested JSON Flattener - 76 entries

Transform a deeply nested JSON structure into a flattened key-value format where each path is represented by dot notation

  • Best score: 44
  • Best player score: 56
  • Position: #5 / 21
  • Number of attempts: 8
The Fibonacci Spacer - 127 entries

Split the words, remove punctuation and add spaces before each line following the Fibonacci sequence (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89)

  • Best score: 25
  • Best player score: 25
  • Position: #6 / 37
  • Number of attempts: 10
Fix the Scala Method - 218 entries

Fix the missing semicolons and the Int type, ensure the floating point division, and remove the unnecessary return.

  • Best score: 9
  • Best player score: 22
  • Position: #28 / 71
  • Number of attempts: 2
Change class fields from camel case to snake case - 448 entries

This is the reverse of the previous challenge: https://www.vimgolf.com/challenges/9v006705493c000000000513

  • Best score: 18
  • Best player score: 18
  • Position: #31 / 108
  • Number of attempts: 3
Change class fields from snake case to camel case - 230 entries

Change the class fields in this Scala class from snake case to camel case

  • Best score: 13
  • Best player score: 13
  • Position: #51 / 88
  • Number of attempts: 2
Reorganize Pokémon - 579 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 19
  • Position: #50 / 157
  • Number of attempts: 5
Replace csv column if it's not empty - 185 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: #23 / 64
  • Number of attempts: 4
extract struct tag in go - 83 entries

Can you extract all struct tags in the fewest keystrokes possible?

  • Best score: 29
  • Best player score: 33
  • Position: #8 / 28
  • Number of attempts: 12
CaN yOuR ViM dO ThAt? #1 - 176 entries

Tsoding's famous "Can your Vim do that?" https://youtu.be/Bafo3hhheHU?si=DfcT4sUEMTSAevnx&t=1091

  • Best score: 41
  • Best player score: 41
  • Position: #16 / 70
  • Number of attempts: 5
Append leading hyphen count to each line - 81 entries

Append the number of leading hyphens to the end of each line.

  • Best score: 23
  • Best player score: 24
  • Position: #7 / 26
  • Number of attempts: 9
Move list of uuids into a SQL query - 154 entries

Take the list of UUIDs and use them as a filter in the where statement of a SQL query

  • Best score: 57
  • Best player score: 61
  • Position: #10 / 52
  • Number of attempts: 3
Markdown Blog Editing - 354 entries

Convert the given link text in start file to a markdown link list.

  • Best score: 30
  • Best player score: 35
  • Position: #17 / 83
  • Number of attempts: 7
Word completion - 233 entries

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 20
  • Position: #12 / 63
  • Number of attempts: 9
Search different SQL column with similar where clause - 258 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: 22
  • Position: #14 / 59
  • Number of attempts: 13
Remove adjacent duplicates - 559 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 19
  • Position: #14 / 146
  • Number of attempts: 6
Rearrange array to single level - 1495 entries

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

  • Best score: 14
  • Best player score: 43
  • Position: #212 / 247
  • Number of attempts: 2
Rearrange array to one line - 707 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #23 / 170
  • Number of attempts: 8
Copy punctuation - 570 entries

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

  • Best score: 19
  • Best player score: 21
  • Position: #18 / 144
  • Number of attempts: 13
Column wise pasting - 223 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 17
  • Position: #9 / 47
  • Number of attempts: 8
Define Gray code states - 41 entries

List the states using Gray code and assign Gray code values to each state.

  • Best score: 56
  • Best player score: 80
  • Position: #7 / 12
  • Number of attempts: 5
Hex to binary - 101 entries

Convert hexadecimal numbers into binary format.

  • Best score: 29
  • Best player score: 31
  • Position: #5 / 20
  • Number of attempts: 10
Count words - 80 entries

Merge duplicates and count each word.

  • Best score: 39
  • Best player score: 42
  • Position: #6 / 20
  • Number of attempts: 12
Format a long line - 94 entries

Reformat long lines (gq), textwidth=78, no trailing spaces.

  • Best score: 17
  • Best player score: 31
  • Position: #20 / 28
  • Number of attempts: 6
Evil Numbers - 96 entries

Print the first 100 evil numbers https://oeis.org/A001969. This is an advert for code.golf https://code.golf/evil-numbers#viml

  • Best score: 25
  • Best player score: 25
  • Position: #8 / 25
  • Number of attempts: 9
Mirror image - 95 entries

Add the second eye

  • Best score: 15
  • Best player score: 17
  • Position: #8 / 32
  • Number of attempts: 8
Find anomalies - 157 entries

There is one special character per line

  • Best score: 30
  • Best player score: 54
  • Position: #30 / 42
  • Number of attempts: 6
New teacher - 1357 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 19
  • Position: #23 / 282
  • Number of attempts: 13
Quicksort - 2035 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

  • Best score: 6
  • Best player score: 6
  • Position: #135 / 450
  • Number of attempts: 3
Python dataclasses - 1214 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 19
  • Position: #83 / 300
  • Number of attempts: 5
Change double quotes to single quotes, but with a twist - 319 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: 38
  • Position: #47 / 58
  • Number of attempts: 3
Palindrome numbers - 30 entries

For each number compute its associated palindrome. First number (first line) has been eaten! #prime

  • Best score: 30
  • Best player score: 76
  • Position: #16 / 17
  • Number of attempts: 1
V to the i - 4824 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #803 / 1899
  • Number of attempts: 6
SCREAMING_SNAKE_CASE to Title Case - 1231 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: 20
  • Position: #121 / 254
  • Number of attempts: 8
remove lines containing the word "reader" - 3610 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #872 / 1172
  • Number of attempts: 2
Wrap the text of an email message to 79 characters - 814 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #329 / 426
  • Number of attempts: 4
Box it - 7939 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #455 / 1885
  • Number of attempts: 2
multiple cursor alternative - 1542 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 20
  • Position: #199 / 384
  • Number of attempts: 5
Every other line - 2922 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #271 / 706
  • Number of attempts: 6
Extract argument from function - 2369 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 13
  • Position: #275 / 756
  • Number of attempts: 5
Number Sort - 317 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: #143 / 169
  • Number of attempts: 1
comment and uncomment code inline - 1151 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 9
  • Position: #166 / 328
  • Number of attempts: 8
Extract HTML option values from tag values - 115 entries

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

  • Best score: 34
  • Best player score: 35
  • Position: #14 / 45
  • Number of attempts: 5
Todo list specification - 401 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 37
  • Position: #101 / 180
  • Number of attempts: 2
Stairstep digits - 407 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 9
  • Position: #56 / 149
  • Number of attempts: 3
Adam's challenge - 1008 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: 18
  • Position: #103 / 275
  • Number of attempts: 5
Fiddle percentages into real numbers - 873 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: #166 / 294
  • Number of attempts: 4
7th Birthday - 210 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 23
  • Position: #46 / 76
  • Number of attempts: 8
Paragraph breaks - 527 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 10
  • Position: #47 / 168
  • Number of attempts: 5
comments galore - 1069 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #310 / 428
  • Number of attempts: 9
Angular naming conventions - 326 entries

In angular, a directive name follows the camelCase convention. When the directive is used in an HTML template, the words are instead separated by a dash. Go from to the other the fastest!

  • Best score: 18
  • Best player score: 18
  • Position: #48 / 119
  • Number of attempts: 6
Create bison tokens - 48 entries

Create tokens for bison out of a known list of words

  • Best score: 85
  • Best player score: 114
  • Position: #16 / 19
  • Number of attempts: 1
Hello ${world} - 325 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

  • Best score: 24
  • Best player score: 41
  • Position: #79 / 97
  • Number of attempts: 1
One to Ten - 2234 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: 12
  • Position: #372 / 679
  • Number of attempts: 3
Build a six - 305 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 22
  • Position: #62 / 98
  • Number of attempts: 6
Increment each number - 1036 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 15
  • Position: #59 / 252
  • Number of attempts: 4
Delete to the end of the current line - 847 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 5
  • Position: #278 / 406
  • Number of attempts: 3
Put the months in order - 978 entries

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

  • Best score: 20
  • Best player score: 44
  • Position: #96 / 164
  • Number of attempts: 4
Array transposition - 2427 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 35
  • Position: #396 / 450
  • Number of attempts: 2
Cartesian product - 266 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 32
  • Position: #51 / 99
  • Number of attempts: 5
VimGolfNight - 575 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #300 / 352
  • Number of attempts: 2
120 Degrees - 505 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #41 / 146
  • Number of attempts: 12
Neither Fizz nor Buzz - 257 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 13
  • Position: #17 / 104
  • Number of attempts: 4
Do you demand a shrubbery? - 1164 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 23
  • Position: #189 / 301
  • Number of attempts: 6
Where should I put the Newline? - 883 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #225 / 438
  • Number of attempts: 2
Five Pillars - 65 entries

Arrange all words in a table with 5 columns. The minimal space between words in columns is 2 spaces. Columns do have varying width.

  • Best score: 41
  • Best player score: 83
  • Position: #24 / 25
  • Number of attempts: 2
Piphilology - 158 entries

Piphilology comprises the creation and use of mnemonic techniques to remember a span of digits of the mathematical constant π. http://en.wikipedia.org/wiki/Piphilology

  • Best score: 28
  • Best player score: 28
  • Position: #3 / 54
  • Number of attempts: 12
A HAPPY NEW YEAR 2014 ! - 10699 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2524 / 3695
  • Number of attempts: 2
attr_aligner - 3525 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 76
  • Position: #702 / 706
  • Number of attempts: 1
Delete unwanted lines - 431 entries

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

  • Best score: 9
  • Best player score: 11
  • Position: #217 / 234
  • Number of attempts: 1
abcd > a b c d - 298 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #210 / 227
  • Number of attempts: 1
Readable Rubyhash - 274 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: 23
  • Best player score: 24
  • Position: #15 / 97
  • Number of attempts: 6
Exchanging Quotes - 859 entries

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

  • Best score: 30
  • Best player score: 52
  • Position: #221 / 231
  • 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: #267 / 420
  • Number of attempts: 1
Happy New Year! - 147 entries

This is a simple new year's challenge.

  • Best score: 22
  • Best player score: 64
  • Position: #55 / 60
  • Number of attempts: 2
Insert a Markdown link - 459 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 23
  • Position: #45 / 151
  • Number of attempts: 5
Getters & Setters: Java - 212 entries

Boilerplate getters & setters - it's a tedious fact of life in Java, and probably the only thing that still pulls me back to an IDE. Perhaps someone knows a fast, pure vim way...

  • Best score: 89
  • Best player score: 110
  • Position: #24 / 60
  • Number of attempts: 1
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: #594 / 670
  • Number of attempts: 2
Table Reshuffle - 450 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 23
  • Position: #34 / 144
  • Number of attempts: 9
Reverse Simple Deletion - 857 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Position: #60 / 461
  • Number of attempts: 3
Increment, increment, increment.... - 701 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #76 / 413
  • Number of attempts: 4
The Cake is a Lie - 1374 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #291 / 534
  • Number of attempts: 5
Compile C - 441 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 19
  • Position: #28 / 143
  • Number of attempts: 9
Make Fancy Header - 1070 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #131 / 348
  • Number of attempts: 5
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: #94 / 217
  • Number of attempts: 3
Remember FizzBuzz? - 742 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 56
  • Position: #86 / 194
  • Number of attempts: 4
Get rid of html tags - 415 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 12
  • Best player score: 16
  • Position: #28 / 239
  • Number of attempts: 3
Change the content of a string - 1646 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #244 / 607
  • Number of attempts: 3
Sort and add attributes - 1499 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #302 / 581
  • Number of attempts: 3
Reconstruct the Sentence - 1647 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 19
  • Position: #7 / 433
  • Number of attempts: 7
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: 54
  • Position: #280 / 331
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3793 entries

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

  • Best score: 16
  • Best player score: 24
  • Position: #395 / 814
  • Number of attempts: 4
Flodder-challenge - 1369 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 44
  • Position: #288 / 352
  • Number of attempts: 2
Simple text editing with Vim - 13092 entries

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

  • Best score: 13
  • Best player score: 36
  • Position: #3556 / 3765
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 7229 entries

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

  • Best score: 10
  • Best player score: 41
  • Position: #952 / 1778
  • Number of attempts: 6
Leon Kacowicz
Github:

entered into 102 challenges

contributed 0 challenges