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

Reorganize Pokémon - 858 entries

Change the format of the each line and sort alphabetically.

  • Best score: 18
  • Best player score: 21
  • Position: #108 / 235
  • Number of attempts: 2
Rearrange array to single level - 1811 entries

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

  • Best score: 14
  • Best player score: 14
  • Position: #13 / 306
  • Number of attempts: 9
Rearrange array to one line - 865 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #58 / 203
  • Number of attempts: 6
New teacher - 1502 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 23
  • Position: #95 / 315
  • Number of attempts: 6
months to html list items - 1139 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 26
  • Position: #164 / 309
  • Number of attempts: 1
Quicksort - 2109 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: 7
  • Position: #175 / 471
  • Number of attempts: 5
Surround the 'z' character with brackets, quotes, and print as formatted string. - 580 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #239 / 326
  • Number of attempts: 1
Paste a column after a column - 2666 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #245 / 577
  • Number of attempts: 1
Reformat symbols in list - 1649 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #171 / 355
  • Number of attempts: 4
Fix the shell script! - 2676 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 29
  • Position: #228 / 622
  • Number of attempts: 5
Making 3 line function a one liner. - 346 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #183 / 213
  • Number of attempts: 1
swap number pairs - 2169 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 18
  • Position: #139 / 393
  • Number of attempts: 9
prepend * to every non-blank line - 6388 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 15
  • Position: #1013 / 1559
  • Number of attempts: 4
Swap values inside brackets - 2546 entries

Easy challenge.

  • Best score: 13
  • Best player score: 15
  • Position: #220 / 592
  • Number of attempts: 6
Applying same text modification in several lines - 2927 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 13
  • Position: #278 / 865
  • Number of attempts: 3
Add string initializers to an enum - 901 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 23
  • Position: #128 / 265
  • Number of attempts: 1
Add semicolons - 10943 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1796 / 3093
  • Number of attempts: 1
Bad Copy Syntax - 2079 entries

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

  • Best score: 18
  • Best player score: 22
  • Position: #342 / 541
  • Number of attempts: 1
Split line with dots - 2174 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 16
  • Position: #238 / 638
  • Number of attempts: 10
remove lines containing the word "reader" - 3645 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #508 / 1182
  • Number of attempts: 2
Box it - 7998 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #820 / 1898
  • Number of attempts: 4
multiple cursor alternative - 1556 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: 21
  • Position: #224 / 386
  • Number of attempts: 2
From argument to object - 1552 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 18
  • Position: #276 / 469
  • Number of attempts: 1
Every other line - 2945 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #271 / 710
  • Number of attempts: 5
Extract argument from function - 2399 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #559 / 767
  • Number of attempts: 2
comment and uncomment code inline - 1161 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: #225 / 330
  • Number of attempts: 2
Team names - 1858 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #286 / 594
  • Number of attempts: 5
Make HTML List - 1071 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 36
  • Position: #77 / 275
  • Number of attempts: 11
Remember VimGolf Rules ! - 277 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #133 / 147
  • Number of attempts: 3
Missing Library and a Typo - 952 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

  • Best score: 14
  • Best player score: 16
  • Position: #109 / 222
  • Number of attempts: 6
Adam's challenge - 1018 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: 19
  • Position: #133 / 278
  • Number of attempts: 3
Vice versa - 8011 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #630 / 2153
  • Number of attempts: 5
Order and join - 1030 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #148 / 264
  • Number of attempts: 2
comments galore - 1079 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #309 / 431
  • Number of attempts: 3
One to Ten - 2248 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: #371 / 686
  • Number of attempts: 2
Line under headers - 2093 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #206 / 514
  • Number of attempts: 7
Increment each number - 1063 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 21
  • Position: #187 / 258
  • Number of attempts: 2
Delete to the end of the current line - 866 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #269 / 416
  • Number of attempts: 2
Reorder the groups - 1198 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #144 / 268
  • Number of attempts: 1
move titles next to url, in quotes - 558 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 22
  • Position: #99 / 147
  • Number of attempts: 3
Array transposition - 2474 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 17
  • Position: #176 / 459
  • Number of attempts: 8
Space out the alphabet - 1690 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 32
  • Position: #439 / 454
  • Number of attempts: 1
I forgot quotes - 16179 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2064 / 4218
  • Number of attempts: 2
Don't know what this is - 2044 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: 16
  • Position: #546 / 591
  • Number of attempts: 2
Shebangs for all - 2090 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: 15
  • Position: #295 / 529
  • Number of attempts: 6
Reformat/Refactor a Golfer Class - 7614 entries

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

  • Best score: 7
  • Best player score: 35
  • Position: #422 / 1876
  • Number of attempts: 8
Nathan Priego
Github:

entered into 46 challenges

contributed 0 challenges