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

A simple everyday task.

  • Best score: 39
  • Best player score: 43
  • Position: #63 / 303
  • Number of attempts: 8
Reordering properties - 1042 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: 43
  • Position: #47 / 240
  • Number of attempts: 1
Sort and Tag - 613 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: 75
  • Position: #53 / 125
  • Number of attempts: 1
Changing date formats - 610 entries

Change the date format to Y/M/D.

  • Best score: 37
  • Best player score: 72
  • Position: #79 / 168
  • Number of attempts: 1
YAML to dotenv - 1226 entries

Convert this YAML config file to a .env file.

  • Best score: 16
  • Best player score: 22
  • Position: #114 / 262
  • Number of attempts: 3
Change to ascending order - 448 entries

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

  • Best score: 17
  • Best player score: 30
  • Position: #28 / 109
  • Number of attempts: 3
Swap columns and transform to CSV format - 386 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #38 / 143
  • Number of attempts: 5
Generate an entry for each month - 351 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: #14 / 84
  • Number of attempts: 8
Append leading hyphen count to each line - 108 entries

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

  • Best score: 23
  • Best player score: 24
  • Position: #11 / 31
  • Number of attempts: 4
Move list of uuids into a SQL query - 196 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: 63
  • Position: #24 / 66
  • Number of attempts: 1
Word completion - 279 entries

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 20
  • Position: #13 / 72
  • Number of attempts: 4
Remove adjacent duplicates - 646 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 20
  • Position: #33 / 162
  • Number of attempts: 10
Copy punctuation - 655 entries

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

  • Best score: 19
  • Best player score: 30
  • Position: #60 / 158
  • Number of attempts: 6
Define Gray code states - 53 entries

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

  • Best score: 56
  • Best player score: 99
  • Position: #11 / 14
  • Number of attempts: 2
Morse - 155 entries

Translate Morse code to Text

  • Best score: 31
  • Best player score: 71
  • Position: #21 / 35
  • Number of attempts: 7
New teacher - 1419 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 29
  • Position: #202 / 299
  • Number of attempts: 1
months to html list items - 1108 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #120 / 300
  • Number of attempts: 3
EDN reformat - 1193 entries

The goal is to make the code more readable and concise while maintaining its functionality.

  • Best score: 17
  • Best player score: 18
  • Position: #73 / 169
  • Number of attempts: 8
Populate 3D bone names list - 638 entries

Ran into this at work, excited to see how this gets optimized

  • Best score: 21
  • Best player score: 23
  • Position: #52 / 166
  • Number of attempts: 6
Remove line numbers - 752 entries

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

  • Best score: 9
  • Best player score: 12
  • Position: #60 / 201
  • Number of attempts: 4
Find fix point of cos - 1444 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: #227 / 427
  • Number of attempts: 2
Paste a column after a column - 2632 entries

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

  • Best score: 14
  • Best player score: 14
  • Position: #97 / 570
  • Number of attempts: 7
HS exam question - 1599 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 63
  • Position: #144 / 419
  • Number of attempts: 5
Reformat symbols in list - 1635 entries

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

  • Best score: 24
  • Best player score: 26
  • Position: #114 / 352
  • Number of attempts: 4
Fizzbuzz - 586 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 44
  • Best player score: 84
  • Position: #105 / 169
  • Number of attempts: 5
Many duplicates - 1465 entries

Quick and easy

  • Best score: 7
  • Best player score: 10
  • Position: #399 / 478
  • Number of attempts: 1
delete swap - 1818 entries

delete all swap

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

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

  • Best score: 29
  • Best player score: 39
  • Position: #109 / 275
  • Number of attempts: 3
Fix the shell script! - 2651 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 36
  • Position: #372 / 616
  • Number of attempts: 10
Visual block training - 1096 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #81 / 207
  • Number of attempts: 3
Put a newline after every 10 lines in vim - 1668 entries

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

  • Best score: 10
  • Best player score: 52
  • Position: #554 / 561
  • Number of attempts: 3
Plotting some variables in python - 1673 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: 71
  • Position: #315 / 350
  • Number of attempts: 1
simple replacements - 1833 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 27
  • Position: #332 / 396
  • Number of attempts: 1
Inverting Lines - 1932 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #226 / 518
  • Number of attempts: 2
CSV to MD format - 429 entries

To convert a CSV list to Markdown list

  • Best score: 36
  • Best player score: 86
  • Position: #65 / 96
  • Number of attempts: 6
Generate a very basic Python constructor - 323 entries

I actually needed to do this myself, so I look forward to learning how.

  • Best score: 38
  • Best player score: 48
  • Position: #44 / 100
  • Number of attempts: 2
Python dataclasses - 1229 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 29
  • Position: #203 / 308
  • Number of attempts: 1
Making 3 line function a one liner. - 340 entries

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 46
  • Position: #203 / 328
  • Number of attempts: 1
Swap values - 4661 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #528 / 1282
  • Number of attempts: 5
Make HTML List - 1061 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 45
  • Position: #131 / 274
  • Number of attempts: 3
JS notation to Immutable.js notation - 186 entries

Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.

  • Best score: 34
  • Best player score: 36
  • Position: #27 / 63
  • Number of attempts: 3
Forgot to follow the naming convention... - 40 entries

Rename everything like MY_VAR_SOMETHING to MyVarSomething.

  • Best score: 32
  • Best player score: 34
  • Position: #9 / 16
  • Number of attempts: 8
Add to end of each line... kinda - 339 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Position: #111 / 176
  • Number of attempts: 2
Vice versa - 7974 entries

Little role switching.

  • Best score: 12
  • Best player score: 15
  • Position: #1126 / 2146
  • Number of attempts: 2
Free hyphen! - 176 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 11
  • Position: #87 / 90
  • Number of attempts: 2
Vim's not included features - 244 entries

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

  • Best score: 23
  • Best player score: 24
  • Position: #14 / 66
  • Number of attempts: 9
Sorting a glossary - 132 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

  • Best score: 6
  • Best player score: 6
  • Position: #72 / 82
  • Number of attempts: 1
comments galore - 1073 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #303 / 429
  • Number of attempts: 3
lipsum lines - 278 entries

Convert a quoted block of text into strings in a list.

  • Best score: 28
  • Best player score: 34
  • Position: #70 / 95
  • Number of attempts: 2
Inner hyphens - 143 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

  • Best score: 11
  • Best player score: 14
  • Position: #83 / 85
  • Number of attempts: 1
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: #45 / 119
  • Number of attempts: 4
Replace and keep the case - 437 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 26
  • Position: #56 / 118
  • Number of attempts: 7
Sudoku table - 92 entries

Make this simple sudoku table look nice and legible.

  • Best score: 48
  • Best player score: 72
  • Position: #30 / 34
  • Number of attempts: 2
Alsa configuration - 513 entries

I'm tweaking my ~/.asoundrc file!

  • Best score: 22
  • Best player score: 22
  • Position: #52 / 128
  • Number of attempts: 10
Manual SQL - 160 entries

Change select and insert queries to simulate inserting a new record.

  • Best score: 48
  • Best player score: 55
  • Position: #17 / 50
  • Number of attempts: 2
Separating firstname & lastname - 166 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 20
  • Position: #13 / 59
  • Number of attempts: 12
Restore order to the alphabet - 201 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 13
  • Position: #41 / 72
  • Number of attempts: 5
Assign numbers to fields - 116 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 20
  • Position: #50 / 62
  • Number of attempts: 1
No naked if allowed! - 39 entries

House style forbids naked condition statements, comments should start with a space character and be on their own line. Good luck!

  • Best score: 46
  • Best player score: 58
  • Position: #10 / 17
  • Number of attempts: 7
Collect List - 4317 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #529 / 1194
  • Number of attempts: 2
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 17
  • Position: #199 / 281
  • Number of attempts: 2
swap or reverse - 126 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Position: #55 / 69
  • Number of attempts: 2
readability - 327 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 19
  • Position: #136 / 152
  • Number of attempts: 2
Line 'em up! - 421 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 28
  • Position: #91 / 114
  • Number of attempts: 3
Shuffled numbers - 246 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 16
  • Position: #71 / 96
  • Number of attempts: 2
Winning streak - 139 entries

Make the number on each line equal the consecutive L's or W's.

  • Best score: 21
  • Best player score: 27
  • Position: #29 / 52
  • Number of attempts: 4
Two become one - 719 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 33
  • Position: #132 / 210
  • Number of attempts: 3
Tiny column alignment - 61 entries

Align using the four blocks, don't forget to lowercase and have fun!

  • Best score: 33
  • Best player score: 52
  • Position: #18 / 23
  • Number of attempts: 1
Get rid of html tags - 423 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #20 / 245
  • Number of attempts: 3
constap
Github:

entered into 70 challenges

contributed 0 challenges