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

Put a newline after every 10 lines in vim - 992 entries

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

  • Best score: 10
  • Best player score: 13
  • Position: #207 / 350
  • Number of attempts: 1
hello-world-vimgolf - 1581 entries

Simple number generation

  • Best score: 10
  • Best player score: 16
  • Position: #375 / 455
  • Number of attempts: 6
Change double quotes to single quotes, but with a twist - 258 entries

Although this challenge is in the context of a Python function, you don't need to know Python to do this challenge. It is to add contexts and interesting constraints. The file contains a function that prints a multi-line string literal. I wrote the string literal with double quotes, but then I decided to use single quotes instead, and that's your challenge. However, interestingly enough, the string itself contains single and double quotes. This means, inside the string literal, the originally escaped double quotes no longer need to be escaped, but the single quotes now need to be escaped. Note that the triple double quotes in the docstring should be left alone.

  • Best score: 22
  • Best player score: 37
  • Position: #33 / 49
  • Number of attempts: 5
Yo To Hello - 1051 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #355 / 483
  • Number of attempts: 2
Replace pattern with 1, 2, 3, ... on each line - 1037 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

  • Best score: 21
  • Best player score: 27
  • Position: #111 / 209
  • Number of attempts: 6
Simple, Practical, and Common - 32963 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: #4444 / 7277
  • Number of attempts: 1
Merge blank lines and properly capitalize - 61 entries

Here you need complete 2 tasks: 1. Remove all unwanted continuous blank lines and leave only 1 blank line between paragraphs. 2. Properly capitalize the sentences.

  • Best score: 21
  • Best player score: 33
  • Position: #12 / 20
  • Number of attempts: 9
formatted text to markdown - 180 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

  • Best score: 70
  • Best player score: 79
  • Position: #43 / 65
  • Number of attempts: 3
Jakob Weickmann
Twitter:

Psychologist & Japanologist at Babelfisch Lab | Vienna | Bayesian Modelling | Language Studies

entered into 8 challenges

contributed 0 challenges