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

months to html list items - 1108 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 31
  • Position: #232 / 300
  • Number of attempts: 1
Quicksort - 2058 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: 24
  • Position: #246 / 457
  • Number of attempts: 3
Populate 3D bone names list - 638 entries

Ran into this at work, excited to see how this gets optimized

  • Best score: 21
  • Best player score: 38
  • Position: #141 / 166
  • Number of attempts: 2
Remove line numbers - 752 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

  • Best score: 9
  • Best player score: 84
  • Position: #197 / 201
  • Number of attempts: 1
Find fix point of cos - 1444 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: 16
  • Position: #277 / 427
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 572 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #205 / 321
  • Number of attempts: 2
Paste a column after a column - 2632 entries

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

  • Best score: 14
  • Best player score: 14
  • Position: #81 / 570
  • Number of attempts: 8
Many duplicates - 1465 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #290 / 478
  • Number of attempts: 4
delete swap - 1818 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #334 / 567
  • Number of attempts: 6
Wikitext headings to markdown - 1014 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 53
  • Position: #174 / 211
  • Number of attempts: 1
hello-world-vimgolf - 2513 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #323 / 717
  • Number of attempts: 4
Inverting Lines - 1932 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #228 / 518
  • Number of attempts: 5
RUST Cargo.toml version to last - 378 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

  • Best score: 16
  • Best player score: 20
  • Position: #72 / 104
  • Number of attempts: 5
Making 3 line function a one liner. - 340 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #175 / 209
  • Number of attempts: 1
Put a cross in the square - 235 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 27
  • Position: #88 / 92
  • Number of attempts: 1
swap number pairs - 2146 entries

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

  • Best score: 16
  • Best player score: 34
  • Position: #295 / 390
  • Number of attempts: 2
HS Final exam vimgolf - 913 entries

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

  • Best score: 21
  • Best player score: 42
  • Position: #207 / 241
  • Number of attempts: 1
Rural Post - 4572 entries

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

  • Best score: 9
  • Best player score: 21
  • Position: #889 / 1116
  • Number of attempts: 1
Satisfy the go linter - 2468 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: 38
  • Position: #447 / 491
  • Number of attempts: 1
Add quotes to ansible playbook - 1030 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #90 / 325
  • Number of attempts: 4
Multiline to Single Line - 747 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #251 / 318
  • Number of attempts: 1
xrandr outputs and dashes - 725 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 12
  • Position: #145 / 226
  • Number of attempts: 4
Yo To Hello - 1152 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #399 / 534
  • Number of attempts: 3
Get mail address from outlook format - 649 entries

Create a mail list space separated of mail list formatted by outlook

  • Best score: 15
  • Best player score: 37
  • Position: #200 / 204
  • Number of attempts: 2
Add text at some column - 174 entries

Complete golang struct statement.

  • Best score: 31
  • Best player score: 36
  • Position: #59 / 66
  • Number of attempts: 1
prepend * to every non-blank line - 6366 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 10
  • Position: #444 / 1555
  • Number of attempts: 9
Quote modules - 1095 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 30
  • Position: #221 / 286
  • Number of attempts: 1
Quote modules (ver.2) - 241 entries

Complete golang import statement.

  • Best score: 22
  • Best player score: 34
  • Position: #58 / 61
  • Number of attempts: 3
Search and Replace 0 - 5027 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 13
  • Position: #892 / 1637
  • Number of attempts: 5
Python Hello World! Reformatting - 1007 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 45
  • Position: #294 / 384
  • Number of attempts: 1
Line under headers - 2072 entries

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

  • Best score: 24
  • Best player score: 32
  • Position: #336 / 510
  • Number of attempts: 1
Swap assigned value - 671 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #111 / 259
  • Number of attempts: 2
Groups magic - 162 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 13
  • Position: #17 / 95
  • Number of attempts: 3
Prefixes and suffixes - 638 entries

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

  • Best score: 17
  • Best player score: 33
  • Position: #176 / 203
  • Number of attempts: 2
Alphabet soup - 434 entries

Create a column of all alphabet characters organized in a funky way

  • Best score: 25
  • Best player score: 42
  • Position: #96 / 109
  • Number of attempts: 1
Exchanging Quotes - 859 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 39
  • Position: #175 / 231
  • Number of attempts: 2
replacing each line of a block selection - 3007 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 35
  • Position: #739 / 780
  • Number of attempts: 1
Switch function arguments - 2182 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 15
  • Position: #588 / 674
  • Number of attempts: 4
Append semicolon after expressions - 1061 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #141 / 421
  • Number of attempts: 4
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Position: #157 / 199
  • Number of attempts: 2
Remove noise from HTTP log - 729 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #145 / 276
  • Number of attempts: 4
Remove semicolons after expressions - 663 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #134 / 264
  • Number of attempts: 4
switch variable - 5094 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #667 / 1754
  • Number of attempts: 5
Ruby 1.9 hashes - 1272 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: 31
  • Position: #410 / 412
  • Number of attempts: 1
A Simple One - 1067 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #566 / 671
  • Number of attempts: 3
82 bottles of beer on the wall - 313 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

  • Best score: 106
  • Best player score: 128
  • Position: #68 / 146
  • Number of attempts: 1
Table Reshuffle - 450 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 37
  • Position: #98 / 144
  • Number of attempts: 1
Reverse and count - 486 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 18
  • Position: #16 / 179
  • Number of attempts: 3
Reverse Simple Deletion - 862 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #376 / 463
  • Number of attempts: 2
Increment, increment, increment.... - 701 entries

Vim likes macros

  • Best score: 10
  • Best player score: 10
  • Position: #64 / 413
  • Number of attempts: 3
Hatsuyume - 556 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 15
  • Best player score: 39
  • Position: #179 / 191
  • Number of attempts: 1
Turn this csv list into queries - 252 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

  • Best score: 98
  • Best player score: 126
  • Position: #58 / 101
  • Number of attempts: 1
The Cake is a Lie - 1386 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 14
  • Position: #510 / 537
  • Number of attempts: 1
Compile C - 441 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 36
  • Position: #139 / 143
  • Number of attempts: 1
Context Insensitive completion 1 - 512 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 49
  • Position: #246 / 248
  • Number of attempts: 1
Make Fancy Header - 1075 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 28
  • Position: #332 / 349
  • Number of attempts: 1
Reformat some Python - 627 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 55
  • Position: #202 / 240
  • Number of attempts: 1
Reformat a C golf submission - 614 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 37
  • Position: #155 / 210
  • Number of attempts: 1
Reformat most common surnames - 782 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 47
  • Position: #194 / 227
  • Number of attempts: 1
Remember FizzBuzz? - 758 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 85
  • Position: #173 / 200
  • Number of attempts: 1
Get rid of html tags - 423 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 12
  • Best player score: 17
  • Position: #131 / 245
  • Number of attempts: 4
Change the content of a string - 1707 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 31
  • Position: #584 / 628
  • Number of attempts: 1
Sort and add attributes - 1539 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 38
  • Position: #515 / 594
  • Number of attempts: 1
Reconstruct the Sentence - 1677 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 61
  • Position: #422 / 440
  • Number of attempts: 4
Braces or Brackets? - 1096 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 50
  • Position: #245 / 339
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3852 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 34
  • Position: #694 / 829
  • Number of attempts: 2
Simple text editing with Vim - 13262 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #704 / 3810
  • Number of attempts: 10
xiaoao1024
Github:

entered into 67 challenges

contributed 0 challenges