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

Simple, Practical, and Common - 33621 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: 26
  • Position: #3567 / 7422
  • Number of attempts: 2
prepend * to every non-blank line - 6318 entries

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

  • Best score: 10
  • Best player score: 16
  • Position: #1001 / 1539
  • Number of attempts: 1
Swap values inside brackets - 2496 entries

Easy challenge.

  • Best score: 14
  • Best player score: 17
  • Position: #281 / 579
  • Number of attempts: 4
Bad Copy Syntax - 2038 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 20
  • Position: #250 / 526
  • Number of attempts: 6
Box it - 7906 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #915 / 1877
  • Number of attempts: 1
Start coding format - 155 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 24
  • Position: #60 / 72
  • Number of attempts: 1
Preferably without multi-cursor plugin - 540 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 37
  • Position: #81 / 129
  • Number of attempts: 1
Number Sort - 314 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 10
  • Position: #144 / 166
  • Number of attempts: 1
Python Hello World! Reformatting - 994 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: 44
  • Position: #243 / 380
  • Number of attempts: 1
Mirrored text - 177 entries

backward and forward, and long enough to be challenging

  • Best score: 14
  • Best player score: 16
  • Position: #53 / 71
  • Number of attempts: 2
Swap assigned value - 651 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #182 / 255
  • Number of attempts: 1
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 18
  • Position: #239 / 281
  • Number of attempts: 2
Logging with key - 328 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 38
  • Position: #75 / 88
  • Number of attempts: 1
Mute the second method of this script - 455 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 10
  • Position: #216 / 239
  • Number of attempts: 1
Happy TvvO - 427 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #131 / 206
  • Number of attempts: 3
Letter case trickery - 1630 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 12
  • Position: #356 / 518
  • Number of attempts: 4
Remove noise from HTTP log - 717 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: 17
  • Position: #232 / 273
  • Number of attempts: 1
Increment, increment, increment.... - 688 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #347 / 408
  • Number of attempts: 3
Context Insensitive completion 1 - 498 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 36
  • Position: #226 / 245
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3680 entries

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

  • Best score: 16
  • Best player score: 31
  • Position: #566 / 790
  • Number of attempts: 3
Simple text editing with Vim - 12823 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1827 / 3699
  • Number of attempts: 2
Marius Jurgelenas
Twitter:

entered into 21 challenges

contributed 0 challenges