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

Delete the last function argument in python. - 649 entries

Delete the last function argument in this python script.

  • Best score: 6
  • Best player score: 7
  • Position: #146 / 233
  • Number of attempts: 2
Flip All Bits - 401 entries

Perform a bitwise NOT operation on each bit, meaning that bits that are 0 become 1, and those that are 1 become 0.

  • Best score: 26
  • Best player score: 35
  • Position: #38 / 123
  • Number of attempts: 2
From brakets to parens - 1306 entries

This is one of the most common problem when you wrap an array for error handling. Vim is useful when you convert foo[i][j][k] into foo(i, j, k) for many times.

  • Best score: 24
  • Best player score: 35
  • Position: #142 / 295
  • Number of attempts: 3
Create json from a .env file - 1716 entries

A simple everyday task.

  • Best score: 38
  • Best player score: 42
  • Position: #74 / 416
  • Number of attempts: 5
Reordering properties - 1372 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: 38
  • Position: #44 / 298
  • Number of attempts: 7
YAML to dotenv - 1637 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 16
  • Position: #67 / 342
  • Number of attempts: 2
Swap columns and transform to CSV format - 491 entries

Turn this spreadsheet output into a CSV file but first swap the columns

  • Best score: 16
  • Best player score: 17
  • Position: #78 / 176
  • Number of attempts: 3
Fix the git merge conflicts - 351 entries

Solve the merge conflicts in the Python file

  • Best score: 36
  • Best player score: 48
  • Position: #28 / 106
  • Number of attempts: 3
Change class fields from camel case to snake case - 669 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #49 / 154
  • Number of attempts: 5
Change class fields from snake case to camel case - 325 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #73 / 122
  • Number of attempts: 1
Reorganize Pokémon - 880 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 34
  • Position: #220 / 242
  • Number of attempts: 1
Replace csv column if it's not empty - 310 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #64 / 100
  • Number of attempts: 3
extract struct tag in go - 164 entries

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

  • Best score: 29
  • Best player score: 82
  • Position: #43 / 49
  • Number of attempts: 1
CaN yOuR ViM dO ThAt? #1 - 297 entries

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

  • Best score: 41
  • Best player score: 42
  • Position: #33 / 118
  • Number of attempts: 7
Move list of uuids into a SQL query - 245 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: 99
  • Position: #80 / 82
  • Number of attempts: 1
Search different SQL column with similar where clause - 363 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: 49
  • Position: #82 / 87
  • Number of attempts: 1
Rearrange array to single level - 1829 entries

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

  • Best score: 14
  • Best player score: 21
  • Position: #100 / 307
  • Number of attempts: 2
Rearrange array to one line - 889 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #50 / 205
  • Number of attempts: 6
Column wise pasting - 268 entries

Make a table from 3 columns

  • Best score: 17
  • Best player score: 26
  • Position: #29 / 58
  • Number of attempts: 3
New teacher - 1527 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 21
  • Position: #69 / 319
  • Number of attempts: 2
months to html list items - 1151 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 26
  • Position: #168 / 311
  • Number of attempts: 1
Remove line numbers - 786 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

  • Best score: 8
  • Best player score: 14
  • Position: #118 / 209
  • Number of attempts: 1
Paste a column after a column - 2668 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #249 / 578
  • Number of attempts: 4
Inverting Lines - 1961 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #240 / 526
  • Number of attempts: 2
Making 3 line function a one liner. - 347 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #189 / 214
  • Number of attempts: 1
Enumerate Bullets - 339 entries

We will need to refer to the bullet points in our document explicitly later, so we need to assign them some ID's!

  • Best score: 18
  • Best player score: 29
  • Position: #58 / 93
  • Number of attempts: 1
Python: Def to Lambda - 492 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 20
  • Position: #110 / 162
  • Number of attempts: 2
Rural Post - 4602 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #497 / 1124
  • Number of attempts: 2
Hogwarts Email Sorting - 954 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #111 / 272
  • Number of attempts: 2
Get mail address from outlook format - 663 entries

Create a mail list space separated of mail list formatted by outlook

  • Best score: 15
  • Best player score: 16
  • Position: #129 / 208
  • Number of attempts: 2
Quote modules - 1104 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 25
  • Position: #139 / 291
  • Number of attempts: 1
Wget failed to download redirections - 250 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 16
  • Position: #19 / 73
  • Number of attempts: 5
citizen_hacks_2019_challenge2 - 209 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 7
  • Position: #98 / 108
  • Number of attempts: 1
V to the i - 4885 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1512 / 1915
  • Number of attempts: 2
Add string initializers to an enum - 903 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 22
  • Position: #108 / 266
  • Number of attempts: 2
SCREAMING_SNAKE_CASE to Title Case - 1273 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: #123 / 266
  • Number of attempts: 3
Add semicolons - 10956 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1801 / 3098
  • Number of attempts: 2
Bad Copy Syntax - 2088 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #227 / 543
  • Number of attempts: 1
Cool or not? - 881 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 19
  • Position: #153 / 237
  • Number of attempts: 2
Extract argument from function - 2429 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #567 / 773
  • Number of attempts: 2
comment and uncomment code inline - 1182 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: 10
  • Position: #227 / 332
  • Number of attempts: 3
Just the middle - 11620 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3247 / 4258
  • Number of attempts: 1
Todo list specification - 420 entries

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

  • Best score: 37
  • Best player score: 39
  • Position: #158 / 187
  • Number of attempts: 1
Vim's not included features - 266 entries

Filter not included (-) features in a hypothetical installation of vim.

  • Best score: 23
  • Best player score: 23
  • Position: #12 / 70
  • Number of attempts: 9
Angular naming conventions - 359 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: 20
  • Position: #80 / 124
  • Number of attempts: 1
citizen_hacks_2019_challenge4 - 110 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 5
  • Best player score: 5
  • Position: #58 / 71
  • Number of attempts: 2
citizen_hacks_2019_challenge5 - 158 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #55 / 82
  • Number of attempts: 1
Join 'em - 258 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 4
  • Position: #29 / 157
  • Number of attempts: 1
Reorder the groups - 1201 entries

Change the order so that the groups of fruit come before the vegetables.

  • Best score: 14
  • Best player score: 14
  • Position: #98 / 270
  • Number of attempts: 3
Swap assigned value - 695 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #201 / 263
  • Number of attempts: 2
Space out the alphabet - 1696 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 18
  • Position: #236 / 458
  • Number of attempts: 2
Condensed Cases - 829 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: 14
  • Position: #155 / 255
  • Number of attempts: 1
Happy TvvO - 440 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #160 / 212
  • Number of attempts: 1
I forgot quotes - 16239 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2416 / 4225
  • Number of attempts: 2
Count both ways - 1053 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #140 / 362
  • Number of attempts: 4
NBCU Weekly Challenge - Test - 265 entries

Just testing.

  • Best score: 18
  • Best player score: 19
  • Position: #80 / 121
  • Number of attempts: 5
Neither Fizz nor Buzz - 271 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 16
  • Position: #35 / 107
  • Number of attempts: 4
Don't know what this is - 2070 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: 12
  • Position: #246 / 596
  • Number of attempts: 4
Where should I put the Newline? - 912 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #422 / 451
  • Number of attempts: 1
quotes inside quotes - 3202 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: #959 / 1093
  • Number of attempts: 2
Words in parens - 13054 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1193 / 3991
  • Number of attempts: 3
Enumerate words - 279 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 25
  • Position: #39 / 96
  • Number of attempts: 2
Groups magic - 173 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • Position: #76 / 100
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 456 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: #103 / 199
  • Number of attempts: 2
The name of the game - 696 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #286 / 369
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1642 entries

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

  • Best score: 8
  • Best player score: 10
  • Position: #275 / 457
  • Number of attempts: 2
Saving the hashes(#) - 2116 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 20
  • Position: #79 / 488
  • Number of attempts: 10
Convert pandoc unordered list to a numbered list - 215 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: 21
  • Position: #9 / 62
  • Number of attempts: 8
Let's play some Ivmgolf - 1163 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #348 / 459
  • Number of attempts: 2
Vertical Limit - 2637 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #192 / 778
  • Number of attempts: 5
replacing each line of a block selection - 3068 entries

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

  • Best score: 18
  • Best player score: 34
  • Position: #730 / 789
  • Number of attempts: 1
Switch function arguments - 2229 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #350 / 684
  • Number of attempts: 2
Append semicolon after expressions - 1087 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #271 / 426
  • Number of attempts: 1
Reverse and double space - 511 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 15
  • Position: #90 / 202
  • Number of attempts: 4
switch variable - 5128 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #679 / 1764
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 1046 entries

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

  • Best score: 19
  • Best player score: 22
  • Position: #62 / 199
  • Number of attempts: 7
Ruby 1.9 hashes - 1313 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: #255 / 419
  • Number of attempts: 1
Reverse Simple Deletion - 874 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 14
  • Position: #406 / 466
  • Number of attempts: 3
Reformat most common surnames - 837 entries

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

  • Best score: 23
  • Best player score: 25
  • Position: #77 / 239
  • Number of attempts: 4
Илья Кукушкин
Twitter2:

entered into 79 challenges

contributed 0 challenges