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

Define Gray code states - 20 entries

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

  • Best score: 56
  • Best player score: 99
  • Position: #6 / 8
  • Number of attempts: 2
Morse - 96 entries

Translate Morse code to Text

  • Best score: 31
  • Best player score: 71
  • Position: #14 / 23
  • Number of attempts: 7
New teacher - 592 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 29
  • Position: #93 / 128
  • Number of attempts: 1
months to html list items - 817 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #100 / 219
  • Number of attempts: 3
EDN reformat - 1095 entries

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

  • Best score: 17
  • Best player score: 18
  • Position: #72 / 152
  • Number of attempts: 8
Populate 3D bone names list - 521 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #46 / 140
  • Number of attempts: 6
Remove line numbers - 654 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: 12
  • Position: #59 / 173
  • Number of attempts: 4
Find fix point of cos - 1199 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: #218 / 363
  • Number of attempts: 2
Paste a column after a column - 2407 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 / 521
  • Number of attempts: 7
HS exam question - 1522 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 63
  • Position: #135 / 403
  • Number of attempts: 5
Reformat symbols in list - 1506 entries

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

  • Best score: 24
  • Best player score: 26
  • Position: #107 / 333
  • Number of attempts: 4
Fizzbuzz - 536 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 45
  • Best player score: 84
  • Position: #99 / 161
  • Number of attempts: 5
Many duplicates - 1333 entries

Quick and easy

  • Best score: 7
  • Best player score: 10
  • Position: #368 / 436
  • Number of attempts: 1
delete swap - 1639 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #332 / 512
  • Number of attempts: 1
Generate a very basic Python constructor (fixed) - 1223 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: #104 / 258
  • Number of attempts: 3
Fix the shell script! - 2421 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 36
  • Position: #348 / 562
  • Number of attempts: 10
Visual block training - 1047 entries

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

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

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

  • Best score: 10
  • Best player score: 52
  • Position: #541 / 548
  • Number of attempts: 3
Plotting some variables in python - 1604 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: #310 / 344
  • Number of attempts: 1
simple replacements - 1706 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 27
  • Position: #323 / 377
  • Number of attempts: 1
Inverting Lines - 1870 entries

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

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

To convert a CSV list to Markdown list

  • Best score: 36
  • Best player score: 86
  • Position: #63 / 93
  • Number of attempts: 6
Generate a very basic Python constructor - 315 entries

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

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

Simple challenge to extract fields from a Python class

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 46
  • Position: #195 / 316
  • Number of attempts: 1
Swap values - 4553 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #525 / 1259
  • Number of attempts: 5
Make HTML List - 1050 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 45
  • Position: #130 / 273
  • Number of attempts: 3
JS notation to Immutable.js notation - 165 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: #26 / 62
  • Number of attempts: 3
Forgot to follow the naming convention... - 34 entries

Rename everything like MY_VAR_SOMETHING to MyVarSomething.

  • Best score: 32
  • Best player score: 34
  • Position: #8 / 15
  • Number of attempts: 8
Add to end of each line... kinda - 328 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 / 173
  • Number of attempts: 2
Vice versa - 7864 entries

Little role switching.

  • Best score: 12
  • Best player score: 15
  • Position: #1117 / 2114
  • Number of attempts: 2
Free hyphen! - 164 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: #84 / 88
  • Number of attempts: 2
Vim's not included features - 220 entries

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

  • Best score: 23
  • Best player score: 24
  • Position: #13 / 64
  • Number of attempts: 9
Sorting a glossary - 126 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 / 80
  • Number of attempts: 1
comments galore - 1017 entries

Basic comment reformatting

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

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

  • Best score: 28
  • Best player score: 34
  • Position: #68 / 93
  • Number of attempts: 2
Inner hyphens - 129 entries

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

  • Best score: 11
  • Best player score: 14
  • Position: #80 / 80
  • Number of attempts: 1
Angular naming conventions - 307 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 / 117
  • Number of attempts: 4
Replace and keep the case - 415 entries

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

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

Make this simple sudoku table look nice and legible.

  • Best score: 48
  • Best player score: 72
  • Position: #29 / 33
  • Number of attempts: 2
Alsa configuration - 502 entries

I'm tweaking my ~/.asoundrc file!

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

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

  • Best score: 48
  • Best player score: 55
  • Position: #16 / 49
  • Number of attempts: 2
Restore order to the alphabet - 197 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 13
  • Position: #41 / 71
  • Number of attempts: 5
Assign numbers to fields - 107 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: #49 / 61
  • Number of attempts: 1
No naked if allowed! - 33 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 / 16
  • Number of attempts: 7
Collect List - 4267 entries

Convert to comma separated list.

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

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 17
  • Position: #198 / 277
  • Number of attempts: 2
swap or reverse - 118 entries

Try to swap or reverse the line as needed.

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

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 19
  • Position: #134 / 150
  • Number of attempts: 2
Line 'em up! - 396 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: #90 / 112
  • Number of attempts: 3
Shuffled numbers - 237 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: #70 / 95
  • Number of attempts: 2
Tiny column alignment - 47 entries

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

  • Best score: 33
  • Best player score: 52
  • Position: #17 / 22
  • Number of attempts: 1
Get rid of html tags - 378 entries

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

  • Best score: 15
  • Best player score: 16
  • Position: #18 / 222
  • Number of attempts: 3
constap
Github:

entered into 54 challenges

contributed 0 challenges