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

Replace word while reserving first letter case - 489 entries

Window -> Door window -> door Windows -> Windows windows -> windows

  • Best score: 24
  • Best player score: 34
  • Position: #50 / 105
  • Number of attempts: 4
months to html list items - 826 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 24
  • Position: #47 / 222
  • Number of attempts: 2
Quicksort - 1757 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: #134 / 385
  • Number of attempts: 4
EDN reformat - 1099 entries

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

  • Best score: 17
  • Best player score: 19
  • Position: #77 / 153
  • Number of attempts: 10
Pick and sort servers from mirror list - 379 entries

Retrieve the primary server for each country from a mirror list file and organize them alphabetically by country name. Given a mirror list file containing server information for various countries, the objective is to extract the primary server from each country and then arrange these servers in alphabetical order based on the respective country names.

  • Best score: 28
  • Best player score: 83
  • Position: #75 / 81
  • Number of attempts: 2
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: 13
  • Position: #88 / 173
  • Number of attempts: 5
Find fix point of cos - 1204 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: 24
  • Position: #292 / 365
  • Number of attempts: 4
Surround the 'z' character with brackets, quotes, and print as formatted string. - 507 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #180 / 287
  • Number of attempts: 1
Filter number combinations that don't add to 11 - 379 entries

Append the sum of each line to its end, alongside an equals sign, and remove any that do not sum to 11. The ordering of lines should stay the same. Note that the combinations are semi-arbitrary and not all 4-number combinations are present in the file.

  • Best score: 27
  • Best player score: 28
  • Position: #72 / 112
  • Number of attempts: 6
Tabbed Table to Python Array - 652 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 65
  • Position: #113 / 171
  • Number of attempts: 2
Reformat symbols in list - 1507 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #159 / 334
  • Number of attempts: 6
Changing around text with citations - 324 entries

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 128
  • Position: #87 / 90
  • Number of attempts: 2
Many duplicates - 1350 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #270 / 440
  • Number of attempts: 3
delete swap - 1650 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #310 / 514
  • Number of attempts: 1
Innocent Monster - 165 entries

You have the tools, just create him!

  • Best score: 60
  • Best player score: 90
  • Position: #29 / 48
  • Number of attempts: 1
Put a newline after every 10 lines in vim - 1649 entries

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

  • Best score: 10
  • Best player score: 12
  • Position: #238 / 551
  • Number of attempts: 3
Plotting some variables in python - 1605 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: 60
  • Position: #269 / 345
  • Number of attempts: 1
Transpose a python matrix - 848 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 24
  • Position: #41 / 135
  • Number of attempts: 12
Lowercase first characters - 484 entries

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

  • Best score: 33
  • Best player score: 34
  • Position: #55 / 181
  • Number of attempts: 1
simple replacements - 1710 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 21
  • Position: #153 / 378
  • Number of attempts: 5
Inverting Lines - 1870 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #216 / 505
  • Number of attempts: 4
Python dataclasses - 1121 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 39
  • Position: #252 / 281
  • Number of attempts: 2
Modernise code - 1368 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 43
  • Position: #158 / 316
  • Number of attempts: 6
Simple, Practical, and Common - 33483 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 32
  • Position: #5978 / 7384
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 194 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #65 / 101
  • Number of attempts: 1
Applying same text modification in several lines - 2851 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #488 / 843
  • Number of attempts: 5
Swap the operands under comparison - 274 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

  • Best score: 19
  • Best player score: 24
  • Position: #67 / 99
  • Number of attempts: 3
Add semicolons - 10831 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 15
  • Position: #2351 / 3055
  • Number of attempts: 2
remove lines containing the word "reader" - 3556 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #852 / 1151
  • Number of attempts: 4
Com(m)a Trouble - 3711 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 15
  • Position: #439 / 839
  • Number of attempts: 2
citizen_hacks_2019_challenge3 - 37 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 4
  • Best player score: 4
  • Position: #31 / 34
  • Number of attempts: 1
From argument to object - 1481 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: #268 / 453
  • Number of attempts: 2
Every other line - 2902 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #527 / 702
  • Number of attempts: 2
Start coding format - 149 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 25
  • Position: #67 / 71
  • Number of attempts: 2
comment and uncomment code inline - 1074 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: 11
  • Position: #223 / 316
  • Number of attempts: 2
Extract HTML option values from tag values - 99 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: 39
  • Position: #36 / 43
  • Number of attempts: 7
Team names - 1812 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #326 / 585
  • Number of attempts: 4
Make HTML List - 1050 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 38
  • Position: #78 / 273
  • Number of attempts: 4
Todo list specification - 389 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: #152 / 178
  • Number of attempts: 2
Text to HTML Table - 174 entries

Turn the plain text table to an HTML table.

  • Best score: 52
  • Best player score: 58
  • Position: #36 / 51
  • Number of attempts: 1
For all cases. - 145 entries

In this case... change it! :) Watch the line.

  • Best score: 8
  • Best player score: 8
  • Position: #89 / 102
  • Number of attempts: 2
Remember VimGolf Rules ! - 259 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #130 / 139
  • Number of attempts: 2
Stairstep digits - 383 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #126 / 143
  • Number of attempts: 3
Back to the roots - 54 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

  • Best score: 21
  • Best player score: 23
  • Position: #32 / 37
  • Number of attempts: 1
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 64 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

  • Best score: 18
  • Best player score: 18
  • Position: #33 / 38
  • Number of attempts: 1
Missing Library and a Typo - 860 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: #101 / 211
  • Number of attempts: 6
Simple addition - 312 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 15
  • Position: #106 / 118
  • Number of attempts: 1
Adam's challenge - 958 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: 20
  • Position: #134 / 267
  • Number of attempts: 6
Fiddle percentages into real numbers - 841 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: 18
  • Position: #251 / 288
  • Number of attempts: 1
Nesting SASS - 262 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 15
  • Position: #68 / 94
  • Number of attempts: 2
Add to end of each line... kinda - 329 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: #107 / 173
  • Number of attempts: 3
Combines all items - 307 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 10
  • Position: #132 / 139
  • Number of attempts: 1
replace 2nd column blanks with values in same column if blank - 232 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

  • Best score: 15
  • Best player score: 23
  • Position: #78 / 82
  • Number of attempts: 1
underscore_to_camelCase - 163 entries

Pointy haired boss decided we need to switch to camelCase. Let's get this over with.

  • Best score: 14
  • Best player score: 15
  • Position: #59 / 81
  • Number of attempts: 2
Fun With The Diagonal - 104 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #77 / 80
  • Number of attempts: 2
Vice versa - 7865 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #851 / 2114
  • Number of attempts: 4
7th Birthday - 187 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: 27
  • Position: #61 / 74
  • Number of attempts: 1
Free hyphen! - 165 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: 9
  • Position: #33 / 88
  • Number of attempts: 3
Paragraph sort - 431 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 17
  • Position: #77 / 124
  • Number of attempts: 9
Vim's not included features - 220 entries

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

  • Best score: 23
  • Best player score: 31
  • Position: #39 / 64
  • Number of attempts: 7
Sort files from hosts - 180 entries

Resume files by host. I hope you enjoy with this challenge

  • Best score: 15
  • Best player score: 19
  • Position: #71 / 75
  • Number of attempts: 2
Order and join - 965 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #143 / 258
  • Number of attempts: 6
Paragraph breaks - 509 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 14
  • Position: #145 / 166
  • Number of attempts: 5
Array of characters - 157 entries

We all copy paste things off the internet, but the syntax doesn't look right. Fix it as fast as possible.

  • Best score: 33
  • Best player score: 43
  • Position: #34 / 46
  • 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: 33
  • Position: #62 / 93
  • Number of attempts: 3
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: 19
  • Position: #63 / 117
  • Number of attempts: 8
Sudoku table - 73 entries

Make this simple sudoku table look nice and legible.

  • Best score: 48
  • Best player score: 61
  • Position: #19 / 33
  • Number of attempts: 1
Change attribute to getter - 134 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 26
  • Position: #47 / 58
  • Number of attempts: 1
Scrambled numbers - 780 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Position: #105 / 183
  • Number of attempts: 3
Manual SQL - 136 entries

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

  • Best score: 48
  • Best player score: 54
  • Position: #14 / 49
  • Number of attempts: 8
citizen_hacks_2019_challenge4 - 90 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 5
  • Best player score: 5
  • Position: #51 / 63
  • Number of attempts: 1
Generate a list of numbers - 284 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 14
  • Position: #66 / 137
  • Number of attempts: 1
One to Ten - 2174 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: #360 / 664
  • Number of attempts: 1
citizen_hacks_2019_challenge5 - 139 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #48 / 75
  • Number of attempts: 2
Line under headers - 2023 entries

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

  • Best score: 24
  • Best player score: 39
  • Position: #434 / 498
  • Number of attempts: 1
Build a six - 277 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 41
  • Position: #84 / 94
  • Number of attempts: 3
citizen_hacks_2019_challenge6 - 61 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 3
  • Best player score: 3
  • Position: #45 / 49
  • Number of attempts: 1
Delete to the end of the current line - 795 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #256 / 387
  • Number of attempts: 2
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: #48 / 61
  • Number of attempts: 3
Mirror Symmetry - 812 entries

Add backslashes.

  • Best score: 7
  • Best player score: 7
  • Position: #95 / 268
  • Number of attempts: 5
unknown command - 166 entries

I want change 5 words

  • Best score: 7
  • Best player score: 34
  • Position: #76 / 86
  • Number of attempts: 1
From A to B - 575 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 18
  • Position: #107 / 157
  • Number of attempts: 2
Collect List - 4267 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #527 / 1188
  • Number of attempts: 3
Happy TvvO - 417 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #153 / 204
  • Number of attempts: 3
citizen_hacks_2019_challenge1 - 50 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 5
  • Best player score: 5
  • Position: #37 / 44
  • Number of attempts: 1
Shebangs for all - 1917 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: 21
  • Position: #425 / 502
  • Number of attempts: 3
The Cake is a Lie - 1301 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #387 / 517
  • Number of attempts: 3
Simple text editing with Vim - 12491 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2264 / 3626
  • Number of attempts: 5
jonas-grobe
Github:

entered into 88 challenges

contributed 0 challenges