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

New teacher - 1357 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 24
  • Position: #103 / 282
  • Number of attempts: 8
Replace word while reserving first letter case - 636 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #32 / 122
  • Number of attempts: 14
months to html list items - 1088 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 24
  • Position: #69 / 295
  • Number of attempts: 3
Quicksort - 2035 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 / 450
  • Number of attempts: 13
Find fix point of cos - 1426 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: #217 / 422
  • Number of attempts: 3
Paste a column after a column - 2604 entries

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

  • Best score: 14
  • Best player score: 16
  • Position: #130 / 565
  • Number of attempts: 9
Reformat symbols in list - 1633 entries

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

  • Best score: 24
  • Best player score: 25
  • Position: #104 / 351
  • Number of attempts: 10
Many duplicates - 1459 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #204 / 476
  • Number of attempts: 4
delete swap - 1801 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #190 / 561
  • Number of attempts: 3
Wikitext headings to markdown - 1003 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 21
  • Position: #72 / 210
  • Number of attempts: 14
hello-world-vimgolf - 2505 entries

Simple number generation

  • Best score: 10
  • Best player score: 14
  • Position: #545 / 712
  • Number of attempts: 1
Contribute to keyboard mashing - 898 entries

Speak in tongues

  • Best score: 17
  • Best player score: 18
  • Position: #113 / 272
  • Number of attempts: 4
simple replacements - 1814 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 21
  • Position: #160 / 392
  • Number of attempts: 6
Inverting Lines - 1923 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #271 / 516
  • Number of attempts: 8
Python dataclasses - 1214 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 20
  • Position: #116 / 300
  • Number of attempts: 9
Count to 100 in word form - 148 entries

Write all the numbers from 1 to 100, using their word forms rather than the digit form. Most of the parts you will need are included in the input file. Use hyphens when appropriate.

  • Best score: 53
  • Best player score: 91
  • Position: #26 / 31
  • Number of attempts: 14
Making 3 line function a one liner. - 340 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #122 / 209
  • Number of attempts: 1
Modernise code - 1409 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 43
  • Position: #164 / 325
  • Number of attempts: 10
HS Final exam vimgolf - 906 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 22
  • Position: #86 / 239
  • Number of attempts: 10
Rural Post - 4563 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 10
  • Position: #478 / 1113
  • Number of attempts: 3
Satisfy the go linter - 2448 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 21
  • Position: #200 / 484
  • Number of attempts: 16
Add quotes to ansible playbook - 1008 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 9
  • Position: #203 / 317
  • Number of attempts: 6
Multiline to Single Line - 736 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 7
  • Position: #291 / 312
  • Number of attempts: 1
Data reformat - 304 entries

Reformat this copy-paste data! #csv

  • Best score: 36
  • Best player score: 39
  • Position: #22 / 66
  • Number of attempts: 17
Yo To Hello - 1151 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #377 / 533
  • Number of attempts: 2
Hogwarts Email Sorting - 930 entries

Given a list of emails, get the students full name and their associated house.

  • Best score: 20
  • Best player score: 22
  • Position: #174 / 263
  • Number of attempts: 2
Swap values - 4644 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Position: #523 / 1275
  • Number of attempts: 6
SCREAMING_SNAKE_CASE to Title Case - 1231 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

  • Best score: 19
  • Best player score: 21
  • Position: #127 / 254
  • Number of attempts: 8
Com(m)a Trouble - 3890 entries

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

  • Best score: 12
  • Best player score: 22
  • Position: #682 / 882
  • Number of attempts: 3
From argument to object - 1524 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: #270 / 463
  • Number of attempts: 5
Extract argument from function - 2369 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #392 / 756
  • Number of attempts: 6
comment and uncomment code inline - 1151 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: 19
  • Position: #314 / 328
  • Number of attempts: 4
Just the middle - 11497 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #3188 / 4215
  • Number of attempts: 3
Missing Library and a Typo - 913 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: #104 / 218
  • Number of attempts: 10
Triangle of arrows - 199 entries

I made this by accident when working on another challenge. How would you go about making this?

  • Best score: 14
  • Best player score: 23
  • Position: #29 / 44
  • Number of attempts: 5
Manual SQL - 160 entries

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

  • Best score: 48
  • Best player score: 54
  • Position: #16 / 50
  • Number of attempts: 9
Change part of a function name in multiple occurrences - 663 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

  • Best score: 14
  • Best player score: 16
  • Position: #159 / 209
  • Number of attempts: 2
Swap assigned value - 664 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #195 / 258
  • Number of attempts: 5
Condensed Cases - 807 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 14
  • Position: #150 / 248
  • Number of attempts: 5
I forgot quotes - 16051 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #2039 / 4194
  • Number of attempts: 3
Words in parens - 12969 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1871 / 3970
  • Number of attempts: 1
Prefixes and suffixes - 637 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 21
  • Position: #41 / 202
  • Number of attempts: 5
Vertical Limit - 2564 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 23
  • Position: #259 / 759
  • Number of attempts: 8
Switch function arguments - 2152 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #332 / 667
  • Number of attempts: 2
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #1006 / 1750
  • Number of attempts: 2
Case preserving word replacement - 454 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 20
  • Position: #82 / 180
  • Number of attempts: 7
Ruby 1.9 hashes - 1258 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 14
  • Position: #248 / 409
  • Number of attempts: 2
Shebangs for all - 2039 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: 12
  • Position: #163 / 521
  • Number of attempts: 7
Increment, increment, increment.... - 701 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #57 / 413
  • Number of attempts: 1
Compile C - 441 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Position: #81 / 143
  • Number of attempts: 4
Remember FizzBuzz? - 742 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 47
  • Position: #29 / 194
  • Number of attempts: 13
Simple text editing with Vim - 13092 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1958 / 3765
  • Number of attempts: 7
Reformat/Refactor a Golfer Class - 7228 entries

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

  • Best score: 10
  • Best player score: 35
  • Position: #400 / 1777
  • Number of attempts: 7
かみひろ
Twitter:

entered into 53 challenges

contributed 0 challenges