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

Copy punctuation - 152 entries

I want to copy the last line’s brackets, quotes, and commas to each line. How?

  • Best score: 19
  • Best player score: 23
  • Position: #11 / 37
  • Number of attempts: 4
Change LaTex itemizations formats - 35 entries

Inspired by the way my professor formats their LaTeX assignments.

  • Best score: 44
  • Best player score: 75
  • Position: #6 / 11
  • Number of attempts: 2
Deleting text - 117 entries

Delete everything except some specific numbers.

  • Best score: 28
  • Best player score: 83
  • Position: #37 / 41
  • Number of attempts: 1
Define Gray code states - 20 entries

List the states using Gray code and assign Gray code values to each state.

  • Best score: 56
  • Best player score: 83
  • Position: #5 / 8
  • Number of attempts: 1
Hex to binary - 61 entries

Convert hexadecimal numbers into binary format.

  • Best score: 30
  • Best player score: 32
  • Position: #2 / 15
  • 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: 6
  • Position: #8 / 385
  • Number of attempts: 2
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: 17
  • Position: #4 / 153
  • Number of attempts: 4
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: 12
  • Position: #71 / 173
  • Number of attempts: 2
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: 15
  • Position: #104 / 365
  • Number of attempts: 2
Insert column data on Confluence-style table - 442 entries

Add ip addresses into new "IP" column based on the last digits from the "Server" column

  • Best score: 33
  • Best player score: 34
  • Position: #14 / 105
  • Number of attempts: 5
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: 27
  • Position: #18 / 112
  • Number of attempts: 2
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: 56
  • Position: #55 / 171
  • Number of attempts: 2
HS exam question - 1523 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 57
  • Position: #95 / 404
  • Number of attempts: 3
hello-world-vimgolf - 2472 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #272 / 699
  • Number of attempts: 1
Making 3 line function a one liner. - 312 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #151 / 200
  • Number of attempts: 1
Modernise code - 1368 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 53
  • Position: #247 / 316
  • Number of attempts: 1
Staircase - 146 entries

Going downstairs, while singing the alphabet song. Some vb practice to us all. Would it be much easier to make it go from left to right instead?

  • Best score: 21
  • Best player score: 42
  • Position: #27 / 33
  • Number of attempts: 5
swap number pairs - 2023 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #110 / 373
  • Number of attempts: 5
Rural Post - 4427 entries

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

  • Best score: 9
  • Best player score: 13
  • Position: #653 / 1086
  • Number of attempts: 1
Levenshtein distance - 105 entries

Compute distance for each pair. Notice that this recursive implementation is very inefficient. Wagner-Fischer algorithm is iterative and much faster. #vimscript

  • Best score: 27
  • Best player score: 27
  • Position: #1 / 37
  • Number of attempts: 3
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: 23
  • Position: #2526 / 7384
  • Number of attempts: 3
Swap values - 4554 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #112 / 1259
  • Number of attempts: 5
Wrap the text of an email message to 79 characters - 705 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #221 / 398
  • Number of attempts: 1
Every other line - 2902 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #117 / 702
  • Number of attempts: 4
Copy three lines - 2869 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 13
  • Position: #29 / 639
  • Number of attempts: 5
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2260 / 4174
  • Number of attempts: 1
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: 16
  • Position: #189 / 288
  • Number of attempts: 1
Vice versa - 7865 entries

Little role switching.

  • Best score: 12
  • Best player score: 16
  • Position: #1250 / 2114
  • 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: 11
  • Position: #70 / 88
  • Number of attempts: 1
Paragraph breaks - 509 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 10
  • Position: #15 / 166
  • Number of attempts: 4
Maze path - 38 entries

Follow the given motions and mark your path with Xs. Attention: This maze is quite big (20x20), please set your terminal size to at least 82.

  • Best score: 25
  • Best player score: 27
  • Position: #8 / 16
  • Number of attempts: 3
Restore order to the alphabet - 197 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 12
  • Position: #12 / 71
  • Number of attempts: 1
From A to B - 575 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 18
  • Position: #103 / 157
  • Number of attempts: 2
camel riding - 775 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 16
  • Position: #150 / 277
  • Number of attempts: 3
Fill visual area - 83 entries

Just have fun!

  • Best score: 20
  • Best player score: 20
  • Position: #9 / 37
  • Number of attempts: 3
I forgot quotes - 15946 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #2865 / 4166
  • Number of attempts: 1
-a-b-c- - 3183 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #822 / 1132
  • Number of attempts: 1
Count both ways - 1006 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #256 / 352
  • Number of attempts: 1
Gray area - 745 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #94 / 270
  • Number of attempts: 3
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1548 / 3950
  • Number of attempts: 1
Delete unwanted lines - 398 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #159 / 227
  • Number of attempts: 1
199 Fibonacci Numbers - 40 entries

Generate 199 Fibonacci Numbers using, if you like, the function S(x,y), a vimscript to sum two big numbers in reverse order.

  • Best score: 51
  • Best player score: 65
  • Position: #10 / 18
  • Number of attempts: 2
switch variable - 5045 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #441 / 1742
  • Number of attempts: 2
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: 14
  • Position: #1534 / 3626
  • Number of attempts: 3
jinx balotchnik
Twitter:

entered into 44 challenges

contributed 0 challenges