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

A simple everyday task.

  • Best score: 38
  • Best player score: 41
  • Position: #50 / 411
  • Number of attempts: 7
Reordering properties - 1368 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: 35
  • Position: #27 / 296
  • Number of attempts: 13
Changing date formats - 749 entries

Change the date format to Y/M/D.

  • Best score: 36
  • Best player score: 64
  • Position: #68 / 210
  • Number of attempts: 5
Swap columns and transform to CSV format - 487 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #39 / 175
  • Number of attempts: 4
Fix the Scala Method - 374 entries

Fix the missing semicolons and the Int type, ensure the floating point division, and remove the unnecessary return.

  • Best score: 2
  • Best player score: 22
  • Position: #26 / 123
  • Number of attempts: 4
Change class fields from camel case to snake case - 664 entries

This is the reverse of the previous challenge: https://www.vimgolf.com/challenges/9v006705493c000000000513

  • Best score: 18
  • Best player score: 23
  • Position: #84 / 153
  • Number of attempts: 9
Change class fields from snake case to camel case - 322 entries

Change the class fields in this Scala class from snake case to camel case

  • Best score: 13
  • Best player score: 14
  • Position: #81 / 121
  • Number of attempts: 4
Replace csv column if it's not empty - 310 entries

Replace the credit_score_percentile column with the value 0.0 but leave the empty ones untouched

  • Best score: 15
  • Best player score: 17
  • Position: #71 / 100
  • Number of attempts: 4
CaN yOuR ViM dO ThAt? #1 - 297 entries

Tsoding's famous "Can your Vim do that?" https://youtu.be/Bafo3hhheHU?si=DfcT4sUEMTSAevnx&t=1091

  • Best score: 41
  • Best player score: 47
  • Position: #80 / 118
  • Number of attempts: 1
Append leading hyphen count to each line - 148 entries

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

  • Best score: 23
  • Best player score: 60
  • Position: #40 / 41
  • Number of attempts: 1
Move list of uuids into a SQL query - 245 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: 68
  • Position: #44 / 82
  • Number of attempts: 1
Markdown Blog Editing - 485 entries

Convert the given link text in start file to a markdown link list.

  • Best score: 30
  • Best player score: 41
  • Position: #39 / 117
  • Number of attempts: 8
Replace word while reserving first letter case - 665 entries

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

  • Best score: 24
  • Best player score: 34
  • Position: #64 / 127
  • Number of attempts: 4
months to html list items - 1151 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 24
  • Position: #61 / 311
  • Number of attempts: 2
Quicksort - 2113 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: #157 / 472
  • Number of attempts: 4
EDN reformat - 1222 entries

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

  • Best score: 17
  • Best player score: 19
  • Position: #86 / 173
  • Number of attempts: 10
Pick and sort servers from mirror list - 463 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: #86 / 92
  • Number of attempts: 2
Remove line numbers - 786 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: #102 / 209
  • Number of attempts: 5
Find fix point of cos - 1485 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: #352 / 434
  • Number of attempts: 4
Surround the 'z' character with brackets, quotes, and print as formatted string. - 582 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #180 / 328
  • Number of attempts: 1
Filter number combinations that don't add to 11 - 445 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: #77 / 124
  • Number of attempts: 6
Tabbed Table to Python Array - 777 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: #125 / 186
  • Number of attempts: 2
Reformat symbols in list - 1658 entries

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

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

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 128
  • Position: #92 / 97
  • Number of attempts: 2
Many duplicates - 1488 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #275 / 484
  • Number of attempts: 3
delete swap - 1912 entries

delete all swap

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

You have the tools, just create him!

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

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

  • Best score: 10
  • Best player score: 12
  • Position: #245 / 567
  • Number of attempts: 3
Plotting some variables in python - 1691 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: #278 / 354
  • Number of attempts: 1
Transpose a python matrix - 907 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 24
  • Position: #42 / 141
  • Number of attempts: 12
Lowercase first characters - 509 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: #57 / 188
  • Number of attempts: 1
simple replacements - 1884 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 21
  • Position: #163 / 403
  • Number of attempts: 5
Inverting Lines - 1961 entries

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

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

Simple challenge to extract fields from a Python class

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 43
  • Position: #167 / 333
  • Number of attempts: 6
Simple, Practical, and Common - 34012 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: #6053 / 7513
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 209 entries

For the Citizen Hacks 2019 Vim competition.

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

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

  • Best score: 12
  • Best player score: 14
  • Position: #500 / 867
  • Number of attempts: 5
Swap the operands under comparison - 325 entries

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

  • Best score: 19
  • Best player score: 24
  • Position: #72 / 108
  • Number of attempts: 3
Add semicolons - 10956 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 15
  • Position: #2386 / 3098
  • Number of attempts: 2
remove lines containing the word "reader" - 3652 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #864 / 1185
  • Number of attempts: 4
Com(m)a Trouble - 3993 entries

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

  • Best score: 12
  • Best player score: 15
  • Position: #470 / 910
  • Number of attempts: 2
citizen_hacks_2019_challenge3 - 43 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 4
  • Best player score: 4
  • Position: #31 / 40
  • Number of attempts: 1
From argument to object - 1566 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: #272 / 471
  • Number of attempts: 2
Every other line - 2951 entries

AaAaAaA

  • Best score: 12
  • Best player score: 17
  • Position: #533 / 712
  • Number of attempts: 2
Start coding format - 168 entries

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

  • Best score: 22
  • Best player score: 25
  • Position: #72 / 76
  • Number of attempts: 2
comment and uncomment code inline - 1182 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: #239 / 332
  • Number of attempts: 2
Extract HTML option values from tag values - 140 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: #41 / 49
  • Number of attempts: 7
Team names - 1861 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 17
  • Position: #333 / 596
  • Number of attempts: 4
Make HTML List - 1072 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 38
  • Position: #80 / 276
  • Number of attempts: 4
Todo list specification - 420 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: #157 / 187
  • Number of attempts: 2
Text to HTML Table - 198 entries

Turn the plain text table to an HTML table.

  • Best score: 52
  • Best player score: 58
  • Position: #38 / 57
  • Number of attempts: 1
For all cases. - 180 entries

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

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

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Position: #132 / 149
  • Number of attempts: 2
Stairstep digits - 426 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #129 / 154
  • Number of attempts: 3
Back to the roots - 80 entries

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

  • Best score: 20
  • Best player score: 23
  • Position: #35 / 43
  • Number of attempts: 1
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 75 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 / 42
  • Number of attempts: 1
Missing Library and a Typo - 954 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: #107 / 223
  • Number of attempts: 6
Simple addition - 351 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: #114 / 128
  • Number of attempts: 1
Adam's challenge - 1042 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: #143 / 281
  • Number of attempts: 6
Fiddle percentages into real numbers - 886 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: #258 / 297
  • Number of attempts: 1
Nesting SASS - 302 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 15
  • Position: #69 / 102
  • Number of attempts: 2
Add to end of each line... kinda - 350 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 / 180
  • Number of attempts: 3
Combines all items - 322 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #135 / 143
  • Number of attempts: 1
replace 2nd column blanks with values in same column if blank - 258 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: #82 / 86
  • Number of attempts: 1
underscore_to_camelCase - 197 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: #63 / 86
  • Number of attempts: 2
Fun With The Diagonal - 116 entries

change the lowercase characters on the main diagonal to uppercase

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

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #861 / 2157
  • Number of attempts: 4
7th Birthday - 237 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: #67 / 80
  • Number of attempts: 1
Free hyphen! - 199 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 / 97
  • Number of attempts: 3
Paragraph sort - 479 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #79 / 128
  • Number of attempts: 9
Vim's not included features - 266 entries

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

  • Best score: 23
  • Best player score: 31
  • Position: #42 / 70
  • Number of attempts: 7
Sort files from hosts - 210 entries

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

  • Best score: 15
  • Best player score: 19
  • Position: #76 / 80
  • Number of attempts: 2
Order and join - 1032 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #146 / 265
  • Number of attempts: 6
Paragraph breaks - 550 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 14
  • Position: #151 / 172
  • Number of attempts: 5
Array of characters - 198 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: #36 / 50
  • Number of attempts: 3
lipsum lines - 315 entries

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

  • Best score: 28
  • Best player score: 33
  • Position: #67 / 98
  • Number of attempts: 3
Angular naming conventions - 359 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: #66 / 124
  • Number of attempts: 8
Sudoku table - 123 entries

Make this simple sudoku table look nice and legible.

  • Best score: 48
  • Best player score: 61
  • Position: #22 / 37
  • Number of attempts: 1
Change attribute to getter - 182 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 26
  • Position: #53 / 67
  • Number of attempts: 1
Scrambled numbers - 830 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Position: #107 / 187
  • Number of attempts: 3
Manual SQL - 179 entries

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

  • Best score: 48
  • Best player score: 54
  • Position: #16 / 53
  • Number of attempts: 8
citizen_hacks_2019_challenge4 - 110 entries

For the Citizen Hacks 2019 Vim competition.

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

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 14
  • Position: #66 / 144
  • Number of attempts: 1
One to Ten - 2258 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 / 688
  • Number of attempts: 1
citizen_hacks_2019_challenge5 - 158 entries

For the Citizen Hacks 2019 Vim competition.

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

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

  • Best score: 24
  • Best player score: 39
  • Position: #446 / 515
  • Number of attempts: 1
Build a six - 315 entries

Just enjoy building "a" floors...

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

For the Citizen Hacks 2019 Vim competition.

  • Best score: 3
  • Best player score: 3
  • Position: #45 / 55
  • Number of attempts: 1
Delete to the end of the current line - 882 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 / 418
  • Number of attempts: 2
Assign numbers to fields - 122 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: #51 / 64
  • Number of attempts: 3
Mirror Symmetry - 844 entries

Add backslashes.

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

I want change 5 words

  • Best score: 7
  • Best player score: 34
  • Position: #80 / 92
  • Number of attempts: 1
From A to B - 627 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 18
  • Position: #111 / 163
  • Number of attempts: 2
Collect List - 4341 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #527 / 1200
  • Number of attempts: 3
VimGolfNight - 602 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #298 / 356
  • Number of attempts: 2
Happy TvvO - 439 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #153 / 211
  • Number of attempts: 3
Vim tetris - 390 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 22
  • Position: #32 / 108
  • Number of attempts: 11
Carriage return - 57 entries

I have some raw data from terminal output which uses carriege return for formatting. Carriage return sets the pointer to the first character on the line, and subsequent characters will overwrite what was there before. The challange is to simulate the terminal behaviour in vim. I'm kind of unsure if I should have skipped lines 9 and 15, since there might be some interesting solutions which are not that generic. Happy Golfing!

  • Best score: 22
  • Best player score: 79
  • Position: #23 / 23
  • Number of attempts: 2
Delete unwanted lines - 450 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #199 / 236
  • Number of attempts: 4
Harder than "abcd > a b c d" - 112 entries

Not as easy as the last challenge. This time, just one space between a and b, up to 25 spaces between y and z. (Removed some lines; diff was too long.)

  • Best score: 15
  • Best player score: 30
  • Position: #45 / 49
  • Number of attempts: 2
citizen_hacks_2019_challenge1 - 59 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 5
  • Best player score: 5
  • Position: #37 / 49
  • Number of attempts: 1
Shebangs for all - 2101 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: #446 / 532
  • Number of attempts: 3
The Cake is a Lie - 1416 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 10
  • Position: #402 / 542
  • Number of attempts: 3
Simple text editing with Vim - 13626 entries

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

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

entered into 105 challenges

contributed 0 challenges