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

From brakets to parens - 1356 entries

This is one of the most common problem when you wrap an array for error handling. Vim is useful when you convert foo[i][j][k] into foo(i, j, k) for many times.

  • Best score: 24
  • Best player score: 25
  • Position: #23 / 309
  • Number of attempts: 9
Quicksort - 2114 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: 29
  • Position: #342 / 473
  • Number of attempts: 4
EDN reformat - 1233 entries

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

  • Best score: 17
  • Best player score: 33
  • Position: #128 / 174
  • Number of attempts: 2
Tic-Tac-Toe Grid Transformation - 450 entries

Your mission is to efficiently convert the original Tic-Tac-Toe grid, represented by 'x's and 'o's, into a neat and well-organized game board.

  • Best score: 56
  • Best player score: 112
  • Position: #44 / 88
  • Number of attempts: 1
Populate 3D bone names list - 661 entries

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

  • Best score: 21
  • Best player score: 29
  • Position: #90 / 172
  • Number of attempts: 2
Remove line numbers - 791 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: 14
  • Position: #111 / 210
  • Number of attempts: 2
Find fix point of cos - 1486 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: #175 / 435
  • Number of attempts: 2
Surround the 'z' character with brackets, quotes, and print as formatted string. - 584 entries

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

  • Best score: 17
  • Best player score: 17
  • Position: #154 / 330
  • Number of attempts: 1
Paste a column after a column - 2672 entries

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

  • Best score: 7
  • Best player score: 23
  • Position: #383 / 580
  • Number of attempts: 3
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: 62
  • Position: #110 / 186
  • Number of attempts: 3
Reformat symbols in list - 1661 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #168 / 358
  • Number of attempts: 6
Fizzbuzz - 614 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 44
  • Best player score: 76
  • Position: #87 / 172
  • Number of attempts: 1
Changing around text with citations - 364 entries

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 43
  • Position: #70 / 97
  • Number of attempts: 2
Many duplicates - 1489 entries

Quick and easy

  • Best score: 7
  • Best player score: 8
  • Position: #263 / 484
  • Number of attempts: 4
delete swap - 1918 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #292 / 583
  • Number of attempts: 5
Generate a very basic Python constructor (fixed) - 1297 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 47
  • Position: #167 / 278
  • 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: 11
  • Position: #189 / 567
  • Number of attempts: 3
hello-world-vimgolf - 2535 entries

Simple number generation

  • Best score: 6
  • Best player score: 15
  • Position: #579 / 728
  • Number of attempts: 3
Contribute to keyboard mashing - 913 entries

Speak in tongues

  • Best score: 17
  • Best player score: 17
  • Position: #50 / 277
  • Number of attempts: 5
Reordering Lorem Ipsum - 309 entries

Who even sorted this?

  • Best score: 13
  • Best player score: 87
  • Position: #47 / 69
  • Number of attempts: 2
Fill in the chess board - 980 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 42
  • Position: #126 / 187
  • Number of attempts: 2
Transpose a python matrix - 907 entries

Rotate the matrix in 90 degrees.

  • Best score: 23
  • Best player score: 65
  • Position: #103 / 141
  • Number of attempts: 1
simple replacements - 1910 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 28
  • Position: #346 / 417
  • Number of attempts: 1
Inverting Lines - 1962 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #271 / 527
  • Number of attempts: 5
Python dataclasses - 1277 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 30
  • Position: #223 / 325
  • Number of attempts: 1
Making 3 line function a one liner. - 349 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #165 / 215
  • Number of attempts: 1
Put a cross in the square - 256 entries

Put a cross in the square

  • Best score: 20
  • Best player score: 22
  • Position: #39 / 95
  • Number of attempts: 2
swap number pairs - 2174 entries

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

  • Best score: 7
  • Best player score: 30
  • Position: #252 / 395
  • Number of attempts: 1
HS Final exam vimgolf - 936 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #123 / 245
  • Number of attempts: 7
Simple, Practical, and Common - 34031 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: 28
  • Position: #4571 / 7520
  • Number of attempts: 3
Wrap the text of an email message to 79 characters - 885 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #339 / 458
  • Number of attempts: 2
Just the middle - 11636 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1502 / 4262
  • Number of attempts: 6
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: #445 / 515
  • Number of attempts: 1
I forgot quotes - 16255 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2412 / 4229
  • Number of attempts: 3
Reverse Simple Deletion - 875 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Position: #61 / 467
  • Number of attempts: 3
The Cake is a Lie - 1422 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 9
  • Position: #294 / 546
  • Number of attempts: 6
Sort and add attributes - 1605 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #308 / 622
  • Number of attempts: 4
Simple text editing with Vim - 13682 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #752 / 3920
  • Number of attempts: 4
Ludovic Schwartz
Github:

entered into 38 challenges

contributed 0 challenges