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

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

  • Best score: 24
  • Best player score: 34
  • Position: #41 / 80
  • Number of attempts: 4
months to html list items - 512 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 24
  • Position: #25 / 143
  • Number of attempts: 2
Quicksort - 1545 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: #122 / 339
  • Number of attempts: 4
EDN reformat - 1012 entries

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

  • Best score: 17
  • Best player score: 19
  • Position: #73 / 141
  • Number of attempts: 10
Pick and sort servers from mirror list - 343 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: #69 / 75
  • Number of attempts: 2
Remove line numbers - 528 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: #74 / 140
  • Number of attempts: 5
Find fix point of cos - 1113 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: #266 / 331
  • Number of attempts: 4
Surround the 'z' character with brackets, quotes, and print as formatted string. - 478 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #180 / 267
  • Number of attempts: 1
Filter number combinations that don't add to 11 - 371 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: #71 / 109
  • Number of attempts: 6
Tabbed Table to Python Array - 628 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: #109 / 164
  • Number of attempts: 2
Reformat symbols in list - 1466 entries

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

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

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 128
  • Position: #85 / 88
  • Number of attempts: 2
Many duplicates - 1248 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #265 / 408
  • Number of attempts: 3
delete swap - 1522 entries

delete all swap

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

You have the tools, just create him!

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

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

  • Best score: 10
  • Best player score: 12
  • Position: #232 / 523
  • Number of attempts: 3
Plotting some variables in python - 1557 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: #260 / 332
  • Number of attempts: 1
Transpose a python matrix - 837 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 24
  • Position: #40 / 133
  • Number of attempts: 12
Lowercase first characters - 467 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: #52 / 175
  • Number of attempts: 1
simple replacements - 1647 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 21
  • Position: #150 / 366
  • Number of attempts: 5
Inverting Lines - 1829 entries

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

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

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 39
  • Position: #248 / 276
  • Number of attempts: 2
Modernise code - 1333 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 43
  • Position: #154 / 307
  • Number of attempts: 6
Simple, Practical, and Common - 33379 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: #5963 / 7363
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 189 entries

For the Citizen Hacks 2019 Vim competition.

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

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

  • Best score: 12
  • Best player score: 14
  • Position: #487 / 840
  • Number of attempts: 5
Swap the operands under comparison - 270 entries

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

  • Best score: 19
  • Best player score: 24
  • Position: #66 / 98
  • Number of attempts: 3
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 15
  • Position: #2342 / 3044
  • Number of attempts: 2
remove lines containing the word "reader" - 3537 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #847 / 1144
  • Number of attempts: 4
Com(m)a Trouble - 3660 entries

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

  • Best score: 12
  • Best player score: 15
  • Position: #432 / 824
  • Number of attempts: 2
citizen_hacks_2019_challenge3 - 35 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 4
  • Best player score: 4
  • Position: #31 / 32
  • Number of attempts: 1
From argument to object - 1474 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: #266 / 450
  • Number of attempts: 2
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #525 / 700
  • Number of attempts: 2
Start coding format - 147 entries

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

  • Best score: 22
  • Best player score: 25
  • Position: #66 / 70
  • Number of attempts: 2
comment and uncomment code inline - 1069 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: #222 / 314
  • Number of attempts: 2
Extract HTML option values from tag values - 98 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: #35 / 42
  • Number of attempts: 7
Team names - 1805 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #324 / 581
  • Number of attempts: 4
Make HTML List - 1039 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 38
  • Position: #77 / 271
  • Number of attempts: 4
Todo list specification - 385 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: #150 / 176
  • Number of attempts: 2
Text to HTML Table - 171 entries

Turn the plain text table to an HTML table.

  • Best score: 52
  • Best player score: 58
  • Position: #35 / 49
  • Number of attempts: 1
For all cases. - 141 entries

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

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

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #129 / 138
  • Number of attempts: 2
Stairstep digits - 376 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #125 / 141
  • Number of attempts: 3
Back to the roots - 52 entries

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

  • Best score: 22
  • Best player score: 23
  • Position: #31 / 36
  • Number of attempts: 1
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 63 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 / 37
  • Number of attempts: 1
Missing Library and a Typo - 856 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: 15
  • Best player score: 16
  • Position: #100 / 209
  • Number of attempts: 6
Simple addition - 310 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 / 117
  • Number of attempts: 1
Adam's challenge - 957 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: #133 / 266
  • Number of attempts: 6
Fiddle percentages into real numbers - 840 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: #250 / 287
  • Number of attempts: 1
Nesting SASS - 261 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 15
  • Position: #67 / 93
  • Number of attempts: 2
Add to end of each line... kinda - 323 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 / 170
  • Number of attempts: 3
Combines all items - 303 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #130 / 137
  • Number of attempts: 1
replace 2nd column blanks with values in same column if blank - 231 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: #77 / 81
  • Number of attempts: 1
underscore_to_camelCase - 162 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: #58 / 80
  • Number of attempts: 2
Fun With The Diagonal - 103 entries

change the lowercase characters on the main diagonal to uppercase

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

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #848 / 2099
  • Number of attempts: 4
7th Birthday - 186 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: #60 / 73
  • Number of attempts: 1
Free hyphen! - 159 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 / 85
  • Number of attempts: 3
Paragraph sort - 430 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #76 / 123
  • Number of attempts: 9
Vim's not included features - 210 entries

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

  • Best score: 23
  • Best player score: 31
  • Position: #37 / 62
  • Number of attempts: 7
Sort files from hosts - 179 entries

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

  • Best score: 15
  • Best player score: 19
  • Position: #70 / 74
  • Number of attempts: 2
Order and join - 956 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #141 / 255
  • Number of attempts: 6
Paragraph breaks - 505 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 14
  • Position: #144 / 165
  • Number of attempts: 5
Array of characters - 150 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: #33 / 44
  • Number of attempts: 3
lipsum lines - 252 entries

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

  • Best score: 28
  • Best player score: 33
  • Position: #61 / 91
  • Number of attempts: 3
Angular naming conventions - 295 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: #61 / 113
  • Number of attempts: 8
Sudoku table - 70 entries

Make this simple sudoku table look nice and legible.

  • Best score: 48
  • Best player score: 61
  • Position: #18 / 31
  • Number of attempts: 1
Change attribute to getter - 133 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 26
  • Position: #46 / 57
  • Number of attempts: 1
Scrambled numbers - 779 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Position: #104 / 182
  • Number of attempts: 3
Manual SQL - 133 entries

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

  • Best score: 48
  • Best player score: 54
  • Position: #13 / 47
  • Number of attempts: 8
citizen_hacks_2019_challenge4 - 88 entries

For the Citizen Hacks 2019 Vim competition.

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

Please generate list of numbers from 1 to 20.

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

For the Citizen Hacks 2019 Vim competition.

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

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

  • Best score: 24
  • Best player score: 39
  • Position: #432 / 495
  • Number of attempts: 1
Build a six - 272 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 41
  • Position: #82 / 92
  • Number of attempts: 3
citizen_hacks_2019_challenge6 - 59 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 3
  • Best player score: 3
  • Position: #45 / 47
  • Number of attempts: 1
Delete to the end of the current line - 784 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 / 384
  • Number of attempts: 2
Assign numbers to fields - 105 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: #47 / 59
  • Number of attempts: 3
Mirror Symmetry - 798 entries

Add backslashes.

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

I want change 5 words

  • Best score: 7
  • Best player score: 34
  • Position: #73 / 83
  • Number of attempts: 1
From A to B - 564 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 18
  • Position: #105 / 155
  • Number of attempts: 2
Collect List - 4264 entries

Convert to comma separated list.

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

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

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

For the Citizen Hacks 2019 Vim competition

  • Best score: 5
  • Best player score: 5
  • Position: #37 / 42
  • Number of attempts: 1
Shebangs for all - 1912 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: #424 / 500
  • Number of attempts: 3
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #383 / 511
  • Number of attempts: 3
Simple text editing with Vim - 12276 entries

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

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

entered into 88 challenges

contributed 0 challenges